@stoker-platform/web-app 0.5.47 → 0.5.48
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 +9 -0
- package/package.json +4 -4
- package/src/Collection.tsx +20 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @stoker-platform/web-app
|
|
2
2
|
|
|
3
|
+
## 0.5.48
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- feat: add parent relation args to admin options
|
|
8
|
+
- @stoker-platform/node-client@0.5.31
|
|
9
|
+
- @stoker-platform/utils@0.5.25
|
|
10
|
+
- @stoker-platform/web-client@0.5.27
|
|
11
|
+
|
|
3
12
|
## 0.5.47
|
|
4
13
|
|
|
5
14
|
### 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.48",
|
|
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.31",
|
|
55
|
+
"@stoker-platform/utils": "0.5.25",
|
|
56
|
+
"@stoker-platform/web-client": "0.5.27",
|
|
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
|
@@ -698,7 +698,7 @@ function Collection({
|
|
|
698
698
|
const statusFilterState = state[`collection-status-filter-${labels.collection.toLowerCase()}`]
|
|
699
699
|
const cacheState = state[`collection-range-field-${labels.collection.toLowerCase()}`]
|
|
700
700
|
const rangeState = state[`collection-range-${labels.collection.toLowerCase()}`]
|
|
701
|
-
const defaultView = tryFunction(customization.admin?.defaultView)
|
|
701
|
+
const defaultView = tryFunction(customization.admin?.defaultView, [relationCollection, relationParent])
|
|
702
702
|
if (!relationList) {
|
|
703
703
|
if (tabState) {
|
|
704
704
|
setTab(tabState)
|
|
@@ -734,8 +734,14 @@ function Collection({
|
|
|
734
734
|
setState(`collection-range-${labels.collection.toLowerCase()}`, "range", rangeState)
|
|
735
735
|
}
|
|
736
736
|
} else {
|
|
737
|
-
|
|
738
|
-
|
|
737
|
+
if (defaultView) {
|
|
738
|
+
setTab(defaultView)
|
|
739
|
+
tabRef.current = defaultView
|
|
740
|
+
setState(`collection-tab-${labels.collection.toLowerCase()}`, "tab", defaultView)
|
|
741
|
+
} else {
|
|
742
|
+
setTab("list")
|
|
743
|
+
tabRef.current = "list"
|
|
744
|
+
}
|
|
739
745
|
}
|
|
740
746
|
if (rangeSelectorState) {
|
|
741
747
|
setRangeSelector(rangeSelectorState as "range" | "week" | "month" | undefined)
|
|
@@ -861,6 +867,15 @@ function Collection({
|
|
|
861
867
|
}
|
|
862
868
|
})
|
|
863
869
|
}
|
|
870
|
+
} else {
|
|
871
|
+
filtersClone.forEach((filter: Filter) => {
|
|
872
|
+
if (filter.type === "status" || filter.type === "range") {
|
|
873
|
+
return
|
|
874
|
+
}
|
|
875
|
+
if (filter.type === "select" && !hasFirstPageLoaded[labels.collection] && filter.defaultValue) {
|
|
876
|
+
filter.value = tryFunction(filter.defaultValue, [relationCollection, relationParent])
|
|
877
|
+
}
|
|
878
|
+
})
|
|
864
879
|
}
|
|
865
880
|
|
|
866
881
|
if (statusField || softDelete) {
|
|
@@ -1120,12 +1135,12 @@ function Collection({
|
|
|
1120
1135
|
(filter.value ||
|
|
1121
1136
|
(filter.type === "select" &&
|
|
1122
1137
|
filter.defaultValue &&
|
|
1123
|
-
tryFunction(filter.defaultValue) &&
|
|
1138
|
+
tryFunction(filter.defaultValue, [relationCollection, relationParent]) &&
|
|
1124
1139
|
!filter.value)) &&
|
|
1125
1140
|
!(
|
|
1126
1141
|
filter.type === "select" &&
|
|
1127
1142
|
filter.defaultValue &&
|
|
1128
|
-
tryFunction(filter.defaultValue) === filter.value
|
|
1143
|
+
tryFunction(filter.defaultValue, [relationCollection, relationParent]) === filter.value
|
|
1129
1144
|
),
|
|
1130
1145
|
)
|
|
1131
1146
|
.filter((filter) => !excludedFilters.includes(filter.field)).length > 0
|