@firecms/core 3.4.0-canary.e2466ba → 3.4.0
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/ErrorBoundary.d.ts +1 -3
- package/dist/i18n/__tests__/FireCMSi18nProvider.test.d.ts +1 -0
- package/dist/i18n/__tests__/nested_provider_lifecycle.test.d.ts +1 -0
- package/dist/index.es.js +266 -222
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +265 -221
- package/dist/index.umd.js.map +1 -1
- package/dist/util/entity_cache.d.ts +11 -0
- package/package.json +3 -3
- package/src/components/EntityCollectionTable/EntityCollectionRowActions.tsx +2 -2
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +2 -1
- package/src/components/ErrorBoundary.tsx +12 -18
- package/src/components/common/default_entity_actions.tsx +6 -2
- package/src/components/common/useDataSourceTableController.tsx +15 -3
- package/src/core/EntityEditView.tsx +2 -2
- package/src/core/EntitySidePanel.tsx +2 -2
- package/src/form/EntityForm.tsx +6 -5
- package/src/hooks/data/useEntityFetch.tsx +4 -3
- package/src/i18n/FireCMSi18nProvider.tsx +48 -4
- package/src/i18n/__tests__/FireCMSi18nProvider.test.tsx +91 -0
- package/src/i18n/__tests__/nested_provider_lifecycle.test.tsx +67 -0
- package/src/internal/useBuildSideEntityController.tsx +13 -5
- package/src/preview/components/ReferencePreview.tsx +3 -2
- package/src/util/entity_cache.ts +18 -0
- package/src/util/navigation_from_path.ts +6 -1
- package/src/util/navigation_utils.ts +7 -0
|
@@ -444,6 +444,13 @@ export function navigateToEntity({
|
|
|
444
444
|
});
|
|
445
445
|
|
|
446
446
|
} else {
|
|
447
|
+
// A URL must be built from the ESCAPED chain. `fullIdPath` is that chain; `path` is
|
|
448
|
+
// the raw datasource one, and falling back to it is only safe while no id in it
|
|
449
|
+
// contains "/". When the segments show that it does, the resulting URL would address
|
|
450
|
+
// a different entity, so say so instead of navigating somewhere wrong in silence.
|
|
451
|
+
if (!fullIdPath && pathSegments?.some(segment => segment.includes("/"))) {
|
|
452
|
+
console.warn(`navigateToEntity: no "fullIdPath" was given and "${path}" contains an entity id with a "/", so no unambiguous URL can be built for it. The link will point at a different location. Pass "fullIdPath" — the escaped chain — alongside "path".`);
|
|
453
|
+
}
|
|
447
454
|
let to = navigation.buildUrlCollectionPath(entityId ? `${fullIdPath ?? path}/${encodeEntityId(entityId)}` : fullIdPath ?? path);
|
|
448
455
|
if (entityId && selectedTab) {
|
|
449
456
|
to += `/${selectedTab}`;
|