@stoker-platform/web-app 0.5.35 → 0.5.37
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 +15 -0
- package/package.json +4 -4
- package/src/Collection.tsx +17 -1
- package/src/Form.tsx +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @stoker-platform/web-app
|
|
2
2
|
|
|
3
|
+
## 0.5.37
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- feat: provide parent record to onFormOpen hook
|
|
8
|
+
- @stoker-platform/node-client@0.5.22
|
|
9
|
+
- @stoker-platform/utils@0.5.16
|
|
10
|
+
- @stoker-platform/web-client@0.5.18
|
|
11
|
+
|
|
12
|
+
## 0.5.36
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- feat: improve filters active indicator
|
|
17
|
+
|
|
3
18
|
## 0.5.35
|
|
4
19
|
|
|
5
20
|
### 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.37",
|
|
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.22",
|
|
55
|
+
"@stoker-platform/utils": "0.5.16",
|
|
56
|
+
"@stoker-platform/web-client": "0.5.18",
|
|
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/Collection.tsx
CHANGED
|
@@ -1110,7 +1110,19 @@ function Collection({
|
|
|
1110
1110
|
return (
|
|
1111
1111
|
filters
|
|
1112
1112
|
.filter((filter) => filter.type !== "status" && filter.type !== "range")
|
|
1113
|
-
.filter(
|
|
1113
|
+
.filter(
|
|
1114
|
+
(filter) =>
|
|
1115
|
+
(filter.value ||
|
|
1116
|
+
(filter.type === "select" &&
|
|
1117
|
+
filter.defaultValue &&
|
|
1118
|
+
tryFunction(filter.defaultValue) &&
|
|
1119
|
+
!filter.value)) &&
|
|
1120
|
+
!(
|
|
1121
|
+
filter.type === "select" &&
|
|
1122
|
+
filter.defaultValue &&
|
|
1123
|
+
tryFunction(filter.defaultValue) === filter.value
|
|
1124
|
+
),
|
|
1125
|
+
)
|
|
1114
1126
|
.filter((filter) => !excludedFilters.includes(filter.field)).length > 0
|
|
1115
1127
|
)
|
|
1116
1128
|
}, [filters, excludedFilters])
|
|
@@ -2076,6 +2088,10 @@ function Collection({
|
|
|
2076
2088
|
path={[labels.collection]}
|
|
2077
2089
|
record={createPrePopulatedRecord()}
|
|
2078
2090
|
draft={true}
|
|
2091
|
+
parentCollection={
|
|
2092
|
+
relationCollection?.labels.collection
|
|
2093
|
+
}
|
|
2094
|
+
parentRecord={relationParent}
|
|
2079
2095
|
onSuccess={() => {
|
|
2080
2096
|
setIsCreateDialogOpen(false)
|
|
2081
2097
|
setSelectedDateRange(null)
|
package/src/Form.tsx
CHANGED
|
@@ -223,6 +223,8 @@ interface FormProps {
|
|
|
223
223
|
onSaveRecord?: () => void
|
|
224
224
|
rowSelection?: StokerRecord[]
|
|
225
225
|
fromRelationList?: string
|
|
226
|
+
parentCollection?: string
|
|
227
|
+
parentRecord?: StokerRecord
|
|
226
228
|
}
|
|
227
229
|
|
|
228
230
|
interface FieldProps {
|
|
@@ -2164,6 +2166,8 @@ function RecordForm({
|
|
|
2164
2166
|
onSaveRecord,
|
|
2165
2167
|
rowSelection,
|
|
2166
2168
|
fromRelationList,
|
|
2169
|
+
parentCollection,
|
|
2170
|
+
parentRecord,
|
|
2167
2171
|
}: FormProps) {
|
|
2168
2172
|
const { labels, access, fields, auth, recordTitleField, softDelete, relationLists } = collection
|
|
2169
2173
|
const tenantId = getTenant()
|
|
@@ -3382,7 +3386,7 @@ function RecordForm({
|
|
|
3382
3386
|
if (!onFormOpenCalledRef.current && operation === "create" && customization.admin?.onFormOpen) {
|
|
3383
3387
|
record ||= {} as StokerRecord
|
|
3384
3388
|
const recordClone = cloneDeep(record)
|
|
3385
|
-
await customization.admin?.onFormOpen("create", record)
|
|
3389
|
+
await customization.admin?.onFormOpen("create", record, parentCollection, parentRecord)
|
|
3386
3390
|
const recordKeys = Object.keys(record) as Array<keyof typeof record>
|
|
3387
3391
|
for (const key of recordKeys) {
|
|
3388
3392
|
// eslint-disable-next-line security/detect-object-injection
|