@stoker-platform/web-app 0.5.103 → 0.5.104
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 +6 -0
- package/package.json +1 -1
- package/src/DashboardChart.tsx +2 -2
- package/src/DashboardMetric.tsx +2 -2
- package/src/DashboardReminder.tsx +2 -2
- package/src/Filters.tsx +7 -4
- package/src/Form.tsx +6 -4
- package/src/PermissionPicker.tsx +6 -4
- package/src/SearchAllResults.tsx +4 -4
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/DashboardChart.tsx
CHANGED
|
@@ -63,8 +63,8 @@ export const DashboardChart = ({ chart, title, collection }: DashboardChartProps
|
|
|
63
63
|
|
|
64
64
|
const constraints = useMemo(() => {
|
|
65
65
|
const existingConstraints = [...(chart.constraints || [])]
|
|
66
|
-
if (softDelete) {
|
|
67
|
-
existingConstraints.push([
|
|
66
|
+
if (softDelete?.archivedField) {
|
|
67
|
+
existingConstraints.push([softDelete.archivedField, "==", false])
|
|
68
68
|
}
|
|
69
69
|
return existingConstraints
|
|
70
70
|
}, [])
|
package/src/DashboardMetric.tsx
CHANGED
|
@@ -53,8 +53,8 @@ export const DashboardMetric = ({ metric, title, collection }: DashboardMetricPr
|
|
|
53
53
|
|
|
54
54
|
const constraints = useMemo(() => {
|
|
55
55
|
const existingConstraints = [...(metric.constraints || [])]
|
|
56
|
-
if (softDelete) {
|
|
57
|
-
existingConstraints.push([
|
|
56
|
+
if (softDelete?.archivedField) {
|
|
57
|
+
existingConstraints.push([softDelete.archivedField, "==", false])
|
|
58
58
|
}
|
|
59
59
|
return existingConstraints
|
|
60
60
|
}, [])
|
|
@@ -68,8 +68,8 @@ export const DashboardReminder = ({ reminder, title, collection }: DashboardRemi
|
|
|
68
68
|
|
|
69
69
|
const constraints = useMemo(() => {
|
|
70
70
|
const existingConstraints = [...(reminder.constraints || [])]
|
|
71
|
-
if (softDelete) {
|
|
72
|
-
existingConstraints.push([
|
|
71
|
+
if (softDelete?.archivedField) {
|
|
72
|
+
existingConstraints.push([softDelete.archivedField, "==", false])
|
|
73
73
|
}
|
|
74
74
|
return existingConstraints
|
|
75
75
|
}, [])
|
package/src/Filters.tsx
CHANGED
|
@@ -254,12 +254,15 @@ export function Filters({ collection, excluded, relationList }: FiltersProps) {
|
|
|
254
254
|
newConstraints = constraints.map((constraint) => where(constraint[0], constraint[1], constraint[2]))
|
|
255
255
|
}
|
|
256
256
|
if (isCollectionServerReadOnly) {
|
|
257
|
-
if (softDelete) {
|
|
258
|
-
newConstraints.push([
|
|
257
|
+
if (softDelete?.archivedField) {
|
|
258
|
+
newConstraints.push([softDelete.archivedField, "==", false] as QueryConstraint &
|
|
259
|
+
[string, string, unknown])
|
|
259
260
|
}
|
|
260
261
|
} else {
|
|
261
|
-
if (softDelete) {
|
|
262
|
-
newConstraints.push(
|
|
262
|
+
if (softDelete?.archivedField) {
|
|
263
|
+
newConstraints.push(
|
|
264
|
+
where(softDelete.archivedField, "==", false) as QueryConstraint & [string, string, unknown],
|
|
265
|
+
)
|
|
263
266
|
}
|
|
264
267
|
}
|
|
265
268
|
|
package/src/Form.tsx
CHANGED
|
@@ -1942,13 +1942,15 @@ function RelationField({
|
|
|
1942
1942
|
newConstraints = constraints.map((constraint) => where(constraint[0], constraint[1], constraint[2]))
|
|
1943
1943
|
}
|
|
1944
1944
|
if (isCollectionServerReadOnly) {
|
|
1945
|
-
if (softDelete) {
|
|
1946
|
-
newConstraints.push([
|
|
1945
|
+
if (softDelete?.archivedField) {
|
|
1946
|
+
newConstraints.push([softDelete.archivedField, "==", false] as QueryConstraint &
|
|
1947
|
+
[string, WhereFilterOp, unknown])
|
|
1947
1948
|
}
|
|
1948
1949
|
} else {
|
|
1949
|
-
if (softDelete) {
|
|
1950
|
+
if (softDelete?.archivedField) {
|
|
1950
1951
|
newConstraints.push(
|
|
1951
|
-
where(
|
|
1952
|
+
where(softDelete.archivedField, "==", false) as QueryConstraint &
|
|
1953
|
+
[string, WhereFilterOp, unknown],
|
|
1952
1954
|
)
|
|
1953
1955
|
}
|
|
1954
1956
|
}
|
package/src/PermissionPicker.tsx
CHANGED
|
@@ -90,13 +90,15 @@ export const PermissionPicker = ({
|
|
|
90
90
|
newConstraints = constraints.map((constraint) => where(constraint[0], constraint[1], constraint[2]))
|
|
91
91
|
}
|
|
92
92
|
if (isCollectionServerReadOnly) {
|
|
93
|
-
if (softDelete) {
|
|
94
|
-
newConstraints.push([
|
|
93
|
+
if (softDelete?.archivedField) {
|
|
94
|
+
newConstraints.push([softDelete.archivedField, "==", false] as QueryConstraint &
|
|
95
|
+
[string, WhereFilterOp, unknown])
|
|
95
96
|
}
|
|
96
97
|
} else {
|
|
97
|
-
if (softDelete) {
|
|
98
|
+
if (softDelete?.archivedField) {
|
|
98
99
|
newConstraints.push(
|
|
99
|
-
where(
|
|
100
|
+
where(softDelete.archivedField, "==", false) as QueryConstraint &
|
|
101
|
+
[string, WhereFilterOp, unknown],
|
|
100
102
|
)
|
|
101
103
|
}
|
|
102
104
|
}
|
package/src/SearchAllResults.tsx
CHANGED
|
@@ -64,13 +64,13 @@ export function SearchAllResults({ collection, search }: { collection: Collectio
|
|
|
64
64
|
if (objectIDs.length > 0) {
|
|
65
65
|
if (isServerReadOnly) {
|
|
66
66
|
query.queries[0].constraints = [["id", "in", objectIDs]]
|
|
67
|
-
if (softDelete) {
|
|
68
|
-
query.queries[0].constraints.push([
|
|
67
|
+
if (softDelete?.archivedField) {
|
|
68
|
+
query.queries[0].constraints.push([softDelete.archivedField, "==", false])
|
|
69
69
|
}
|
|
70
70
|
} else {
|
|
71
71
|
query.queries[0].constraints = [where("id", "in", objectIDs)]
|
|
72
|
-
if (softDelete) {
|
|
73
|
-
query.queries[0].constraints.push(where(
|
|
72
|
+
if (softDelete?.archivedField) {
|
|
73
|
+
query.queries[0].constraints.push(where(softDelete.archivedField, "==", false))
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
} else if (search) {
|