@budibase/frontend-core 2.24.1 → 2.24.2
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 +5 -5
- package/src/components/FilterBuilder.svelte +1 -0
- package/src/components/grid/cells/HeaderCell.svelte +8 -2
- package/src/components/grid/overlays/MenuOverlay.svelte +3 -3
- package/src/components/grid/stores/datasource.js +7 -3
- package/src/components/grid/stores/menu.js +1 -0
- package/src/components/grid/stores/rows.js +13 -6
- package/src/constants.js +3 -2
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/frontend-core",
|
|
3
|
-
"version": "2.24.
|
|
3
|
+
"version": "2.24.2",
|
|
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": "2.24.
|
|
10
|
-
"@budibase/shared-core": "2.24.
|
|
11
|
-
"@budibase/types": "2.24.
|
|
9
|
+
"@budibase/bbui": "2.24.2",
|
|
10
|
+
"@budibase/shared-core": "2.24.2",
|
|
11
|
+
"@budibase/types": "2.24.2",
|
|
12
12
|
"dayjs": "^1.10.8",
|
|
13
13
|
"lodash": "4.17.21",
|
|
14
14
|
"shortid": "2.2.15",
|
|
15
15
|
"socket.io-client": "^4.6.1"
|
|
16
16
|
},
|
|
17
|
-
"gitHead": "
|
|
17
|
+
"gitHead": "9c6e0823094ac5bbf514d628152050bf25faf98d"
|
|
18
18
|
}
|
|
@@ -124,6 +124,7 @@
|
|
|
124
124
|
const fieldSchema = schemaFields.find(x => x.name === filter.field)
|
|
125
125
|
filter.type = fieldSchema?.type
|
|
126
126
|
filter.subtype = fieldSchema?.subtype
|
|
127
|
+
filter.formulaType = fieldSchema?.formulaType
|
|
127
128
|
|
|
128
129
|
// Update external type based on field
|
|
129
130
|
filter.externalType = getSchema(filter)?.externalType
|
|
@@ -121,8 +121,14 @@
|
|
|
121
121
|
|
|
122
122
|
const onContextMenu = e => {
|
|
123
123
|
e.preventDefault()
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
|
|
125
|
+
// The timeout allows time for clickoutside to close other open popvers
|
|
126
|
+
// before we show this one. Without the timeout, this popover closes again
|
|
127
|
+
// before it's even visible as clickoutside closes it.
|
|
128
|
+
setTimeout(() => {
|
|
129
|
+
ui.actions.blur()
|
|
130
|
+
open = !open
|
|
131
|
+
}, 10)
|
|
126
132
|
}
|
|
127
133
|
|
|
128
134
|
const sortAscending = () => {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
focusedCellAPI,
|
|
19
19
|
focusedRowId,
|
|
20
20
|
notifications,
|
|
21
|
-
|
|
21
|
+
hasBudibaseIdentifiers,
|
|
22
22
|
} = getContext("grid")
|
|
23
23
|
|
|
24
24
|
let anchor
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
</MenuItem>
|
|
83
83
|
<MenuItem
|
|
84
84
|
icon="Copy"
|
|
85
|
-
disabled={isNewRow || !$focusedRow?._id || !$
|
|
85
|
+
disabled={isNewRow || !$focusedRow?._id || !$hasBudibaseIdentifiers}
|
|
86
86
|
on:click={() => copyToClipboard($focusedRow?._id)}
|
|
87
87
|
on:click={menu.actions.close}
|
|
88
88
|
>
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
</MenuItem>
|
|
91
91
|
<MenuItem
|
|
92
92
|
icon="Copy"
|
|
93
|
-
disabled={isNewRow || !$focusedRow?._rev}
|
|
93
|
+
disabled={isNewRow || !$focusedRow?._rev || !$hasBudibaseIdentifiers}
|
|
94
94
|
on:click={() => copyToClipboard($focusedRow?._rev)}
|
|
95
95
|
on:click={menu.actions.close}
|
|
96
96
|
>
|
|
@@ -75,14 +75,18 @@ export const deriveStores = context => {
|
|
|
75
75
|
}
|
|
76
76
|
)
|
|
77
77
|
|
|
78
|
-
const
|
|
79
|
-
|
|
78
|
+
const hasBudibaseIdentifiers = derived(datasource, $datasource => {
|
|
79
|
+
let type = $datasource?.type
|
|
80
|
+
if (type === "provider") {
|
|
81
|
+
type = $datasource.value?.datasource?.type
|
|
82
|
+
}
|
|
83
|
+
return ["table", "viewV2", "link"].includes(type)
|
|
80
84
|
})
|
|
81
85
|
|
|
82
86
|
return {
|
|
83
87
|
schema,
|
|
84
88
|
enrichedSchema,
|
|
85
|
-
|
|
89
|
+
hasBudibaseIdentifiers,
|
|
86
90
|
}
|
|
87
91
|
}
|
|
88
92
|
|
|
@@ -83,7 +83,7 @@ export const createActions = context => {
|
|
|
83
83
|
error,
|
|
84
84
|
notifications,
|
|
85
85
|
fetch,
|
|
86
|
-
|
|
86
|
+
hasBudibaseIdentifiers,
|
|
87
87
|
refreshing,
|
|
88
88
|
} = context
|
|
89
89
|
const instanceLoaded = writable(false)
|
|
@@ -196,9 +196,16 @@ export const createActions = context => {
|
|
|
196
196
|
// Handles validation errors from the rows API and updates local validation
|
|
197
197
|
// state, storing error messages against relevant cells
|
|
198
198
|
const handleValidationError = (rowId, error) => {
|
|
199
|
+
let errorString
|
|
200
|
+
if (typeof error === "string") {
|
|
201
|
+
errorString = error
|
|
202
|
+
} else if (typeof error?.message === "string") {
|
|
203
|
+
errorString = error.message
|
|
204
|
+
}
|
|
205
|
+
|
|
199
206
|
// If the server doesn't reply with a valid error, assume that the source
|
|
200
207
|
// of the error is the focused cell's column
|
|
201
|
-
if (!error?.json?.validationErrors &&
|
|
208
|
+
if (!error?.json?.validationErrors && errorString) {
|
|
202
209
|
const focusedColumn = get(focusedCellId)?.split("-")[1]
|
|
203
210
|
if (focusedColumn) {
|
|
204
211
|
error = {
|
|
@@ -261,7 +268,7 @@ export const createActions = context => {
|
|
|
261
268
|
focusedCellId.set(`${rowId}-${erroredColumns[0]}`)
|
|
262
269
|
}
|
|
263
270
|
} else {
|
|
264
|
-
get(notifications).error(
|
|
271
|
+
get(notifications).error(errorString || "An unknown error occurred")
|
|
265
272
|
}
|
|
266
273
|
}
|
|
267
274
|
|
|
@@ -458,14 +465,14 @@ export const createActions = context => {
|
|
|
458
465
|
}
|
|
459
466
|
let rowsToAppend = []
|
|
460
467
|
let newRow
|
|
461
|
-
const $
|
|
468
|
+
const $hasBudibaseIdentifiers = get(hasBudibaseIdentifiers)
|
|
462
469
|
for (let i = 0; i < newRows.length; i++) {
|
|
463
470
|
newRow = newRows[i]
|
|
464
471
|
|
|
465
472
|
// Ensure we have a unique _id.
|
|
466
473
|
// This means generating one for non DS+, overwriting any that may already
|
|
467
474
|
// exist as we cannot allow duplicates.
|
|
468
|
-
if (!$
|
|
475
|
+
if (!$hasBudibaseIdentifiers) {
|
|
469
476
|
newRow._id = Helpers.uuid()
|
|
470
477
|
}
|
|
471
478
|
|
|
@@ -510,7 +517,7 @@ export const createActions = context => {
|
|
|
510
517
|
const cleanRow = row => {
|
|
511
518
|
let clone = { ...row }
|
|
512
519
|
delete clone.__idx
|
|
513
|
-
if (!get(
|
|
520
|
+
if (!get(hasBudibaseIdentifiers)) {
|
|
514
521
|
delete clone._id
|
|
515
522
|
}
|
|
516
523
|
return clone
|
package/src/constants.js
CHANGED
|
@@ -57,6 +57,7 @@ export const PlanType = {
|
|
|
57
57
|
PRO: "pro",
|
|
58
58
|
BUSINESS: "business",
|
|
59
59
|
ENTERPRISE: "enterprise",
|
|
60
|
+
ENTERPRISE_BASIC_TRIAL: "enterprise_basic_trial",
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
/**
|
|
@@ -124,8 +125,8 @@ export const TypeIconMap = {
|
|
|
124
125
|
[FieldType.ARRAY]: "Duplicate",
|
|
125
126
|
[FieldType.NUMBER]: "123",
|
|
126
127
|
[FieldType.BOOLEAN]: "Boolean",
|
|
127
|
-
[FieldType.ATTACHMENTS]: "
|
|
128
|
-
[FieldType.ATTACHMENT_SINGLE]: "
|
|
128
|
+
[FieldType.ATTACHMENTS]: "DocumentFragmentGroup",
|
|
129
|
+
[FieldType.ATTACHMENT_SINGLE]: "DocumentFragment",
|
|
129
130
|
[FieldType.LINK]: "DataCorrelated",
|
|
130
131
|
[FieldType.FORMULA]: "Calculator",
|
|
131
132
|
[FieldType.JSON]: "Brackets",
|