@firecms/core 3.0.0-canary.252 → 3.0.0-canary.253
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/EntityCollectionTable/EntityCollectionRowActions.d.ts +2 -1
- package/dist/core/EntityEditView.d.ts +3 -0
- package/dist/form/EntityForm.d.ts +2 -1
- package/dist/form/EntityFormActions.d.ts +3 -1
- package/dist/index.es.js +87 -87
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +87 -87
- package/dist/index.umd.js.map +1 -1
- package/dist/types/entity_actions.d.ts +1 -0
- package/dist/types/side_entity_controller.d.ts +4 -0
- package/dist/util/navigation_from_path.d.ts +4 -0
- package/package.json +5 -5
- package/src/components/EntityCollectionTable/EntityCollectionRowActions.tsx +4 -0
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +2 -2
- package/src/components/FireCMSLogo.tsx +7 -51
- package/src/components/common/default_entity_actions.tsx +7 -4
- package/src/core/EntityEditView.tsx +13 -1
- package/src/core/EntitySidePanel.tsx +4 -1
- package/src/form/EntityForm.tsx +6 -0
- package/src/form/EntityFormActions.tsx +14 -1
- package/src/internal/useBuildSideEntityController.tsx +7 -4
- package/src/routes/FireCMSRoute.tsx +3 -3
- package/src/types/entity_actions.tsx +1 -0
- package/src/types/side_entity_controller.tsx +5 -0
- package/src/util/navigation_from_path.ts +15 -5
- package/src/util/navigation_utils.ts +2 -2
package/dist/index.umd.js
CHANGED
|
@@ -176,8 +176,8 @@
|
|
|
176
176
|
if (openEntityMode === "side_panel") {
|
|
177
177
|
sideEntityController.open({
|
|
178
178
|
entityId,
|
|
179
|
-
path
|
|
180
|
-
|
|
179
|
+
path,
|
|
180
|
+
fullIdPath,
|
|
181
181
|
copy,
|
|
182
182
|
selectedTab,
|
|
183
183
|
collection,
|
|
@@ -920,7 +920,8 @@
|
|
|
920
920
|
const {
|
|
921
921
|
path,
|
|
922
922
|
collections = [],
|
|
923
|
-
currentFullPath
|
|
923
|
+
currentFullPath,
|
|
924
|
+
currentFullIdPath
|
|
924
925
|
} = props;
|
|
925
926
|
const subpaths = removeInitialAndTrailingSlashes(path).split("/");
|
|
926
927
|
const subpathCombinations = getCollectionPathsCombinations(subpaths);
|
|
@@ -933,13 +934,14 @@
|
|
|
933
934
|
collection = collections && collections.find((entry) => entry.path === subpathCombination);
|
|
934
935
|
}
|
|
935
936
|
if (collection) {
|
|
936
|
-
const
|
|
937
|
-
const
|
|
937
|
+
const collectionPath = currentFullPath && currentFullPath.length > 0 ? currentFullPath + "/" + collection.path : collection.path;
|
|
938
|
+
const fullIdPath = currentFullIdPath && currentFullIdPath.length > 0 ? currentFullIdPath + "/" + collection.id : collection.id;
|
|
938
939
|
result.push({
|
|
939
940
|
type: "collection",
|
|
940
941
|
id: collection.id,
|
|
941
942
|
path: collectionPath,
|
|
942
943
|
fullPath: collectionPath,
|
|
944
|
+
fullIdPath,
|
|
943
945
|
collection
|
|
944
946
|
});
|
|
945
947
|
const restOfThePath = removeInitialAndTrailingSlashes(removeInitialAndTrailingSlashes(path).replace(subpathCombination, ""));
|
|
@@ -951,6 +953,7 @@
|
|
|
951
953
|
type: "entity",
|
|
952
954
|
entityId,
|
|
953
955
|
path: collectionPath,
|
|
956
|
+
fullIdPath,
|
|
954
957
|
fullPath,
|
|
955
958
|
parentCollection: collection
|
|
956
959
|
});
|
|
@@ -966,6 +969,7 @@
|
|
|
966
969
|
type: "custom_view",
|
|
967
970
|
path: collectionPath,
|
|
968
971
|
entityId,
|
|
972
|
+
fullIdPath,
|
|
969
973
|
fullPath: fullPath + "/" + customView.key,
|
|
970
974
|
view: customView
|
|
971
975
|
});
|
|
@@ -974,6 +978,7 @@
|
|
|
974
978
|
path: newPath,
|
|
975
979
|
collections: collection.subcollections,
|
|
976
980
|
currentFullPath: fullPath,
|
|
981
|
+
currentFullIdPath: fullIdPath,
|
|
977
982
|
contextEntityViews: props.contextEntityViews
|
|
978
983
|
}));
|
|
979
984
|
}
|
|
@@ -9529,6 +9534,7 @@
|
|
|
9529
9534
|
entity,
|
|
9530
9535
|
collection,
|
|
9531
9536
|
fullPath,
|
|
9537
|
+
fullIdPath,
|
|
9532
9538
|
width,
|
|
9533
9539
|
frozen,
|
|
9534
9540
|
isSelected,
|
|
@@ -9566,6 +9572,7 @@
|
|
|
9566
9572
|
action.onClick({
|
|
9567
9573
|
entity,
|
|
9568
9574
|
fullPath,
|
|
9575
|
+
fullIdPath,
|
|
9569
9576
|
collection,
|
|
9570
9577
|
context,
|
|
9571
9578
|
selectionController,
|
|
@@ -9580,6 +9587,7 @@
|
|
|
9580
9587
|
action_0.onClick({
|
|
9581
9588
|
entity,
|
|
9582
9589
|
fullPath,
|
|
9590
|
+
fullIdPath,
|
|
9583
9591
|
collection,
|
|
9584
9592
|
context,
|
|
9585
9593
|
selectionController,
|
|
@@ -12389,6 +12397,7 @@
|
|
|
12389
12397
|
entity,
|
|
12390
12398
|
collection,
|
|
12391
12399
|
fullPath,
|
|
12400
|
+
fullIdPath,
|
|
12392
12401
|
context,
|
|
12393
12402
|
highlightEntity,
|
|
12394
12403
|
unhighlightEntity,
|
|
@@ -12402,7 +12411,8 @@
|
|
|
12402
12411
|
if (collection) {
|
|
12403
12412
|
addRecentId(collection.id, entity.id);
|
|
12404
12413
|
}
|
|
12405
|
-
const path = collection?.collectionGroup ? collection.
|
|
12414
|
+
const path = collection?.collectionGroup ? collection.path : fullPath ?? collection?.path ?? entity.path;
|
|
12415
|
+
const newFullIdPath = collection?.collectionGroup ? collection.id : fullIdPath ?? collection?.id ?? entity.path;
|
|
12406
12416
|
const defaultSelectedView = resolveDefaultSelectedView(collection ? collection.defaultSelectedView : void 0, {
|
|
12407
12417
|
status: "existing",
|
|
12408
12418
|
entityId: entity.id
|
|
@@ -12412,7 +12422,7 @@
|
|
|
12412
12422
|
collection,
|
|
12413
12423
|
entityId: entity.id,
|
|
12414
12424
|
path,
|
|
12415
|
-
fullIdPath:
|
|
12425
|
+
fullIdPath: newFullIdPath,
|
|
12416
12426
|
sideEntityController: context.sideEntityController,
|
|
12417
12427
|
onClose: () => unhighlightEntity?.(entity),
|
|
12418
12428
|
navigation: context.navigation,
|
|
@@ -12439,13 +12449,14 @@
|
|
|
12439
12449
|
path: entity.path,
|
|
12440
12450
|
entityId: entity.id
|
|
12441
12451
|
});
|
|
12442
|
-
const path = collection?.collectionGroup ? collection.
|
|
12452
|
+
const path = collection?.collectionGroup ? collection.path : fullPath ?? collection?.path ?? entity.path;
|
|
12453
|
+
const fullIdPath = collection?.collectionGroup ? collection.id : fullPath ?? collection?.id ?? entity.path;
|
|
12443
12454
|
navigateToEntity({
|
|
12444
12455
|
openEntityMode,
|
|
12445
12456
|
collection,
|
|
12446
12457
|
entityId: entity.id,
|
|
12447
12458
|
path,
|
|
12448
|
-
fullIdPath
|
|
12459
|
+
fullIdPath,
|
|
12449
12460
|
copy: true,
|
|
12450
12461
|
sideEntityController: context.sideEntityController,
|
|
12451
12462
|
onClose: () => unhighlightEntity?.(entity),
|
|
@@ -14677,8 +14688,10 @@
|
|
|
14677
14688
|
return !ele || ele === document.body ? document.body : isScrollable(ele) ? ele : getScrollableParent(ele.parentNode);
|
|
14678
14689
|
};
|
|
14679
14690
|
function EntityFormActions(t0) {
|
|
14680
|
-
const $ = reactCompilerRuntime.c(
|
|
14691
|
+
const $ = reactCompilerRuntime.c(14);
|
|
14681
14692
|
const {
|
|
14693
|
+
fullPath,
|
|
14694
|
+
fullIdPath,
|
|
14682
14695
|
collection,
|
|
14683
14696
|
entity,
|
|
14684
14697
|
layout,
|
|
@@ -14692,8 +14705,10 @@
|
|
|
14692
14705
|
const context = useFireCMSContext();
|
|
14693
14706
|
const sideEntityController = useSideEntityController();
|
|
14694
14707
|
let t1;
|
|
14695
|
-
if ($[0] !== collection || $[1] !== context || $[2] !== disabled || $[3] !== entity || $[4] !== formex2.isSubmitting || $[5] !==
|
|
14708
|
+
if ($[0] !== collection || $[1] !== context || $[2] !== disabled || $[3] !== entity || $[4] !== formex2.isSubmitting || $[5] !== fullIdPath || $[6] !== fullPath || $[7] !== layout || $[8] !== openEntityMode || $[9] !== pluginActions || $[10] !== savingError || $[11] !== sideEntityController || $[12] !== status) {
|
|
14696
14709
|
t1 = layout === "bottom" ? buildBottomActions$1({
|
|
14710
|
+
fullPath,
|
|
14711
|
+
fullIdPath,
|
|
14697
14712
|
savingError,
|
|
14698
14713
|
entity,
|
|
14699
14714
|
collection,
|
|
@@ -14705,6 +14720,8 @@
|
|
|
14705
14720
|
pluginActions,
|
|
14706
14721
|
openEntityMode
|
|
14707
14722
|
}) : buildSideActions$1({
|
|
14723
|
+
fullPath,
|
|
14724
|
+
fullIdPath,
|
|
14708
14725
|
savingError,
|
|
14709
14726
|
entity,
|
|
14710
14727
|
collection,
|
|
@@ -14721,21 +14738,25 @@
|
|
|
14721
14738
|
$[2] = disabled;
|
|
14722
14739
|
$[3] = entity;
|
|
14723
14740
|
$[4] = formex2.isSubmitting;
|
|
14724
|
-
$[5] =
|
|
14725
|
-
$[6] =
|
|
14726
|
-
$[7] =
|
|
14727
|
-
$[8] =
|
|
14728
|
-
$[9] =
|
|
14729
|
-
$[10] =
|
|
14730
|
-
$[11] =
|
|
14741
|
+
$[5] = fullIdPath;
|
|
14742
|
+
$[6] = fullPath;
|
|
14743
|
+
$[7] = layout;
|
|
14744
|
+
$[8] = openEntityMode;
|
|
14745
|
+
$[9] = pluginActions;
|
|
14746
|
+
$[10] = savingError;
|
|
14747
|
+
$[11] = sideEntityController;
|
|
14748
|
+
$[12] = status;
|
|
14749
|
+
$[13] = t1;
|
|
14731
14750
|
} else {
|
|
14732
|
-
t1 = $[
|
|
14751
|
+
t1 = $[13];
|
|
14733
14752
|
}
|
|
14734
14753
|
return t1;
|
|
14735
14754
|
}
|
|
14736
14755
|
function buildBottomActions$1({
|
|
14737
14756
|
savingError,
|
|
14738
14757
|
entity,
|
|
14758
|
+
fullPath,
|
|
14759
|
+
fullIdPath,
|
|
14739
14760
|
formActions,
|
|
14740
14761
|
collection,
|
|
14741
14762
|
context,
|
|
@@ -14752,7 +14773,8 @@
|
|
|
14752
14773
|
event.stopPropagation();
|
|
14753
14774
|
if (entity) action.onClick({
|
|
14754
14775
|
entity,
|
|
14755
|
-
fullPath: collection.path,
|
|
14776
|
+
fullPath: fullPath ?? collection.path,
|
|
14777
|
+
fullIdPath: fullIdPath ?? collection.id,
|
|
14756
14778
|
collection,
|
|
14757
14779
|
context,
|
|
14758
14780
|
sideEntityController,
|
|
@@ -14793,6 +14815,7 @@
|
|
|
14793
14815
|
}
|
|
14794
14816
|
function EntityForm({
|
|
14795
14817
|
path,
|
|
14818
|
+
fullIdPath,
|
|
14796
14819
|
entityId: entityIdProp,
|
|
14797
14820
|
collection,
|
|
14798
14821
|
onValuesModified,
|
|
@@ -15207,7 +15230,7 @@
|
|
|
15207
15230
|
if (!resolvedCollection || !path) {
|
|
15208
15231
|
throw Error("INTERNAL: Collection and path must be defined in form context");
|
|
15209
15232
|
}
|
|
15210
|
-
const dialogActions = /* @__PURE__ */ jsxRuntime.jsx(EntityFormActionsComponent, { collection: resolvedCollection, path, entity, layout: forceActionsAtTheBottom ? "bottom" : "side", savingError, formex: formex$1, disabled: actionsDisabled, status, pluginActions, openEntityMode, showDefaultActions });
|
|
15233
|
+
const dialogActions = /* @__PURE__ */ jsxRuntime.jsx(EntityFormActionsComponent, { collection: resolvedCollection, path, fullPath: path, fullIdPath, entity, layout: forceActionsAtTheBottom ? "bottom" : "side", savingError, formex: formex$1, disabled: actionsDisabled, status, pluginActions, openEntityMode, showDefaultActions });
|
|
15211
15234
|
return /* @__PURE__ */ jsxRuntime.jsx(formex.Formex, { value: formex$1, children: /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: formex$1.handleSubmit, onReset: () => formex$1.resetForm({
|
|
15212
15235
|
values: getInitialEntityValues(authController, collection, path, status, entity, customizationController.propertyConfigs)
|
|
15213
15236
|
}), noValidate: true, className: ui.cls("flex-1 flex flex-row w-full overflow-y-auto justify-center", className), children: [
|
|
@@ -19971,7 +19994,7 @@
|
|
|
19971
19994
|
entity: entity_6,
|
|
19972
19995
|
customEntityActions: collection.entityActions
|
|
19973
19996
|
});
|
|
19974
|
-
return /* @__PURE__ */ jsxRuntime.jsx(EntityCollectionRowActions, { entity: entity_6, width: width_0, frozen, isSelected, selectionEnabled, size: size_0, highlightEntity: setHighlightedEntity, unhighlightEntity: unselectNavigatedEntity, collection, fullPath
|
|
19997
|
+
return /* @__PURE__ */ jsxRuntime.jsx(EntityCollectionRowActions, { entity: entity_6, width: width_0, frozen, isSelected, selectionEnabled, size: size_0, highlightEntity: setHighlightedEntity, unhighlightEntity: unselectNavigatedEntity, collection, fullPath, fullIdPath, actions: actions_0, hideId: collection?.hideIdFromCollection, onCollectionChange: updateLastDeleteTimestamp, selectionController: usedSelectionController, openEntityMode });
|
|
19975
19998
|
}, [updateLastDeleteTimestamp, usedSelectionController]);
|
|
19976
19999
|
const title = /* @__PURE__ */ jsxRuntime.jsx(ui.Popover, { open: popOverOpen, onOpenChange: setPopOverOpen, enabled: Boolean(collection.description), trigger: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-start", children: [
|
|
19977
20000
|
/* @__PURE__ */ jsxRuntime.jsx(ui.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) => {
|
|
@@ -20375,7 +20398,7 @@
|
|
|
20375
20398
|
return t7;
|
|
20376
20399
|
}
|
|
20377
20400
|
function FireCMSLogo(t0) {
|
|
20378
|
-
const $ = reactCompilerRuntime.c(
|
|
20401
|
+
const $ = reactCompilerRuntime.c(8);
|
|
20379
20402
|
const {
|
|
20380
20403
|
width,
|
|
20381
20404
|
height,
|
|
@@ -20385,70 +20408,36 @@
|
|
|
20385
20408
|
const t1 = width ?? "100%";
|
|
20386
20409
|
const t2 = height ?? "100%";
|
|
20387
20410
|
let t3;
|
|
20411
|
+
let t4;
|
|
20412
|
+
let t5;
|
|
20388
20413
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
20389
|
-
t3 = /* @__PURE__ */ jsxRuntime.
|
|
20390
|
-
|
|
20391
|
-
|
|
20392
|
-
/* @__PURE__ */ jsxRuntime.jsx("stop", { stopColor: "#EC4C51", offset: "44.7242531%" }),
|
|
20393
|
-
/* @__PURE__ */ jsxRuntime.jsx("stop", { stopColor: "#9543C1", offset: "71.4578165%" }),
|
|
20394
|
-
/* @__PURE__ */ jsxRuntime.jsx("stop", { stopColor: "#3857B3", offset: "100%" })
|
|
20395
|
-
] });
|
|
20414
|
+
t3 = /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "291.5", cy: "291.5", r: "291.5", fill: "#0070F4" });
|
|
20415
|
+
t4 = /* @__PURE__ */ jsxRuntime.jsx("ellipse", { cx: "292", cy: "291.5", rx: "173", ry: "173.5", fill: "#FF3773" });
|
|
20416
|
+
t5 = /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M465 291.5C465 268.847 460.525 246.416 451.831 225.487C443.137 204.558 430.394 185.542 414.329 169.524C398.265 153.506 379.194 140.8 358.204 132.131C337.215 123.462 314.719 119 292 119C269.281 119 246.785 123.462 225.796 132.131C204.806 140.8 185.735 153.506 169.671 169.524C153.606 185.542 140.863 204.558 132.169 225.487C123.475 246.416 119 268.847 119 291.5L292 291.5H465Z", fill: "#FFA400" });
|
|
20396
20417
|
$[0] = t3;
|
|
20397
|
-
} else {
|
|
20398
|
-
t3 = $[0];
|
|
20399
|
-
}
|
|
20400
|
-
let t4;
|
|
20401
|
-
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
20402
|
-
t4 = /* @__PURE__ */ jsxRuntime.jsxs("radialGradient", { cx: "53.6205516%", cy: "47.2473036%", fx: "53.6205516%", fy: "47.2473036%", r: "50.8229649%", gradientTransform: "translate(0.536206,0.472473),rotate(90.000000),scale(1.000000,1.206631),translate(-0.536206,-0.472473)", id: "radialGradient-2", children: [
|
|
20403
|
-
/* @__PURE__ */ jsxRuntime.jsx("stop", { stopColor: "#68294F", stopOpacity: "0", offset: "0%" }),
|
|
20404
|
-
/* @__PURE__ */ jsxRuntime.jsx("stop", { stopColor: "#5E2548", stopOpacity: "0.04641108", offset: "75.3503173%" }),
|
|
20405
|
-
/* @__PURE__ */ jsxRuntime.jsx("stop", { stopColor: "#0D060B", stopOpacity: "0.437431709", offset: "100%" })
|
|
20406
|
-
] });
|
|
20407
20418
|
$[1] = t4;
|
|
20408
|
-
} else {
|
|
20409
|
-
t4 = $[1];
|
|
20410
|
-
}
|
|
20411
|
-
let t5;
|
|
20412
|
-
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
20413
|
-
t5 = /* @__PURE__ */ jsxRuntime.jsxs("defs", { children: [
|
|
20414
|
-
t3,
|
|
20415
|
-
t4,
|
|
20416
|
-
/* @__PURE__ */ jsxRuntime.jsxs("radialGradient", { cx: "53.8605015%", cy: "48.1990423%", fx: "53.8605015%", fy: "48.1990423%", r: "59.9151549%", gradientTransform: "translate(0.538605,0.481990),rotate(180.000000),scale(1.000000,0.925027),translate(-0.538605,-0.481990)", id: "radialGradient-3", children: [
|
|
20417
|
-
/* @__PURE__ */ jsxRuntime.jsx("stop", { stopColor: "#68294F", stopOpacity: "0", offset: "0%" }),
|
|
20418
|
-
/* @__PURE__ */ jsxRuntime.jsx("stop", { stopColor: "#5E2548", stopOpacity: "0.04641108", offset: "84.0867343%" }),
|
|
20419
|
-
/* @__PURE__ */ jsxRuntime.jsx("stop", { stopColor: "#FF0000", stopOpacity: "0.567324765", offset: "100%" })
|
|
20420
|
-
] })
|
|
20421
|
-
] });
|
|
20422
20419
|
$[2] = t5;
|
|
20423
20420
|
} else {
|
|
20421
|
+
t3 = $[0];
|
|
20422
|
+
t4 = $[1];
|
|
20424
20423
|
t5 = $[2];
|
|
20425
20424
|
}
|
|
20426
20425
|
let t6;
|
|
20427
|
-
if ($[3]
|
|
20428
|
-
t6 = /* @__PURE__ */ jsxRuntime.
|
|
20429
|
-
|
|
20430
|
-
|
|
20431
|
-
|
|
20432
|
-
] }) });
|
|
20433
|
-
$[3] = t6;
|
|
20434
|
-
} else {
|
|
20435
|
-
t6 = $[3];
|
|
20436
|
-
}
|
|
20437
|
-
let t7;
|
|
20438
|
-
if ($[4] !== className || $[5] !== style || $[6] !== t1 || $[7] !== t2) {
|
|
20439
|
-
t7 = /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: t1, height: t2, viewBox: "0 0 599 599", version: "1.1", style, className, xmlns: "http://www.w3.org/2000/svg", children: [
|
|
20440
|
-
t5,
|
|
20441
|
-
t6
|
|
20426
|
+
if ($[3] !== className || $[4] !== style || $[5] !== t1 || $[6] !== t2) {
|
|
20427
|
+
t6 = /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: t1, height: t2, version: "1.1", style, className, viewBox: "0 0 583 583", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
20428
|
+
t3,
|
|
20429
|
+
t4,
|
|
20430
|
+
t5
|
|
20442
20431
|
] });
|
|
20443
|
-
$[
|
|
20444
|
-
$[
|
|
20445
|
-
$[
|
|
20446
|
-
$[
|
|
20447
|
-
$[
|
|
20432
|
+
$[3] = className;
|
|
20433
|
+
$[4] = style;
|
|
20434
|
+
$[5] = t1;
|
|
20435
|
+
$[6] = t2;
|
|
20436
|
+
$[7] = t6;
|
|
20448
20437
|
} else {
|
|
20449
|
-
|
|
20438
|
+
t6 = $[7];
|
|
20450
20439
|
}
|
|
20451
|
-
return
|
|
20440
|
+
return t6;
|
|
20452
20441
|
}
|
|
20453
20442
|
const AppContext = React.createContext({
|
|
20454
20443
|
hasDrawer: false,
|
|
@@ -22782,8 +22771,15 @@
|
|
|
22782
22771
|
}), role: "tabpanel", children: /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsx(EntityJsonPreview, { values: formContext?.values ?? entity?.values ?? {} }) }) }, "json_view");
|
|
22783
22772
|
const subCollectionsViews = subcollections && subcollections.map((subcollection) => {
|
|
22784
22773
|
const subcollectionId = subcollection.id ?? subcollection.path;
|
|
22785
|
-
const newFullPath = usedEntity ? `${path}/${usedEntity?.id}/${removeInitialAndTrailingSlashes(
|
|
22774
|
+
const newFullPath = usedEntity ? `${path}/${usedEntity?.id}/${removeInitialAndTrailingSlashes(subcollection.path)}` : void 0;
|
|
22786
22775
|
const newFullIdPath = fullIdPath ? `${fullIdPath}/${usedEntity?.id}/${removeInitialAndTrailingSlashes(subcollectionId)}` : void 0;
|
|
22776
|
+
console.debug("Rendering subcollection", {
|
|
22777
|
+
subcollectionId,
|
|
22778
|
+
fullIdPath,
|
|
22779
|
+
newFullPath,
|
|
22780
|
+
newFullIdPath,
|
|
22781
|
+
selectedTab
|
|
22782
|
+
});
|
|
22787
22783
|
if (selectedTab !== subcollectionId) return null;
|
|
22788
22784
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex-1 h-full overflow-auto w-full", role: "tabpanel", children: [
|
|
22789
22785
|
globalLoading && /* @__PURE__ */ jsxRuntime.jsx(CircularProgressCenter, {}),
|
|
@@ -22806,7 +22802,7 @@
|
|
|
22806
22802
|
/* @__PURE__ */ jsxRuntime.jsx(EntityView, { className: "px-8 h-full overflow-auto", entity, path, collection }),
|
|
22807
22803
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-16" })
|
|
22808
22804
|
] }) }) : null;
|
|
22809
|
-
const entityView = /* @__PURE__ */ jsxRuntime.jsx(EntityForm, { collection, path, entityId: entityId ?? usedEntity?.id, onValuesModified, entity, initialDirtyValues: cachedDirtyValues, openEntityMode: layout, forceActionsAtTheBottom: actionsAtTheBottom, initialStatus: status, className: ui.cls((!mainViewVisible || !canEdit) && !selectedSecondaryForm ? "hidden" : "", formProps?.className), EntityFormActionsComponent: EntityEditViewFormActions, disabled: !canEdit, ...formProps, onEntityChange: (entity_0) => {
|
|
22805
|
+
const entityView = /* @__PURE__ */ jsxRuntime.jsx(EntityForm, { fullIdPath, collection, path, entityId: entityId ?? usedEntity?.id, onValuesModified, entity, initialDirtyValues: cachedDirtyValues, openEntityMode: layout, forceActionsAtTheBottom: actionsAtTheBottom, initialStatus: status, className: ui.cls((!mainViewVisible || !canEdit) && !selectedSecondaryForm ? "hidden" : "", formProps?.className), EntityFormActionsComponent: EntityEditViewFormActions, disabled: !canEdit, ...formProps, onEntityChange: (entity_0) => {
|
|
22810
22806
|
setUsedEntity(entity_0);
|
|
22811
22807
|
formProps?.onEntityChange?.(entity_0);
|
|
22812
22808
|
}, onStatusChange: (status_0) => {
|
|
@@ -22864,6 +22860,7 @@
|
|
|
22864
22860
|
allowFullScreen = true,
|
|
22865
22861
|
path,
|
|
22866
22862
|
entityId,
|
|
22863
|
+
fullIdPath,
|
|
22867
22864
|
formProps
|
|
22868
22865
|
} = props;
|
|
22869
22866
|
const {
|
|
@@ -22892,6 +22889,7 @@
|
|
|
22892
22889
|
sideEntityController.replace({
|
|
22893
22890
|
path: params.path,
|
|
22894
22891
|
entityId: params.entityId,
|
|
22892
|
+
fullIdPath: props.fullIdPath,
|
|
22895
22893
|
selectedTab: params.selectedTab,
|
|
22896
22894
|
updateUrl: true,
|
|
22897
22895
|
collection: params.collection
|
|
@@ -22929,21 +22927,21 @@
|
|
|
22929
22927
|
if (!props || !collection) {
|
|
22930
22928
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full" });
|
|
22931
22929
|
}
|
|
22932
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsx(EntityEditView, { ...props, layout: "side_panel", collection, parentCollectionIds, onValuesModified, onSaved: onUpdate, barActions: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
22930
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsx(EntityEditView, { ...props, fullIdPath, layout: "side_panel", collection, parentCollectionIds, onValuesModified, onSaved: onUpdate, barActions: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
22933
22931
|
/* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { className: "self-center", onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsx(ui.CloseIcon, { size: "small" }) }),
|
|
22934
22932
|
allowFullScreen && /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { className: "self-center", onClick: () => {
|
|
22935
22933
|
if (entityId) navigate(location.pathname);
|
|
22936
22934
|
else navigate(location.pathname + "#new");
|
|
22937
22935
|
}, children: /* @__PURE__ */ jsxRuntime.jsx(ui.OpenInFullIcon, { size: "small" }) })
|
|
22938
22936
|
] }), onTabChange: ({
|
|
22939
|
-
path: path_0,
|
|
22940
22937
|
entityId: entityId_0,
|
|
22941
22938
|
selectedTab,
|
|
22942
22939
|
collection: collection_0
|
|
22943
22940
|
}) => {
|
|
22944
22941
|
sideEntityController.replace({
|
|
22945
|
-
path
|
|
22942
|
+
path,
|
|
22946
22943
|
entityId: entityId_0,
|
|
22944
|
+
fullIdPath: props.fullIdPath,
|
|
22947
22945
|
selectedTab,
|
|
22948
22946
|
updateUrl: true,
|
|
22949
22947
|
collection: collection_0
|
|
@@ -23100,16 +23098,18 @@
|
|
|
23100
23098
|
});
|
|
23101
23099
|
let sidePanel = void 0;
|
|
23102
23100
|
let lastCollectionPath = "";
|
|
23101
|
+
let lastCollectionId = void 0;
|
|
23103
23102
|
for (let i = 0; i < navigationViewsForPath.length; i++) {
|
|
23104
23103
|
const navigationEntry = navigationViewsForPath[i];
|
|
23105
23104
|
if (navigationEntry.type === "collection") {
|
|
23106
23105
|
lastCollectionPath = navigationEntry.path;
|
|
23106
|
+
lastCollectionId = navigationEntry.collection.id;
|
|
23107
23107
|
}
|
|
23108
23108
|
const previousEntry = navigationViewsForPath[i - 1];
|
|
23109
23109
|
if (navigationEntry.type === "entity") {
|
|
23110
23110
|
sidePanel = {
|
|
23111
23111
|
path: navigationEntry.path,
|
|
23112
|
-
|
|
23112
|
+
fullIdPath: navigationEntry.fullIdPath,
|
|
23113
23113
|
entityId: navigationEntry.entityId,
|
|
23114
23114
|
copy: false,
|
|
23115
23115
|
width: navigationEntry.parentCollection?.sideDialogWidth
|
|
@@ -23127,7 +23127,7 @@
|
|
|
23127
23127
|
if (newFlag) {
|
|
23128
23128
|
sidePanel = {
|
|
23129
23129
|
path: lastCollectionPath,
|
|
23130
|
-
|
|
23130
|
+
fullIdPath: lastCollectionId,
|
|
23131
23131
|
copy: false
|
|
23132
23132
|
};
|
|
23133
23133
|
}
|
|
@@ -23135,7 +23135,7 @@
|
|
|
23135
23135
|
}
|
|
23136
23136
|
const propsToSidePanel = (props, buildUrlCollectionPath, resolveIdsFrom, smallLayout, customizationController, authController) => {
|
|
23137
23137
|
const collectionPath = removeInitialAndTrailingSlashes(props.path);
|
|
23138
|
-
const
|
|
23138
|
+
const urlPath = props.entityId ? buildUrlCollectionPath(`${collectionPath}/${props.entityId}${props.selectedTab ? "/" + props.selectedTab : ""}#${SIDE_URL_HASH}`) : buildUrlCollectionPath(`${collectionPath}#${NEW_URL_HASH}`);
|
|
23139
23139
|
const resolvedPanelProps = {
|
|
23140
23140
|
...props,
|
|
23141
23141
|
formProps: props.formProps
|
|
@@ -23144,7 +23144,7 @@
|
|
|
23144
23144
|
return {
|
|
23145
23145
|
key: `${props.path}/${props.entityId}`,
|
|
23146
23146
|
component: /* @__PURE__ */ jsxRuntime.jsx(EntitySidePanel, { ...resolvedPanelProps }),
|
|
23147
|
-
urlPath
|
|
23147
|
+
urlPath,
|
|
23148
23148
|
parentUrlPath: buildUrlCollectionPath(collectionPath),
|
|
23149
23149
|
width: entityViewWidth,
|
|
23150
23150
|
onClose: props.onClose,
|
|
@@ -24616,7 +24616,7 @@
|
|
|
24616
24616
|
} else {
|
|
24617
24617
|
t8 = $[22];
|
|
24618
24618
|
}
|
|
24619
|
-
t62 = /* @__PURE__ */ jsxRuntime.jsx(EntityCollectionView, { isSubCollection: false, parentCollectionIds: t8, fullPath: collection.id, updateUrl: true, ...collection, Actions: toArray(collection.Actions) }, `collection_view_${collection.id ?? collection.path}`);
|
|
24619
|
+
t62 = /* @__PURE__ */ jsxRuntime.jsx(EntityCollectionView, { isSubCollection: false, parentCollectionIds: t8, fullPath: collection.path, fullIdPath: collection.id, updateUrl: true, ...collection, Actions: toArray(collection.Actions) }, `collection_view_${collection.id ?? collection.path}`);
|
|
24620
24620
|
}
|
|
24621
24621
|
$[18] = navigation;
|
|
24622
24622
|
$[19] = navigationEntries;
|
|
@@ -24656,7 +24656,7 @@
|
|
|
24656
24656
|
} else {
|
|
24657
24657
|
t8 = $[27];
|
|
24658
24658
|
}
|
|
24659
|
-
t62 = /* @__PURE__ */ jsxRuntime.jsx(EntityCollectionView, { fullIdPath: collection_0.id, isSubCollection: false, parentCollectionIds: t8, fullPath: collection_0.
|
|
24659
|
+
t62 = /* @__PURE__ */ jsxRuntime.jsx(EntityCollectionView, { fullIdPath: collection_0.id, isSubCollection: false, parentCollectionIds: t8, fullPath: collection_0.path, updateUrl: true, ...collection_0, Actions: toArray(collection_0.Actions) }, `collection_view_${collection_0.id ?? collection_0.path}`);
|
|
24660
24660
|
}
|
|
24661
24661
|
$[23] = navigation;
|
|
24662
24662
|
$[24] = navigationEntries;
|