From 3ce5b96b0c9d5e8464728a8cef3a2db096e0d02d Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Wed, 25 Aug 2021 17:00:42 +0100 Subject: [PATCH] use normal combobox for filtering array columns --- .../FilterEditor/FilterDrawer.svelte | 2 +- .../src/api/controllers/row/internalSearch.js | 18 ++---------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/FilterEditor/FilterDrawer.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/FilterEditor/FilterDrawer.svelte index cd5cc1661c..b89fe693f6 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/FilterEditor/FilterDrawer.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/FilterEditor/FilterDrawer.svelte @@ -136,7 +136,7 @@ /> {:else if ["string", "longform", "number"].includes(filter.type)} - {:else if filter.type === "options"} + {:else if filter.type === "options" || filter.type === "array"} - opts.push( - `${key}.${val}:${builder.preprocess(val, allPreProcessingOpts)}` - ) - ) - const joined = opts.join(" AND ") - return joined + return `${key}.${value}:${builder.preprocess(value, allPreProcessingOpts)}` }) } @@ -245,14 +238,7 @@ class QueryBuilder { if (!value) { return null } - let opts = [] - value.forEach(val => - opts.push( - `!${key}.${val}:${builder.preprocess(val, allPreProcessingOpts)}` - ) - ) - const joined = opts.join(" AND ") - return joined + return `!${key}.${value}:${builder.preprocess(value, allPreProcessingOpts)}` }) }