diff --git a/package.json b/package.json index 8b715d8747..42e528dfce 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "lerna": "7.0.2", "madge": "^6.0.0", "minimist": "^1.2.8", - "prettier": "^2.3.1", + "prettier": "2.8.8", "prettier-plugin-svelte": "^2.3.0", "rimraf": "^3.0.2", "rollup-plugin-replace": "^2.2.0", diff --git a/packages/builder/src/components/backend/Datasources/ConfigEditor/ConfigInput.svelte b/packages/builder/src/components/backend/Datasources/ConfigEditor/ConfigInput.svelte index 37fd579594..70f2ffef46 100644 --- a/packages/builder/src/components/backend/Datasources/ConfigEditor/ConfigInput.svelte +++ b/packages/builder/src/components/backend/Datasources/ConfigEditor/ConfigInput.svelte @@ -4,11 +4,13 @@ import LongFormField from "./fields/LongForm.svelte" import FieldGroupField from "./fields/FieldGroup.svelte" import StringField from "./fields/String.svelte" + import SelectField from "./fields/Select.svelte" export let type export let value export let error export let name + export let config export let showModal = () => {} const selectComponent = type => { @@ -20,6 +22,8 @@ return LongFormField } else if (type === "fieldGroup") { return FieldGroupField + } else if (type === "select") { + return SelectField } else { return StringField } @@ -34,6 +38,7 @@ {value} {error} {name} + {config} {showModal} on:blur on:change diff --git a/packages/builder/src/components/backend/Datasources/ConfigEditor/fields/FieldGroup.svelte b/packages/builder/src/components/backend/Datasources/ConfigEditor/fields/FieldGroup.svelte index a83929663b..eaab7d1508 100644 --- a/packages/builder/src/components/backend/Datasources/ConfigEditor/fields/FieldGroup.svelte +++ b/packages/builder/src/components/backend/Datasources/ConfigEditor/fields/FieldGroup.svelte @@ -1,9 +1,11 @@ !!properties.value)} + initialOpen={config?.openByDefault || + Object.values(value).some(properties => !!properties.value)} header={name} > {#each value as field} -
- - handleChange(field.key, e.detail)} - value={field.value} - /> -
+ handleChange(field.key, e.detail)} + /> {/each}
- - diff --git a/packages/builder/src/components/backend/Datasources/ConfigEditor/fields/Select.svelte b/packages/builder/src/components/backend/Datasources/ConfigEditor/fields/Select.svelte new file mode 100644 index 0000000000..3185a6c22c --- /dev/null +++ b/packages/builder/src/components/backend/Datasources/ConfigEditor/fields/Select.svelte @@ -0,0 +1,30 @@ + + +
+ +