Allow hiding config
This commit is contained in:
parent
8a7d610faf
commit
534b4fffb4
3 changed files with 17 additions and 12 deletions
|
@ -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,7 +82,8 @@
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#each $configStore.validatedConfig as { type, key, value, error, name }}
|
{#each $configStore.validatedConfig as { type, key, value, error, name, hidden }}
|
||||||
|
{#if hidden === undefined || !eval(processStringSync(hidden, $configStore.config))}
|
||||||
<ConfigInput
|
<ConfigInput
|
||||||
{type}
|
{type}
|
||||||
{value}
|
{value}
|
||||||
|
@ -92,6 +94,7 @@
|
||||||
on:blur={() => configStore.markFieldActive(key)}
|
on:blur={() => configStore.markFieldActive(key)}
|
||||||
on:change={e => configStore.updateFieldValue(key, e.detail)}
|
on:change={e => configStore.updateFieldValue(key, e.detail)}
|
||||||
/>
|
/>
|
||||||
|
{/if}
|
||||||
{/each}
|
{/each}
|
||||||
</ModalContent>
|
</ModalContent>
|
||||||
|
|
||||||
|
|
|
@ -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,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue