@rebasepro/admin 0.2.1 → 0.2.3
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/dist/{CollectionEditorDialog-BXIh2AXg.js → CollectionEditorDialog-CmGXXSY9.js} +6 -182
- package/dist/CollectionEditorDialog-CmGXXSY9.js.map +1 -0
- package/dist/{CollectionsStudioView-jR8iz_ja.js → CollectionsStudioView-DcLHT5bU.js} +4 -4
- package/dist/{CollectionsStudioView-jR8iz_ja.js.map → CollectionsStudioView-DcLHT5bU.js.map} +1 -1
- package/dist/{ContentHomePage-BQZWuOFb.js → ContentHomePage-C7vFqKSe.js} +2 -2
- package/dist/{ContentHomePage-BQZWuOFb.js.map → ContentHomePage-C7vFqKSe.js.map} +1 -1
- package/dist/{ExportCollectionAction-CMdiiv1L.js → ExportCollectionAction-BfN34eWX.js} +2 -2
- package/dist/{ExportCollectionAction-CMdiiv1L.js.map → ExportCollectionAction-BfN34eWX.js.map} +1 -1
- package/dist/{ImportCollectionAction-C05lE0IW.js → ImportCollectionAction-SZrInjhx.js} +2 -2
- package/dist/{ImportCollectionAction-C05lE0IW.js.map → ImportCollectionAction-SZrInjhx.js.map} +1 -1
- package/dist/{PropertyEditView-BB5xjnhZ.js → PropertyEditView-Cvryrb3B.js} +304 -326
- package/dist/PropertyEditView-Cvryrb3B.js.map +1 -0
- package/dist/{RolesView-CULIHWZ9.js → RolesView-BCb7qwWs.js} +2 -2
- package/dist/{RolesView-CULIHWZ9.js.map → RolesView-BCb7qwWs.js.map} +1 -1
- package/dist/{UsersView-D7_AtJ44.js → UsersView-Cex24r8H.js} +2 -2
- package/dist/{UsersView-D7_AtJ44.js.map → UsersView-Cex24r8H.js.map} +1 -1
- package/dist/collection_editor/ui/collection_editor/properties/RelationPropertyField.d.ts +1 -7
- package/dist/collection_editor_ui.js +3 -3
- package/dist/{index-D5OQhv-T.js → index-DjduZG1T.js} +3 -3
- package/dist/index-DjduZG1T.js.map +1 -0
- package/dist/{index-CoSNm3e3.js → index-MKPc70-v.js} +3 -3
- package/dist/index-MKPc70-v.js.map +1 -0
- package/dist/{index-BAM9KCmM.js → index-PLIQXpTt.js} +2 -2
- package/dist/{index-BAM9KCmM.js.map → index-PLIQXpTt.js.map} +1 -1
- package/dist/index.js +4 -4
- package/dist/{util-DtbWD7LF.js → util-DbWax_sV.js} +95 -15
- package/dist/{util-DtbWD7LF.js.map → util-DbWax_sV.js.map} +1 -1
- package/package.json +10 -9
- package/src/collection_editor/ui/collection_editor/CollectionEditorDialog.tsx +1 -10
- package/src/collection_editor/ui/collection_editor/properties/RelationPropertyField.tsx +37 -57
- package/src/collection_editor/validateCollectionJson.ts +88 -1
- package/dist/CollectionEditorDialog-BXIh2AXg.js.map +0 -1
- package/dist/PropertyEditView-BB5xjnhZ.js.map +0 -1
- package/dist/index-CoSNm3e3.js.map +0 -1
- package/dist/index-D5OQhv-T.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-BAM9KCmM.js","sources":["../src/components/history/UserChip.tsx","../src/components/history/EntityHistoryEntry.tsx","../src/components/history/EntityHistoryView.tsx"],"sourcesContent":["import { User } from \"@rebasepro/types\";\nimport { Chip, Tooltip } from \"@rebasepro/ui\";\n\nexport function UserChip({ user }: { user: User }) {\n return (\n <Tooltip title={user.email ?? user.uid}>\n <Chip size={\"small\"} className={\"flex items-center\"}>\n {user.photoURL && <img\n className={\"rounded-full w-6 h-6 mr-2\"}\n src={user.photoURL} alt={user.displayName ?? \"User picture\"}/>}\n <span>{user.displayName ?? user.email ?? user.uid}</span>\n </Chip>\n </Tooltip>\n );\n}\n","import type { EntityCollection } from \"@rebasepro/types\";\nimport type { Property } from \"@rebasepro/types\";\nimport * as React from \"react\";\n\nimport { ArrowLeftIcon, Chip, cls, defaultBorderMixin, iconSize, Tooltip, Typography } from \"@rebasepro/ui\";\nimport { PreviewSize } from \"../../types/components/PropertyPreviewProps\";\nimport { getPropertyInPath } from \"../../util/property_utils\";\nimport { PropertyPreview } from \"../../preview/PropertyPreview\";\nimport { SkeletonPropertyComponent } from \"../../preview/property_previews/SkeletonPropertyComponent\";\nimport { useAuthController } from \"@rebasepro/core\";\nimport { UserChip } from \"./UserChip\";\nimport { HistoryEntryData } from \"../../hooks\";\nimport { getValueInPath } from \"@rebasepro/utils\";\n\n/**\n * Recursive deep equality for primitives, arrays and plain objects.\n */\nfunction deepEqual(a: unknown, b: unknown): boolean {\n if (a === b) return true;\n if (a == null || b == null) return a === b;\n if (typeof a !== typeof b) return false;\n if (typeof a !== \"object\") return false;\n\n if (Array.isArray(a)) {\n if (!Array.isArray(b) || a.length !== (b as unknown[]).length) return false;\n return a.every((item, i) => deepEqual(item, (b as unknown[])[i]));\n }\n\n if (Array.isArray(b)) return false;\n\n const aObj = a as Record<string, unknown>;\n const bObj = b as Record<string, unknown>;\n const aKeys = Object.keys(aObj);\n const bKeys = Object.keys(bObj);\n if (aKeys.length !== bKeys.length) return false;\n return aKeys.every(key => key in bObj && deepEqual(aObj[key], bObj[key]));\n}\n\nexport type EntityHistoryEntryProps = {\n size: PreviewSize;\n actions?: React.ReactNode;\n collection?: EntityCollection;\n hover?: boolean;\n entry: HistoryEntryData;\n onClick?: (e: React.SyntheticEvent) => void;\n};\n\nfunction PreviousValueView({\n previousValueInPath,\n childProperty,\n propertyKey\n}: {\n previousValueInPath: unknown;\n childProperty: Property;\n propertyKey: string;\n}) {\n if (typeof previousValueInPath === \"string\" || typeof previousValueInPath === \"number\") {\n return <Typography variant={\"caption\"} color={\"secondary\"} className=\"line-through\">\n {previousValueInPath}\n </Typography>;\n } else if (typeof previousValueInPath === \"boolean\") {\n return <Typography variant={\"caption\"} color={\"secondary\"} className=\"line-through\">\n {previousValueInPath ? \"true\" : \"false\"}\n </Typography>;\n } else {\n return <Tooltip\n side={\"left\"}\n title={<div className={\"flex flex-col gap-2\"}>\n <Typography variant={\"caption\"} color={\"secondary\"}>\n Previous value\n </Typography>\n <PropertyPreview\n propertyKey={propertyKey as string}\n value={previousValueInPath as never}\n property={childProperty as Property}\n size={\"small\"}/>\n </div>}>\n <ArrowLeftIcon size={iconSize.smallest} color={\"disabled\"} className={\"mb-1\"}/>\n </Tooltip>\n }\n}\n\n/**\n * Displays a single entity history revision entry.\n * Adapted from the entity_history plugin — now reads from backend API data.\n */\nexport function EntityHistoryEntry({\n actions,\n hover,\n collection,\n size,\n entry\n}: EntityHistoryEntryProps) {\n\n const authController = useAuthController();\n\n const changedFields = entry.changed_fields;\n const previousValues = entry.previous_values;\n const updatedOn = new Date(entry.updated_at);\n const updatedBy = entry.updated_by;\n\n // Resolve user display\n const currentUser = authController.user;\n const userDisplay = updatedBy === currentUser?.uid\n ? currentUser\n : undefined;\n\n return <div className={\"w-full flex flex-col gap-2 mt-4\"}>\n <div className={\"ml-4 flex items-center gap-4\"}>\n <Typography variant={\"body2\"} color={\"secondary\"}>\n {updatedOn.toLocaleString()}\n </Typography>\n <Chip size={\"small\"}>\n {entry.action}\n </Chip>\n {!userDisplay && updatedBy && <Chip size={\"small\"}>{updatedBy}</Chip>}\n {userDisplay && <UserChip user={userDisplay}/>}\n </div>\n <div\n className={cls(\n \"bg-white dark:bg-surface-900\",\n \"min-h-[44px]\",\n \"w-full\",\n \"items-center\",\n hover ? \"hover:bg-surface-accent-50 dark:hover:bg-surface-800\" : \"\",\n size === \"small\" ? \"p-1\" : \"px-2 py-1\",\n \"flex border rounded-lg\",\n defaultBorderMixin\n )}>\n\n {actions}\n\n <div className={\"flex flex-col grow w-full m-1 shrink min-w-0\"}>\n\n {changedFields && collection && changedFields.map((key: string) => {\n const childProperty = getPropertyInPath(collection.properties, key);\n const valueInPath = entry.values ? getValueInPath(entry.values, key) : undefined;\n const previousValueInPath = previousValues ? getValueInPath(previousValues, key) : undefined;\n\n const element = childProperty\n ? <PropertyPreview\n propertyKey={key}\n value={valueInPath as never}\n property={childProperty as Property}\n size={\"small\"}/>\n : <Typography variant={\"body2\"}>\n {typeof valueInPath === \"string\" ? valueInPath : JSON.stringify(valueInPath)}\n </Typography>;\n\n return (\n <div key={\"ref_prev_\" + key}\n className=\"flex w-full my-1 items-center\">\n <Typography variant={\"caption\"}\n color={\"secondary\"}\n className=\"min-w-[140px] md:min-w-[200px] w-1/5 pr-8 overflow-hidden text-ellipsis text-right\">\n {key}\n </Typography>\n <div className=\"w-4/5\">\n {previousValueInPath !== undefined && !deepEqual(previousValueInPath, valueInPath) &&\n <PreviousValueView previousValueInPath={previousValueInPath}\n childProperty={childProperty as Property}\n propertyKey={key}/>\n }\n {element}\n </div>\n </div>\n );\n })}\n\n {(!changedFields || changedFields.length === 0) && (\n <Typography variant={\"caption\"} color={\"secondary\"} className=\"ml-4\">\n {entry.action === \"create\" ? \"Entity created\" :\n entry.action === \"delete\" ? \"Entity deleted\" : \"No field changes recorded\"}\n </Typography>\n )}\n\n </div>\n\n </div>\n </div>;\n}\n","\nimport type { EntityCustomViewParams } from \"@rebasepro/types\";\nimport { useRef, useEffect } from \"react\";\nimport { cls, IconButton, Label, Tooltip, Typography } from \"@rebasepro/ui\";\nimport { ErrorBoundary, HistoryIcon } from \"@rebasepro/ui\";\nimport { EntityHistoryEntry } from \"./EntityHistoryEntry\";\nimport { useSnackbarController, useAuthController } from \"@rebasepro/core\";\nimport { ConfirmationDialog } from \"@rebasepro/core\";\nimport { useState } from \"react\";\nimport { useEntityHistory } from \"../../index\";\n\n/**\n * Entity history tab view. Shows a paginated list of entity revisions\n * fetched from the backend API. Supports infinite scroll and revert.\n */\nexport function EntityHistoryView<M extends Record<string, unknown>>({\n entity,\n collection,\n formContext\n}: EntityCustomViewParams<M>) {\n\n const snackbarController = useSnackbarController();\n const authController = useAuthController();\n const dirty = formContext?.formex.dirty;\n\n const slug = collection.slug;\n const entityId = entity?.id;\n\n const {\n entries,\n isLoading,\n hasMore,\n loadMore,\n revert\n } = useEntityHistory({\n slug,\n entityId,\n enabled: !!entityId,\n pageSize: 10\n });\n\n const [revertHistoryId, setRevertHistoryId] = useState<string | undefined>();\n const [isReverting, setIsReverting] = useState(false);\n\n const containerRef = useRef<HTMLDivElement>(null);\n const loadMoreRef = useRef<HTMLDivElement>(null);\n\n // Intersection observer for infinite scroll\n useEffect(() => {\n const currentContainer = containerRef.current;\n const currentLoadMore = loadMoreRef.current;\n\n if (!currentContainer || !currentLoadMore || !hasMore || isLoading) return;\n\n const observer = new IntersectionObserver(\n (observerEntries) => {\n if (observerEntries[0].isIntersecting && hasMore && !isLoading) {\n loadMore();\n }\n },\n {\n root: currentContainer,\n rootMargin: \"0px 0px 200px 0px\",\n threshold: 0.01\n }\n );\n\n observer.observe(currentLoadMore);\n\n return () => observer.disconnect();\n }, [hasMore, isLoading, entries.length, loadMore]);\n\n if (!entity) {\n return <div className=\"flex items-center justify-center h-full\">\n <Label>HistoryIcon is only available for existing entities</Label>\n </div>;\n }\n\n async function doRevert(historyId: string) {\n setIsReverting(true);\n try {\n const revertedValues = await revert(historyId);\n setRevertHistoryId(undefined);\n\n // Reset the form with the reverted values so the UI updates\n // immediately without requiring a page refresh.\n if (formContext?.formex?.resetForm && revertedValues) {\n formContext.formex.resetForm({\n values: revertedValues as M,\n submitCount: 0,\n touched: {}\n });\n }\n\n snackbarController.open({\n message: \"Reverted to selected version\",\n type: \"info\"\n });\n } catch (error) {\n console.error(\"Error reverting entity:\", error);\n snackbarController.open({\n message: \"Error reverting entity\",\n type: \"error\"\n });\n } finally {\n setIsReverting(false);\n }\n }\n\n const revertEntry = revertHistoryId\n ? entries.find(e => e.id === revertHistoryId)\n : undefined;\n\n return <div\n ref={containerRef}\n className={cls(\"relative flex-1 h-full overflow-auto w-full flex flex-col gap-4 p-8\")}>\n <div className=\"flex flex-col gap-2 max-w-6xl mx-auto w-full\">\n\n <Typography variant={\"h5\"} className={\"mt-24 ml-4\"}>\n HistoryIcon\n </Typography>\n\n {isLoading && entries.length === 0 && (\n <div className=\"flex flex-col gap-4 mt-8 ml-4\">\n {[1, 2, 3].map(i => (\n <div key={i} className=\"flex flex-col gap-2 animate-pulse\">\n <div className=\"h-4 w-48 bg-surface-200 dark:bg-surface-700 rounded\"/>\n <div className=\"h-12 w-full bg-surface-100 dark:bg-surface-900 rounded-lg border border-surface-200 dark:border-surface-700\"/>\n </div>\n ))}\n </div>\n )}\n\n {!isLoading && entries.length === 0 && <>\n <Label className={\"ml-4 mt-8\"}>\n No history available\n </Label>\n <Typography variant={\"caption\"} className={\"ml-4\"}>\n When you save an entity, a new version is created and stored in the history.\n </Typography>\n </>}\n\n {entries.map((entry) => (\n <div key={entry.id} className=\"flex flex-cols gap-2 w-full\">\n <EntityHistoryEntry\n entry={entry}\n collection={collection}\n size={\"medium\"}\n actions={\n <Tooltip title={\"Revert to this version\"}\n className={\"m-2 grow-0 self-start\"}>\n <IconButton\n onClick={() => {\n if (dirty) {\n snackbarController.open({\n message: \"Please save or discard your changes before reverting\",\n type: \"warning\"\n });\n } else {\n setRevertHistoryId(entry.id);\n }\n }}>\n <HistoryIcon/>\n </IconButton>\n </Tooltip>\n }\n />\n </div>\n ))}\n\n {/* Load more sentinel */}\n {entries.length > 0 && (\n <div ref={loadMoreRef} className=\"py-4 text-center\">\n {isLoading && <Label>Loading more...</Label>}\n {!hasMore && entries.length > 10 && <Label>No more history available</Label>}\n </div>\n )}\n </div>\n\n <ErrorBoundary>\n <ConfirmationDialog\n open={Boolean(revertHistoryId)}\n onAccept={() => {\n if (revertHistoryId) doRevert(revertHistoryId);\n }}\n onCancel={() => setRevertHistoryId(undefined)}\n title={<Typography variant={\"subtitle2\"}>Revert data to this version?</Typography>}\n body={revertEntry\n ? <div className=\"p-4\">\n <Typography variant={\"caption\"} color={\"secondary\"}>\n This will save the entity with the values from{\" \"}\n {new Date(revertEntry.updated_at).toLocaleString()}.\n A new history entry will be created for the revert.\n </Typography>\n </div>\n : null\n }\n />\n </ErrorBoundary>\n </div>;\n}\n"],"names":["UserChip","t0","$","_c","user","t1","email","uid","t2","displayName","photoURL","t3","t4","t5","t6","deepEqual","a","b","Array","isArray","length","every","item","i","aObj","bObj","aKeys","Object","keys","bKeys","key","PreviousValueView","previousValueInPath","childProperty","propertyKey","Symbol","for","iconSize","smallest","t7","EntityHistoryEntry","actions","hover","collection","size","entry","authController","useAuthController","changedFields","changed_fields","previousValues","previous_values","T0","updatedBy","userDisplay","updated_at","updated_by","updatedOn","Date","currentUser","undefined","Typography","toLocaleString","action","t8","t9","t10","t11","t12","t13","cls","defaultBorderMixin","t14","values","map","getPropertyInPath","properties","valueInPath","getValueInPath","element","JSON","stringify","t15","t16","t17","t18","EntityHistoryView","entity","formContext","snackbarController","useSnackbarController","dirty","formex","slug","entityId","id","entries","isLoading","hasMore","loadMore","revert","useEntityHistory","enabled","pageSize","revertHistoryId","setRevertHistoryId","useState","isReverting","setIsReverting","containerRef","useRef","loadMoreRef","useEffect","currentContainer","current","currentLoadMore","observer","IntersectionObserver","observerEntries","isIntersecting","root","rootMargin","threshold","observe","disconnect","doRevert","historyId","revertedValues","resetForm","submitCount","touched","open","message","type","error","console","revertEntry","find","e","Boolean"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAGO,SAAAA,SAAAC,IAAA;AAAA,QAAAC,IAAAC,EAAA,EAAA;AAAkB,QAAA;AAAA,IAAAC;AAAAA,EAAAA,IAAAH;AAED,QAAAI,KAAAD,KAAIE,SAAUF,KAAIG;AAAI,MAAAC;AAAA,MAAAN,EAAA,CAAA,MAAAE,KAAAK,eAAAP,EAAA,CAAA,MAAAE,KAAAM,UAAA;AAE7BF,SAAAJ,KAAIM,YAAa,oBAAA,OAAA,EACH,WAAA,6BACN,KAAAN,KAAIM,UAAgB,KAAAN,KAAIK,eAAgB,gBAAc;AAAGP,MAAA,CAAA,IAAAE,KAAAK;AAAAP,MAAA,CAAA,IAAAE,KAAAM;AAAAR,WAAAM;AAAAA,EAAA,OAAA;AAAAA,SAAAN,EAAA,CAAA;AAAA,EAAA;AAC3D,QAAAS,KAAAP,KAAIK,eAAgBL,KAAIE,SAAUF,KAAIG;AAAI,MAAAK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AAe;AAAA,IACjD,GACA,UAAU,MAAMC,mBAAmB7C,MAAS,GAC5C,OAAO,oBAAC,YAAA,EAAW,SAAS,aAAa,UAAA,+BAAA,CAA4B,GACrE,MAAM4E,cACA,oBAAC,OAAA,EAAI,WAAU,OACb,+BAAC,YAAA,EAAW,SAAS,WAAW,OAAO,aAAY,UAAA;AAAA,MAAA;AAAA,MACA;AAAA,MAC9C,IAAI9E,KAAK8E,YAAYjF,UAAU,EAAEO,eAAAA;AAAAA,MAAiB;AAAA,IAAA,EAAA,CAEvD,EAAA,CACJ,IACE,KAAA,CACL,EAAA,CAET;AAAA,EAAA,GACJ;AACJ;"}
|
|
1
|
+
{"version":3,"file":"index-PLIQXpTt.js","sources":["../src/components/history/UserChip.tsx","../src/components/history/EntityHistoryEntry.tsx","../src/components/history/EntityHistoryView.tsx"],"sourcesContent":["import { User } from \"@rebasepro/types\";\nimport { Chip, Tooltip } from \"@rebasepro/ui\";\n\nexport function UserChip({ user }: { user: User }) {\n return (\n <Tooltip title={user.email ?? user.uid}>\n <Chip size={\"small\"} className={\"flex items-center\"}>\n {user.photoURL && <img\n className={\"rounded-full w-6 h-6 mr-2\"}\n src={user.photoURL} alt={user.displayName ?? \"User picture\"}/>}\n <span>{user.displayName ?? user.email ?? user.uid}</span>\n </Chip>\n </Tooltip>\n );\n}\n","import type { EntityCollection } from \"@rebasepro/types\";\nimport type { Property } from \"@rebasepro/types\";\nimport * as React from \"react\";\n\nimport { ArrowLeftIcon, Chip, cls, defaultBorderMixin, iconSize, Tooltip, Typography } from \"@rebasepro/ui\";\nimport { PreviewSize } from \"../../types/components/PropertyPreviewProps\";\nimport { getPropertyInPath } from \"../../util/property_utils\";\nimport { PropertyPreview } from \"../../preview/PropertyPreview\";\nimport { SkeletonPropertyComponent } from \"../../preview/property_previews/SkeletonPropertyComponent\";\nimport { useAuthController } from \"@rebasepro/core\";\nimport { UserChip } from \"./UserChip\";\nimport { HistoryEntryData } from \"../../hooks\";\nimport { getValueInPath } from \"@rebasepro/utils\";\n\n/**\n * Recursive deep equality for primitives, arrays and plain objects.\n */\nfunction deepEqual(a: unknown, b: unknown): boolean {\n if (a === b) return true;\n if (a == null || b == null) return a === b;\n if (typeof a !== typeof b) return false;\n if (typeof a !== \"object\") return false;\n\n if (Array.isArray(a)) {\n if (!Array.isArray(b) || a.length !== (b as unknown[]).length) return false;\n return a.every((item, i) => deepEqual(item, (b as unknown[])[i]));\n }\n\n if (Array.isArray(b)) return false;\n\n const aObj = a as Record<string, unknown>;\n const bObj = b as Record<string, unknown>;\n const aKeys = Object.keys(aObj);\n const bKeys = Object.keys(bObj);\n if (aKeys.length !== bKeys.length) return false;\n return aKeys.every(key => key in bObj && deepEqual(aObj[key], bObj[key]));\n}\n\nexport type EntityHistoryEntryProps = {\n size: PreviewSize;\n actions?: React.ReactNode;\n collection?: EntityCollection;\n hover?: boolean;\n entry: HistoryEntryData;\n onClick?: (e: React.SyntheticEvent) => void;\n};\n\nfunction PreviousValueView({\n previousValueInPath,\n childProperty,\n propertyKey\n}: {\n previousValueInPath: unknown;\n childProperty: Property;\n propertyKey: string;\n}) {\n if (typeof previousValueInPath === \"string\" || typeof previousValueInPath === \"number\") {\n return <Typography variant={\"caption\"} color={\"secondary\"} className=\"line-through\">\n {previousValueInPath}\n </Typography>;\n } else if (typeof previousValueInPath === \"boolean\") {\n return <Typography variant={\"caption\"} color={\"secondary\"} className=\"line-through\">\n {previousValueInPath ? \"true\" : \"false\"}\n </Typography>;\n } else {\n return <Tooltip\n side={\"left\"}\n title={<div className={\"flex flex-col gap-2\"}>\n <Typography variant={\"caption\"} color={\"secondary\"}>\n Previous value\n </Typography>\n <PropertyPreview\n propertyKey={propertyKey as string}\n value={previousValueInPath as never}\n property={childProperty as Property}\n size={\"small\"}/>\n </div>}>\n <ArrowLeftIcon size={iconSize.smallest} color={\"disabled\"} className={\"mb-1\"}/>\n </Tooltip>\n }\n}\n\n/**\n * Displays a single entity history revision entry.\n * Adapted from the entity_history plugin — now reads from backend API data.\n */\nexport function EntityHistoryEntry({\n actions,\n hover,\n collection,\n size,\n entry\n}: EntityHistoryEntryProps) {\n\n const authController = useAuthController();\n\n const changedFields = entry.changed_fields;\n const previousValues = entry.previous_values;\n const updatedOn = new Date(entry.updated_at);\n const updatedBy = entry.updated_by;\n\n // Resolve user display\n const currentUser = authController.user;\n const userDisplay = updatedBy === currentUser?.uid\n ? currentUser\n : undefined;\n\n return <div className={\"w-full flex flex-col gap-2 mt-4\"}>\n <div className={\"ml-4 flex items-center gap-4\"}>\n <Typography variant={\"body2\"} color={\"secondary\"}>\n {updatedOn.toLocaleString()}\n </Typography>\n <Chip size={\"small\"}>\n {entry.action}\n </Chip>\n {!userDisplay && updatedBy && <Chip size={\"small\"}>{updatedBy}</Chip>}\n {userDisplay && <UserChip user={userDisplay}/>}\n </div>\n <div\n className={cls(\n \"bg-white dark:bg-surface-900\",\n \"min-h-[44px]\",\n \"w-full\",\n \"items-center\",\n hover ? \"hover:bg-surface-accent-50 dark:hover:bg-surface-800\" : \"\",\n size === \"small\" ? \"p-1\" : \"px-2 py-1\",\n \"flex border rounded-lg\",\n defaultBorderMixin\n )}>\n\n {actions}\n\n <div className={\"flex flex-col grow w-full m-1 shrink min-w-0\"}>\n\n {changedFields && collection && changedFields.map((key: string) => {\n const childProperty = getPropertyInPath(collection.properties, key);\n const valueInPath = entry.values ? getValueInPath(entry.values, key) : undefined;\n const previousValueInPath = previousValues ? getValueInPath(previousValues, key) : undefined;\n\n const element = childProperty\n ? <PropertyPreview\n propertyKey={key}\n value={valueInPath as never}\n property={childProperty as Property}\n size={\"small\"}/>\n : <Typography variant={\"body2\"}>\n {typeof valueInPath === \"string\" ? valueInPath : JSON.stringify(valueInPath)}\n </Typography>;\n\n return (\n <div key={\"ref_prev_\" + key}\n className=\"flex w-full my-1 items-center\">\n <Typography variant={\"caption\"}\n color={\"secondary\"}\n className=\"min-w-[140px] md:min-w-[200px] w-1/5 pr-8 overflow-hidden text-ellipsis text-right\">\n {key}\n </Typography>\n <div className=\"w-4/5\">\n {previousValueInPath !== undefined && !deepEqual(previousValueInPath, valueInPath) &&\n <PreviousValueView previousValueInPath={previousValueInPath}\n childProperty={childProperty as Property}\n propertyKey={key}/>\n }\n {element}\n </div>\n </div>\n );\n })}\n\n {(!changedFields || changedFields.length === 0) && (\n <Typography variant={\"caption\"} color={\"secondary\"} className=\"ml-4\">\n {entry.action === \"create\" ? \"Entity created\" :\n entry.action === \"delete\" ? \"Entity deleted\" : \"No field changes recorded\"}\n </Typography>\n )}\n\n </div>\n\n </div>\n </div>;\n}\n","\nimport type { EntityCustomViewParams } from \"@rebasepro/types\";\nimport { useRef, useEffect } from \"react\";\nimport { cls, IconButton, Label, Tooltip, Typography } from \"@rebasepro/ui\";\nimport { ErrorBoundary, HistoryIcon } from \"@rebasepro/ui\";\nimport { EntityHistoryEntry } from \"./EntityHistoryEntry\";\nimport { useSnackbarController, useAuthController } from \"@rebasepro/core\";\nimport { ConfirmationDialog } from \"@rebasepro/core\";\nimport { useState } from \"react\";\nimport { useEntityHistory } from \"../../index\";\n\n/**\n * Entity history tab view. Shows a paginated list of entity revisions\n * fetched from the backend API. Supports infinite scroll and revert.\n */\nexport function EntityHistoryView<M extends Record<string, unknown>>({\n entity,\n collection,\n formContext\n}: EntityCustomViewParams<M>) {\n\n const snackbarController = useSnackbarController();\n const authController = useAuthController();\n const dirty = formContext?.formex.dirty;\n\n const slug = collection.slug;\n const entityId = entity?.id;\n\n const {\n entries,\n isLoading,\n hasMore,\n loadMore,\n revert\n } = useEntityHistory({\n slug,\n entityId,\n enabled: !!entityId,\n pageSize: 10\n });\n\n const [revertHistoryId, setRevertHistoryId] = useState<string | undefined>();\n const [isReverting, setIsReverting] = useState(false);\n\n const containerRef = useRef<HTMLDivElement>(null);\n const loadMoreRef = useRef<HTMLDivElement>(null);\n\n // Intersection observer for infinite scroll\n useEffect(() => {\n const currentContainer = containerRef.current;\n const currentLoadMore = loadMoreRef.current;\n\n if (!currentContainer || !currentLoadMore || !hasMore || isLoading) return;\n\n const observer = new IntersectionObserver(\n (observerEntries) => {\n if (observerEntries[0].isIntersecting && hasMore && !isLoading) {\n loadMore();\n }\n },\n {\n root: currentContainer,\n rootMargin: \"0px 0px 200px 0px\",\n threshold: 0.01\n }\n );\n\n observer.observe(currentLoadMore);\n\n return () => observer.disconnect();\n }, [hasMore, isLoading, entries.length, loadMore]);\n\n if (!entity) {\n return <div className=\"flex items-center justify-center h-full\">\n <Label>HistoryIcon is only available for existing entities</Label>\n </div>;\n }\n\n async function doRevert(historyId: string) {\n setIsReverting(true);\n try {\n const revertedValues = await revert(historyId);\n setRevertHistoryId(undefined);\n\n // Reset the form with the reverted values so the UI updates\n // immediately without requiring a page refresh.\n if (formContext?.formex?.resetForm && revertedValues) {\n formContext.formex.resetForm({\n values: revertedValues as M,\n submitCount: 0,\n touched: {}\n });\n }\n\n snackbarController.open({\n message: \"Reverted to selected version\",\n type: \"info\"\n });\n } catch (error) {\n console.error(\"Error reverting entity:\", error);\n snackbarController.open({\n message: \"Error reverting entity\",\n type: \"error\"\n });\n } finally {\n setIsReverting(false);\n }\n }\n\n const revertEntry = revertHistoryId\n ? entries.find(e => e.id === revertHistoryId)\n : undefined;\n\n return <div\n ref={containerRef}\n className={cls(\"relative flex-1 h-full overflow-auto w-full flex flex-col gap-4 p-8\")}>\n <div className=\"flex flex-col gap-2 max-w-6xl mx-auto w-full\">\n\n <Typography variant={\"h5\"} className={\"mt-24 ml-4\"}>\n HistoryIcon\n </Typography>\n\n {isLoading && entries.length === 0 && (\n <div className=\"flex flex-col gap-4 mt-8 ml-4\">\n {[1, 2, 3].map(i => (\n <div key={i} className=\"flex flex-col gap-2 animate-pulse\">\n <div className=\"h-4 w-48 bg-surface-200 dark:bg-surface-700 rounded\"/>\n <div className=\"h-12 w-full bg-surface-100 dark:bg-surface-900 rounded-lg border border-surface-200 dark:border-surface-700\"/>\n </div>\n ))}\n </div>\n )}\n\n {!isLoading && entries.length === 0 && <>\n <Label className={\"ml-4 mt-8\"}>\n No history available\n </Label>\n <Typography variant={\"caption\"} className={\"ml-4\"}>\n When you save an entity, a new version is created and stored in the history.\n </Typography>\n </>}\n\n {entries.map((entry) => (\n <div key={entry.id} className=\"flex flex-cols gap-2 w-full\">\n <EntityHistoryEntry\n entry={entry}\n collection={collection}\n size={\"medium\"}\n actions={\n <Tooltip title={\"Revert to this version\"}\n className={\"m-2 grow-0 self-start\"}>\n <IconButton\n onClick={() => {\n if (dirty) {\n snackbarController.open({\n message: \"Please save or discard your changes before reverting\",\n type: \"warning\"\n });\n } else {\n setRevertHistoryId(entry.id);\n }\n }}>\n <HistoryIcon/>\n </IconButton>\n </Tooltip>\n }\n />\n </div>\n ))}\n\n {/* Load more sentinel */}\n {entries.length > 0 && (\n <div ref={loadMoreRef} className=\"py-4 text-center\">\n {isLoading && <Label>Loading more...</Label>}\n {!hasMore && entries.length > 10 && <Label>No more history available</Label>}\n </div>\n )}\n </div>\n\n <ErrorBoundary>\n <ConfirmationDialog\n open={Boolean(revertHistoryId)}\n onAccept={() => {\n if (revertHistoryId) doRevert(revertHistoryId);\n }}\n onCancel={() => setRevertHistoryId(undefined)}\n title={<Typography variant={\"subtitle2\"}>Revert data to this version?</Typography>}\n body={revertEntry\n ? <div className=\"p-4\">\n <Typography variant={\"caption\"} color={\"secondary\"}>\n This will save the entity with the values from{\" \"}\n {new Date(revertEntry.updated_at).toLocaleString()}.\n A new history entry will be created for the revert.\n </Typography>\n </div>\n : null\n }\n />\n </ErrorBoundary>\n </div>;\n}\n"],"names":["UserChip","t0","$","_c","user","t1","email","uid","t2","displayName","photoURL","t3","t4","t5","t6","deepEqual","a","b","Array","isArray","length","every","item","i","aObj","bObj","aKeys","Object","keys","bKeys","key","PreviousValueView","previousValueInPath","childProperty","propertyKey","Symbol","for","iconSize","smallest","t7","EntityHistoryEntry","actions","hover","collection","size","entry","authController","useAuthController","changedFields","changed_fields","previousValues","previous_values","T0","updatedBy","userDisplay","updated_at","updated_by","updatedOn","Date","currentUser","undefined","Typography","toLocaleString","action","t8","t9","t10","t11","t12","t13","cls","defaultBorderMixin","t14","values","map","getPropertyInPath","properties","valueInPath","getValueInPath","element","JSON","stringify","t15","t16","t17","t18","EntityHistoryView","entity","formContext","snackbarController","useSnackbarController","dirty","formex","slug","entityId","id","entries","isLoading","hasMore","loadMore","revert","useEntityHistory","enabled","pageSize","revertHistoryId","setRevertHistoryId","useState","isReverting","setIsReverting","containerRef","useRef","loadMoreRef","useEffect","currentContainer","current","currentLoadMore","observer","IntersectionObserver","observerEntries","isIntersecting","root","rootMargin","threshold","observe","disconnect","doRevert","historyId","revertedValues","resetForm","submitCount","touched","open","message","type","error","console","revertEntry","find","e","Boolean"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAGO,SAAAA,SAAAC,IAAA;AAAA,QAAAC,IAAAC,EAAA,EAAA;AAAkB,QAAA;AAAA,IAAAC;AAAAA,EAAAA,IAAAH;AAED,QAAAI,KAAAD,KAAIE,SAAUF,KAAIG;AAAI,MAAAC;AAAA,MAAAN,EAAA,CAAA,MAAAE,KAAAK,eAAAP,EAAA,CAAA,MAAAE,KAAAM,UAAA;AAE7BF,SAAAJ,KAAIM,YAAa,oBAAA,OAAA,EACH,WAAA,6BACN,KAAAN,KAAIM,UAAgB,KAAAN,KAAIK,eAAgB,gBAAc;AAAGP,MAAA,CAAA,IAAAE,KAAAK;AAAAP,MAAA,CAAA,IAAAE,KAAAM;AAAAR,WAAAM;AAAAA,EAAA,OAAA;AAAAA,SAAAN,EAAA,CAAA;AAAA,EAAA;AAC3D,QAAAS,KAAAP,KAAIK,eAAgBL,KAAIE,SAAUF,KAAIG;AAAI,MAAAK;AAAA,MAAAV,SAAAS,IAAA;AAAjDC,uCAAOD,UAAAA,GAAAA,CAA2C;AAAOT,WAAAS;AAAAT,WAAAU;AAAAA,EAAA,OAAA;AAAAA,SAAAV,EAAA,CAAA;AAAA,EAAA;AAAA,MAAAW;AAAA,MAAAX,EAAA,CAAA,MAAA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,OAAO,aAAY,UAAA;AAAA,MAAA;AAAA,MACA;AAAA,MAC9C,IAAI9E,KAAK8E,YAAYjF,UAAU,EAAEO,eAAAA;AAAAA,MAAiB;AAAA,IAAA,EAAA,CAEvD,EAAA,CACJ,IACE,KAAA,CACL,EAAA,CAET;AAAA,EAAA,GACJ;AACJ;"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { be as useCMSContext, bh as useCollectionRegistryController, bj as useEntitySelectionDialog, a9 as ReferencePreview, bt as useUrlController, s as Drawer, A as AppBar, ah as SideDialogs, ac as Scaffold, a4 as RebaseNavigation, a6 as RebaseRouteDefs, a2 as PropertyPreview, bg as useCollectionEditorController } from "./util-
|
|
2
|
-
import { a, b, c, d, e, f, g, h, i, j, B, k, C, l, m, n, D, o, p, q, r, E, t, u, v, w, x, y, z, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, _, $, a0, a1, a3, a5, a7, a8, aa, ab, ad, ae, af, ag, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aL, aM, aN, aO, aP, aQ, aR, aS, aT, aU, aV, aW, aX, aY, aZ, a_, a$, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, ba, bb, bc, bd, bf, bi, bk, bl, bm, bn, bo, bp, bq, br, bs, bu, bv } from "./util-
|
|
1
|
+
import { be as useCMSContext, bh as useCollectionRegistryController, bj as useEntitySelectionDialog, a9 as ReferencePreview, bt as useUrlController, s as Drawer, A as AppBar, ah as SideDialogs, ac as Scaffold, a4 as RebaseNavigation, a6 as RebaseRouteDefs, a2 as PropertyPreview, bg as useCollectionEditorController } from "./util-DbWax_sV.js";
|
|
2
|
+
import { a, b, c, d, e, f, g, h, i, j, B, k, C, l, m, n, D, o, p, q, r, E, t, u, v, w, x, y, z, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, _, $, a0, a1, a3, a5, a7, a8, aa, ab, ad, ae, af, ag, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aL, aM, aN, aO, aP, aQ, aR, aS, aT, aU, aV, aW, aX, aY, aZ, a_, a$, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, ba, bb, bc, bd, bf, bi, bk, bl, bm, bn, bo, bp, bq, br, bs, bu, bv } from "./util-DbWax_sV.js";
|
|
3
3
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
4
4
|
import { c as c2 } from "react-compiler-runtime";
|
|
5
5
|
import { Button, cls, CircularProgressCenter, ErrorBoundary, SelectItem, Select, MultiSelectItem, MultiSelect } from "@rebasepro/ui";
|
|
@@ -23,8 +23,8 @@ import { useLocation, Outlet } from "react-router-dom";
|
|
|
23
23
|
import "exceljs";
|
|
24
24
|
import "@rebasepro/schema-inference";
|
|
25
25
|
import { u as u2 } from "./useEntityHistory-UVsSclfZ.js";
|
|
26
|
-
import { I as I2, a as a2, P as P2 } from "./ImportCollectionAction-
|
|
27
|
-
import { B as B2, E as E2, d as d2, a as a4, b as b10, g as g2, c as c3 } from "./ExportCollectionAction-
|
|
26
|
+
import { I as I2, a as a2, P as P2 } from "./ImportCollectionAction-SZrInjhx.js";
|
|
27
|
+
import { B as B2, E as E2, d as d2, a as a4, b as b10, g as g2, c as c3 } from "./ExportCollectionAction-BfN34eWX.js";
|
|
28
28
|
import { R as RoleChip } from "./RoleChip-QtUFXeTp.js";
|
|
29
29
|
function resolveNavigationFrom({
|
|
30
30
|
path,
|
|
@@ -2577,7 +2577,7 @@ function EntityView(t0) {
|
|
|
2577
2577
|
}
|
|
2578
2578
|
return t8;
|
|
2579
2579
|
}
|
|
2580
|
-
const EntityHistoryView$2 = lazy(() => import("./index-
|
|
2580
|
+
const EntityHistoryView$2 = lazy(() => import("./index-PLIQXpTt.js").then((m) => ({
|
|
2581
2581
|
default: m.EntityHistoryView
|
|
2582
2582
|
})));
|
|
2583
2583
|
const BUILTIN_ENTITY_VIEWS = {
|
|
@@ -2667,7 +2667,7 @@ function EntityJsonPreview(t0) {
|
|
|
2667
2667
|
}
|
|
2668
2668
|
return t4;
|
|
2669
2669
|
}
|
|
2670
|
-
const EntityHistoryView$1 = lazy(() => import("./index-
|
|
2670
|
+
const EntityHistoryView$1 = lazy(() => import("./index-PLIQXpTt.js").then((m) => ({
|
|
2671
2671
|
default: m.EntityHistoryView
|
|
2672
2672
|
})));
|
|
2673
2673
|
const MAIN_TAB_VALUE$1 = "__main_##Q$SC^#S6";
|
|
@@ -8428,7 +8428,7 @@ function EntityActionButton(t0) {
|
|
|
8428
8428
|
}
|
|
8429
8429
|
return t5;
|
|
8430
8430
|
}
|
|
8431
|
-
const EntityHistoryView = lazy(() => import("./index-
|
|
8431
|
+
const EntityHistoryView = lazy(() => import("./index-PLIQXpTt.js").then((m) => ({
|
|
8432
8432
|
default: m.EntityHistoryView
|
|
8433
8433
|
})));
|
|
8434
8434
|
const MAIN_TAB_VALUE = "__main_##Q$SC^#S6";
|
|
@@ -9681,10 +9681,10 @@ function viewSlugsEqual(a, b) {
|
|
|
9681
9681
|
}
|
|
9682
9682
|
return true;
|
|
9683
9683
|
}
|
|
9684
|
-
const UsersView$1 = lazy(() => import("./UsersView-
|
|
9684
|
+
const UsersView$1 = lazy(() => import("./UsersView-Cex24r8H.js").then((m) => ({
|
|
9685
9685
|
default: m.UsersView
|
|
9686
9686
|
})));
|
|
9687
|
-
const RolesView$1 = lazy(() => import("./RolesView-
|
|
9687
|
+
const RolesView$1 = lazy(() => import("./RolesView-BCb7qwWs.js").then((m) => ({
|
|
9688
9688
|
default: m.RolesView
|
|
9689
9689
|
})));
|
|
9690
9690
|
function useResolvedViews(props) {
|
|
@@ -18538,10 +18538,10 @@ function EditorCollectionAction(t0) {
|
|
|
18538
18538
|
}
|
|
18539
18539
|
return t9;
|
|
18540
18540
|
}
|
|
18541
|
-
const ImportCollectionAction = lazy(() => import("./index-
|
|
18541
|
+
const ImportCollectionAction = lazy(() => import("./index-MKPc70-v.js").then((m) => ({
|
|
18542
18542
|
default: m.ImportCollectionAction
|
|
18543
18543
|
})));
|
|
18544
|
-
const ExportCollectionAction = lazy(() => import("./index-
|
|
18544
|
+
const ExportCollectionAction = lazy(() => import("./index-DjduZG1T.js").then((m) => ({
|
|
18545
18545
|
default: m.ExportCollectionAction
|
|
18546
18546
|
})));
|
|
18547
18547
|
function EntityCollectionViewActions(t0) {
|
|
@@ -26779,7 +26779,7 @@ function useLocalCollectionsConfigController(clientOrUrl, baseCollections = [],
|
|
|
26779
26779
|
}
|
|
26780
26780
|
const EMPTY_PLUGINS = [];
|
|
26781
26781
|
const EMPTY_COLLECTIONS = [];
|
|
26782
|
-
const CollectionsStudioView = lazy(() => import("./CollectionsStudioView-
|
|
26782
|
+
const CollectionsStudioView = lazy(() => import("./CollectionsStudioView-DcLHT5bU.js").then((n) => n.b).then((m) => ({
|
|
26783
26783
|
default: m.CollectionsStudioView
|
|
26784
26784
|
})));
|
|
26785
26785
|
function RebaseNavigation({
|
|
@@ -27626,10 +27626,10 @@ function CustomViewRoute(t0) {
|
|
|
27626
27626
|
useEffect(t1, t2);
|
|
27627
27627
|
return view.view;
|
|
27628
27628
|
}
|
|
27629
|
-
const CollectionEditorDialog = lazy(() => import("./CollectionEditorDialog-
|
|
27629
|
+
const CollectionEditorDialog = lazy(() => import("./CollectionEditorDialog-CmGXXSY9.js").then((m) => ({
|
|
27630
27630
|
default: m.CollectionEditorDialog
|
|
27631
27631
|
})));
|
|
27632
|
-
const PropertyFormDialog = lazy(() => import("./PropertyEditView-
|
|
27632
|
+
const PropertyFormDialog = lazy(() => import("./PropertyEditView-Cvryrb3B.js").then((n) => n.P).then((m) => ({
|
|
27633
27633
|
default: m.PropertyFormDialog
|
|
27634
27634
|
})));
|
|
27635
27635
|
function CollectionEditorDialogs() {
|
|
@@ -27678,13 +27678,13 @@ function CollectionEditorDialogs() {
|
|
|
27678
27678
|
}
|
|
27679
27679
|
function _temp$2() {
|
|
27680
27680
|
}
|
|
27681
|
-
const ContentHomePage = lazy(() => import("./ContentHomePage-
|
|
27681
|
+
const ContentHomePage = lazy(() => import("./ContentHomePage-C7vFqKSe.js").then((m) => ({
|
|
27682
27682
|
default: m.ContentHomePage
|
|
27683
27683
|
})));
|
|
27684
|
-
const UsersView = lazy(() => import("./UsersView-
|
|
27684
|
+
const UsersView = lazy(() => import("./UsersView-Cex24r8H.js").then((m) => ({
|
|
27685
27685
|
default: m.UsersView
|
|
27686
27686
|
})));
|
|
27687
|
-
const RolesView = lazy(() => import("./RolesView-
|
|
27687
|
+
const RolesView = lazy(() => import("./RolesView-BCb7qwWs.js").then((m) => ({
|
|
27688
27688
|
default: m.RolesView
|
|
27689
27689
|
})));
|
|
27690
27690
|
function SettingsView() {
|
|
@@ -30395,7 +30395,7 @@ function useOnAutoSave(autoSave, formex, lastSavedValues, save) {
|
|
|
30395
30395
|
const useCollectionsConfigController = () => {
|
|
30396
30396
|
return useContext(ConfigControllerContext);
|
|
30397
30397
|
};
|
|
30398
|
-
const VALID_DATA_TYPES = ["string", "number", "boolean", "date", "geopoint", "reference", "array", "map"];
|
|
30398
|
+
const VALID_DATA_TYPES = ["string", "number", "boolean", "date", "geopoint", "reference", "relation", "array", "map", "vector", "binary"];
|
|
30399
30399
|
function validateProperty(property, path, errors) {
|
|
30400
30400
|
if (typeof property !== "object" || property === null) {
|
|
30401
30401
|
errors.push({
|
|
@@ -30453,6 +30453,86 @@ function validateProperty(property, path, errors) {
|
|
|
30453
30453
|
});
|
|
30454
30454
|
}
|
|
30455
30455
|
}
|
|
30456
|
+
if (property.dataType === "relation") {
|
|
30457
|
+
if (property.target !== void 0 && typeof property.target !== "string" && typeof property.target !== "function") {
|
|
30458
|
+
errors.push({
|
|
30459
|
+
path: `${path}.target`,
|
|
30460
|
+
message: "Must be a string (collection slug) or a function"
|
|
30461
|
+
});
|
|
30462
|
+
}
|
|
30463
|
+
if (property.cardinality !== void 0 && property.cardinality !== "one" && property.cardinality !== "many") {
|
|
30464
|
+
errors.push({
|
|
30465
|
+
path: `${path}.cardinality`,
|
|
30466
|
+
message: "Must be either 'one' or 'many'"
|
|
30467
|
+
});
|
|
30468
|
+
}
|
|
30469
|
+
if (property.direction !== void 0 && property.direction !== "owning" && property.direction !== "inverse") {
|
|
30470
|
+
errors.push({
|
|
30471
|
+
path: `${path}.direction`,
|
|
30472
|
+
message: "Must be either 'owning' or 'inverse'"
|
|
30473
|
+
});
|
|
30474
|
+
}
|
|
30475
|
+
if (property.localKey !== void 0 && typeof property.localKey !== "string") {
|
|
30476
|
+
errors.push({
|
|
30477
|
+
path: `${path}.localKey`,
|
|
30478
|
+
message: "Must be a string"
|
|
30479
|
+
});
|
|
30480
|
+
}
|
|
30481
|
+
if (property.foreignKeyOnTarget !== void 0 && typeof property.foreignKeyOnTarget !== "string") {
|
|
30482
|
+
errors.push({
|
|
30483
|
+
path: `${path}.foreignKeyOnTarget`,
|
|
30484
|
+
message: "Must be a string"
|
|
30485
|
+
});
|
|
30486
|
+
}
|
|
30487
|
+
if (property.through !== void 0) {
|
|
30488
|
+
if (typeof property.through !== "object" || property.through === null) {
|
|
30489
|
+
errors.push({
|
|
30490
|
+
path: `${path}.through`,
|
|
30491
|
+
message: "Must be an object"
|
|
30492
|
+
});
|
|
30493
|
+
} else {
|
|
30494
|
+
const throughObj = property.through;
|
|
30495
|
+
if (throughObj.table !== void 0 && typeof throughObj.table !== "string") {
|
|
30496
|
+
errors.push({
|
|
30497
|
+
path: `${path}.through.table`,
|
|
30498
|
+
message: "Must be a string"
|
|
30499
|
+
});
|
|
30500
|
+
}
|
|
30501
|
+
if (throughObj.sourceColumn !== void 0 && typeof throughObj.sourceColumn !== "string") {
|
|
30502
|
+
errors.push({
|
|
30503
|
+
path: `${path}.through.sourceColumn`,
|
|
30504
|
+
message: "Must be a string"
|
|
30505
|
+
});
|
|
30506
|
+
}
|
|
30507
|
+
if (throughObj.targetColumn !== void 0 && typeof throughObj.targetColumn !== "string") {
|
|
30508
|
+
errors.push({
|
|
30509
|
+
path: `${path}.through.targetColumn`,
|
|
30510
|
+
message: "Must be a string"
|
|
30511
|
+
});
|
|
30512
|
+
}
|
|
30513
|
+
}
|
|
30514
|
+
}
|
|
30515
|
+
if (property.onUpdate !== void 0 && typeof property.onUpdate !== "string") {
|
|
30516
|
+
errors.push({
|
|
30517
|
+
path: `${path}.onUpdate`,
|
|
30518
|
+
message: "Must be a string"
|
|
30519
|
+
});
|
|
30520
|
+
}
|
|
30521
|
+
if (property.onDelete !== void 0 && typeof property.onDelete !== "string") {
|
|
30522
|
+
errors.push({
|
|
30523
|
+
path: `${path}.onDelete`,
|
|
30524
|
+
message: "Must be a string"
|
|
30525
|
+
});
|
|
30526
|
+
}
|
|
30527
|
+
}
|
|
30528
|
+
if (property.dataType === "vector") {
|
|
30529
|
+
if (property.dimensions !== void 0 && (typeof property.dimensions !== "number" || isNaN(property.dimensions) || property.dimensions <= 0)) {
|
|
30530
|
+
errors.push({
|
|
30531
|
+
path: `${path}.dimensions`,
|
|
30532
|
+
message: "Must be a positive number"
|
|
30533
|
+
});
|
|
30534
|
+
}
|
|
30535
|
+
}
|
|
30456
30536
|
if (property.dataType === "string" && property.storage) {
|
|
30457
30537
|
if (typeof property.storage !== "object") {
|
|
30458
30538
|
errors.push({
|
|
@@ -30845,4 +30925,4 @@ export {
|
|
|
30845
30925
|
EntityCollectionViewActions as y,
|
|
30846
30926
|
EntityForm as z
|
|
30847
30927
|
};
|
|
30848
|
-
//# sourceMappingURL=util-
|
|
30928
|
+
//# sourceMappingURL=util-DbWax_sV.js.map
|