@stoker-platform/web-app 0.5.177 → 0.5.179

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,20 @@
1
1
  # @stoker-platform/web-app
2
2
 
3
+ ## 0.5.179
4
+
5
+ ### Patch Changes
6
+
7
+ - feat: add relation list parameter to titles method
8
+ - @stoker-platform/node-client@0.5.72
9
+ - @stoker-platform/utils@0.5.63
10
+ - @stoker-platform/web-client@0.5.74
11
+
12
+ ## 0.5.178
13
+
14
+ ### Patch Changes
15
+
16
+ - fix: fix filters button showing when no filters to show
17
+
3
18
  ## 0.5.177
4
19
 
5
20
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoker-platform/web-app",
3
- "version": "0.5.177",
3
+ "version": "0.5.179",
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.56.0",
54
- "@stoker-platform/node-client": "0.5.71",
55
- "@stoker-platform/utils": "0.5.62",
56
- "@stoker-platform/web-client": "0.5.73",
54
+ "@stoker-platform/node-client": "0.5.72",
55
+ "@stoker-platform/utils": "0.5.63",
56
+ "@stoker-platform/web-client": "0.5.74",
57
57
  "@tanstack/react-table": "^8.21.3",
58
58
  "@types/react": "18.3.13",
59
59
  "@types/react-dom": "18.3.1",
@@ -783,7 +783,12 @@ function Collection({
783
783
  labels.collection,
784
784
  "admin",
785
785
  ]
786
- const titles = await getCachedConfigValue(customization, [...collectionAdminPath, "titles"])
786
+ const titles = await getCachedConfigValue(
787
+ customization,
788
+ [...collectionAdminPath, "titles"],
789
+ [relationList ? "relation-list" : undefined, relationCollection, relationParent],
790
+ true,
791
+ )
787
792
  setCollectionTitle(titles?.collection || labels.collection)
788
793
  setRecordTitle(titles?.record || labels.record)
789
794
  if (!itemsPerPageOverride) {
@@ -1298,7 +1303,7 @@ function Collection({
1298
1303
  })
1299
1304
  }
1300
1305
  return excluded
1301
- }, [isPreloadCacheEnabled, cardsConfig, statusField, tab])
1306
+ }, [isPreloadCacheEnabled, cardsConfig, statusField, tab, filters])
1302
1307
 
1303
1308
  const filtersActive = useMemo(() => {
1304
1309
  return (
@@ -1335,12 +1340,13 @@ function Collection({
1335
1340
  if (!field) return false
1336
1341
 
1337
1342
  if (filter.roles && !filter.roles.includes(userRole)) return false
1343
+ if (relationList && relationList.field === filter.field) return false
1338
1344
 
1339
1345
  if (filter.type === "relation") {
1340
1346
  if (!isRelationField(field)) return false
1341
1347
  const relationCollection = schema.collections[field.collection]
1342
- if (!relationCollection || !relationCollection.fullTextSearch) return false
1343
- const collectionPermissions = permissions?.collections?.[relationCollection.labels.collection]
1348
+ if (!relationCollection?.fullTextSearch) return false
1349
+ const collectionPermissions = permissions.collections?.[relationCollection.labels.collection]
1344
1350
  const fullCollectionAccess = collectionPermissions && collectionAccess("Read", collectionPermissions)
1345
1351
  const dependencyAccess = hasDependencyAccess(relationCollection, schema, permissions)
1346
1352
  if (!fullCollectionAccess && dependencyAccess.length === 0) return false
package/src/Record.tsx CHANGED
@@ -208,6 +208,7 @@ export const Record = ({ collection }: { collection: CollectionSchema }) => {
208
208
  <CardContent className="px-0">
209
209
  <SidebarProvider defaultOpen={true} open={true} className="flex flex-col lg:flex-row">
210
210
  <RecordSidebar
211
+ record={record}
211
212
  collection={collection}
212
213
  customRecordPages={customRecordPages}
213
214
  isAssigning={isAssigning}
@@ -10,7 +10,13 @@ import {
10
10
  } from "./components/ui/sidebar"
11
11
  import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "./components/ui/dropdown-menu"
12
12
  import { useLocation, useNavigate, useParams } from "react-router"
13
- import { Assignable, CollectionPermissions, CollectionSchema, CustomRecordPage } from "@stoker-platform/types"
13
+ import {
14
+ Assignable,
15
+ CollectionPermissions,
16
+ CollectionSchema,
17
+ CustomRecordPage,
18
+ StokerRecord,
19
+ } from "@stoker-platform/types"
14
20
  import { collectionAccess, getField, isRelationField, tryFunction, tryPromise } from "@stoker-platform/utils"
15
21
  import { getCurrentUserPermissions, getCollectionConfigModule, getSchema } from "@stoker-platform/web-client"
16
22
  import { runViewTransition } from "./utils/runViewTransition"
@@ -24,11 +30,13 @@ interface SidebarItem {
24
30
  }
25
31
 
26
32
  export const RecordSidebar = ({
33
+ record,
27
34
  collection,
28
35
  customRecordPages,
29
36
  isAssigning,
30
37
  setIsAssigning,
31
38
  }: {
39
+ record: StokerRecord
32
40
  collection: CollectionSchema
33
41
  customRecordPages?: CustomRecordPage[]
34
42
  isAssigning: Record<string, boolean>
@@ -54,7 +62,11 @@ export const RecordSidebar = ({
54
62
  const relationCollection = schema.collections[relationList.collection]
55
63
  if (!relationCollection) return
56
64
  const relationCustomization = getCollectionConfigModule(relationCollection.labels.collection)
57
- const titles = await tryPromise(relationCustomization.admin?.titles)
65
+ const titles = await tryPromise(relationCustomization.admin?.titles, [
66
+ "relation-list",
67
+ collection,
68
+ record,
69
+ ])
58
70
  const title = titles?.collection || relationList.collection
59
71
  setRelationTitles((prev) => ({
60
72
  ...prev,