@stoker-platform/web-app 0.5.102 → 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,17 @@
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
+
9
+ ## 0.5.103
10
+
11
+ ### Patch Changes
12
+
13
+ - feat: add message and error output for index generation
14
+
3
15
  ## 0.5.102
4
16
 
5
17
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoker-platform/web-app",
3
- "version": "0.5.102",
3
+ "version": "0.5.104",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "scripts": {
@@ -1742,7 +1742,7 @@ function Collection({
1742
1742
  fullTextSearch &&
1743
1743
  !hasEntityRestrictions?.length &&
1744
1744
  !hasEntityParentFilters?.length)) && (
1745
- <div className="relative flex-1">
1745
+ <search className="relative flex-1">
1746
1746
  <Search className="absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground" />
1747
1747
  <Input
1748
1748
  type="search"
@@ -1754,7 +1754,7 @@ function Collection({
1754
1754
  {search && (
1755
1755
  <span className="absolute top-0 right-0 transform translate-x-1/2 -translate-y-1/2 block h-3 w-3 rounded-full bg-destructive"></span>
1756
1756
  )}
1757
- </div>
1757
+ </search>
1758
1758
  )}
1759
1759
  {ai?.chat && ai.chat.roles.includes(permissions.Role) && (
1760
1760
  <Sheet>
@@ -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) {
package/src/Tenant.tsx CHANGED
@@ -590,7 +590,7 @@ function Tenant() {
590
590
  <div className="ml-auto flex-1 lg:flex-initial text-primary dark">
591
591
  <Popover open={searchFocused && Boolean(search)}>
592
592
  <PopoverTrigger asChild>
593
- <div className="relative">
593
+ <search className="relative">
594
594
  <Search className="absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground" />
595
595
  <Input
596
596
  type="search"
@@ -612,7 +612,7 @@ function Tenant() {
612
612
  }
613
613
  }}
614
614
  />
615
- </div>
615
+ </search>
616
616
  </PopoverTrigger>
617
617
  {search && showSearchAll && <SearchAll query={search} />}
618
618
  </Popover>