From 624080800f449a83638138e2d093d681ea678aa0 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Thu, 26 Aug 2021 11:39:42 +0100 Subject: [PATCH] Fix lucene not allowed characters --- .../src/components/backend/DataTable/RowFieldControl.svelte | 6 +----- .../PropertyControls/FilterEditor/FilterDrawer.svelte | 2 +- packages/server/src/api/controllers/row/internalSearch.js | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/builder/src/components/backend/DataTable/RowFieldControl.svelte b/packages/builder/src/components/backend/DataTable/RowFieldControl.svelte index f2f7a6c687..5b3a3689ba 100644 --- a/packages/builder/src/components/backend/DataTable/RowFieldControl.svelte +++ b/packages/builder/src/components/backend/DataTable/RowFieldControl.svelte @@ -34,11 +34,7 @@ {:else if type === "boolean"} {:else if type === "array"} - p.concat(n), [])} - /> + {:else if type === "link"} {:else if type === "longform"} 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 b89fe693f6..df56f994b8 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/FilterEditor/FilterDrawer.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/FilterEditor/FilterDrawer.svelte @@ -62,7 +62,7 @@ } // if changed to an array, change default value to empty array - const idx = filters.findIndex(x => (x.field = field)) + const idx = filters.findIndex(x => x.field === field) if (expression.type === "array") { filters[idx].value = [] } else { diff --git a/packages/server/src/api/controllers/row/internalSearch.js b/packages/server/src/api/controllers/row/internalSearch.js index cb4e273658..9b7cb71453 100644 --- a/packages/server/src/api/controllers/row/internalSearch.js +++ b/packages/server/src/api/controllers/row/internalSearch.js @@ -133,7 +133,7 @@ class QueryBuilder { } // Escape characters if (escape && originalType === "string") { - value = `${value}`.replace(/[ #+\-&|!{}\]^"~*?:\\]/g, "\\$&") + value = `${value}`.replace(/[ #+\-&|!(){}\]^"~*?:\\]/g, "\\$&") } // Wrap in quotes if (hasVersion && wrap) {