@strapi/content-manager 0.0.0-experimental.f74ae50eea1ce95176f088dba837e95b60fa2a4d → 0.0.0-experimental.f8a68bc03b751aa0a66c4dcfaf83553c9b6adf2b
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/_chunks/{ComponentConfigurationPage-7-qB29e7.mjs → ComponentConfigurationPage-B2g3icXu.mjs} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-7-qB29e7.mjs.map → ComponentConfigurationPage-B2g3icXu.mjs.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-DP7AC0UU.js → ComponentConfigurationPage-CzDn8Uxh.js} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-DP7AC0UU.js.map → ComponentConfigurationPage-CzDn8Uxh.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-DITVliEI.js → EditConfigurationPage-Bcbi6r5y.js} +3 -3
- package/dist/_chunks/{EditConfigurationPage-DITVliEI.js.map → EditConfigurationPage-Bcbi6r5y.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-CI4XoymK.mjs → EditConfigurationPage-DSA1zONV.mjs} +3 -3
- package/dist/_chunks/{EditConfigurationPage-CI4XoymK.mjs.map → EditConfigurationPage-DSA1zONV.mjs.map} +1 -1
- package/dist/_chunks/{EditViewPage-CUS2EAhB.js → EditViewPage-BvcMXaP2.js} +10 -4
- package/dist/_chunks/EditViewPage-BvcMXaP2.js.map +1 -0
- package/dist/_chunks/{EditViewPage-Dzpno8xI.mjs → EditViewPage-Ca2EmJpb.mjs} +10 -4
- package/dist/_chunks/EditViewPage-Ca2EmJpb.mjs.map +1 -0
- package/dist/_chunks/{Field-B_jG_EV9.mjs → Field-BEYkgCZ0.mjs} +41 -9
- package/dist/_chunks/Field-BEYkgCZ0.mjs.map +1 -0
- package/dist/_chunks/{Field-CtUU1Fg8.js → Field-CmaWxdpf.js} +41 -9
- package/dist/_chunks/Field-CmaWxdpf.js.map +1 -0
- package/dist/_chunks/{Form-BXHao2mZ.mjs → Form-BJVbU6w4.mjs} +3 -3
- package/dist/_chunks/Form-BJVbU6w4.mjs.map +1 -0
- package/dist/_chunks/{Form-DTqO0ymI.js → Form-DAUpPBVM.js} +3 -3
- package/dist/_chunks/Form-DAUpPBVM.js.map +1 -0
- package/dist/_chunks/{History-C_uSGzO5.js → History-Bw9vfT1k.js} +23 -10
- package/dist/_chunks/History-Bw9vfT1k.js.map +1 -0
- package/dist/_chunks/{History-2Ah2CQ4T.mjs → History-M6Pk9CoY.mjs} +24 -11
- package/dist/_chunks/History-M6Pk9CoY.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-BjSJlaoC.mjs → ListConfigurationPage-D7ior2zq.mjs} +2 -2
- package/dist/_chunks/{ListConfigurationPage-BjSJlaoC.mjs.map → ListConfigurationPage-D7ior2zq.mjs.map} +1 -1
- package/dist/_chunks/{ListConfigurationPage-nyuP7OSy.js → ListConfigurationPage-DBVqF5fc.js} +2 -2
- package/dist/_chunks/{ListConfigurationPage-nyuP7OSy.js.map → ListConfigurationPage-DBVqF5fc.js.map} +1 -1
- package/dist/_chunks/{ListViewPage-B75x3nz2.mjs → ListViewPage-BH37wONY.mjs} +3 -3
- package/dist/_chunks/{ListViewPage-B75x3nz2.mjs.map → ListViewPage-BH37wONY.mjs.map} +1 -1
- package/dist/_chunks/{ListViewPage-DHgHD8Xg.js → ListViewPage-MZu-8OKX.js} +3 -3
- package/dist/_chunks/{ListViewPage-DHgHD8Xg.js.map → ListViewPage-MZu-8OKX.js.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-CDUKdZ7d.js → NoContentTypePage-C9lRMTCa.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-CDUKdZ7d.js.map → NoContentTypePage-C9lRMTCa.js.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-DUacQSyF.mjs → NoContentTypePage-DRp7Aem_.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-DUacQSyF.mjs.map → NoContentTypePage-DRp7Aem_.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-zwIZydDI.js → NoPermissionsPage-COs61PpB.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-zwIZydDI.js.map → NoPermissionsPage-COs61PpB.js.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-SFllMekk.mjs → NoPermissionsPage-CzhRt5CA.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-SFllMekk.mjs.map → NoPermissionsPage-CzhRt5CA.mjs.map} +1 -1
- package/dist/_chunks/{Relations-D2NRW8fC.mjs → Relations-68XxIzPI.mjs} +42 -25
- package/dist/_chunks/Relations-68XxIzPI.mjs.map +1 -0
- package/dist/_chunks/{Relations-NFLaRNPr.js → Relations-CsGlulU_.js} +42 -25
- package/dist/_chunks/Relations-CsGlulU_.js.map +1 -0
- package/dist/_chunks/{en-BlhnxQfj.js → en-Bm0D0IWz.js} +7 -7
- package/dist/_chunks/{en-BlhnxQfj.js.map → en-Bm0D0IWz.js.map} +1 -1
- package/dist/_chunks/{en-C8YBvRrK.mjs → en-DKV44jRb.mjs} +7 -7
- package/dist/_chunks/{en-C8YBvRrK.mjs.map → en-DKV44jRb.mjs.map} +1 -1
- package/dist/_chunks/{index-C9HxCo5R.mjs → index-CsfwpRfc.mjs} +102 -77
- package/dist/_chunks/index-CsfwpRfc.mjs.map +1 -0
- package/dist/_chunks/{index-ovJRE1FM.js → index-oDq3VO9j.js} +102 -76
- package/dist/_chunks/index-oDq3VO9j.js.map +1 -0
- package/dist/_chunks/{layout-DaUjDiWQ.mjs → layout-C5uSVTqi.mjs} +3 -3
- package/dist/_chunks/{layout-DaUjDiWQ.mjs.map → layout-C5uSVTqi.mjs.map} +1 -1
- package/dist/_chunks/{layout-UNWstw_s.js → layout-Euka-kfv.js} +3 -3
- package/dist/_chunks/{layout-UNWstw_s.js.map → layout-Euka-kfv.js.map} +1 -1
- package/dist/_chunks/{relations-D8iFAeRu.mjs → relations-BpHVgFuV.mjs} +2 -2
- package/dist/_chunks/{relations-D8iFAeRu.mjs.map → relations-BpHVgFuV.mjs.map} +1 -1
- package/dist/_chunks/{relations-NN3coOG5.js → relations-DG7kmxa0.js} +2 -2
- package/dist/_chunks/{relations-NN3coOG5.js.map → relations-DG7kmxa0.js.map} +1 -1
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/server/index.js +21 -11
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +21 -11
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
- package/dist/server/src/controllers/relations.d.ts.map +1 -1
- package/dist/server/src/history/services/history.d.ts.map +1 -1
- package/package.json +7 -7
- package/dist/_chunks/EditViewPage-CUS2EAhB.js.map +0 -1
- package/dist/_chunks/EditViewPage-Dzpno8xI.mjs.map +0 -1
- package/dist/_chunks/Field-B_jG_EV9.mjs.map +0 -1
- package/dist/_chunks/Field-CtUU1Fg8.js.map +0 -1
- package/dist/_chunks/Form-BXHao2mZ.mjs.map +0 -1
- package/dist/_chunks/Form-DTqO0ymI.js.map +0 -1
- package/dist/_chunks/History-2Ah2CQ4T.mjs.map +0 -1
- package/dist/_chunks/History-C_uSGzO5.js.map +0 -1
- package/dist/_chunks/Relations-D2NRW8fC.mjs.map +0 -1
- package/dist/_chunks/Relations-NFLaRNPr.js.map +0 -1
- package/dist/_chunks/index-C9HxCo5R.mjs.map +0 -1
- package/dist/_chunks/index-ovJRE1FM.js.map +0 -1
@@ -4,6 +4,7 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const strapiAdmin = require("@strapi/admin/strapi-admin");
|
5
5
|
const React = require("react");
|
6
6
|
const designSystem = require("@strapi/design-system");
|
7
|
+
const mapValues = require("lodash/fp/mapValues");
|
7
8
|
const reactIntl = require("react-intl");
|
8
9
|
const reactRouterDom = require("react-router-dom");
|
9
10
|
const yup = require("yup");
|
@@ -32,6 +33,7 @@ function _interopNamespace(e) {
|
|
32
33
|
return Object.freeze(n);
|
33
34
|
}
|
34
35
|
const React__namespace = /* @__PURE__ */ _interopNamespace(React);
|
36
|
+
const mapValues__default = /* @__PURE__ */ _interopDefault(mapValues);
|
35
37
|
const yup__namespace = /* @__PURE__ */ _interopNamespace(yup);
|
36
38
|
const pipe__default = /* @__PURE__ */ _interopDefault(pipe);
|
37
39
|
const __variableDynamicImportRuntimeHelper = (glob, path) => {
|
@@ -121,6 +123,7 @@ const DocumentRBAC = ({ children, permissions }) => {
|
|
121
123
|
if (!slug) {
|
122
124
|
throw new Error("Cannot find the slug param in the URL");
|
123
125
|
}
|
126
|
+
const [{ rawQuery }] = strapiAdmin.useQueryParams();
|
124
127
|
const userPermissions = strapiAdmin.useAuth("DocumentRBAC", (state) => state.permissions);
|
125
128
|
const contentTypePermissions = React__namespace.useMemo(() => {
|
126
129
|
const contentTypePermissions2 = userPermissions.filter(
|
@@ -131,7 +134,14 @@ const DocumentRBAC = ({ children, permissions }) => {
|
|
131
134
|
return { ...acc, [action]: [permission] };
|
132
135
|
}, {});
|
133
136
|
}, [slug, userPermissions]);
|
134
|
-
const { isLoading, allowedActions } = strapiAdmin.useRBAC(
|
137
|
+
const { isLoading, allowedActions } = strapiAdmin.useRBAC(
|
138
|
+
contentTypePermissions,
|
139
|
+
permissions ?? void 0,
|
140
|
+
// TODO: useRBAC context should be typed and built differently
|
141
|
+
// We are passing raw query as context to the hook so that it can
|
142
|
+
// rely on the locale provided from DocumentRBAC for its permission calculations.
|
143
|
+
rawQuery
|
144
|
+
);
|
135
145
|
const canCreateFields = !isLoading && allowedActions.canCreate ? extractAndDedupeFields(contentTypePermissions.create) : [];
|
136
146
|
const canReadFields = !isLoading && allowedActions.canRead ? extractAndDedupeFields(contentTypePermissions.read) : [];
|
137
147
|
const canUpdateFields = !isLoading && allowedActions.canUpdate ? extractAndDedupeFields(contentTypePermissions.update) : [];
|
@@ -482,6 +492,24 @@ const buildValidParams = (query) => {
|
|
482
492
|
const isBaseQueryError = (error) => {
|
483
493
|
return error.name !== void 0;
|
484
494
|
};
|
495
|
+
const arrayValidator = (attribute, options) => ({
|
496
|
+
message: strapiAdmin.translatedErrors.required,
|
497
|
+
test(value) {
|
498
|
+
if (options.status === "draft") {
|
499
|
+
return true;
|
500
|
+
}
|
501
|
+
if (!attribute.required) {
|
502
|
+
return true;
|
503
|
+
}
|
504
|
+
if (!value) {
|
505
|
+
return false;
|
506
|
+
}
|
507
|
+
if (Array.isArray(value) && value.length === 0) {
|
508
|
+
return false;
|
509
|
+
}
|
510
|
+
return true;
|
511
|
+
}
|
512
|
+
});
|
485
513
|
const createYupSchema = (attributes = {}, components = {}, options = { status: null }) => {
|
486
514
|
const createModelSchema = (attributes2) => yup__namespace.object().shape(
|
487
515
|
Object.entries(attributes2).reduce((acc, [name, attribute]) => {
|
@@ -489,6 +517,7 @@ const createYupSchema = (attributes = {}, components = {}, options = { status: n
|
|
489
517
|
return acc;
|
490
518
|
}
|
491
519
|
const validations = [
|
520
|
+
addNullableValidation,
|
492
521
|
addRequiredValidation,
|
493
522
|
addMinLengthValidation,
|
494
523
|
addMaxLengthValidation,
|
@@ -505,12 +534,12 @@ const createYupSchema = (attributes = {}, components = {}, options = { status: n
|
|
505
534
|
...acc,
|
506
535
|
[name]: transformSchema(
|
507
536
|
yup__namespace.array().of(createModelSchema(attributes3).nullable(false))
|
508
|
-
)
|
537
|
+
).test(arrayValidator(attribute, options))
|
509
538
|
};
|
510
539
|
} else {
|
511
540
|
return {
|
512
541
|
...acc,
|
513
|
-
[name]: transformSchema(createModelSchema(attributes3))
|
542
|
+
[name]: transformSchema(createModelSchema(attributes3).nullable())
|
514
543
|
};
|
515
544
|
}
|
516
545
|
}
|
@@ -532,7 +561,7 @@ const createYupSchema = (attributes = {}, components = {}, options = { status: n
|
|
532
561
|
}
|
533
562
|
)
|
534
563
|
)
|
535
|
-
)
|
564
|
+
).test(arrayValidator(attribute, options))
|
536
565
|
};
|
537
566
|
case "relation":
|
538
567
|
return {
|
@@ -630,17 +659,17 @@ const nullableSchema = (schema) => {
|
|
630
659
|
schema
|
631
660
|
);
|
632
661
|
};
|
662
|
+
const addNullableValidation = () => (schema) => {
|
663
|
+
return nullableSchema(schema);
|
664
|
+
};
|
633
665
|
const addRequiredValidation = (attribute, options) => (schema) => {
|
634
|
-
if (options.status === "draft") {
|
635
|
-
return
|
636
|
-
}
|
637
|
-
if ((attribute.type === "component" && attribute.repeatable || attribute.type === "dynamiczone") && attribute.required && "min" in schema) {
|
638
|
-
return schema.min(1, strapiAdmin.translatedErrors.required);
|
666
|
+
if (options.status === "draft" || !attribute.required) {
|
667
|
+
return schema;
|
639
668
|
}
|
640
|
-
if (attribute.required &&
|
669
|
+
if (attribute.required && "required" in schema) {
|
641
670
|
return schema.required(strapiAdmin.translatedErrors.required);
|
642
671
|
}
|
643
|
-
return
|
672
|
+
return schema;
|
644
673
|
};
|
645
674
|
const addMinLengthValidation = (attribute, options) => (schema) => {
|
646
675
|
if (options.status === "draft") {
|
@@ -668,31 +697,12 @@ const addMaxLengthValidation = (attribute) => (schema) => {
|
|
668
697
|
return schema;
|
669
698
|
};
|
670
699
|
const addMinValidation = (attribute, options) => (schema) => {
|
671
|
-
if ("
|
700
|
+
if (options.status === "draft") {
|
701
|
+
return schema;
|
702
|
+
}
|
703
|
+
if ("min" in attribute && "min" in schema) {
|
672
704
|
const min = toInteger(attribute.min);
|
673
|
-
if (
|
674
|
-
if (options.status !== "draft" && !attribute.required && "test" in schema && min) {
|
675
|
-
return schema.test(
|
676
|
-
"custom-min",
|
677
|
-
{
|
678
|
-
...strapiAdmin.translatedErrors.min,
|
679
|
-
values: {
|
680
|
-
min: attribute.min
|
681
|
-
}
|
682
|
-
},
|
683
|
-
(value) => {
|
684
|
-
if (!value) {
|
685
|
-
return true;
|
686
|
-
}
|
687
|
-
if (Array.isArray(value) && value.length === 0) {
|
688
|
-
return true;
|
689
|
-
}
|
690
|
-
return value.length >= min;
|
691
|
-
}
|
692
|
-
);
|
693
|
-
}
|
694
|
-
}
|
695
|
-
if ("min" in schema && min) {
|
705
|
+
if (min) {
|
696
706
|
return schema.min(min, {
|
697
707
|
...strapiAdmin.translatedErrors.min,
|
698
708
|
values: {
|
@@ -1187,16 +1197,18 @@ const useDoc = () => {
|
|
1187
1197
|
if (!slug) {
|
1188
1198
|
throw new Error("Could not find model in url params");
|
1189
1199
|
}
|
1200
|
+
const document = useDocument(
|
1201
|
+
{ documentId: origin || id, model: slug, collectionType, params },
|
1202
|
+
{
|
1203
|
+
skip: id === "create" || !origin && !id && collectionType !== SINGLE_TYPES
|
1204
|
+
}
|
1205
|
+
);
|
1206
|
+
const returnId = origin || id === "create" ? void 0 : id;
|
1190
1207
|
return {
|
1191
1208
|
collectionType,
|
1192
1209
|
model: slug,
|
1193
|
-
id:
|
1194
|
-
...
|
1195
|
-
{ documentId: origin || id, model: slug, collectionType, params },
|
1196
|
-
{
|
1197
|
-
skip: id === "create" || !origin && !id && collectionType !== SINGLE_TYPES
|
1198
|
-
}
|
1199
|
-
)
|
1210
|
+
id: returnId,
|
1211
|
+
...document
|
1200
1212
|
};
|
1201
1213
|
};
|
1202
1214
|
const useContentManagerContext = () => {
|
@@ -1676,7 +1688,7 @@ const useDocumentActions = () => {
|
|
1676
1688
|
};
|
1677
1689
|
};
|
1678
1690
|
const ProtectedHistoryPage = React.lazy(
|
1679
|
-
() => Promise.resolve().then(() => require("./History-
|
1691
|
+
() => Promise.resolve().then(() => require("./History-Bw9vfT1k.js")).then((mod) => ({ default: mod.ProtectedHistoryPage }))
|
1680
1692
|
);
|
1681
1693
|
const routes$1 = [
|
1682
1694
|
{
|
@@ -1689,31 +1701,31 @@ const routes$1 = [
|
|
1689
1701
|
}
|
1690
1702
|
];
|
1691
1703
|
const ProtectedEditViewPage = React.lazy(
|
1692
|
-
() => Promise.resolve().then(() => require("./EditViewPage-
|
1704
|
+
() => Promise.resolve().then(() => require("./EditViewPage-BvcMXaP2.js")).then((mod) => ({ default: mod.ProtectedEditViewPage }))
|
1693
1705
|
);
|
1694
1706
|
const ProtectedListViewPage = React.lazy(
|
1695
|
-
() => Promise.resolve().then(() => require("./ListViewPage-
|
1707
|
+
() => Promise.resolve().then(() => require("./ListViewPage-MZu-8OKX.js")).then((mod) => ({ default: mod.ProtectedListViewPage }))
|
1696
1708
|
);
|
1697
1709
|
const ProtectedListConfiguration = React.lazy(
|
1698
|
-
() => Promise.resolve().then(() => require("./ListConfigurationPage-
|
1710
|
+
() => Promise.resolve().then(() => require("./ListConfigurationPage-DBVqF5fc.js")).then((mod) => ({
|
1699
1711
|
default: mod.ProtectedListConfiguration
|
1700
1712
|
}))
|
1701
1713
|
);
|
1702
1714
|
const ProtectedEditConfigurationPage = React.lazy(
|
1703
|
-
() => Promise.resolve().then(() => require("./EditConfigurationPage-
|
1715
|
+
() => Promise.resolve().then(() => require("./EditConfigurationPage-Bcbi6r5y.js")).then((mod) => ({
|
1704
1716
|
default: mod.ProtectedEditConfigurationPage
|
1705
1717
|
}))
|
1706
1718
|
);
|
1707
1719
|
const ProtectedComponentConfigurationPage = React.lazy(
|
1708
|
-
() => Promise.resolve().then(() => require("./ComponentConfigurationPage-
|
1720
|
+
() => Promise.resolve().then(() => require("./ComponentConfigurationPage-CzDn8Uxh.js")).then((mod) => ({
|
1709
1721
|
default: mod.ProtectedComponentConfigurationPage
|
1710
1722
|
}))
|
1711
1723
|
);
|
1712
1724
|
const NoPermissions = React.lazy(
|
1713
|
-
() => Promise.resolve().then(() => require("./NoPermissionsPage-
|
1725
|
+
() => Promise.resolve().then(() => require("./NoPermissionsPage-COs61PpB.js")).then((mod) => ({ default: mod.NoPermissions }))
|
1714
1726
|
);
|
1715
1727
|
const NoContentType = React.lazy(
|
1716
|
-
() => Promise.resolve().then(() => require("./NoContentTypePage-
|
1728
|
+
() => Promise.resolve().then(() => require("./NoContentTypePage-C9lRMTCa.js")).then((mod) => ({ default: mod.NoContentType }))
|
1717
1729
|
);
|
1718
1730
|
const CollectionTypePages = () => {
|
1719
1731
|
const { collectionType } = reactRouterDom.useParams();
|
@@ -2067,6 +2079,18 @@ const DocumentActionModal = ({
|
|
2067
2079
|
typeof Footer === "function" ? /* @__PURE__ */ jsxRuntime.jsx(Footer, { onClose: handleClose }) : Footer
|
2068
2080
|
] }) });
|
2069
2081
|
};
|
2082
|
+
const transformData = (data) => {
|
2083
|
+
if (Array.isArray(data)) {
|
2084
|
+
return data.map(transformData);
|
2085
|
+
}
|
2086
|
+
if (typeof data === "object" && data !== null) {
|
2087
|
+
if ("apiData" in data) {
|
2088
|
+
return data.apiData;
|
2089
|
+
}
|
2090
|
+
return mapValues__default.default(transformData)(data);
|
2091
|
+
}
|
2092
|
+
return data;
|
2093
|
+
};
|
2070
2094
|
const PublishAction$1 = ({
|
2071
2095
|
activeTab,
|
2072
2096
|
documentId,
|
@@ -2160,7 +2184,9 @@ const PublishAction$1 = ({
|
|
2160
2184
|
const performPublish = async () => {
|
2161
2185
|
setSubmitting(true);
|
2162
2186
|
try {
|
2163
|
-
const { errors } = await validate(
|
2187
|
+
const { errors } = await validate(true, {
|
2188
|
+
status: "published"
|
2189
|
+
});
|
2164
2190
|
if (errors) {
|
2165
2191
|
toggleNotification({
|
2166
2192
|
type: "danger",
|
@@ -2178,7 +2204,7 @@ const PublishAction$1 = ({
|
|
2178
2204
|
documentId,
|
2179
2205
|
params
|
2180
2206
|
},
|
2181
|
-
formValues
|
2207
|
+
transformData(formValues)
|
2182
2208
|
);
|
2183
2209
|
if ("data" in res && collectionType !== SINGLE_TYPES) {
|
2184
2210
|
navigate({
|
@@ -2274,18 +2300,18 @@ const UpdateAction = ({
|
|
2274
2300
|
onClick: async () => {
|
2275
2301
|
setSubmitting(true);
|
2276
2302
|
try {
|
2277
|
-
|
2278
|
-
|
2279
|
-
|
2280
|
-
|
2281
|
-
|
2282
|
-
|
2283
|
-
|
2284
|
-
|
2285
|
-
|
2286
|
-
})
|
2287
|
-
|
2288
|
-
|
2303
|
+
const { errors } = await validate(true, {
|
2304
|
+
status: "draft"
|
2305
|
+
});
|
2306
|
+
if (errors) {
|
2307
|
+
toggleNotification({
|
2308
|
+
type: "danger",
|
2309
|
+
message: formatMessage({
|
2310
|
+
id: "content-manager.validation.error",
|
2311
|
+
defaultMessage: "There are validation errors in your document. Please fix them before saving."
|
2312
|
+
})
|
2313
|
+
});
|
2314
|
+
return;
|
2289
2315
|
}
|
2290
2316
|
if (isCloning) {
|
2291
2317
|
const res = await clone(
|
@@ -2294,7 +2320,7 @@ const UpdateAction = ({
|
|
2294
2320
|
documentId: cloneMatch.params.origin,
|
2295
2321
|
params
|
2296
2322
|
},
|
2297
|
-
document
|
2323
|
+
transformData(document)
|
2298
2324
|
);
|
2299
2325
|
if ("data" in res) {
|
2300
2326
|
navigate(
|
@@ -2315,7 +2341,7 @@ const UpdateAction = ({
|
|
2315
2341
|
documentId,
|
2316
2342
|
params
|
2317
2343
|
},
|
2318
|
-
document
|
2344
|
+
transformData(document)
|
2319
2345
|
);
|
2320
2346
|
if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
2321
2347
|
setErrors(formatValidationErrors(res.error));
|
@@ -2328,7 +2354,7 @@ const UpdateAction = ({
|
|
2328
2354
|
model,
|
2329
2355
|
params
|
2330
2356
|
},
|
2331
|
-
document
|
2357
|
+
transformData(document)
|
2332
2358
|
);
|
2333
2359
|
if ("data" in res && collectionType !== SINGLE_TYPES) {
|
2334
2360
|
navigate(
|
@@ -2667,12 +2693,12 @@ const Information = ({ activeTab }) => {
|
|
2667
2693
|
isDisplayed: !!publishDocument?.[PUBLISHED_AT_ATTRIBUTE_NAME],
|
2668
2694
|
label: formatMessage({
|
2669
2695
|
id: "content-manager.containers.edit.information.last-published.label",
|
2670
|
-
defaultMessage: "
|
2696
|
+
defaultMessage: "Published"
|
2671
2697
|
}),
|
2672
2698
|
value: formatMessage(
|
2673
2699
|
{
|
2674
2700
|
id: "content-manager.containers.edit.information.last-published.value",
|
2675
|
-
defaultMessage: `
|
2701
|
+
defaultMessage: `{time}{isAnonymous, select, true {} other { by {author}}}`
|
2676
2702
|
},
|
2677
2703
|
{
|
2678
2704
|
time: /* @__PURE__ */ jsxRuntime.jsx(RelativeTime, { timestamp: new Date(publishDocument?.[PUBLISHED_AT_ATTRIBUTE_NAME]) }),
|
@@ -2685,12 +2711,12 @@ const Information = ({ activeTab }) => {
|
|
2685
2711
|
isDisplayed: !!createAndUpdateDocument?.[UPDATED_AT_ATTRIBUTE_NAME],
|
2686
2712
|
label: formatMessage({
|
2687
2713
|
id: "content-manager.containers.edit.information.last-draft.label",
|
2688
|
-
defaultMessage: "
|
2714
|
+
defaultMessage: "Updated"
|
2689
2715
|
}),
|
2690
2716
|
value: formatMessage(
|
2691
2717
|
{
|
2692
2718
|
id: "content-manager.containers.edit.information.last-draft.value",
|
2693
|
-
defaultMessage: `
|
2719
|
+
defaultMessage: `{time}{isAnonymous, select, true {} other { by {author}}}`
|
2694
2720
|
},
|
2695
2721
|
{
|
2696
2722
|
time: /* @__PURE__ */ jsxRuntime.jsx(
|
@@ -2708,12 +2734,12 @@ const Information = ({ activeTab }) => {
|
|
2708
2734
|
isDisplayed: !!createAndUpdateDocument?.[CREATED_AT_ATTRIBUTE_NAME],
|
2709
2735
|
label: formatMessage({
|
2710
2736
|
id: "content-manager.containers.edit.information.document.label",
|
2711
|
-
defaultMessage: "
|
2737
|
+
defaultMessage: "Created"
|
2712
2738
|
}),
|
2713
2739
|
value: formatMessage(
|
2714
2740
|
{
|
2715
2741
|
id: "content-manager.containers.edit.information.document.value",
|
2716
|
-
defaultMessage: `
|
2742
|
+
defaultMessage: `{time}{isAnonymous, select, true {} other { by {author}}}`
|
2717
2743
|
},
|
2718
2744
|
{
|
2719
2745
|
time: /* @__PURE__ */ jsxRuntime.jsx(
|
@@ -4018,7 +4044,7 @@ const index = {
|
|
4018
4044
|
app.router.addRoute({
|
4019
4045
|
path: "content-manager/*",
|
4020
4046
|
lazy: async () => {
|
4021
|
-
const { Layout } = await Promise.resolve().then(() => require("./layout-
|
4047
|
+
const { Layout } = await Promise.resolve().then(() => require("./layout-Euka-kfv.js"));
|
4022
4048
|
return {
|
4023
4049
|
Component: Layout
|
4024
4050
|
};
|
@@ -4035,7 +4061,7 @@ const index = {
|
|
4035
4061
|
async registerTrads({ locales }) {
|
4036
4062
|
const importedTrads = await Promise.all(
|
4037
4063
|
locales.map((locale) => {
|
4038
|
-
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/ar.json": () => Promise.resolve().then(() => require("./ar-BUUWXIYu.js")), "./translations/ca.json": () => Promise.resolve().then(() => require("./ca-Cmk45QO6.js")), "./translations/cs.json": () => Promise.resolve().then(() => require("./cs-CkJy6B2v.js")), "./translations/de.json": () => Promise.resolve().then(() => require("./de-CCEmbAah.js")), "./translations/en.json": () => Promise.resolve().then(() => require("./en-
|
4064
|
+
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/ar.json": () => Promise.resolve().then(() => require("./ar-BUUWXIYu.js")), "./translations/ca.json": () => Promise.resolve().then(() => require("./ca-Cmk45QO6.js")), "./translations/cs.json": () => Promise.resolve().then(() => require("./cs-CkJy6B2v.js")), "./translations/de.json": () => Promise.resolve().then(() => require("./de-CCEmbAah.js")), "./translations/en.json": () => Promise.resolve().then(() => require("./en-Bm0D0IWz.js")), "./translations/es.json": () => Promise.resolve().then(() => require("./es-EUonQTon.js")), "./translations/eu.json": () => Promise.resolve().then(() => require("./eu-VDH-3ovk.js")), "./translations/fr.json": () => Promise.resolve().then(() => require("./fr-B7kGGg3E.js")), "./translations/gu.json": () => Promise.resolve().then(() => require("./gu-BRmF601H.js")), "./translations/hi.json": () => Promise.resolve().then(() => require("./hi-CCJBptSq.js")), "./translations/hu.json": () => Promise.resolve().then(() => require("./hu-sNV_yLYy.js")), "./translations/id.json": () => Promise.resolve().then(() => require("./id-B5Ser98A.js")), "./translations/it.json": () => Promise.resolve().then(() => require("./it-DkBIs7vD.js")), "./translations/ja.json": () => Promise.resolve().then(() => require("./ja-CcFe8diO.js")), "./translations/ko.json": () => Promise.resolve().then(() => require("./ko-woFZPmLk.js")), "./translations/ml.json": () => Promise.resolve().then(() => require("./ml-C2W8N8k1.js")), "./translations/ms.json": () => Promise.resolve().then(() => require("./ms-BuFotyP_.js")), "./translations/nl.json": () => Promise.resolve().then(() => require("./nl-bbEOHChV.js")), "./translations/pl.json": () => Promise.resolve().then(() => require("./pl-uzwG-hk7.js")), "./translations/pt-BR.json": () => Promise.resolve().then(() => require("./pt-BR-BiOz37D9.js")), "./translations/pt.json": () => Promise.resolve().then(() => require("./pt-CeXQuq50.js")), "./translations/ru.json": () => Promise.resolve().then(() => require("./ru-BT3ybNny.js")), "./translations/sa.json": () => Promise.resolve().then(() => require("./sa-CcvkYInH.js")), "./translations/sk.json": () => Promise.resolve().then(() => require("./sk-CvY09Xjv.js")), "./translations/sv.json": () => Promise.resolve().then(() => require("./sv-MYDuzgvT.js")), "./translations/th.json": () => Promise.resolve().then(() => require("./th-D9_GfAjc.js")), "./translations/tr.json": () => Promise.resolve().then(() => require("./tr-D9UH-O_R.js")), "./translations/uk.json": () => Promise.resolve().then(() => require("./uk-C8EiqJY7.js")), "./translations/vi.json": () => Promise.resolve().then(() => require("./vi-CJlYDheJ.js")), "./translations/zh-Hans.json": () => Promise.resolve().then(() => require("./zh-Hans-9kOncHGw.js")), "./translations/zh.json": () => Promise.resolve().then(() => require("./zh-CQQfszqR.js")) }), `./translations/${locale}.json`).then(({ default: data }) => {
|
4039
4065
|
return {
|
4040
4066
|
data: prefixPluginTranslations(data, PLUGIN_ID),
|
4041
4067
|
locale
|
@@ -4094,4 +4120,4 @@ exports.useGetAllDocumentsQuery = useGetAllDocumentsQuery;
|
|
4094
4120
|
exports.useGetContentTypeConfigurationQuery = useGetContentTypeConfigurationQuery;
|
4095
4121
|
exports.useGetInitialDataQuery = useGetInitialDataQuery;
|
4096
4122
|
exports.useUpdateContentTypeConfigurationMutation = useUpdateContentTypeConfigurationMutation;
|
4097
|
-
//# sourceMappingURL=index-
|
4123
|
+
//# sourceMappingURL=index-oDq3VO9j.js.map
|