@firecms/core 3.0.0-alpha.62 → 3.0.0-alpha.63
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/components/HomePage/DefaultHomePage.d.ts +11 -1
- package/dist/index.es.js +3974 -3977
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +5 -5
- package/dist/index.umd.js.map +1 -1
- package/dist/preview/PropertyPreview.d.ts +2 -1
- package/dist/preview/PropertyPreviewProps.d.ts +1 -6
- package/dist/preview/property_previews/ArrayOfMapsPreview.d.ts +1 -1
- package/dist/preview/property_previews/ArrayOfStorageComponentsPreview.d.ts +1 -1
- package/dist/preview/property_previews/ArrayOfStringsPreview.d.ts +1 -1
- package/dist/preview/property_previews/ArrayOneOfPreview.d.ts +1 -1
- package/dist/preview/property_previews/ArrayPropertyPreview.d.ts +1 -1
- package/dist/preview/property_previews/MapPropertyPreview.d.ts +1 -1
- package/dist/types/navigation.d.ts +6 -1
- package/dist/types/plugins.d.ts +10 -0
- package/dist/util/navigation_utils.d.ts +2 -2
- package/package.json +3 -3
- package/src/components/EntityCollectionTable/fields/TableStorageUpload.tsx +1 -1
- package/src/components/EntityCollectionTable/internal/PropertyTableCell.tsx +2 -2
- package/src/components/EntityPreview.tsx +1 -1
- package/src/components/HomePage/DefaultHomePage.tsx +16 -4
- package/src/form/components/StorageItemPreview.tsx +1 -1
- package/src/form/field_bindings/ReadOnlyFieldBinding.tsx +1 -1
- package/src/internal/useBuildNavigationController.tsx +21 -5
- package/src/preview/PropertyPreview.tsx +15 -13
- package/src/preview/PropertyPreviewProps.tsx +2 -2
- package/src/preview/components/ReferencePreview.tsx +1 -1
- package/src/preview/property_previews/ArrayOfMapsPreview.tsx +2 -2
- package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +2 -2
- package/src/preview/property_previews/ArrayOfStringsPreview.tsx +2 -2
- package/src/preview/property_previews/ArrayOneOfPreview.tsx +2 -2
- package/src/preview/property_previews/ArrayPropertyPreview.tsx +2 -2
- package/src/preview/property_previews/MapPropertyPreview.tsx +4 -4
- package/src/types/navigation.ts +7 -1
- package/src/types/plugins.tsx +13 -0
- package/src/util/join_collections.ts +5 -2
- package/src/util/navigation_utils.ts +5 -5
|
@@ -46,7 +46,7 @@ export function getLastSegment(path: string) {
|
|
|
46
46
|
return cleanPath;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
export function
|
|
49
|
+
export function resolveCollectionPathIds(path: string, allCollections: EntityCollection[]): string {
|
|
50
50
|
|
|
51
51
|
const cleanPath = removeInitialAndTrailingSlashes(path);
|
|
52
52
|
const subpaths = cleanPath.split("/");
|
|
@@ -61,12 +61,12 @@ export function resolveCollectionPathAliases(path: string, allCollections: Entit
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
if (subpaths.length > 1) {
|
|
64
|
-
const segmentCollection =
|
|
64
|
+
const segmentCollection = getCollectionByPathOrId(resolvedAliased ?? subpaths[0], allCollections);
|
|
65
65
|
if (!segmentCollection?.subcollections) {
|
|
66
66
|
return cleanPath;
|
|
67
67
|
}
|
|
68
68
|
const restOfThePath = cleanPath.split("/").slice(2).join("/");
|
|
69
|
-
return (resolvedAliased ?? subpaths[0]) + "/" + subpaths[1] + "/" +
|
|
69
|
+
return (resolvedAliased ?? subpaths[0]) + "/" + subpaths[1] + "/" + resolveCollectionPathIds(restOfThePath, segmentCollection.subcollections);
|
|
70
70
|
} else {
|
|
71
71
|
return resolvedAliased ?? cleanPath;
|
|
72
72
|
}
|
|
@@ -78,7 +78,7 @@ export function resolveCollectionPathAliases(path: string, allCollections: Entit
|
|
|
78
78
|
* @param pathOrAlias
|
|
79
79
|
* @param collections
|
|
80
80
|
*/
|
|
81
|
-
export function
|
|
81
|
+
export function getCollectionByPathOrId(pathOrAlias: string, collections: EntityCollection[]): EntityCollection | undefined {
|
|
82
82
|
|
|
83
83
|
const subpaths = removeInitialAndTrailingSlashes(pathOrAlias).split("/");
|
|
84
84
|
if (subpaths.length % 2 === 0) {
|
|
@@ -100,7 +100,7 @@ export function getCollectionByPathOrAlias(pathOrAlias: string, collections: Ent
|
|
|
100
100
|
} else if (navigationEntry.subcollections) {
|
|
101
101
|
const newPath = pathOrAlias.replace(subpathCombination, "").split("/").slice(2).join("/");
|
|
102
102
|
if (newPath.length > 0)
|
|
103
|
-
result =
|
|
103
|
+
result = getCollectionByPathOrId(newPath, navigationEntry.subcollections);
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
if (result) break;
|