@stoker-platform/web-app 0.5.37 → 0.5.39
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/CHANGELOG.md +19 -0
- package/package.json +4 -4
- package/src/Form.tsx +11 -0
- package/src/utils/getRelationFields.ts +2 -1
- package/src/utils/prepareCSVData.ts +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @stoker-platform/web-app
|
|
2
2
|
|
|
3
|
+
## 0.5.39
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- feat: support full text search on array fields
|
|
8
|
+
- feat: load full relation document into create record form
|
|
9
|
+
- feat: support modifying CSV export value
|
|
10
|
+
- @stoker-platform/node-client@0.5.24
|
|
11
|
+
- @stoker-platform/utils@0.5.18
|
|
12
|
+
- @stoker-platform/web-client@0.5.20
|
|
13
|
+
|
|
14
|
+
## 0.5.38
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- @stoker-platform/node-client@0.5.23
|
|
19
|
+
- @stoker-platform/utils@0.5.17
|
|
20
|
+
- @stoker-platform/web-client@0.5.19
|
|
21
|
+
|
|
3
22
|
## 0.5.37
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stoker-platform/web-app",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.39",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"scripts": {
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
52
52
|
"@react-google-maps/api": "^2.20.8",
|
|
53
53
|
"@sentry/react": "^10.38.0",
|
|
54
|
-
"@stoker-platform/node-client": "0.5.
|
|
55
|
-
"@stoker-platform/utils": "0.5.
|
|
56
|
-
"@stoker-platform/web-client": "0.5.
|
|
54
|
+
"@stoker-platform/node-client": "0.5.24",
|
|
55
|
+
"@stoker-platform/utils": "0.5.18",
|
|
56
|
+
"@stoker-platform/web-client": "0.5.20",
|
|
57
57
|
"@tanstack/react-table": "^8.21.3",
|
|
58
58
|
"@types/react": "18.3.13",
|
|
59
59
|
"@types/react-dom": "18.3.1",
|
package/src/Form.tsx
CHANGED
|
@@ -1678,6 +1678,17 @@ function RelationField({
|
|
|
1678
1678
|
} else {
|
|
1679
1679
|
setDisplay(relationId)
|
|
1680
1680
|
}
|
|
1681
|
+
if (operation === "create") {
|
|
1682
|
+
const queryFullRecord = tryFunction(fieldCustomization.admin?.queryFullRecord)
|
|
1683
|
+
if (!(field.includeFields && field.titleField) || queryFullRecord) {
|
|
1684
|
+
const fullRecord = await getOne([relationCollection.labels.collection], relationId, {
|
|
1685
|
+
noEmbeddingFields: true,
|
|
1686
|
+
})
|
|
1687
|
+
if (!isEqual(fullRecord, relationRecord)) {
|
|
1688
|
+
form.setValue(field.name, { ...form.getValues(field.name), [relationId]: fullRecord })
|
|
1689
|
+
}
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1681
1692
|
} else {
|
|
1682
1693
|
setValue("no_selection")
|
|
1683
1694
|
setDisplay("----")
|
|
@@ -18,6 +18,7 @@ export const getRelationFields = (collection: CollectionSchema) => {
|
|
|
18
18
|
for (const field of fields) {
|
|
19
19
|
const fieldCustomization = getFieldCustomization(field, customization)
|
|
20
20
|
if (!isRelationField(field)) continue
|
|
21
|
+
const queryFullRecord = tryFunction(fieldCustomization.admin?.queryFullRecord)
|
|
21
22
|
const condition = tryFunction(fieldCustomization.admin?.condition?.form, ["update"])
|
|
22
23
|
const roleGroup = getRoleGroup(permissions.Role, collectionSchema, schema)
|
|
23
24
|
if (!roleGroup) throw new Error("PERMISSION_DENIED")
|
|
@@ -27,7 +28,7 @@ export const getRelationFields = (collection: CollectionSchema) => {
|
|
|
27
28
|
const titleField = field.titleField
|
|
28
29
|
if (
|
|
29
30
|
(!fieldCustomization.admin?.condition?.form || condition) &&
|
|
30
|
-
!(titleField && field.includeFields?.includes(titleField))
|
|
31
|
+
(!(titleField && field.includeFields?.includes(titleField)) || queryFullRecord)
|
|
31
32
|
) {
|
|
32
33
|
relationFields.push(field.name)
|
|
33
34
|
}
|
|
@@ -86,8 +86,16 @@ export const prepareCSVData = (collection: CollectionSchema, data: any[]) => {
|
|
|
86
86
|
computedValue = "No"
|
|
87
87
|
} else if (doc[field.name] === "tick") {
|
|
88
88
|
computedValue = "Yes"
|
|
89
|
+
} else if (fieldCustomization.admin?.modifyDisplayValue) {
|
|
90
|
+
computedValue = tryFunction(fieldCustomization.admin?.modifyDisplayValue(doc, "export"))
|
|
91
|
+
if (computedValue === "-") {
|
|
92
|
+
computedValue = ""
|
|
93
|
+
}
|
|
89
94
|
} else {
|
|
90
95
|
computedValue = doc[field.name]
|
|
96
|
+
if (computedValue === "-") {
|
|
97
|
+
computedValue = ""
|
|
98
|
+
}
|
|
91
99
|
}
|
|
92
100
|
docData[field.name] = escapeCSVField(computedValue)
|
|
93
101
|
} else if (doc[field.name] !== undefined) {
|