@stoker-platform/web-app 0.5.84 → 0.5.85
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 +11 -0
- package/bin/build.js +1 -1
- package/package.json +4 -4
- package/src/Collection.tsx +8 -8
- package/src/Filters.tsx +3 -3
- package/src/Form.tsx +3 -3
- package/src/PermissionPicker.tsx +3 -3
- package/src/SearchAllResults.tsx +1 -1
- package/src/utils/getData.ts +1 -1
- package/vite.config.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @stoker-platform/web-app
|
|
2
2
|
|
|
3
|
+
## 0.5.85
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- feat: use single args object for config functions
|
|
8
|
+
- feat: update doc references to record
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
- @stoker-platform/node-client@0.5.48
|
|
11
|
+
- @stoker-platform/utils@0.5.40
|
|
12
|
+
- @stoker-platform/web-client@0.5.48
|
|
13
|
+
|
|
3
14
|
## 0.5.84
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
package/bin/build.js
CHANGED
|
@@ -407,7 +407,7 @@ try {
|
|
|
407
407
|
const path = join(process.cwd(), "lib", "main.js")
|
|
408
408
|
const url = pathToFileURL(path).href
|
|
409
409
|
const globalConfigModule = await import(url)
|
|
410
|
-
const globalConfig = globalConfigModule.default("
|
|
410
|
+
const globalConfig = globalConfigModule.default({ sdk: "web" })
|
|
411
411
|
const appName = await tryPromise(globalConfig.appName)
|
|
412
412
|
const description = await tryPromise(globalConfig.admin?.meta?.description)
|
|
413
413
|
|
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.85",
|
|
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.50.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.48",
|
|
55
|
+
"@stoker-platform/utils": "0.5.40",
|
|
56
|
+
"@stoker-platform/web-client": "0.5.48",
|
|
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
|
@@ -675,8 +675,8 @@ function Collection({
|
|
|
675
675
|
...(additionalConstraintsRef.current || []),
|
|
676
676
|
],
|
|
677
677
|
})
|
|
678
|
-
setServerList((prev) => ({ ...prev, [key]: data.
|
|
679
|
-
setOptimisticList(data.
|
|
678
|
+
setServerList((prev) => ({ ...prev, [key]: data.records }))
|
|
679
|
+
setOptimisticList(data.records, key)
|
|
680
680
|
setIsRouteLoading("-", location.pathname)
|
|
681
681
|
resolve()
|
|
682
682
|
}
|
|
@@ -734,13 +734,13 @@ function Collection({
|
|
|
734
734
|
// TODO: subcollection support
|
|
735
735
|
const records = await getSome([labels.collection])
|
|
736
736
|
|
|
737
|
-
if (records.
|
|
737
|
+
if (records.records.length > 0) {
|
|
738
738
|
runViewTransition(() =>
|
|
739
739
|
navigate(
|
|
740
|
-
`${records.
|
|
740
|
+
`${records.records[0].Collection_Path.join("-").toLowerCase()}/${records.records[0].id}/edit`,
|
|
741
741
|
{
|
|
742
742
|
state: {
|
|
743
|
-
record: records.
|
|
743
|
+
record: records.records[0],
|
|
744
744
|
},
|
|
745
745
|
replace: true,
|
|
746
746
|
},
|
|
@@ -1408,8 +1408,8 @@ function Collection({
|
|
|
1408
1408
|
pagination: { orderByField, orderByDirection, number: 10000 },
|
|
1409
1409
|
},
|
|
1410
1410
|
)
|
|
1411
|
-
if (!serverData.
|
|
1412
|
-
const data = await prepareCSVData(collection, serverData.
|
|
1411
|
+
if (!serverData.records.length) return
|
|
1412
|
+
const data = await prepareCSVData(collection, serverData.records)
|
|
1413
1413
|
if (isServerReadOnly) {
|
|
1414
1414
|
data.data = sortList(
|
|
1415
1415
|
collection,
|
|
@@ -1564,7 +1564,7 @@ function Collection({
|
|
|
1564
1564
|
|
|
1565
1565
|
const parentId = relationParent?.id
|
|
1566
1566
|
const relationArrayField = `${relationList.field}_Array`
|
|
1567
|
-
const filtered = data.
|
|
1567
|
+
const filtered = data.records.filter((doc) => {
|
|
1568
1568
|
// eslint-disable-next-line security/detect-object-injection
|
|
1569
1569
|
const array = doc[relationArrayField] as string[] | undefined
|
|
1570
1570
|
return !array?.includes(parentId)
|
package/src/Filters.tsx
CHANGED
|
@@ -301,16 +301,16 @@ export function Filters({ collection, excluded, relationList }: FiltersProps) {
|
|
|
301
301
|
clearTimeout(pickerDebounceTimeout.current)
|
|
302
302
|
|
|
303
303
|
if (isCollectionPreloadCacheEnabled && query) {
|
|
304
|
-
const searchResults = localFullTextSearch(collectionSchema, query, data.
|
|
304
|
+
const searchResults = localFullTextSearch(collectionSchema, query, data.records)
|
|
305
305
|
const objectIds = searchResults.map((result) => result.id)
|
|
306
306
|
setData((prev) => ({
|
|
307
307
|
...prev,
|
|
308
|
-
[field]: data.
|
|
308
|
+
[field]: data.records.filter((doc) => objectIds.includes(doc.id)).slice(0, 10),
|
|
309
309
|
}))
|
|
310
310
|
} else {
|
|
311
311
|
setData((prev) => ({
|
|
312
312
|
...prev,
|
|
313
|
-
[field]: data.
|
|
313
|
+
[field]: data.records.slice(0, 10),
|
|
314
314
|
}))
|
|
315
315
|
}
|
|
316
316
|
setLoadingImmediate((prev) => ({
|
package/src/Form.tsx
CHANGED
|
@@ -1961,17 +1961,17 @@ function RelationField({
|
|
|
1961
1961
|
clearTimeout(pickerDebounceTimeout.current)
|
|
1962
1962
|
|
|
1963
1963
|
if (isCollectionPreloadCacheEnabled && query) {
|
|
1964
|
-
const searchResults = localFullTextSearch(relationCollection, query, data.
|
|
1964
|
+
const searchResults = localFullTextSearch(relationCollection, query, data.records, (result) => {
|
|
1965
1965
|
if (!fieldCustomization.admin?.filterResults) return true
|
|
1966
1966
|
return !!fieldCustomization.admin?.filterResults?.(result, collection, record)
|
|
1967
1967
|
})
|
|
1968
1968
|
const objectIds = searchResults.map((result) => result.id)
|
|
1969
|
-
orderData(data.
|
|
1969
|
+
orderData(data.records.filter((doc) => objectIds.includes(doc.id)).slice(0, 10)).then((data) => {
|
|
1970
1970
|
setData(data)
|
|
1971
1971
|
})
|
|
1972
1972
|
} else {
|
|
1973
1973
|
orderData(
|
|
1974
|
-
data.
|
|
1974
|
+
data.records
|
|
1975
1975
|
.filter((doc) => {
|
|
1976
1976
|
if (!isCollectionPreloadCacheEnabled) return true
|
|
1977
1977
|
if (!fieldCustomization.admin?.filterResults) return true
|
package/src/PermissionPicker.tsx
CHANGED
|
@@ -133,11 +133,11 @@ export const PermissionPicker = ({
|
|
|
133
133
|
clearTimeout(pickerDebounceTimeout.current)
|
|
134
134
|
|
|
135
135
|
if (isCollectionPreloadCacheEnabled && query) {
|
|
136
|
-
const searchResults = localFullTextSearch(collection, query, data.
|
|
136
|
+
const searchResults = localFullTextSearch(collection, query, data.records)
|
|
137
137
|
const objectIds = searchResults.map((result) => result.id)
|
|
138
|
-
setData(data.
|
|
138
|
+
setData(data.records.filter((doc) => objectIds.includes(doc.id)).slice(0, 10))
|
|
139
139
|
} else {
|
|
140
|
-
setData(data.
|
|
140
|
+
setData(data.records.slice(0, 10))
|
|
141
141
|
}
|
|
142
142
|
setIsLoadingImmediate(false)
|
|
143
143
|
setIsLoading(false)
|
package/src/SearchAllResults.tsx
CHANGED
package/src/utils/getData.ts
CHANGED
|
@@ -85,7 +85,7 @@ export const getData = async (
|
|
|
85
85
|
const data = await getSome([labels.collection], {
|
|
86
86
|
constraints: query.queries[0].constraints as [string, WhereFilterOp, unknown][],
|
|
87
87
|
})
|
|
88
|
-
setResults(data.
|
|
88
|
+
setResults(data.records)
|
|
89
89
|
setLoading(false)
|
|
90
90
|
resolve()
|
|
91
91
|
}
|
package/vite.config.ts
CHANGED
|
@@ -13,7 +13,7 @@ export default defineConfig(async ({ mode }) => {
|
|
|
13
13
|
const path = join(process.cwd(), "src", "assets", "system-custom", "main.js")
|
|
14
14
|
const url = pathToFileURL(path).href
|
|
15
15
|
const globalConfigModule = await import(url)
|
|
16
|
-
const globalConfig = globalConfigModule.default("
|
|
16
|
+
const globalConfig = globalConfigModule.default({ sdk: "web" })
|
|
17
17
|
const appName = await tryPromise(globalConfig.appName)
|
|
18
18
|
const description = await tryPromise(globalConfig.admin?.meta?.description)
|
|
19
19
|
|