1
0
Fork 0
mirror of synced 2024-07-06 15:00:49 +12:00

Allow hiding config

This commit is contained in:
Adria Navarro 2023-06-28 11:42:49 +01:00
parent 8a7d610faf
commit 534b4fffb4
3 changed files with 17 additions and 12 deletions

View file

@ -6,6 +6,7 @@
Layout, Layout,
ModalContent, ModalContent,
} from "@budibase/bbui" } from "@budibase/bbui"
import { processStringSync } from "@budibase/string-templates"
import CreateEditVariableModal from "components/portal/environment/CreateEditVariableModal.svelte" import CreateEditVariableModal from "components/portal/environment/CreateEditVariableModal.svelte"
import ConfigInput from "./ConfigInput.svelte" import ConfigInput from "./ConfigInput.svelte"
import { createValidatedConfigStore } from "./stores/validatedConfig" import { createValidatedConfigStore } from "./stores/validatedConfig"
@ -81,17 +82,19 @@
/> />
{/if} {/if}
{#each $configStore.validatedConfig as { type, key, value, error, name }} {#each $configStore.validatedConfig as { type, key, value, error, name, hidden }}
<ConfigInput {#if hidden === undefined || !eval(processStringSync(hidden, $configStore.config))}
{type} <ConfigInput
{value} {type}
{error} {value}
{name} {error}
showModal={() => {name}
showModal(newValue => configStore.updateFieldValue(key, newValue))} showModal={() =>
on:blur={() => configStore.markFieldActive(key)} showModal(newValue => configStore.updateFieldValue(key, newValue))}
on:change={e => configStore.updateFieldValue(key, e.detail)} on:blur={() => configStore.markFieldActive(key)}
/> on:change={e => configStore.updateFieldValue(key, e.detail)}
/>
{/if}
{/each} {/each}
</ModalContent> </ModalContent>

View file

@ -101,6 +101,7 @@ export const createValidatedConfigStore = (integration, config) => {
error: $errorsStore[key], error: $errorsStore[key],
name: capitalise(properties.display || key), name: capitalise(properties.display || key),
type: properties.type, type: properties.type,
hidden: properties.hidden,
}) })
}) })

View file

@ -110,7 +110,8 @@ export interface DatasourceConfig {
required?: boolean required?: boolean
default?: any default?: any
deprecated?: boolean deprecated?: boolean
} hidden?: string
} & { fields?: DatasourceConfig }
} }
export interface Integration { export interface Integration {