From d34e57382e441a45f8adcc1e2199c875b024efdb Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 14 Feb 2022 10:21:31 +0000 Subject: [PATCH 01/13] Replace all spaces with underscores in column names rather than just the first one --- packages/server/src/api/controllers/row/internalSearch.js | 2 +- packages/server/src/db/views/staticViews.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/src/api/controllers/row/internalSearch.js b/packages/server/src/api/controllers/row/internalSearch.js index 611b3272f3..ad95a25fc5 100644 --- a/packages/server/src/api/controllers/row/internalSearch.js +++ b/packages/server/src/api/controllers/row/internalSearch.js @@ -235,7 +235,7 @@ class QueryBuilder { if (this.sort) { const order = this.sortOrder === "descending" ? "-" : "" const type = `<${this.sortType}>` - body.sort = `${order}${this.sort.replace(/ /, "_")}${type}` + body.sort = `${order}${this.sort.replace(/ /g, "_")}${type}` } return body } diff --git a/packages/server/src/db/views/staticViews.js b/packages/server/src/db/views/staticViews.js index 50b7c305d3..fa0b1f3605 100644 --- a/packages/server/src/db/views/staticViews.js +++ b/packages/server/src/db/views/staticViews.js @@ -96,7 +96,7 @@ exports.createAllSearchIndex = async () => { function idx(input, prev) { for (let key of Object.keys(input)) { let idxKey = prev != null ? `${prev}.${key}` : key - idxKey = idxKey.replace(/ /, "_") + idxKey = idxKey.replace(/ /g, "_") if (Array.isArray(input[key])) { for (let val of input[key]) { if (typeof val !== "object") { From c1bd5b832997cb4d1dd617fd1120780fe4e872ff Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 14 Feb 2022 14:57:06 +0000 Subject: [PATCH 02/13] Fixing issue #4337, allows internal tables to search by the _id or _rev properties in automation query block. --- packages/bbui/src/Drawer/Drawer.svelte | 5 +++ .../SetupPanel/AutomationBlockSetup.svelte | 3 +- .../FilterEditor/FilterDrawer.svelte | 33 +++++++++++++++---- 3 files changed, 32 insertions(+), 9 deletions(-) diff --git a/packages/bbui/src/Drawer/Drawer.svelte b/packages/bbui/src/Drawer/Drawer.svelte index 4bc8a69445..d2c48c4fa4 100644 --- a/packages/bbui/src/Drawer/Drawer.svelte +++ b/packages/bbui/src/Drawer/Drawer.svelte @@ -44,6 +44,11 @@ {/if}