@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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @stoker-platform/web-app
2
2
 
3
+ ## 0.5.104
4
+
5
+ ### Patch Changes
6
+
7
+ - fix: use soft delete archivedField instead of literal field name
8
+
3
9
  ## 0.5.103
4
10
 
5
11
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoker-platform/web-app",
3
- "version": "0.5.103",
3
+ "version": "0.5.104",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "scripts": {
@@ -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(["Archived", "==", false])
66
+ if (softDelete?.archivedField) {
67
+ existingConstraints.push([softDelete.archivedField, "==", false])
68
68
  }
69
69
  return existingConstraints
70
70
  }, [])
@@ -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(["Archived", "==", false])
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(["Archived", "==", false])
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(["Archived", "==", false] as QueryConstraint & [string, string, unknown])
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(where("Archived", "==", false) as QueryConstraint & [string, string, unknown])
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(["Archived", "==", false] as QueryConstraint & [string, WhereFilterOp, unknown])
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("Archived", "==", false) as QueryConstraint & [string, WhereFilterOp, unknown],
1952
+ where(softDelete.archivedField, "==", false) as QueryConstraint &
1953
+ [string, WhereFilterOp, unknown],
1952
1954
  )
1953
1955
  }
1954
1956
  }
@@ -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(["Archived", "==", false] as QueryConstraint & [string, WhereFilterOp, unknown])
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("Archived", "==", false) as QueryConstraint & [string, WhereFilterOp, unknown],
100
+ where(softDelete.archivedField, "==", false) as QueryConstraint &
101
+ [string, WhereFilterOp, unknown],
100
102
  )
101
103
  }
102
104
  }
@@ -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(["Archived", "==", false])
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("Archived", "==", false))
72
+ if (softDelete?.archivedField) {
73
+ query.queries[0].constraints.push(where(softDelete.archivedField, "==", false))
74
74
  }
75
75
  }
76
76
  } else if (search) {