From b77fed6766b649241e14db874da600c2d67a6c45 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 12 Aug 2021 09:50:09 +0100 Subject: [PATCH] Add duplicate action to filter drawer --- .../FilterEditor/FilterDrawer.svelte | 182 ++++++++++++++++++ .../FilterEditor/FilterEditor.svelte | 34 +--- .../FilterEditor/LuceneFilterBuilder.svelte | 151 --------------- 3 files changed, 190 insertions(+), 177 deletions(-) create mode 100644 packages/builder/src/components/design/PropertiesPanel/PropertyControls/FilterEditor/FilterDrawer.svelte delete mode 100644 packages/builder/src/components/design/PropertiesPanel/PropertyControls/FilterEditor/LuceneFilterBuilder.svelte diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/FilterEditor/FilterDrawer.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/FilterEditor/FilterDrawer.svelte new file mode 100644 index 0000000000..c206492595 --- /dev/null +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/FilterEditor/FilterDrawer.svelte @@ -0,0 +1,182 @@ + + + +
+ + + {#if !filters?.length} + Add your first filter column. + {:else} + Results are filtered to only those which match all of the following + constraints. + {/if} + + {#if filters?.length} +
+ {#each filters as filter, idx} + onOperatorChange(filter, e.detail)} + placeholder={null} + /> + + {:else if filter.type === "options"} + + {:else if filter.type === "boolean"} + + {:else if filter.type === "datetime"} + + {:else} + + {/if} + duplicateFilter(filter.id)} + /> + removeFilter(filter.id)} + /> + {/each} +
+ {/if} +
+ +
+
+
+
+ + diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/FilterEditor/FilterEditor.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/FilterEditor/FilterEditor.svelte index adcf7ec29b..58b767353b 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/FilterEditor/FilterEditor.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/FilterEditor/FilterEditor.svelte @@ -1,19 +1,11 @@ - -{#if value?.length} -
- {#each value as expression, idx} - onOperatorChange(expression, e.detail)} - placeholder={null} - /> - - {:else if expression.type === "options"} - - {:else if expression.type === "boolean"} - - {:else if expression.type === "datetime"} - - {:else} - - {/if} - - removeField(expression.id)} - /> - {/each} -
-{/if} -
- -
- -