@firecms/core 3.0.0-canary.227 → 3.0.0-canary.228
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/EntityCollectionView/EntityCollectionView.d.ts +4 -0
- package/dist/core/EntityEditView.d.ts +5 -1
- package/dist/index.es.js +87 -71
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +87 -71
- package/dist/index.umd.js.map +1 -1
- package/dist/util/navigation_utils.d.ts +2 -1
- package/package.json +5 -5
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +17 -3
- package/src/components/common/default_entity_actions.tsx +2 -0
- package/src/core/EntityEditView.tsx +12 -4
- package/src/internal/useBuildSideEntityController.tsx +2 -3
- package/src/routes/FireCMSRoute.tsx +4 -1
- package/src/types/side_entity_controller.tsx +5 -0
- package/src/util/navigation_utils.ts +6 -2
|
@@ -9,6 +9,10 @@ export type EntityCollectionViewProps<M extends Record<string, any>> = {
|
|
|
9
9
|
* It defaults to the collection path if not provided.
|
|
10
10
|
*/
|
|
11
11
|
fullPath?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Full path using navigation ids.
|
|
14
|
+
*/
|
|
15
|
+
fullIdPath?: string;
|
|
12
16
|
/**
|
|
13
17
|
* If this is a subcollection, specify the parent collection ids.
|
|
14
18
|
*/
|
|
@@ -19,6 +19,10 @@ export type OnTabChangeParams<M extends Record<string, any>> = {
|
|
|
19
19
|
};
|
|
20
20
|
export interface EntityEditViewProps<M extends Record<string, any>> {
|
|
21
21
|
path: string;
|
|
22
|
+
/**
|
|
23
|
+
* The navigation path to the entity.
|
|
24
|
+
*/
|
|
25
|
+
fullIdPath?: string;
|
|
22
26
|
collection: EntityCollection<M>;
|
|
23
27
|
entityId?: string;
|
|
24
28
|
databaseId?: string;
|
|
@@ -37,7 +41,7 @@ export interface EntityEditViewProps<M extends Record<string, any>> {
|
|
|
37
41
|
* an entity is opened.
|
|
38
42
|
*/
|
|
39
43
|
export declare function EntityEditView<M extends Record<string, any>, USER extends User>({ entityId, ...props }: EntityEditViewProps<M>): import("react/jsx-runtime").JSX.Element;
|
|
40
|
-
export declare function EntityEditViewInner<M extends Record<string, any>>({ path, entityId, selectedTab: selectedTabProp, collection, parentCollectionIds, onValuesModified, onSaved, onTabChange, entity, cachedDirtyValues, dataLoading, layout, barActions, status, setStatus, formProps, canEdit }: EntityEditViewProps<M> & {
|
|
44
|
+
export declare function EntityEditViewInner<M extends Record<string, any>>({ path, fullIdPath, entityId, selectedTab: selectedTabProp, collection, parentCollectionIds, onValuesModified, onSaved, onTabChange, entity, cachedDirtyValues, dataLoading, layout, barActions, status, setStatus, formProps, canEdit }: EntityEditViewProps<M> & {
|
|
41
45
|
entity?: Entity<M>;
|
|
42
46
|
cachedDirtyValues?: Partial<M>;
|
|
43
47
|
dataLoading: boolean;
|
package/dist/index.es.js
CHANGED
|
@@ -149,6 +149,7 @@ function navigateToEntity({
|
|
|
149
149
|
entityId,
|
|
150
150
|
copy,
|
|
151
151
|
path,
|
|
152
|
+
fullIdPath,
|
|
152
153
|
selectedTab,
|
|
153
154
|
sideEntityController,
|
|
154
155
|
onClose,
|
|
@@ -157,7 +158,8 @@ function navigateToEntity({
|
|
|
157
158
|
if (openEntityMode === "side_panel") {
|
|
158
159
|
sideEntityController.open({
|
|
159
160
|
entityId,
|
|
160
|
-
path,
|
|
161
|
+
path: fullIdPath ?? path,
|
|
162
|
+
// fullIdPath,
|
|
161
163
|
copy,
|
|
162
164
|
selectedTab,
|
|
163
165
|
collection,
|
|
@@ -165,7 +167,7 @@ function navigateToEntity({
|
|
|
165
167
|
onClose
|
|
166
168
|
});
|
|
167
169
|
} else {
|
|
168
|
-
let to = navigation.buildUrlCollectionPath(entityId ? `${path}/${entityId}` : path);
|
|
170
|
+
let to = navigation.buildUrlCollectionPath(entityId ? `${fullIdPath ?? path}/${entityId}` : fullIdPath ?? path);
|
|
169
171
|
if (entityId && selectedTab) {
|
|
170
172
|
to += `/${selectedTab}`;
|
|
171
173
|
}
|
|
@@ -12263,6 +12265,7 @@ const editEntityAction = {
|
|
|
12263
12265
|
collection,
|
|
12264
12266
|
entityId: entity.id,
|
|
12265
12267
|
path,
|
|
12268
|
+
fullIdPath: path,
|
|
12266
12269
|
sideEntityController: context.sideEntityController,
|
|
12267
12270
|
onClose: () => unhighlightEntity?.(entity),
|
|
12268
12271
|
navigation: context.navigation,
|
|
@@ -12295,6 +12298,7 @@ const copyEntityAction = {
|
|
|
12295
12298
|
collection,
|
|
12296
12299
|
entityId: entity.id,
|
|
12297
12300
|
path,
|
|
12301
|
+
fullIdPath: path,
|
|
12298
12302
|
copy: true,
|
|
12299
12303
|
sideEntityController: context.sideEntityController,
|
|
12300
12304
|
onClose: () => unhighlightEntity?.(entity),
|
|
@@ -18462,6 +18466,7 @@ function createCacheKey(fullPath, filters) {
|
|
|
18462
18466
|
const DEFAULT_ENTITY_OPEN_MODE = "side_panel";
|
|
18463
18467
|
const EntityCollectionView = React__default.memo(function EntityCollectionView2({
|
|
18464
18468
|
fullPath: fullPathProp,
|
|
18469
|
+
fullIdPath,
|
|
18465
18470
|
parentCollectionIds,
|
|
18466
18471
|
isSubCollection,
|
|
18467
18472
|
className,
|
|
@@ -18541,6 +18546,7 @@ const EntityCollectionView = React__default.memo(function EntityCollectionView2(
|
|
|
18541
18546
|
navigateToEntity({
|
|
18542
18547
|
navigation,
|
|
18543
18548
|
path,
|
|
18549
|
+
fullIdPath,
|
|
18544
18550
|
sideEntityController,
|
|
18545
18551
|
openEntityMode,
|
|
18546
18552
|
collection: collection_1,
|
|
@@ -18557,6 +18563,7 @@ const EntityCollectionView = React__default.memo(function EntityCollectionView2(
|
|
|
18557
18563
|
collection: collection_2,
|
|
18558
18564
|
entityId: void 0,
|
|
18559
18565
|
path: fullPath,
|
|
18566
|
+
fullIdPath,
|
|
18560
18567
|
sideEntityController,
|
|
18561
18568
|
navigation,
|
|
18562
18569
|
onClose: unselectNavigatedEntity
|
|
@@ -18692,6 +18699,7 @@ const EntityCollectionView = React__default.memo(function EntityCollectionView2(
|
|
|
18692
18699
|
entityId: entity_3.id,
|
|
18693
18700
|
selectedTab: subcollection.id ?? subcollection.path,
|
|
18694
18701
|
path: fullPath,
|
|
18702
|
+
fullIdPath,
|
|
18695
18703
|
navigation,
|
|
18696
18704
|
sideEntityController
|
|
18697
18705
|
});
|
|
@@ -18747,7 +18755,7 @@ const EntityCollectionView = React__default.memo(function EntityCollectionView2(
|
|
|
18747
18755
|
entity: entity_6,
|
|
18748
18756
|
customEntityActions: collection.entityActions
|
|
18749
18757
|
});
|
|
18750
|
-
return /* @__PURE__ */ jsx(EntityCollectionRowActions, { entity: entity_6, width: width_0, frozen, isSelected, selectionEnabled, size: size_0, highlightEntity: setHighlightedEntity, unhighlightEntity: unselectNavigatedEntity, collection, fullPath, actions: actions_0, hideId: collection?.hideIdFromCollection, onCollectionChange: updateLastDeleteTimestamp, selectionController: usedSelectionController, openEntityMode });
|
|
18758
|
+
return /* @__PURE__ */ jsx(EntityCollectionRowActions, { entity: entity_6, width: width_0, frozen, isSelected, selectionEnabled, size: size_0, highlightEntity: setHighlightedEntity, unhighlightEntity: unselectNavigatedEntity, collection, fullPath: fullIdPath ?? fullPath, actions: actions_0, hideId: collection?.hideIdFromCollection, onCollectionChange: updateLastDeleteTimestamp, selectionController: usedSelectionController, openEntityMode });
|
|
18751
18759
|
}, [updateLastDeleteTimestamp, usedSelectionController]);
|
|
18752
18760
|
const title = /* @__PURE__ */ jsx(Popover, { open: popOverOpen, onOpenChange: setPopOverOpen, enabled: Boolean(collection.description), trigger: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-start", children: [
|
|
18753
18761
|
/* @__PURE__ */ jsx(Typography, { variant: "subtitle1", className: `leading-none truncate max-w-[160px] lg:max-w-[240px] ${collection.description ? "cursor-pointer" : "cursor-auto"}`, onClick: collection.description ? (e_2) => {
|
|
@@ -18789,7 +18797,7 @@ const EntityCollectionView = React__default.memo(function EntityCollectionView2(
|
|
|
18789
18797
|
/* @__PURE__ */ jsx(AddIcon, {}),
|
|
18790
18798
|
"Create your first entity"
|
|
18791
18799
|
] })
|
|
18792
|
-
] }) : /* @__PURE__ */ jsx(Typography, { variant: "label", children: "No results with the applied filter/sort" }), hoverRow, inlineEditing: checkInlineEditing(), AdditionalHeaderWidget: buildAdditionalHeaderWidget, AddColumnComponent: addColumnComponentInternal, getIdColumnWidth, additionalIDHeaderWidget: /* @__PURE__ */ jsx(EntityIdHeaderWidget, { path: fullPath, collection }), openEntityMode }, `collection_table_${fullPath}`),
|
|
18800
|
+
] }) : /* @__PURE__ */ jsx(Typography, { variant: "label", children: "No results with the applied filter/sort" }), hoverRow, inlineEditing: checkInlineEditing(), AdditionalHeaderWidget: buildAdditionalHeaderWidget, AddColumnComponent: addColumnComponentInternal, getIdColumnWidth, additionalIDHeaderWidget: /* @__PURE__ */ jsx(EntityIdHeaderWidget, { path: fullPath, fullIdPath: fullIdPath ?? fullPath, collection }), openEntityMode }, `collection_table_${fullPath}`),
|
|
18793
18801
|
popupCell && /* @__PURE__ */ jsx(PopupFormField, { open: Boolean(popupCell), onClose: onPopupClose, cellRect: popupCell?.cellRect, propertyKey: popupCell?.propertyKey, collection, entityId: popupCell.entityId, tableKey: tableKey.current, customFieldValidator: uniqueFieldValidator, path: resolvedFullPath, onCellValueChange: onValueChange, container: containerRef.current }, `popup_form_${popupCell?.propertyKey}_${popupCell?.entityId}`),
|
|
18794
18802
|
deleteEntityClicked && /* @__PURE__ */ jsx(DeleteEntityDialog, { entityOrEntitiesToDelete: deleteEntityClicked, path: fullPath, collection, callbacks: collection.callbacks, open: Boolean(deleteEntityClicked), onEntityDelete: internalOnEntityDelete, onMultipleEntitiesDelete: internalOnMultipleEntitiesDelete, onClose: () => setDeleteEntityClicked(void 0) })
|
|
18795
18803
|
] });
|
|
@@ -18848,10 +18856,11 @@ function buildPropertyWidthOverwrite(key, width) {
|
|
|
18848
18856
|
};
|
|
18849
18857
|
}
|
|
18850
18858
|
function EntityIdHeaderWidget(t0) {
|
|
18851
|
-
const $ = c(
|
|
18859
|
+
const $ = c(42);
|
|
18852
18860
|
const {
|
|
18853
18861
|
collection,
|
|
18854
|
-
path
|
|
18862
|
+
path,
|
|
18863
|
+
fullIdPath
|
|
18855
18864
|
} = t0;
|
|
18856
18865
|
const navigation = useNavigationController();
|
|
18857
18866
|
const [openPopup, setOpenPopup] = React__default.useState(false);
|
|
@@ -18880,7 +18889,7 @@ function EntityIdHeaderWidget(t0) {
|
|
|
18880
18889
|
t4 = $[3];
|
|
18881
18890
|
}
|
|
18882
18891
|
let t5;
|
|
18883
|
-
if ($[4] !== collection || $[5] !==
|
|
18892
|
+
if ($[4] !== collection || $[5] !== fullIdPath || $[6] !== navigation || $[7] !== openEntityMode || $[8] !== path || $[9] !== searchString || $[10] !== sideEntityController) {
|
|
18884
18893
|
t5 = (e) => {
|
|
18885
18894
|
e.preventDefault();
|
|
18886
18895
|
if (!searchString) {
|
|
@@ -18894,77 +18903,79 @@ function EntityIdHeaderWidget(t0) {
|
|
|
18894
18903
|
collection,
|
|
18895
18904
|
entityId,
|
|
18896
18905
|
path,
|
|
18906
|
+
fullIdPath,
|
|
18897
18907
|
sideEntityController,
|
|
18898
18908
|
navigation
|
|
18899
18909
|
});
|
|
18900
18910
|
};
|
|
18901
18911
|
$[4] = collection;
|
|
18902
|
-
$[5] =
|
|
18903
|
-
$[6] =
|
|
18904
|
-
$[7] =
|
|
18905
|
-
$[8] =
|
|
18906
|
-
$[9] =
|
|
18907
|
-
$[10] =
|
|
18912
|
+
$[5] = fullIdPath;
|
|
18913
|
+
$[6] = navigation;
|
|
18914
|
+
$[7] = openEntityMode;
|
|
18915
|
+
$[8] = path;
|
|
18916
|
+
$[9] = searchString;
|
|
18917
|
+
$[10] = sideEntityController;
|
|
18918
|
+
$[11] = t5;
|
|
18908
18919
|
} else {
|
|
18909
|
-
t5 = $[
|
|
18920
|
+
t5 = $[11];
|
|
18910
18921
|
}
|
|
18911
18922
|
let t6;
|
|
18912
|
-
if ($[
|
|
18923
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
18913
18924
|
t6 = (e_0) => {
|
|
18914
18925
|
setSearchString(e_0.target.value);
|
|
18915
18926
|
};
|
|
18916
|
-
$[
|
|
18927
|
+
$[12] = t6;
|
|
18917
18928
|
} else {
|
|
18918
|
-
t6 = $[
|
|
18929
|
+
t6 = $[12];
|
|
18919
18930
|
}
|
|
18920
18931
|
let t7;
|
|
18921
|
-
if ($[
|
|
18932
|
+
if ($[13] !== openPopup || $[14] !== searchString) {
|
|
18922
18933
|
t7 = /* @__PURE__ */ jsx("input", { autoFocus: openPopup, placeholder: "Find entity by ID", onChange: t6, value: searchString, className: "rounded-lg bg-white dark:bg-surface-800 flex-grow bg-transparent outline-none p-2 " + focusedDisabled });
|
|
18923
|
-
$[
|
|
18924
|
-
$[
|
|
18925
|
-
$[
|
|
18934
|
+
$[13] = openPopup;
|
|
18935
|
+
$[14] = searchString;
|
|
18936
|
+
$[15] = t7;
|
|
18926
18937
|
} else {
|
|
18927
|
-
t7 = $[
|
|
18938
|
+
t7 = $[15];
|
|
18928
18939
|
}
|
|
18929
18940
|
const t8 = !searchString.trim();
|
|
18930
18941
|
let t9;
|
|
18931
|
-
if ($[
|
|
18942
|
+
if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
|
|
18932
18943
|
t9 = /* @__PURE__ */ jsx(KeyboardTabIcon, {});
|
|
18933
|
-
$[
|
|
18944
|
+
$[16] = t9;
|
|
18934
18945
|
} else {
|
|
18935
|
-
t9 = $[
|
|
18946
|
+
t9 = $[16];
|
|
18936
18947
|
}
|
|
18937
18948
|
let t10;
|
|
18938
|
-
if ($[
|
|
18949
|
+
if ($[17] !== t8) {
|
|
18939
18950
|
t10 = /* @__PURE__ */ jsx(Button, { variant: "text", disabled: t8, type: "submit", children: t9 });
|
|
18940
|
-
$[
|
|
18941
|
-
$[
|
|
18951
|
+
$[17] = t8;
|
|
18952
|
+
$[18] = t10;
|
|
18942
18953
|
} else {
|
|
18943
|
-
t10 = $[
|
|
18954
|
+
t10 = $[18];
|
|
18944
18955
|
}
|
|
18945
18956
|
let t11;
|
|
18946
|
-
if ($[
|
|
18957
|
+
if ($[19] !== t10 || $[20] !== t7) {
|
|
18947
18958
|
t11 = /* @__PURE__ */ jsxs("div", { className: "flex p-2 w-full gap-2", children: [
|
|
18948
18959
|
t7,
|
|
18949
18960
|
t10
|
|
18950
18961
|
] });
|
|
18951
|
-
$[
|
|
18952
|
-
$[
|
|
18953
|
-
$[
|
|
18962
|
+
$[19] = t10;
|
|
18963
|
+
$[20] = t7;
|
|
18964
|
+
$[21] = t11;
|
|
18954
18965
|
} else {
|
|
18955
|
-
t11 = $[
|
|
18966
|
+
t11 = $[21];
|
|
18956
18967
|
}
|
|
18957
18968
|
let t12;
|
|
18958
|
-
if ($[
|
|
18969
|
+
if ($[22] !== t11 || $[23] !== t5) {
|
|
18959
18970
|
t12 = /* @__PURE__ */ jsx("form", { noValidate: true, onSubmit: t5, className: "w-96 max-w-full", children: t11 });
|
|
18960
|
-
$[
|
|
18961
|
-
$[
|
|
18962
|
-
$[
|
|
18971
|
+
$[22] = t11;
|
|
18972
|
+
$[23] = t5;
|
|
18973
|
+
$[24] = t12;
|
|
18963
18974
|
} else {
|
|
18964
|
-
t12 = $[
|
|
18975
|
+
t12 = $[24];
|
|
18965
18976
|
}
|
|
18966
18977
|
let t13;
|
|
18967
|
-
if ($[
|
|
18978
|
+
if ($[25] !== collection || $[26] !== fullIdPath || $[27] !== navigation || $[28] !== openEntityMode || $[29] !== path || $[30] !== recentIds || $[31] !== sideEntityController) {
|
|
18968
18979
|
t13 = recentIds && recentIds.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-2 p-2", children: recentIds.map((id) => /* @__PURE__ */ jsx(ReferencePreview, { reference: new EntityReference(id, path), hover: true, onClick: () => {
|
|
18969
18980
|
setOpenPopup(false);
|
|
18970
18981
|
navigateToEntity({
|
|
@@ -18972,49 +18983,51 @@ function EntityIdHeaderWidget(t0) {
|
|
|
18972
18983
|
collection,
|
|
18973
18984
|
entityId: id,
|
|
18974
18985
|
path,
|
|
18986
|
+
fullIdPath,
|
|
18975
18987
|
sideEntityController,
|
|
18976
18988
|
navigation
|
|
18977
18989
|
});
|
|
18978
18990
|
}, includeEntityLink: false, size: "small" }, id)) });
|
|
18979
|
-
$[
|
|
18980
|
-
$[
|
|
18981
|
-
$[
|
|
18982
|
-
$[
|
|
18983
|
-
$[
|
|
18984
|
-
$[
|
|
18985
|
-
$[
|
|
18991
|
+
$[25] = collection;
|
|
18992
|
+
$[26] = fullIdPath;
|
|
18993
|
+
$[27] = navigation;
|
|
18994
|
+
$[28] = openEntityMode;
|
|
18995
|
+
$[29] = path;
|
|
18996
|
+
$[30] = recentIds;
|
|
18997
|
+
$[31] = sideEntityController;
|
|
18998
|
+
$[32] = t13;
|
|
18986
18999
|
} else {
|
|
18987
|
-
t13 = $[
|
|
19000
|
+
t13 = $[32];
|
|
18988
19001
|
}
|
|
18989
19002
|
let t14;
|
|
18990
|
-
if ($[
|
|
19003
|
+
if ($[33] !== t12 || $[34] !== t13) {
|
|
18991
19004
|
t14 = /* @__PURE__ */ jsxs("div", { className: t4, children: [
|
|
18992
19005
|
t12,
|
|
18993
19006
|
t13
|
|
18994
19007
|
] });
|
|
18995
|
-
$[
|
|
18996
|
-
$[
|
|
18997
|
-
$[
|
|
19008
|
+
$[33] = t12;
|
|
19009
|
+
$[34] = t13;
|
|
19010
|
+
$[35] = t14;
|
|
18998
19011
|
} else {
|
|
18999
|
-
t14 = $[
|
|
19012
|
+
t14 = $[35];
|
|
19000
19013
|
}
|
|
19001
19014
|
let t15;
|
|
19002
|
-
if ($[
|
|
19015
|
+
if ($[36] !== openPopup || $[37] !== t14) {
|
|
19003
19016
|
t15 = /* @__PURE__ */ jsx(Popover, { open: openPopup, onOpenChange: setOpenPopup, sideOffset: 0, align: "start", alignOffset: -117, trigger: t3, children: t14 });
|
|
19004
|
-
$[
|
|
19005
|
-
$[
|
|
19006
|
-
$[
|
|
19017
|
+
$[36] = openPopup;
|
|
19018
|
+
$[37] = t14;
|
|
19019
|
+
$[38] = t15;
|
|
19007
19020
|
} else {
|
|
19008
|
-
t15 = $[
|
|
19021
|
+
t15 = $[38];
|
|
19009
19022
|
}
|
|
19010
19023
|
let t16;
|
|
19011
|
-
if ($[
|
|
19024
|
+
if ($[39] !== t15 || $[40] !== t2) {
|
|
19012
19025
|
t16 = /* @__PURE__ */ jsx(Tooltip, { title: t2, asChild: false, children: t15 });
|
|
19013
|
-
$[
|
|
19014
|
-
$[
|
|
19015
|
-
$[
|
|
19026
|
+
$[39] = t15;
|
|
19027
|
+
$[40] = t2;
|
|
19028
|
+
$[41] = t16;
|
|
19016
19029
|
} else {
|
|
19017
|
-
t16 = $[
|
|
19030
|
+
t16 = $[41];
|
|
19018
19031
|
}
|
|
19019
19032
|
return t16;
|
|
19020
19033
|
}
|
|
@@ -21270,6 +21283,7 @@ function EntityEditView({
|
|
|
21270
21283
|
}
|
|
21271
21284
|
function EntityEditViewInner({
|
|
21272
21285
|
path,
|
|
21286
|
+
fullIdPath,
|
|
21273
21287
|
entityId,
|
|
21274
21288
|
selectedTab: selectedTabProp,
|
|
21275
21289
|
collection,
|
|
@@ -21367,18 +21381,19 @@ function EntityEditViewInner({
|
|
|
21367
21381
|
}), role: "tabpanel", children: /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(EntityJsonPreview, { values: formContext?.values ?? entity?.values ?? {} }) }) }, "json_view");
|
|
21368
21382
|
const subCollectionsViews = subcollections && subcollections.map((subcollection) => {
|
|
21369
21383
|
const subcollectionId = subcollection.id ?? subcollection.path;
|
|
21370
|
-
const
|
|
21384
|
+
const newFullPath = usedEntity ? `${path}/${usedEntity?.id}/${removeInitialAndTrailingSlashes(subcollectionId)}` : void 0;
|
|
21385
|
+
const newFullIdPath = fullIdPath ? `${fullIdPath}/${usedEntity?.id}/${removeInitialAndTrailingSlashes(subcollectionId)}` : void 0;
|
|
21371
21386
|
if (selectedTab !== subcollectionId) return null;
|
|
21372
21387
|
return /* @__PURE__ */ jsxs("div", { className: "relative flex-1 h-full overflow-auto w-full", role: "tabpanel", children: [
|
|
21373
21388
|
globalLoading && /* @__PURE__ */ jsx(CircularProgressCenter, {}),
|
|
21374
|
-
!globalLoading && (usedEntity &&
|
|
21389
|
+
!globalLoading && (usedEntity && newFullPath ? /* @__PURE__ */ jsx(EntityCollectionView, { fullPath: newFullPath, fullIdPath: newFullIdPath, parentCollectionIds: [...parentCollectionIds, collection.id], isSubCollection: true, updateUrl: false, ...subcollection, openEntityMode: layout }) : /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center w-full h-full p-3", children: /* @__PURE__ */ jsx(Typography, { variant: "label", children: "You need to save your entity before adding additional collections" }) }))
|
|
21375
21390
|
] }, `subcol_${subcollectionId}`);
|
|
21376
21391
|
}).filter(Boolean);
|
|
21377
21392
|
const onSideTabClick = (value_0) => {
|
|
21378
21393
|
setSelectedTab(value_0);
|
|
21379
21394
|
if (status === "existing") {
|
|
21380
21395
|
onTabChange?.({
|
|
21381
|
-
path,
|
|
21396
|
+
path: fullIdPath ?? path,
|
|
21382
21397
|
entityId,
|
|
21383
21398
|
selectedTab: value_0 === MAIN_TAB_VALUE ? void 0 : value_0,
|
|
21384
21399
|
collection
|
|
@@ -21695,6 +21710,7 @@ function buildSidePanelsFromUrl(path, collections, newFlag) {
|
|
|
21695
21710
|
if (navigationEntry.type === "entity") {
|
|
21696
21711
|
sidePanel = {
|
|
21697
21712
|
path: navigationEntry.path,
|
|
21713
|
+
// fullIdPath: navigationEntry.path,
|
|
21698
21714
|
entityId: navigationEntry.entityId,
|
|
21699
21715
|
copy: false,
|
|
21700
21716
|
width: navigationEntry.parentCollection?.sideDialogWidth
|
|
@@ -21712,6 +21728,7 @@ function buildSidePanelsFromUrl(path, collections, newFlag) {
|
|
|
21712
21728
|
if (newFlag) {
|
|
21713
21729
|
sidePanel = {
|
|
21714
21730
|
path: lastCollectionPath,
|
|
21731
|
+
// fullIdPath: lastCollectionPath,
|
|
21715
21732
|
copy: false
|
|
21716
21733
|
};
|
|
21717
21734
|
}
|
|
@@ -21720,10 +21737,8 @@ function buildSidePanelsFromUrl(path, collections, newFlag) {
|
|
|
21720
21737
|
const propsToSidePanel = (props, buildUrlCollectionPath, resolveIdsFrom, smallLayout, customizationController, authController) => {
|
|
21721
21738
|
const collectionPath = removeInitialAndTrailingSlashes(props.path);
|
|
21722
21739
|
const newPath = props.entityId ? buildUrlCollectionPath(`${collectionPath}/${props.entityId}${props.selectedTab ? "/" + props.selectedTab : ""}#${SIDE_URL_HASH}`) : buildUrlCollectionPath(`${collectionPath}#${NEW_URL_HASH}`);
|
|
21723
|
-
const resolvedPath = resolveIdsFrom(props.path);
|
|
21724
21740
|
const resolvedPanelProps = {
|
|
21725
21741
|
...props,
|
|
21726
|
-
path: resolvedPath,
|
|
21727
21742
|
formProps: props.formProps
|
|
21728
21743
|
};
|
|
21729
21744
|
const entityViewWidth = getEntityViewWidth(props, smallLayout, customizationController, authController);
|
|
@@ -23225,7 +23240,7 @@ function FireCMSRoute() {
|
|
|
23225
23240
|
} else {
|
|
23226
23241
|
t8 = $[27];
|
|
23227
23242
|
}
|
|
23228
|
-
t62 = /* @__PURE__ */ jsx(EntityCollectionView, { isSubCollection: false, parentCollectionIds: t8, fullPath: collection_0.id, updateUrl: true, ...collection_0, Actions: toArray(collection_0.Actions) }, `collection_view_${collection_0.id ?? collection_0.path}`);
|
|
23243
|
+
t62 = /* @__PURE__ */ jsx(EntityCollectionView, { fullIdPath: collection_0.id, isSubCollection: false, parentCollectionIds: t8, fullPath: collection_0.id, updateUrl: true, ...collection_0, Actions: toArray(collection_0.Actions) }, `collection_view_${collection_0.id ?? collection_0.path}`);
|
|
23229
23244
|
}
|
|
23230
23245
|
$[23] = navigation;
|
|
23231
23246
|
$[24] = navigationEntries;
|
|
@@ -23314,9 +23329,10 @@ function EntityFullScreenRoute({
|
|
|
23314
23329
|
return /* @__PURE__ */ jsx(NotFoundPage, {});
|
|
23315
23330
|
}
|
|
23316
23331
|
const collection = isNew ? lastCollectionEntry.collection : lastEntityEntry.parentCollection;
|
|
23317
|
-
const
|
|
23332
|
+
const fullIdPath = isNew ? lastCollectionEntry.path : lastEntityEntry.path;
|
|
23333
|
+
const collectionPath = navigation.resolveIdsFrom(fullIdPath);
|
|
23318
23334
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
23319
|
-
/* @__PURE__ */ jsx(EntityEditView, { entityId: isNew ? void 0 : entityId, collection, layout: "full_screen", path: collectionPath, copy: isCopy, selectedTab: selectedTab ?? void 0, onValuesModified: (modified) => blocked.current = modified, onSaved: (params) => {
|
|
23335
|
+
/* @__PURE__ */ jsx(EntityEditView, { entityId: isNew ? void 0 : entityId, fullIdPath, collection, layout: "full_screen", path: collectionPath, copy: isCopy, selectedTab: selectedTab ?? void 0, onValuesModified: (modified) => blocked.current = modified, onSaved: (params) => {
|
|
23320
23336
|
const newSelectedTab = params.selectedTab;
|
|
23321
23337
|
const newEntityId = params.entityId;
|
|
23322
23338
|
if (newSelectedTab) {
|