@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
@@ -1,9 +1,10 @@
|
|
1
1
|
import { More, Cross, WarningCircle, ListPlus, Pencil, Trash, Check, CrossCircle, CheckCircle, ArrowsCounterClockwise, ChevronRight, Duplicate, ClockCounterClockwise, Feather } from "@strapi/icons";
|
2
2
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
3
|
-
import { useStrapiApp, createContext, useAuth, useRBAC, Page, adminApi, translatedErrors, useNotification, useAPIErrorHandler,
|
3
|
+
import { useStrapiApp, createContext, useQueryParams, useAuth, useRBAC, Page, adminApi, translatedErrors, useNotification, useAPIErrorHandler, getYupValidationErrors, useForm, useTracking, useGuidedTour, BackButton, DescriptionComponentRenderer, useTable, Table } from "@strapi/admin/strapi-admin";
|
4
4
|
import * as React from "react";
|
5
5
|
import { lazy } from "react";
|
6
6
|
import { Button, Menu, VisuallyHidden, Flex, Typography, Dialog, Modal, Radio, Status, Box, SingleSelect, SingleSelectOption, IconButton, Loader, Tooltip, LinkButton } from "@strapi/design-system";
|
7
|
+
import mapValues from "lodash/fp/mapValues";
|
7
8
|
import { useIntl } from "react-intl";
|
8
9
|
import { useParams, useNavigate, Navigate, useMatch, useLocation, Link, NavLink } from "react-router-dom";
|
9
10
|
import * as yup from "yup";
|
@@ -100,6 +101,7 @@ const DocumentRBAC = ({ children, permissions }) => {
|
|
100
101
|
if (!slug) {
|
101
102
|
throw new Error("Cannot find the slug param in the URL");
|
102
103
|
}
|
104
|
+
const [{ rawQuery }] = useQueryParams();
|
103
105
|
const userPermissions = useAuth("DocumentRBAC", (state) => state.permissions);
|
104
106
|
const contentTypePermissions = React.useMemo(() => {
|
105
107
|
const contentTypePermissions2 = userPermissions.filter(
|
@@ -110,7 +112,14 @@ const DocumentRBAC = ({ children, permissions }) => {
|
|
110
112
|
return { ...acc, [action]: [permission] };
|
111
113
|
}, {});
|
112
114
|
}, [slug, userPermissions]);
|
113
|
-
const { isLoading, allowedActions } = useRBAC(
|
115
|
+
const { isLoading, allowedActions } = useRBAC(
|
116
|
+
contentTypePermissions,
|
117
|
+
permissions ?? void 0,
|
118
|
+
// TODO: useRBAC context should be typed and built differently
|
119
|
+
// We are passing raw query as context to the hook so that it can
|
120
|
+
// rely on the locale provided from DocumentRBAC for its permission calculations.
|
121
|
+
rawQuery
|
122
|
+
);
|
114
123
|
const canCreateFields = !isLoading && allowedActions.canCreate ? extractAndDedupeFields(contentTypePermissions.create) : [];
|
115
124
|
const canReadFields = !isLoading && allowedActions.canRead ? extractAndDedupeFields(contentTypePermissions.read) : [];
|
116
125
|
const canUpdateFields = !isLoading && allowedActions.canUpdate ? extractAndDedupeFields(contentTypePermissions.update) : [];
|
@@ -461,6 +470,24 @@ const buildValidParams = (query) => {
|
|
461
470
|
const isBaseQueryError = (error) => {
|
462
471
|
return error.name !== void 0;
|
463
472
|
};
|
473
|
+
const arrayValidator = (attribute, options) => ({
|
474
|
+
message: translatedErrors.required,
|
475
|
+
test(value) {
|
476
|
+
if (options.status === "draft") {
|
477
|
+
return true;
|
478
|
+
}
|
479
|
+
if (!attribute.required) {
|
480
|
+
return true;
|
481
|
+
}
|
482
|
+
if (!value) {
|
483
|
+
return false;
|
484
|
+
}
|
485
|
+
if (Array.isArray(value) && value.length === 0) {
|
486
|
+
return false;
|
487
|
+
}
|
488
|
+
return true;
|
489
|
+
}
|
490
|
+
});
|
464
491
|
const createYupSchema = (attributes = {}, components = {}, options = { status: null }) => {
|
465
492
|
const createModelSchema = (attributes2) => yup.object().shape(
|
466
493
|
Object.entries(attributes2).reduce((acc, [name, attribute]) => {
|
@@ -468,6 +495,7 @@ const createYupSchema = (attributes = {}, components = {}, options = { status: n
|
|
468
495
|
return acc;
|
469
496
|
}
|
470
497
|
const validations = [
|
498
|
+
addNullableValidation,
|
471
499
|
addRequiredValidation,
|
472
500
|
addMinLengthValidation,
|
473
501
|
addMaxLengthValidation,
|
@@ -484,12 +512,12 @@ const createYupSchema = (attributes = {}, components = {}, options = { status: n
|
|
484
512
|
...acc,
|
485
513
|
[name]: transformSchema(
|
486
514
|
yup.array().of(createModelSchema(attributes3).nullable(false))
|
487
|
-
)
|
515
|
+
).test(arrayValidator(attribute, options))
|
488
516
|
};
|
489
517
|
} else {
|
490
518
|
return {
|
491
519
|
...acc,
|
492
|
-
[name]: transformSchema(createModelSchema(attributes3))
|
520
|
+
[name]: transformSchema(createModelSchema(attributes3).nullable())
|
493
521
|
};
|
494
522
|
}
|
495
523
|
}
|
@@ -511,7 +539,7 @@ const createYupSchema = (attributes = {}, components = {}, options = { status: n
|
|
511
539
|
}
|
512
540
|
)
|
513
541
|
)
|
514
|
-
)
|
542
|
+
).test(arrayValidator(attribute, options))
|
515
543
|
};
|
516
544
|
case "relation":
|
517
545
|
return {
|
@@ -609,17 +637,17 @@ const nullableSchema = (schema) => {
|
|
609
637
|
schema
|
610
638
|
);
|
611
639
|
};
|
640
|
+
const addNullableValidation = () => (schema) => {
|
641
|
+
return nullableSchema(schema);
|
642
|
+
};
|
612
643
|
const addRequiredValidation = (attribute, options) => (schema) => {
|
613
|
-
if (options.status === "draft") {
|
614
|
-
return
|
615
|
-
}
|
616
|
-
if ((attribute.type === "component" && attribute.repeatable || attribute.type === "dynamiczone") && attribute.required && "min" in schema) {
|
617
|
-
return schema.min(1, translatedErrors.required);
|
644
|
+
if (options.status === "draft" || !attribute.required) {
|
645
|
+
return schema;
|
618
646
|
}
|
619
|
-
if (attribute.required &&
|
647
|
+
if (attribute.required && "required" in schema) {
|
620
648
|
return schema.required(translatedErrors.required);
|
621
649
|
}
|
622
|
-
return
|
650
|
+
return schema;
|
623
651
|
};
|
624
652
|
const addMinLengthValidation = (attribute, options) => (schema) => {
|
625
653
|
if (options.status === "draft") {
|
@@ -647,31 +675,12 @@ const addMaxLengthValidation = (attribute) => (schema) => {
|
|
647
675
|
return schema;
|
648
676
|
};
|
649
677
|
const addMinValidation = (attribute, options) => (schema) => {
|
650
|
-
if ("
|
678
|
+
if (options.status === "draft") {
|
679
|
+
return schema;
|
680
|
+
}
|
681
|
+
if ("min" in attribute && "min" in schema) {
|
651
682
|
const min = toInteger(attribute.min);
|
652
|
-
if (
|
653
|
-
if (options.status !== "draft" && !attribute.required && "test" in schema && min) {
|
654
|
-
return schema.test(
|
655
|
-
"custom-min",
|
656
|
-
{
|
657
|
-
...translatedErrors.min,
|
658
|
-
values: {
|
659
|
-
min: attribute.min
|
660
|
-
}
|
661
|
-
},
|
662
|
-
(value) => {
|
663
|
-
if (!value) {
|
664
|
-
return true;
|
665
|
-
}
|
666
|
-
if (Array.isArray(value) && value.length === 0) {
|
667
|
-
return true;
|
668
|
-
}
|
669
|
-
return value.length >= min;
|
670
|
-
}
|
671
|
-
);
|
672
|
-
}
|
673
|
-
}
|
674
|
-
if ("min" in schema && min) {
|
683
|
+
if (min) {
|
675
684
|
return schema.min(min, {
|
676
685
|
...translatedErrors.min,
|
677
686
|
values: {
|
@@ -1166,16 +1175,18 @@ const useDoc = () => {
|
|
1166
1175
|
if (!slug) {
|
1167
1176
|
throw new Error("Could not find model in url params");
|
1168
1177
|
}
|
1178
|
+
const document = useDocument(
|
1179
|
+
{ documentId: origin || id, model: slug, collectionType, params },
|
1180
|
+
{
|
1181
|
+
skip: id === "create" || !origin && !id && collectionType !== SINGLE_TYPES
|
1182
|
+
}
|
1183
|
+
);
|
1184
|
+
const returnId = origin || id === "create" ? void 0 : id;
|
1169
1185
|
return {
|
1170
1186
|
collectionType,
|
1171
1187
|
model: slug,
|
1172
|
-
id:
|
1173
|
-
...
|
1174
|
-
{ documentId: origin || id, model: slug, collectionType, params },
|
1175
|
-
{
|
1176
|
-
skip: id === "create" || !origin && !id && collectionType !== SINGLE_TYPES
|
1177
|
-
}
|
1178
|
-
)
|
1188
|
+
id: returnId,
|
1189
|
+
...document
|
1179
1190
|
};
|
1180
1191
|
};
|
1181
1192
|
const useContentManagerContext = () => {
|
@@ -1655,7 +1666,7 @@ const useDocumentActions = () => {
|
|
1655
1666
|
};
|
1656
1667
|
};
|
1657
1668
|
const ProtectedHistoryPage = lazy(
|
1658
|
-
() => import("./History-
|
1669
|
+
() => import("./History-M6Pk9CoY.mjs").then((mod) => ({ default: mod.ProtectedHistoryPage }))
|
1659
1670
|
);
|
1660
1671
|
const routes$1 = [
|
1661
1672
|
{
|
@@ -1668,31 +1679,31 @@ const routes$1 = [
|
|
1668
1679
|
}
|
1669
1680
|
];
|
1670
1681
|
const ProtectedEditViewPage = lazy(
|
1671
|
-
() => import("./EditViewPage-
|
1682
|
+
() => import("./EditViewPage-Ca2EmJpb.mjs").then((mod) => ({ default: mod.ProtectedEditViewPage }))
|
1672
1683
|
);
|
1673
1684
|
const ProtectedListViewPage = lazy(
|
1674
|
-
() => import("./ListViewPage-
|
1685
|
+
() => import("./ListViewPage-BH37wONY.mjs").then((mod) => ({ default: mod.ProtectedListViewPage }))
|
1675
1686
|
);
|
1676
1687
|
const ProtectedListConfiguration = lazy(
|
1677
|
-
() => import("./ListConfigurationPage-
|
1688
|
+
() => import("./ListConfigurationPage-D7ior2zq.mjs").then((mod) => ({
|
1678
1689
|
default: mod.ProtectedListConfiguration
|
1679
1690
|
}))
|
1680
1691
|
);
|
1681
1692
|
const ProtectedEditConfigurationPage = lazy(
|
1682
|
-
() => import("./EditConfigurationPage-
|
1693
|
+
() => import("./EditConfigurationPage-DSA1zONV.mjs").then((mod) => ({
|
1683
1694
|
default: mod.ProtectedEditConfigurationPage
|
1684
1695
|
}))
|
1685
1696
|
);
|
1686
1697
|
const ProtectedComponentConfigurationPage = lazy(
|
1687
|
-
() => import("./ComponentConfigurationPage-
|
1698
|
+
() => import("./ComponentConfigurationPage-B2g3icXu.mjs").then((mod) => ({
|
1688
1699
|
default: mod.ProtectedComponentConfigurationPage
|
1689
1700
|
}))
|
1690
1701
|
);
|
1691
1702
|
const NoPermissions = lazy(
|
1692
|
-
() => import("./NoPermissionsPage-
|
1703
|
+
() => import("./NoPermissionsPage-CzhRt5CA.mjs").then((mod) => ({ default: mod.NoPermissions }))
|
1693
1704
|
);
|
1694
1705
|
const NoContentType = lazy(
|
1695
|
-
() => import("./NoContentTypePage-
|
1706
|
+
() => import("./NoContentTypePage-DRp7Aem_.mjs").then((mod) => ({ default: mod.NoContentType }))
|
1696
1707
|
);
|
1697
1708
|
const CollectionTypePages = () => {
|
1698
1709
|
const { collectionType } = useParams();
|
@@ -2046,6 +2057,18 @@ const DocumentActionModal = ({
|
|
2046
2057
|
typeof Footer === "function" ? /* @__PURE__ */ jsx(Footer, { onClose: handleClose }) : Footer
|
2047
2058
|
] }) });
|
2048
2059
|
};
|
2060
|
+
const transformData = (data) => {
|
2061
|
+
if (Array.isArray(data)) {
|
2062
|
+
return data.map(transformData);
|
2063
|
+
}
|
2064
|
+
if (typeof data === "object" && data !== null) {
|
2065
|
+
if ("apiData" in data) {
|
2066
|
+
return data.apiData;
|
2067
|
+
}
|
2068
|
+
return mapValues(transformData)(data);
|
2069
|
+
}
|
2070
|
+
return data;
|
2071
|
+
};
|
2049
2072
|
const PublishAction$1 = ({
|
2050
2073
|
activeTab,
|
2051
2074
|
documentId,
|
@@ -2139,7 +2162,9 @@ const PublishAction$1 = ({
|
|
2139
2162
|
const performPublish = async () => {
|
2140
2163
|
setSubmitting(true);
|
2141
2164
|
try {
|
2142
|
-
const { errors } = await validate(
|
2165
|
+
const { errors } = await validate(true, {
|
2166
|
+
status: "published"
|
2167
|
+
});
|
2143
2168
|
if (errors) {
|
2144
2169
|
toggleNotification({
|
2145
2170
|
type: "danger",
|
@@ -2157,7 +2182,7 @@ const PublishAction$1 = ({
|
|
2157
2182
|
documentId,
|
2158
2183
|
params
|
2159
2184
|
},
|
2160
|
-
formValues
|
2185
|
+
transformData(formValues)
|
2161
2186
|
);
|
2162
2187
|
if ("data" in res && collectionType !== SINGLE_TYPES) {
|
2163
2188
|
navigate({
|
@@ -2253,18 +2278,18 @@ const UpdateAction = ({
|
|
2253
2278
|
onClick: async () => {
|
2254
2279
|
setSubmitting(true);
|
2255
2280
|
try {
|
2256
|
-
|
2257
|
-
|
2258
|
-
|
2259
|
-
|
2260
|
-
|
2261
|
-
|
2262
|
-
|
2263
|
-
|
2264
|
-
|
2265
|
-
})
|
2266
|
-
|
2267
|
-
|
2281
|
+
const { errors } = await validate(true, {
|
2282
|
+
status: "draft"
|
2283
|
+
});
|
2284
|
+
if (errors) {
|
2285
|
+
toggleNotification({
|
2286
|
+
type: "danger",
|
2287
|
+
message: formatMessage({
|
2288
|
+
id: "content-manager.validation.error",
|
2289
|
+
defaultMessage: "There are validation errors in your document. Please fix them before saving."
|
2290
|
+
})
|
2291
|
+
});
|
2292
|
+
return;
|
2268
2293
|
}
|
2269
2294
|
if (isCloning) {
|
2270
2295
|
const res = await clone(
|
@@ -2273,7 +2298,7 @@ const UpdateAction = ({
|
|
2273
2298
|
documentId: cloneMatch.params.origin,
|
2274
2299
|
params
|
2275
2300
|
},
|
2276
|
-
document
|
2301
|
+
transformData(document)
|
2277
2302
|
);
|
2278
2303
|
if ("data" in res) {
|
2279
2304
|
navigate(
|
@@ -2294,7 +2319,7 @@ const UpdateAction = ({
|
|
2294
2319
|
documentId,
|
2295
2320
|
params
|
2296
2321
|
},
|
2297
|
-
document
|
2322
|
+
transformData(document)
|
2298
2323
|
);
|
2299
2324
|
if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
2300
2325
|
setErrors(formatValidationErrors(res.error));
|
@@ -2307,7 +2332,7 @@ const UpdateAction = ({
|
|
2307
2332
|
model,
|
2308
2333
|
params
|
2309
2334
|
},
|
2310
|
-
document
|
2335
|
+
transformData(document)
|
2311
2336
|
);
|
2312
2337
|
if ("data" in res && collectionType !== SINGLE_TYPES) {
|
2313
2338
|
navigate(
|
@@ -2646,12 +2671,12 @@ const Information = ({ activeTab }) => {
|
|
2646
2671
|
isDisplayed: !!publishDocument?.[PUBLISHED_AT_ATTRIBUTE_NAME],
|
2647
2672
|
label: formatMessage({
|
2648
2673
|
id: "content-manager.containers.edit.information.last-published.label",
|
2649
|
-
defaultMessage: "
|
2674
|
+
defaultMessage: "Published"
|
2650
2675
|
}),
|
2651
2676
|
value: formatMessage(
|
2652
2677
|
{
|
2653
2678
|
id: "content-manager.containers.edit.information.last-published.value",
|
2654
|
-
defaultMessage: `
|
2679
|
+
defaultMessage: `{time}{isAnonymous, select, true {} other { by {author}}}`
|
2655
2680
|
},
|
2656
2681
|
{
|
2657
2682
|
time: /* @__PURE__ */ jsx(RelativeTime, { timestamp: new Date(publishDocument?.[PUBLISHED_AT_ATTRIBUTE_NAME]) }),
|
@@ -2664,12 +2689,12 @@ const Information = ({ activeTab }) => {
|
|
2664
2689
|
isDisplayed: !!createAndUpdateDocument?.[UPDATED_AT_ATTRIBUTE_NAME],
|
2665
2690
|
label: formatMessage({
|
2666
2691
|
id: "content-manager.containers.edit.information.last-draft.label",
|
2667
|
-
defaultMessage: "
|
2692
|
+
defaultMessage: "Updated"
|
2668
2693
|
}),
|
2669
2694
|
value: formatMessage(
|
2670
2695
|
{
|
2671
2696
|
id: "content-manager.containers.edit.information.last-draft.value",
|
2672
|
-
defaultMessage: `
|
2697
|
+
defaultMessage: `{time}{isAnonymous, select, true {} other { by {author}}}`
|
2673
2698
|
},
|
2674
2699
|
{
|
2675
2700
|
time: /* @__PURE__ */ jsx(
|
@@ -2687,12 +2712,12 @@ const Information = ({ activeTab }) => {
|
|
2687
2712
|
isDisplayed: !!createAndUpdateDocument?.[CREATED_AT_ATTRIBUTE_NAME],
|
2688
2713
|
label: formatMessage({
|
2689
2714
|
id: "content-manager.containers.edit.information.document.label",
|
2690
|
-
defaultMessage: "
|
2715
|
+
defaultMessage: "Created"
|
2691
2716
|
}),
|
2692
2717
|
value: formatMessage(
|
2693
2718
|
{
|
2694
2719
|
id: "content-manager.containers.edit.information.document.value",
|
2695
|
-
defaultMessage: `
|
2720
|
+
defaultMessage: `{time}{isAnonymous, select, true {} other { by {author}}}`
|
2696
2721
|
},
|
2697
2722
|
{
|
2698
2723
|
time: /* @__PURE__ */ jsx(
|
@@ -3997,7 +4022,7 @@ const index = {
|
|
3997
4022
|
app.router.addRoute({
|
3998
4023
|
path: "content-manager/*",
|
3999
4024
|
lazy: async () => {
|
4000
|
-
const { Layout } = await import("./layout-
|
4025
|
+
const { Layout } = await import("./layout-C5uSVTqi.mjs");
|
4001
4026
|
return {
|
4002
4027
|
Component: Layout
|
4003
4028
|
};
|
@@ -4014,7 +4039,7 @@ const index = {
|
|
4014
4039
|
async registerTrads({ locales }) {
|
4015
4040
|
const importedTrads = await Promise.all(
|
4016
4041
|
locales.map((locale) => {
|
4017
|
-
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/ar.json": () => import("./ar-CCEVvqGG.mjs"), "./translations/ca.json": () => import("./ca-5U32ON2v.mjs"), "./translations/cs.json": () => import("./cs-CM2aBUar.mjs"), "./translations/de.json": () => import("./de-C72KDNOl.mjs"), "./translations/en.json": () => import("./en-
|
4042
|
+
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/ar.json": () => import("./ar-CCEVvqGG.mjs"), "./translations/ca.json": () => import("./ca-5U32ON2v.mjs"), "./translations/cs.json": () => import("./cs-CM2aBUar.mjs"), "./translations/de.json": () => import("./de-C72KDNOl.mjs"), "./translations/en.json": () => import("./en-DKV44jRb.mjs"), "./translations/es.json": () => import("./es-CeXiYflN.mjs"), "./translations/eu.json": () => import("./eu-CdALomew.mjs"), "./translations/fr.json": () => import("./fr-CD9VFbPM.mjs"), "./translations/gu.json": () => import("./gu-CNpaMDpH.mjs"), "./translations/hi.json": () => import("./hi-Dwvd04m3.mjs"), "./translations/hu.json": () => import("./hu-CeYvaaO0.mjs"), "./translations/id.json": () => import("./id-BtwA9WJT.mjs"), "./translations/it.json": () => import("./it-BrVPqaf1.mjs"), "./translations/ja.json": () => import("./ja-CtsUxOvk.mjs"), "./translations/ko.json": () => import("./ko-HVQRlfUI.mjs"), "./translations/ml.json": () => import("./ml-BihZwQit.mjs"), "./translations/ms.json": () => import("./ms-m_WjyWx7.mjs"), "./translations/nl.json": () => import("./nl-D4R9gHx5.mjs"), "./translations/pl.json": () => import("./pl-sbx9mSt_.mjs"), "./translations/pt-BR.json": () => import("./pt-BR-C71iDxnh.mjs"), "./translations/pt.json": () => import("./pt-BsaFvS8-.mjs"), "./translations/ru.json": () => import("./ru-BE6A4Exp.mjs"), "./translations/sa.json": () => import("./sa-Dag0k-Z8.mjs"), "./translations/sk.json": () => import("./sk-BFg-R8qJ.mjs"), "./translations/sv.json": () => import("./sv-CUnfWGsh.mjs"), "./translations/th.json": () => import("./th-BqbI8lIT.mjs"), "./translations/tr.json": () => import("./tr-CgeK3wJM.mjs"), "./translations/uk.json": () => import("./uk-CR-zDhAY.mjs"), "./translations/vi.json": () => import("./vi-DUXIk_fw.mjs"), "./translations/zh-Hans.json": () => import("./zh-Hans-BPQcRIyH.mjs"), "./translations/zh.json": () => import("./zh-BWZspA60.mjs") }), `./translations/${locale}.json`).then(({ default: data }) => {
|
4018
4043
|
return {
|
4019
4044
|
data: prefixPluginTranslations(data, PLUGIN_ID),
|
4020
4045
|
locale
|
@@ -4075,4 +4100,4 @@ export {
|
|
4075
4100
|
capitalise as y,
|
4076
4101
|
useUpdateContentTypeConfigurationMutation as z
|
4077
4102
|
};
|
4078
|
-
//# sourceMappingURL=index-
|
4103
|
+
//# sourceMappingURL=index-CsfwpRfc.mjs.map
|