@budibase/frontend-core 1.3.13 → 1.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/src/utils/lucene.js +14 -1
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/frontend-core",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.15",
|
|
4
4
|
"description": "Budibase frontend core libraries used in builder and client",
|
|
5
5
|
"author": "Budibase",
|
|
6
6
|
"license": "MPL-2.0",
|
|
7
7
|
"svelte": "src/index.js",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@budibase/bbui": "^1.3.
|
|
9
|
+
"@budibase/bbui": "^1.3.15",
|
|
10
10
|
"lodash": "^4.17.21",
|
|
11
11
|
"svelte": "^3.46.2"
|
|
12
12
|
},
|
|
13
|
-
"gitHead": "
|
|
13
|
+
"gitHead": "735709a59a4f62b5b91d1e4477da7c9b5dd5d8ac"
|
|
14
14
|
}
|
package/src/utils/lucene.js
CHANGED
|
@@ -80,6 +80,19 @@ const cleanupQuery = query => {
|
|
|
80
80
|
return query
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Removes a numeric prefix on field names designed to give fields uniqueness
|
|
85
|
+
*/
|
|
86
|
+
const removeKeyNumbering = key => {
|
|
87
|
+
if (typeof key === "string" && key.match(/\d[0-9]*:/g) != null) {
|
|
88
|
+
const parts = key.split(":")
|
|
89
|
+
parts.shift()
|
|
90
|
+
return parts.join(":")
|
|
91
|
+
} else {
|
|
92
|
+
return key
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
83
96
|
/**
|
|
84
97
|
* Builds a lucene JSON query from the filter structure generated in the builder
|
|
85
98
|
* @param filter the builder filter structure
|
|
@@ -194,7 +207,7 @@ export const runLuceneQuery = (docs, query) => {
|
|
|
194
207
|
const filters = Object.entries(query[type] || {})
|
|
195
208
|
for (let i = 0; i < filters.length; i++) {
|
|
196
209
|
const [key, testValue] = filters[i]
|
|
197
|
-
const docValue = Helpers.deepGet(doc, key)
|
|
210
|
+
const docValue = Helpers.deepGet(doc, removeKeyNumbering(key))
|
|
198
211
|
if (failFn(docValue, testValue)) {
|
|
199
212
|
return false
|
|
200
213
|
}
|