@budibase/frontend-core 3.2.26 → 3.2.27
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
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/frontend-core",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.27",
|
|
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": "
|
|
10
|
-
"@budibase/shared-core": "
|
|
11
|
-
"@budibase/types": "
|
|
9
|
+
"@budibase/bbui": "*",
|
|
10
|
+
"@budibase/shared-core": "*",
|
|
11
|
+
"@budibase/types": "*",
|
|
12
12
|
"dayjs": "^1.10.8",
|
|
13
13
|
"lodash": "4.17.21",
|
|
14
14
|
"shortid": "2.2.15",
|
|
15
15
|
"socket.io-client": "^4.7.5"
|
|
16
16
|
},
|
|
17
|
-
"gitHead": "
|
|
17
|
+
"gitHead": "1ea577227cec7d169dfc3e13f4b7eced8fdbc53c"
|
|
18
18
|
}
|
package/src/utils/utils.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { makePropSafe as safe } from "@budibase/string-templates"
|
|
2
2
|
import { Helpers } from "@budibase/bbui"
|
|
3
|
+
import { cloneDeep } from "lodash"
|
|
3
4
|
|
|
4
5
|
export const sleep = ms => new Promise(resolve => setTimeout(resolve, ms))
|
|
5
6
|
|
|
@@ -351,3 +352,27 @@ export const buildMultiStepFormBlockDefaultProps = props => {
|
|
|
351
352
|
title,
|
|
352
353
|
}
|
|
353
354
|
}
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Parse out empty or invalid UI filters and clear empty groups
|
|
358
|
+
* @param {Object} filter UI filter
|
|
359
|
+
* @returns {Object} parsed filter
|
|
360
|
+
*/
|
|
361
|
+
export function parseFilter(filter) {
|
|
362
|
+
if (!filter?.groups) {
|
|
363
|
+
return filter
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
const update = cloneDeep(filter)
|
|
367
|
+
|
|
368
|
+
update.groups = update.groups
|
|
369
|
+
.map(group => {
|
|
370
|
+
group.filters = group.filters.filter(filter => {
|
|
371
|
+
return filter.field && filter.operator
|
|
372
|
+
})
|
|
373
|
+
return group.filters.length ? group : null
|
|
374
|
+
})
|
|
375
|
+
.filter(group => group)
|
|
376
|
+
|
|
377
|
+
return update
|
|
378
|
+
}
|