From b638324ce225beaf9696af6273ec650b74458248 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Sat, 15 Oct 2022 12:58:32 +0100 Subject: [PATCH 01/19] Prevent crash when determining datasource schema for non string type values --- packages/builder/src/builderStore/dataBinding.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/builderStore/dataBinding.js b/packages/builder/src/builderStore/dataBinding.js index 536692eecc..0a70150949 100644 --- a/packages/builder/src/builderStore/dataBinding.js +++ b/packages/builder/src/builderStore/dataBinding.js @@ -1004,7 +1004,10 @@ const bindingReplacement = ( * {{ literal [componentId] }} */ const extractLiteralHandlebarsID = value => { - return value?.match(/{{\s*literal\s*\[+([^\]]+)].*}}/)?.[1] + if (!value || typeof value !== "string") { + return null + } + return value.match(/{{\s*literal\s*\[+([^\]]+)].*}}/)?.[1] } /** From 7bf5cad453dcd6fd80d789b82279516c58de0922 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Sat, 15 Oct 2022 13:06:34 +0100 Subject: [PATCH 02/19] Fix selected rows bindings for table blocks not having a category --- packages/builder/src/builderStore/dataBinding.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/builder/src/builderStore/dataBinding.js b/packages/builder/src/builderStore/dataBinding.js index 0a70150949..d188073b95 100644 --- a/packages/builder/src/builderStore/dataBinding.js +++ b/packages/builder/src/builderStore/dataBinding.js @@ -481,6 +481,7 @@ const getSelectedRowsBindings = asset => { block._id + "-table" )}.${makePropSafe("selectedRows")}`, readableBinding: `${block._instanceName}.Selected rows`, + category: "Selected rows", })) ) } From d1e011814ef3f421a1444f5bc8efcd4f44b9dfbe Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Sat, 15 Oct 2022 13:17:40 +0100 Subject: [PATCH 03/19] Add sensible min widths to settings in the conditional UI drawer so that it's usable on any res --- .../_components/settings/ConditionalUIDrawer.svelte | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/settings/ConditionalUIDrawer.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/settings/ConditionalUIDrawer.svelte index 74f0c930cd..855c42173b 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/settings/ConditionalUIDrawer.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/settings/ConditionalUIDrawer.svelte @@ -282,12 +282,16 @@ gap: var(--spacing-l); display: grid; align-items: center; - grid-template-columns: auto 160px auto 1fr 130px 130px 1fr auto auto; + grid-template-columns: + auto 150px auto minmax(140px, 1fr) 120px 100px minmax(140px, 1fr) + auto auto; border-radius: var(--border-radius-s); transition: background-color ease-in-out 130ms; } .condition.update { - grid-template-columns: auto 160px 1fr auto 1fr auto 1fr 130px 130px 1fr auto auto; + grid-template-columns: + auto 150px minmax(140px, 1fr) auto minmax(140px, 1fr) auto + minmax(140px, 1fr) 120px 100px minmax(140px, 1fr) auto auto; } .condition:hover { background-color: var(--spectrum-global-color-gray-100); From 267095f235c923701b9b2018874a6ef9bcb575bc Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Sat, 15 Oct 2022 13:23:20 +0100 Subject: [PATCH 04/19] Add sensible min widths to settings in the filter drawer --- .../controls/FilterEditor/FilterDrawer.svelte | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/packages/builder/src/components/design/settings/controls/FilterEditor/FilterDrawer.svelte b/packages/builder/src/components/design/settings/controls/FilterEditor/FilterDrawer.svelte index a419f5ad46..214db0f814 100644 --- a/packages/builder/src/components/design/settings/controls/FilterEditor/FilterDrawer.svelte +++ b/packages/builder/src/components/design/settings/controls/FilterEditor/FilterDrawer.svelte @@ -38,8 +38,8 @@ let behaviourValue const behaviourOptions = [ - { value: "and", label: "Match all of the following filters" }, - { value: "or", label: "Match any of the following filters" }, + { value: "and", label: "Match all filters" }, + { value: "or", label: "Match any filter" }, ] const addFilter = () => { filters = [ @@ -137,14 +137,9 @@
- - {#if !filters?.length} - Add your first filter expression. - {:else} - Results are filtered to only those which match all of the following - constraints. - {/if} - + {#if !filters?.length} + Add your first filter expression. + {/if} {#if filters?.length}
opt.label} getOptionValue={opt => opt.value} - on:change={e => (allOr = e.detail === "or")} + on:change={e => (matchAny = e.detail === "or")} placeholder={null} />
@@ -167,7 +198,7 @@
- {#each filters as filter, idx} + {#each rawFilters as filter, idx}