@stoker-platform/web-app 0.5.178 → 0.5.180
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 +18 -0
- package/package.json +4 -4
- package/src/Collection.tsx +6 -1
- package/src/List.tsx +15 -0
- package/src/Record.tsx +1 -0
- package/src/RecordSidebar.tsx +14 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @stoker-platform/web-app
|
|
2
2
|
|
|
3
|
+
## 0.5.180
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- feat: add compact option to list metrics
|
|
8
|
+
- @stoker-platform/node-client@0.5.73
|
|
9
|
+
- @stoker-platform/utils@0.5.64
|
|
10
|
+
- @stoker-platform/web-client@0.5.75
|
|
11
|
+
|
|
12
|
+
## 0.5.179
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- feat: add relation list parameter to titles method
|
|
17
|
+
- @stoker-platform/node-client@0.5.72
|
|
18
|
+
- @stoker-platform/utils@0.5.63
|
|
19
|
+
- @stoker-platform/web-client@0.5.74
|
|
20
|
+
|
|
3
21
|
## 0.5.178
|
|
4
22
|
|
|
5
23
|
### 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.180",
|
|
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.
|
|
55
|
-
"@stoker-platform/utils": "0.5.
|
|
56
|
-
"@stoker-platform/web-client": "0.5.
|
|
54
|
+
"@stoker-platform/node-client": "0.5.73",
|
|
55
|
+
"@stoker-platform/utils": "0.5.64",
|
|
56
|
+
"@stoker-platform/web-client": "0.5.75",
|
|
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
|
@@ -783,7 +783,12 @@ function Collection({
|
|
|
783
783
|
labels.collection,
|
|
784
784
|
"admin",
|
|
785
785
|
]
|
|
786
|
-
const titles = await getCachedConfigValue(
|
|
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) {
|
package/src/List.tsx
CHANGED
|
@@ -1512,6 +1512,21 @@ export function List({
|
|
|
1512
1512
|
metric.type === "custom"
|
|
1513
1513
|
) {
|
|
1514
1514
|
const metricTitle = metric.title || `Total ${collectionTitle}`
|
|
1515
|
+
if (metric.compact) {
|
|
1516
|
+
return (
|
|
1517
|
+
<div
|
|
1518
|
+
key={`metric-${index}`}
|
|
1519
|
+
className={"grid gap-3 place-content-center"}
|
|
1520
|
+
>
|
|
1521
|
+
<Card className="p-4 flex flex-col min-w-[175px] place-content-center items-center bg-blue-500 dark:bg-blue-500/50 text-primary-foreground dark:text-primary">
|
|
1522
|
+
<div className="font-semibold line-clamp-1 text-center">
|
|
1523
|
+
{/* eslint-disable-next-line security/detect-object-injection */}
|
|
1524
|
+
{metricTitle}: {metricsValues[index] as string}
|
|
1525
|
+
</div>
|
|
1526
|
+
</Card>
|
|
1527
|
+
</div>
|
|
1528
|
+
)
|
|
1529
|
+
}
|
|
1515
1530
|
return (
|
|
1516
1531
|
<div
|
|
1517
1532
|
key={`metric-${index}`}
|
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}
|
package/src/RecordSidebar.tsx
CHANGED
|
@@ -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 {
|
|
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,
|