From e8442c8161e3b75e662cec39a90962470afe94c7 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 17 Aug 2021 13:58:51 +0100 Subject: [PATCH 1/8] Fix autoscreen-generated form component default settings --- .../store/screenTemplates/utils/commonComponents.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/builderStore/store/screenTemplates/utils/commonComponents.js b/packages/builder/src/builderStore/store/screenTemplates/utils/commonComponents.js index aaf25f6d03..1a64a8958f 100644 --- a/packages/builder/src/builderStore/store/screenTemplates/utils/commonComponents.js +++ b/packages/builder/src/builderStore/store/screenTemplates/utils/commonComponents.js @@ -161,7 +161,11 @@ export function makeDatasourceFormComponents(datasource) { placeholder: field, }) if (fieldType === "options") { - component.customProps({ placeholder: "Choose an option " }) + component.customProps({ + placeholder: "Choose an option", + optionsType: "select", + optionsSource: "schema", + }) } if (fieldType === "link") { let placeholder = From a1aa2df3cd126f74227e38e6bfbc2577e69fdc96 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 17 Aug 2021 14:10:03 +0100 Subject: [PATCH 2/8] Add steps option to form --- packages/standard-components/manifest.json | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/standard-components/manifest.json b/packages/standard-components/manifest.json index 17d95321c9..59df5211f1 100644 --- a/packages/standard-components/manifest.json +++ b/packages/standard-components/manifest.json @@ -1705,7 +1705,8 @@ "illegalChildren": ["section"], "actions": [ "ValidateForm", - "ClearForm" + "ClearForm", + "NextFormStep" ], "styles": ["size"], "settings": [ @@ -1725,6 +1726,13 @@ "label": "Custom" } }, + { + "type": "select", + "label": "Steps", + "key": "steps", + "defaultValue": "1", + "options": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + }, { "type": "boolean", "label": "Disabled", From 35b69206371417033464fb258969ca9fcd30998f Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 17 Aug 2021 14:10:25 +0100 Subject: [PATCH 3/8] Ensure placeholder is null when undefined so avoid sometimes having a placeholder and sometimes not --- .../design/PropertiesPanel/ComponentSettingsSection.svelte | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/components/design/PropertiesPanel/ComponentSettingsSection.svelte b/packages/builder/src/components/design/PropertiesPanel/ComponentSettingsSection.svelte index c8e23cc535..9ec1108985 100644 --- a/packages/builder/src/components/design/PropertiesPanel/ComponentSettingsSection.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/ComponentSettingsSection.svelte @@ -71,7 +71,7 @@ /> {/if} {#if settings && settings.length > 0} - {#each settings as setting} + {#each settings as setting (setting.key)} {#if canRenderControl(setting)} updateProp(setting.key, val)} props={{ - options: setting.options, - placeholder: setting.placeholder, + options: setting.options || [], + placeholder: setting.placeholder || null, }} {bindings} {componentDefinition} From e222cd64526a346a932da267d01a57bb0443dbcb Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 17 Aug 2021 14:12:23 +0100 Subject: [PATCH 4/8] Ensure options are always rendered with a default type of select --- packages/standard-components/src/forms/OptionsField.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/standard-components/src/forms/OptionsField.svelte b/packages/standard-components/src/forms/OptionsField.svelte index 29ec7c2328..9142aa4fa0 100644 --- a/packages/standard-components/src/forms/OptionsField.svelte +++ b/packages/standard-components/src/forms/OptionsField.svelte @@ -74,7 +74,7 @@ bind:fieldSchema > {#if fieldState} - {#if optionsType === "select"} + {#if !optionsType || optionsType === "select"} Date: Tue, 17 Aug 2021 14:15:48 +0100 Subject: [PATCH 5/8] Fix dynamic options with radio groups --- .../standard-components/src/forms/OptionsField.svelte | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/standard-components/src/forms/OptionsField.svelte b/packages/standard-components/src/forms/OptionsField.svelte index 9142aa4fa0..8a455e50ed 100644 --- a/packages/standard-components/src/forms/OptionsField.svelte +++ b/packages/standard-components/src/forms/OptionsField.svelte @@ -1,5 +1,5 @@