@strapi/content-manager 0.0.0-experimental.baa6cf22298e591b4d52d8e59c60406d7a9f137f → 0.0.0-experimental.bd712ad3930045f4a5d2144c119e0b7856e97fc4
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/LICENSE +18 -3
- package/dist/_chunks/{ComponentConfigurationPage-DiigqkCf.js → ComponentConfigurationPage-BWQv6yRj.js} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-DiigqkCf.js.map → ComponentConfigurationPage-BWQv6yRj.js.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-CYqQv0ne.mjs → ComponentConfigurationPage-C7ImeKGM.mjs} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-CYqQv0ne.mjs.map → ComponentConfigurationPage-C7ImeKGM.mjs.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-BeeGw2RI.js → EditConfigurationPage-CEGwxV-L.js} +3 -3
- package/dist/_chunks/{EditConfigurationPage-BeeGw2RI.js.map → EditConfigurationPage-CEGwxV-L.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-BArY-b8_.mjs → EditConfigurationPage-MItFGzT9.mjs} +3 -3
- package/dist/_chunks/{EditConfigurationPage-BArY-b8_.mjs.map → EditConfigurationPage-MItFGzT9.mjs.map} +1 -1
- package/dist/_chunks/{EditViewPage-DZPDqo_G.js → EditViewPage-CmMi2Xsn.js} +45 -45
- package/dist/_chunks/EditViewPage-CmMi2Xsn.js.map +1 -0
- package/dist/_chunks/{EditViewPage-B8ETGsFo.mjs → EditViewPage-DhmAg0NK.mjs} +46 -46
- package/dist/_chunks/EditViewPage-DhmAg0NK.mjs.map +1 -0
- package/dist/_chunks/{Field-DnJMS8cB.js → Field-1DLtcLAI.js} +416 -136
- package/dist/_chunks/Field-1DLtcLAI.js.map +1 -0
- package/dist/_chunks/{Field-Dn4ThnFB.mjs → Field-Cs62u5pl.mjs} +417 -137
- package/dist/_chunks/Field-Cs62u5pl.mjs.map +1 -0
- package/dist/_chunks/{Form-DiTmWq2k.js → Form-CqFA7F_V.js} +25 -26
- package/dist/_chunks/Form-CqFA7F_V.js.map +1 -0
- package/dist/_chunks/{Form-DY721B6y.mjs → Form-zYHtzGUX.mjs} +27 -28
- package/dist/_chunks/Form-zYHtzGUX.mjs.map +1 -0
- package/dist/_chunks/{History-DShoVAh0.js → History-BblwXv7-.js} +123 -29
- package/dist/_chunks/History-BblwXv7-.js.map +1 -0
- package/dist/_chunks/{History-CwWN_uNp.mjs → History-DalgFQ3D.mjs} +124 -30
- package/dist/_chunks/History-DalgFQ3D.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-COIRGF5b.js → ListConfigurationPage-Cpy4QqNd.js} +48 -47
- package/dist/_chunks/ListConfigurationPage-Cpy4QqNd.js.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-D062TiTL.mjs → ListConfigurationPage-DWy-vRzs.mjs} +49 -49
- package/dist/_chunks/ListConfigurationPage-DWy-vRzs.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-BeHTsIr5.mjs → ListViewPage-BkAwIW9s.mjs} +74 -70
- package/dist/_chunks/ListViewPage-BkAwIW9s.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-CFuXPZ_r.js → ListViewPage-DFjn1DNW.js} +72 -68
- package/dist/_chunks/ListViewPage-DFjn1DNW.js.map +1 -0
- package/dist/_chunks/{NoContentTypePage-B_KLijrG.mjs → NoContentTypePage-B9BCNNdL.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-B_KLijrG.mjs.map → NoContentTypePage-B9BCNNdL.mjs.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-rdH0Zp0A.js → NoContentTypePage-C-3ykoxs.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-rdH0Zp0A.js.map → NoContentTypePage-C-3ykoxs.js.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-BPU-v48V.mjs → NoPermissionsPage-Bt_HWGat.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-BPU-v48V.mjs.map → NoPermissionsPage-Bt_HWGat.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-D8gbX1Y_.js → NoPermissionsPage-DKLmDZnZ.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-D8gbX1Y_.js.map → NoPermissionsPage-DKLmDZnZ.js.map} +1 -1
- package/dist/_chunks/{Relations-Bbz90ZWv.mjs → Relations-CJmTbZ8T.mjs} +3 -3
- package/dist/_chunks/{Relations-Bbz90ZWv.mjs.map → Relations-CJmTbZ8T.mjs.map} +1 -1
- package/dist/_chunks/{Relations-wHyjWWT5.js → Relations-CrxfoH2n.js} +3 -3
- package/dist/_chunks/{Relations-wHyjWWT5.js.map → Relations-CrxfoH2n.js.map} +1 -1
- package/dist/_chunks/{en-Dzv55oQw.mjs → en-Ux26r5pl.mjs} +4 -1
- package/dist/_chunks/{en-Dzv55oQw.mjs.map → en-Ux26r5pl.mjs.map} +1 -1
- package/dist/_chunks/{en-BN1bvFK7.js → en-fbKQxLGn.js} +4 -1
- package/dist/_chunks/{en-BN1bvFK7.js.map → en-fbKQxLGn.js.map} +1 -1
- package/dist/_chunks/{index-BRHpg0az.js → index-Buwn78Rt.js} +189 -296
- package/dist/_chunks/index-Buwn78Rt.js.map +1 -0
- package/dist/_chunks/{index-Dv4oDn11.mjs → index-D1344xdw.mjs} +218 -325
- package/dist/_chunks/index-D1344xdw.mjs.map +1 -0
- package/dist/_chunks/{layout-hInnLBbA.mjs → layout-ChVuUpa1.mjs} +22 -17
- package/dist/_chunks/layout-ChVuUpa1.mjs.map +1 -0
- package/dist/_chunks/{layout-pZc2Q3bK.js → layout-DRuJUpas.js} +21 -16
- package/dist/_chunks/layout-DRuJUpas.js.map +1 -0
- package/dist/_chunks/{relations-BcPI8XhI.mjs → relations-B-deMCy4.mjs} +2 -2
- package/dist/_chunks/{relations-BcPI8XhI.mjs.map → relations-B-deMCy4.mjs.map} +1 -1
- package/dist/_chunks/{relations-CVE30dYt.js → relations-DuoUwyJr.js} +2 -2
- package/dist/_chunks/{relations-CVE30dYt.js.map → relations-DuoUwyJr.js.map} +1 -1
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +8 -8
- package/dist/admin/src/history/components/VersionInputRenderer.d.ts +1 -1
- package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +7 -3
- package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +4 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +2 -10
- package/dist/admin/src/pages/ListView/components/BulkActions/Actions.d.ts +3 -30
- package/dist/admin/src/pages/ListView/components/BulkActions/ConfirmBulkActionDialog.d.ts +2 -2
- package/dist/server/index.js +26 -17
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +26 -17
- 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/single-types.d.ts.map +1 -1
- package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
- package/dist/server/src/history/services/utils.d.ts.map +1 -1
- package/dist/server/src/services/utils/populate.d.ts.map +1 -1
- package/package.json +8 -8
- package/dist/_chunks/EditViewPage-B8ETGsFo.mjs.map +0 -1
- package/dist/_chunks/EditViewPage-DZPDqo_G.js.map +0 -1
- package/dist/_chunks/Field-Dn4ThnFB.mjs.map +0 -1
- package/dist/_chunks/Field-DnJMS8cB.js.map +0 -1
- package/dist/_chunks/Form-DY721B6y.mjs.map +0 -1
- package/dist/_chunks/Form-DiTmWq2k.js.map +0 -1
- package/dist/_chunks/History-CwWN_uNp.mjs.map +0 -1
- package/dist/_chunks/History-DShoVAh0.js.map +0 -1
- package/dist/_chunks/ListConfigurationPage-COIRGF5b.js.map +0 -1
- package/dist/_chunks/ListConfigurationPage-D062TiTL.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-BeHTsIr5.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-CFuXPZ_r.js.map +0 -1
- package/dist/_chunks/index-BRHpg0az.js.map +0 -1
- package/dist/_chunks/index-Dv4oDn11.mjs.map +0 -1
- package/dist/_chunks/layout-hInnLBbA.mjs.map +0 -1
- package/dist/_chunks/layout-pZc2Q3bK.js.map +0 -1
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ClockCounterClockwise, CrossCircle, More, WarningCircle, ListPlus, Pencil, Trash, Check, CheckCircle, ChevronRight, Duplicate, Feather } from "@strapi/icons";
|
1
|
+
import { ClockCounterClockwise, CrossCircle, More, WarningCircle, ListPlus, Pencil, Trash, Check, CheckCircle, ArrowsCounterClockwise, ChevronRight, Duplicate, Feather } from "@strapi/icons";
|
2
2
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
3
3
|
import { useStrapiApp, useQueryParams, createContext, useAuth, useRBAC, Page, adminApi, translatedErrors, useNotification, useAPIErrorHandler, getYupValidationErrors, useTracking, useForm, BackButton, DescriptionComponentRenderer, useTable, Table } from "@strapi/admin/strapi-admin";
|
4
4
|
import { stringify } from "qs";
|
@@ -6,7 +6,7 @@ import { useIntl } from "react-intl";
|
|
6
6
|
import { useNavigate, useParams, Navigate, useMatch, useLocation, Link, NavLink } from "react-router-dom";
|
7
7
|
import * as React from "react";
|
8
8
|
import { lazy } from "react";
|
9
|
-
import { Menu, VisuallyHidden, Flex, Typography, Dialog,
|
9
|
+
import { Button, Menu, VisuallyHidden, Flex, Box, Typography, Dialog, Modal, Radio, Status, SingleSelect, SingleSelectOption, Loader, IconButton, Tooltip, LinkButton } from "@strapi/design-system";
|
10
10
|
import { styled } from "styled-components";
|
11
11
|
import * as yup from "yup";
|
12
12
|
import { ValidationError } from "yup";
|
@@ -198,6 +198,7 @@ const contentManagerApi = adminApi.enhanceEndpoints({
|
|
198
198
|
]
|
199
199
|
});
|
200
200
|
const documentApi = contentManagerApi.injectEndpoints({
|
201
|
+
overrideExisting: true,
|
201
202
|
endpoints: (builder) => ({
|
202
203
|
autoCloneDocument: builder.mutation({
|
203
204
|
query: ({ model, sourceId, query }) => ({
|
@@ -599,11 +600,11 @@ const createAttributeSchema = (attribute) => {
|
|
599
600
|
}
|
600
601
|
};
|
601
602
|
const addRequiredValidation = (attribute) => (schema) => {
|
602
|
-
if (attribute.required) {
|
603
|
-
return schema.required
|
604
|
-
|
605
|
-
|
606
|
-
|
603
|
+
if ((attribute.type === "component" && attribute.repeatable || attribute.type === "dynamiczone") && attribute.required && "min" in schema) {
|
604
|
+
return schema.min(1, translatedErrors.required);
|
605
|
+
}
|
606
|
+
if (attribute.required && attribute.type !== "relation") {
|
607
|
+
return schema.required(translatedErrors.required);
|
607
608
|
}
|
608
609
|
return schema?.nullable ? schema.nullable() : (
|
609
610
|
// In some cases '.nullable' will not be available on the schema.
|
@@ -637,6 +638,28 @@ const addMaxLengthValidation = (attribute) => (schema) => {
|
|
637
638
|
const addMinValidation = (attribute) => (schema) => {
|
638
639
|
if ("min" in attribute) {
|
639
640
|
const min = toInteger(attribute.min);
|
641
|
+
if (attribute.type === "component" && attribute.repeatable || attribute.type === "dynamiczone") {
|
642
|
+
if (!attribute.required && "test" in schema && min) {
|
643
|
+
return schema.test(
|
644
|
+
"custom-min",
|
645
|
+
{
|
646
|
+
...translatedErrors.min,
|
647
|
+
values: {
|
648
|
+
min: attribute.min
|
649
|
+
}
|
650
|
+
},
|
651
|
+
(value) => {
|
652
|
+
if (!value) {
|
653
|
+
return true;
|
654
|
+
}
|
655
|
+
if (Array.isArray(value) && value.length === 0) {
|
656
|
+
return true;
|
657
|
+
}
|
658
|
+
return value.length >= min;
|
659
|
+
}
|
660
|
+
);
|
661
|
+
}
|
662
|
+
}
|
640
663
|
if ("min" in schema && min) {
|
641
664
|
return schema.min(min, {
|
642
665
|
...translatedErrors.min,
|
@@ -763,7 +786,10 @@ const useDocument = (args, opts) => {
|
|
763
786
|
isLoading: isLoadingDocument,
|
764
787
|
isFetching: isFetchingDocument,
|
765
788
|
error
|
766
|
-
} = useGetDocumentQuery(args,
|
789
|
+
} = useGetDocumentQuery(args, {
|
790
|
+
...opts,
|
791
|
+
skip: !args.documentId && args.collectionType !== SINGLE_TYPES || opts?.skip
|
792
|
+
});
|
767
793
|
const { components, schema, isLoading: isLoadingSchema } = useContentTypeSchema(args.model);
|
768
794
|
React.useEffect(() => {
|
769
795
|
if (error) {
|
@@ -927,12 +953,13 @@ const useDocumentActions = () => {
|
|
927
953
|
);
|
928
954
|
const [discardDocument] = useDiscardDocumentMutation();
|
929
955
|
const discard = React.useCallback(
|
930
|
-
async ({ collectionType, model, documentId }) => {
|
956
|
+
async ({ collectionType, model, documentId, params }) => {
|
931
957
|
try {
|
932
958
|
const res = await discardDocument({
|
933
959
|
collectionType,
|
934
960
|
model,
|
935
|
-
documentId
|
961
|
+
documentId,
|
962
|
+
params
|
936
963
|
});
|
937
964
|
if ("error" in res) {
|
938
965
|
toggleNotification({
|
@@ -1264,7 +1291,7 @@ const useDocumentActions = () => {
|
|
1264
1291
|
};
|
1265
1292
|
};
|
1266
1293
|
const ProtectedHistoryPage = lazy(
|
1267
|
-
() => import("./History-
|
1294
|
+
() => import("./History-DalgFQ3D.mjs").then((mod) => ({ default: mod.ProtectedHistoryPage }))
|
1268
1295
|
);
|
1269
1296
|
const routes$1 = [
|
1270
1297
|
{
|
@@ -1277,31 +1304,31 @@ const routes$1 = [
|
|
1277
1304
|
}
|
1278
1305
|
];
|
1279
1306
|
const ProtectedEditViewPage = lazy(
|
1280
|
-
() => import("./EditViewPage-
|
1307
|
+
() => import("./EditViewPage-DhmAg0NK.mjs").then((mod) => ({ default: mod.ProtectedEditViewPage }))
|
1281
1308
|
);
|
1282
1309
|
const ProtectedListViewPage = lazy(
|
1283
|
-
() => import("./ListViewPage-
|
1310
|
+
() => import("./ListViewPage-BkAwIW9s.mjs").then((mod) => ({ default: mod.ProtectedListViewPage }))
|
1284
1311
|
);
|
1285
1312
|
const ProtectedListConfiguration = lazy(
|
1286
|
-
() => import("./ListConfigurationPage-
|
1313
|
+
() => import("./ListConfigurationPage-DWy-vRzs.mjs").then((mod) => ({
|
1287
1314
|
default: mod.ProtectedListConfiguration
|
1288
1315
|
}))
|
1289
1316
|
);
|
1290
1317
|
const ProtectedEditConfigurationPage = lazy(
|
1291
|
-
() => import("./EditConfigurationPage-
|
1318
|
+
() => import("./EditConfigurationPage-MItFGzT9.mjs").then((mod) => ({
|
1292
1319
|
default: mod.ProtectedEditConfigurationPage
|
1293
1320
|
}))
|
1294
1321
|
);
|
1295
1322
|
const ProtectedComponentConfigurationPage = lazy(
|
1296
|
-
() => import("./ComponentConfigurationPage-
|
1323
|
+
() => import("./ComponentConfigurationPage-C7ImeKGM.mjs").then((mod) => ({
|
1297
1324
|
default: mod.ProtectedComponentConfigurationPage
|
1298
1325
|
}))
|
1299
1326
|
);
|
1300
1327
|
const NoPermissions = lazy(
|
1301
|
-
() => import("./NoPermissionsPage-
|
1328
|
+
() => import("./NoPermissionsPage-Bt_HWGat.mjs").then((mod) => ({ default: mod.NoPermissions }))
|
1302
1329
|
);
|
1303
1330
|
const NoContentType = lazy(
|
1304
|
-
() => import("./NoContentTypePage-
|
1331
|
+
() => import("./NoContentTypePage-B9BCNNdL.mjs").then((mod) => ({ default: mod.NoContentType }))
|
1305
1332
|
);
|
1306
1333
|
const CollectionTypePages = () => {
|
1307
1334
|
const { collectionType } = useParams();
|
@@ -1508,7 +1535,7 @@ const DocumentActionsMenu = ({
|
|
1508
1535
|
display: "block",
|
1509
1536
|
children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", gap: 4, children: [
|
1510
1537
|
/* @__PURE__ */ jsxs(Flex, { color: convertActionVariantToColor(action.variant), gap: 2, tag: "span", children: [
|
1511
|
-
action.icon,
|
1538
|
+
/* @__PURE__ */ jsx(Box, { tag: "span", color: convertActionVariantToIconColor(action.variant), children: action.icon }),
|
1512
1539
|
action.label
|
1513
1540
|
] }),
|
1514
1541
|
action.id.startsWith("HistoryAction") && /* @__PURE__ */ jsx(
|
@@ -1569,6 +1596,18 @@ const convertActionVariantToColor = (variant = "secondary") => {
|
|
1569
1596
|
return "primary600";
|
1570
1597
|
}
|
1571
1598
|
};
|
1599
|
+
const convertActionVariantToIconColor = (variant = "secondary") => {
|
1600
|
+
switch (variant) {
|
1601
|
+
case "danger":
|
1602
|
+
return "danger600";
|
1603
|
+
case "secondary":
|
1604
|
+
return "neutral500";
|
1605
|
+
case "success":
|
1606
|
+
return "success600";
|
1607
|
+
default:
|
1608
|
+
return "primary600";
|
1609
|
+
}
|
1610
|
+
};
|
1572
1611
|
const DocumentActionConfirmDialog = ({
|
1573
1612
|
onClose,
|
1574
1613
|
onCancel,
|
@@ -1591,22 +1630,20 @@ const DocumentActionConfirmDialog = ({
|
|
1591
1630
|
}
|
1592
1631
|
onClose();
|
1593
1632
|
};
|
1594
|
-
return /* @__PURE__ */
|
1595
|
-
/* @__PURE__ */ jsx(
|
1596
|
-
/* @__PURE__ */ jsx(
|
1597
|
-
|
1598
|
-
{
|
1599
|
-
|
1600
|
-
|
1601
|
-
|
1602
|
-
|
1603
|
-
|
1604
|
-
|
1605
|
-
|
1606
|
-
|
1607
|
-
|
1608
|
-
)
|
1609
|
-
] });
|
1633
|
+
return /* @__PURE__ */ jsx(Dialog.Root, { open: isOpen, onOpenChange: handleClose, children: /* @__PURE__ */ jsxs(Dialog.Content, { children: [
|
1634
|
+
/* @__PURE__ */ jsx(Dialog.Header, { children: title }),
|
1635
|
+
/* @__PURE__ */ jsx(Dialog.Body, { children: content }),
|
1636
|
+
/* @__PURE__ */ jsxs(Dialog.Footer, { children: [
|
1637
|
+
/* @__PURE__ */ jsx(Dialog.Cancel, { children: /* @__PURE__ */ jsx(Button, { variant: "tertiary", children: formatMessage({
|
1638
|
+
id: "app.components.Button.cancel",
|
1639
|
+
defaultMessage: "Cancel"
|
1640
|
+
}) }) }),
|
1641
|
+
/* @__PURE__ */ jsx(Button, { onClick: handleConfirm, variant, children: formatMessage({
|
1642
|
+
id: "app.components.Button.confirm",
|
1643
|
+
defaultMessage: "Confirm"
|
1644
|
+
}) })
|
1645
|
+
] })
|
1646
|
+
] }) });
|
1610
1647
|
};
|
1611
1648
|
const DocumentActionModal = ({
|
1612
1649
|
isOpen,
|
@@ -1616,34 +1653,17 @@ const DocumentActionModal = ({
|
|
1616
1653
|
content: Content,
|
1617
1654
|
onModalClose
|
1618
1655
|
}) => {
|
1619
|
-
const id = React.useId();
|
1620
|
-
if (!isOpen) {
|
1621
|
-
return null;
|
1622
|
-
}
|
1623
1656
|
const handleClose = () => {
|
1624
1657
|
if (onClose) {
|
1625
1658
|
onClose();
|
1626
1659
|
}
|
1627
1660
|
onModalClose();
|
1628
1661
|
};
|
1629
|
-
return /* @__PURE__ */
|
1630
|
-
/* @__PURE__ */ jsx(
|
1631
|
-
/* @__PURE__ */ jsx(
|
1632
|
-
/* @__PURE__ */ jsx(
|
1633
|
-
|
1634
|
-
{
|
1635
|
-
paddingTop: 4,
|
1636
|
-
paddingBottom: 4,
|
1637
|
-
paddingLeft: 5,
|
1638
|
-
paddingRight: 5,
|
1639
|
-
borderWidth: "1px 0 0 0",
|
1640
|
-
borderStyle: "solid",
|
1641
|
-
borderColor: "neutral150",
|
1642
|
-
background: "neutral100",
|
1643
|
-
children: typeof Footer === "function" ? /* @__PURE__ */ jsx(Footer, { onClose: handleClose }) : Footer
|
1644
|
-
}
|
1645
|
-
)
|
1646
|
-
] });
|
1662
|
+
return /* @__PURE__ */ jsx(Modal.Root, { open: isOpen, onOpenChange: handleClose, children: /* @__PURE__ */ jsxs(Modal.Content, { children: [
|
1663
|
+
/* @__PURE__ */ jsx(Modal.Header, { children: /* @__PURE__ */ jsx(Modal.Title, { children: title }) }),
|
1664
|
+
/* @__PURE__ */ jsx(Modal.Body, { children: typeof Content === "function" ? /* @__PURE__ */ jsx(Content, { onClose: handleClose }) : Content }),
|
1665
|
+
/* @__PURE__ */ jsx(Modal.Footer, { children: typeof Footer === "function" ? /* @__PURE__ */ jsx(Footer, { onClose: handleClose }) : Footer })
|
1666
|
+
] }) });
|
1647
1667
|
};
|
1648
1668
|
const PublishAction$1 = ({
|
1649
1669
|
activeTab,
|
@@ -1826,10 +1846,13 @@ const UpdateAction = ({
|
|
1826
1846
|
document
|
1827
1847
|
);
|
1828
1848
|
if ("data" in res && collectionType !== SINGLE_TYPES) {
|
1829
|
-
navigate(
|
1830
|
-
|
1831
|
-
|
1832
|
-
|
1849
|
+
navigate(
|
1850
|
+
{
|
1851
|
+
pathname: `../${collectionType}/${model}/${res.data.documentId}`,
|
1852
|
+
search: rawQuery
|
1853
|
+
},
|
1854
|
+
{ replace: true }
|
1855
|
+
);
|
1833
1856
|
} else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
1834
1857
|
setErrors(formatValidationErrors(res.error));
|
1835
1858
|
}
|
@@ -1861,10 +1884,8 @@ const UnpublishAction$1 = ({
|
|
1861
1884
|
const { toggleNotification } = useNotification();
|
1862
1885
|
const [shouldKeepDraft, setShouldKeepDraft] = React.useState(true);
|
1863
1886
|
const isDocumentModified = document?.status === "modified";
|
1864
|
-
const handleChange = (
|
1865
|
-
|
1866
|
-
setShouldKeepDraft(e.target.value === UNPUBLISH_DRAFT_OPTIONS.KEEP);
|
1867
|
-
}
|
1887
|
+
const handleChange = (value) => {
|
1888
|
+
setShouldKeepDraft(value === UNPUBLISH_DRAFT_OPTIONS.KEEP);
|
1868
1889
|
};
|
1869
1890
|
if (!schema?.options?.draftAndPublish) {
|
1870
1891
|
return null;
|
@@ -1914,40 +1935,24 @@ const UnpublishAction$1 = ({
|
|
1914
1935
|
}) })
|
1915
1936
|
] }),
|
1916
1937
|
/* @__PURE__ */ jsxs(
|
1917
|
-
|
1938
|
+
Radio.Group,
|
1918
1939
|
{
|
1919
|
-
|
1920
|
-
|
1921
|
-
|
1922
|
-
|
1923
|
-
|
1924
|
-
|
1940
|
+
defaultValue: UNPUBLISH_DRAFT_OPTIONS.KEEP,
|
1941
|
+
name: "discard-options",
|
1942
|
+
"aria-label": formatMessage({
|
1943
|
+
id: "content-manager.actions.unpublish.dialog.radio-label",
|
1944
|
+
defaultMessage: "Choose an option to unpublish the document."
|
1945
|
+
}),
|
1946
|
+
onValueChange: handleChange,
|
1925
1947
|
children: [
|
1926
|
-
/* @__PURE__ */ jsx(
|
1927
|
-
|
1928
|
-
|
1929
|
-
|
1930
|
-
|
1931
|
-
|
1932
|
-
|
1933
|
-
|
1934
|
-
id: "content-manager.actions.unpublish.dialog.option.keep-draft",
|
1935
|
-
defaultMessage: "Keep draft"
|
1936
|
-
})
|
1937
|
-
}
|
1938
|
-
),
|
1939
|
-
/* @__PURE__ */ jsx(
|
1940
|
-
Radio,
|
1941
|
-
{
|
1942
|
-
checked: !shouldKeepDraft,
|
1943
|
-
value: UNPUBLISH_DRAFT_OPTIONS.DISCARD,
|
1944
|
-
name: "discard-options",
|
1945
|
-
children: formatMessage({
|
1946
|
-
id: "content-manager.actions.unpublish.dialog.option.replace-draft",
|
1947
|
-
defaultMessage: "Replace draft"
|
1948
|
-
})
|
1949
|
-
}
|
1950
|
-
)
|
1948
|
+
/* @__PURE__ */ jsx(Radio.Item, { checked: shouldKeepDraft, value: UNPUBLISH_DRAFT_OPTIONS.KEEP, children: formatMessage({
|
1949
|
+
id: "content-manager.actions.unpublish.dialog.option.keep-draft",
|
1950
|
+
defaultMessage: "Keep draft"
|
1951
|
+
}) }),
|
1952
|
+
/* @__PURE__ */ jsx(Radio.Item, { checked: !shouldKeepDraft, value: UNPUBLISH_DRAFT_OPTIONS.DISCARD, children: formatMessage({
|
1953
|
+
id: "content-manager.actions.unpublish.dialog.option.replace-draft",
|
1954
|
+
defaultMessage: "Replace draft"
|
1955
|
+
}) })
|
1951
1956
|
]
|
1952
1957
|
}
|
1953
1958
|
)
|
@@ -2800,30 +2805,23 @@ const ConfirmBulkActionDialog = ({
|
|
2800
2805
|
endAction
|
2801
2806
|
}) => {
|
2802
2807
|
const { formatMessage } = useIntl();
|
2803
|
-
return /* @__PURE__ */ jsxs(
|
2804
|
-
Dialog,
|
2805
|
-
|
2806
|
-
|
2807
|
-
|
2808
|
-
|
2809
|
-
|
2810
|
-
|
2811
|
-
|
2812
|
-
|
2813
|
-
|
2814
|
-
|
2815
|
-
|
2816
|
-
|
2817
|
-
|
2818
|
-
|
2819
|
-
|
2820
|
-
}) }),
|
2821
|
-
endAction
|
2822
|
-
}
|
2823
|
-
)
|
2824
|
-
]
|
2825
|
-
}
|
2826
|
-
);
|
2808
|
+
return /* @__PURE__ */ jsx(Dialog.Root, { onOpenChange: onToggleDialog, open: isOpen, children: /* @__PURE__ */ jsxs(Dialog.Content, { children: [
|
2809
|
+
/* @__PURE__ */ jsx(Dialog.Header, { children: formatMessage({
|
2810
|
+
id: "app.components.ConfirmDialog.title",
|
2811
|
+
defaultMessage: "Confirmation"
|
2812
|
+
}) }),
|
2813
|
+
/* @__PURE__ */ jsx(Dialog.Body, { children: /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "stretch", gap: 2, children: [
|
2814
|
+
/* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(WarningCircle, { width: "24px", height: "24px", fill: "danger600" }) }),
|
2815
|
+
dialogBody
|
2816
|
+
] }) }),
|
2817
|
+
/* @__PURE__ */ jsxs(Dialog.Footer, { children: [
|
2818
|
+
/* @__PURE__ */ jsx(Dialog.Cancel, { children: /* @__PURE__ */ jsx(Button, { fullWidth: true, onClick: onToggleDialog, variant: "tertiary", children: formatMessage({
|
2819
|
+
id: "app.components.Button.cancel",
|
2820
|
+
defaultMessage: "Cancel"
|
2821
|
+
}) }) }),
|
2822
|
+
endAction
|
2823
|
+
] })
|
2824
|
+
] }) });
|
2827
2825
|
};
|
2828
2826
|
const BoldChunk$1 = (chunks) => /* @__PURE__ */ jsx(Typography, { fontWeight: "bold", children: chunks });
|
2829
2827
|
const ConfirmDialogPublishAll = ({
|
@@ -2883,7 +2881,7 @@ const ConfirmDialogPublishAll = ({
|
|
2883
2881
|
defaultMessage: "Are you sure you want to publish these entries?"
|
2884
2882
|
})
|
2885
2883
|
] }),
|
2886
|
-
schema?.pluginOptions && "i18n" in schema.pluginOptions && schema?.pluginOptions.i18n && /* @__PURE__ */ jsx(Typography, { textColor: "danger500", children: formatMessage(
|
2884
|
+
schema?.pluginOptions && "i18n" in schema.pluginOptions && schema?.pluginOptions.i18n && /* @__PURE__ */ jsx(Typography, { textColor: "danger500", textAlign: "center", children: formatMessage(
|
2887
2885
|
{
|
2888
2886
|
id: getTranslation("Settings.list.actions.publishAdditionalInfos"),
|
2889
2887
|
defaultMessage: "This will publish the active locale versions <em>(from Internationalization)</em>"
|
@@ -2928,16 +2926,30 @@ const formatErrorMessages = (errors, parentKey, formatMessage) => {
|
|
2928
2926
|
)
|
2929
2927
|
);
|
2930
2928
|
} else {
|
2931
|
-
messages.push(
|
2929
|
+
messages.push(
|
2930
|
+
...formatErrorMessages(
|
2931
|
+
// @ts-expect-error TODO: check why value is not compatible with FormErrors
|
2932
|
+
value,
|
2933
|
+
currentKey,
|
2934
|
+
formatMessage
|
2935
|
+
)
|
2936
|
+
);
|
2932
2937
|
}
|
2938
|
+
} else {
|
2939
|
+
messages.push(
|
2940
|
+
formatMessage(
|
2941
|
+
{
|
2942
|
+
id: `${value}.withField`,
|
2943
|
+
defaultMessage: value
|
2944
|
+
},
|
2945
|
+
{ field: currentKey }
|
2946
|
+
)
|
2947
|
+
);
|
2933
2948
|
}
|
2934
2949
|
});
|
2935
2950
|
return messages;
|
2936
2951
|
};
|
2937
|
-
const EntryValidationText = ({
|
2938
|
-
validationErrors,
|
2939
|
-
isPublished = false
|
2940
|
-
}) => {
|
2952
|
+
const EntryValidationText = ({ validationErrors, status }) => {
|
2941
2953
|
const { formatMessage } = useIntl();
|
2942
2954
|
if (validationErrors) {
|
2943
2955
|
const validationErrorsMessages = formatErrorMessages(validationErrors, "", formatMessage).join(
|
@@ -2948,7 +2960,7 @@ const EntryValidationText = ({
|
|
2948
2960
|
/* @__PURE__ */ jsx(Tooltip, { description: validationErrorsMessages, children: /* @__PURE__ */ jsx(TypographyMaxWidth, { textColor: "danger600", variant: "omega", fontWeight: "semiBold", ellipsis: true, children: validationErrorsMessages }) })
|
2949
2961
|
] });
|
2950
2962
|
}
|
2951
|
-
if (
|
2963
|
+
if (status === "published") {
|
2952
2964
|
return /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
2953
2965
|
/* @__PURE__ */ jsx(CheckCircle, { fill: "success600" }),
|
2954
2966
|
/* @__PURE__ */ jsx(Typography, { textColor: "success600", fontWeight: "bold", children: formatMessage({
|
@@ -2957,6 +2969,15 @@ const EntryValidationText = ({
|
|
2957
2969
|
}) })
|
2958
2970
|
] });
|
2959
2971
|
}
|
2972
|
+
if (status === "modified") {
|
2973
|
+
return /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
2974
|
+
/* @__PURE__ */ jsx(ArrowsCounterClockwise, { fill: "alternative600" }),
|
2975
|
+
/* @__PURE__ */ jsx(Typography, { children: formatMessage({
|
2976
|
+
id: "content-manager.bulk-publish.modified",
|
2977
|
+
defaultMessage: "Ready to publish changes"
|
2978
|
+
}) })
|
2979
|
+
] });
|
2980
|
+
}
|
2960
2981
|
return /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
2961
2982
|
/* @__PURE__ */ jsx(CheckCircle, { fill: "success600" }),
|
2962
2983
|
/* @__PURE__ */ jsx(Typography, { children: formatMessage({
|
@@ -3008,7 +3029,7 @@ const SelectedEntriesTableContent = ({
|
|
3008
3029
|
EntryValidationText,
|
3009
3030
|
{
|
3010
3031
|
validationErrors: validationErrors[row.documentId],
|
3011
|
-
|
3032
|
+
status: row.status
|
3012
3033
|
}
|
3013
3034
|
) }),
|
3014
3035
|
/* @__PURE__ */ jsx(Table.Cell, { children: /* @__PURE__ */ jsx(
|
@@ -3097,18 +3118,16 @@ const SelectedEntriesModalContent = ({
|
|
3097
3118
|
const [isDialogOpen, setIsDialogOpen] = React.useState(false);
|
3098
3119
|
const { publishMany: bulkPublishAction } = useDocumentActions();
|
3099
3120
|
const [, { isLoading: isSubmittingForm }] = usePublishManyDocumentsMutation();
|
3100
|
-
const
|
3101
|
-
const
|
3102
|
-
|
3103
|
-
|
3104
|
-
|
3105
|
-
return acc;
|
3106
|
-
}, []);
|
3121
|
+
const selectedRows = useTable("publishAction", (state) => state.selectedRows);
|
3122
|
+
const selectedEntries = rows.filter(
|
3123
|
+
(entry) => selectedRows.some((selectedEntry) => selectedEntry.documentId === entry.documentId)
|
3124
|
+
);
|
3125
|
+
const entriesToPublish = selectedEntries.filter((entry) => !validationErrors[entry.documentId]).map((entry) => entry.documentId);
|
3107
3126
|
const selectedEntriesWithErrorsCount = selectedEntries.filter(
|
3108
3127
|
({ documentId }) => validationErrors[documentId]
|
3109
3128
|
).length;
|
3110
3129
|
const selectedEntriesPublished = selectedEntries.filter(
|
3111
|
-
({
|
3130
|
+
({ status }) => status === "published"
|
3112
3131
|
).length;
|
3113
3132
|
const selectedEntriesWithNoErrorsCount = selectedEntries.length - selectedEntriesWithErrorsCount - selectedEntriesPublished;
|
3114
3133
|
const toggleDialog = () => setIsDialogOpen((prev) => !prev);
|
@@ -3151,7 +3170,7 @@ const SelectedEntriesModalContent = ({
|
|
3151
3170
|
);
|
3152
3171
|
};
|
3153
3172
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
3154
|
-
/* @__PURE__ */ jsxs(
|
3173
|
+
/* @__PURE__ */ jsxs(Modal.Body, { children: [
|
3155
3174
|
/* @__PURE__ */ jsx(Typography, { children: getFormattedCountMessage() }),
|
3156
3175
|
/* @__PURE__ */ jsx(Box, { marginTop: 5, children: /* @__PURE__ */ jsx(
|
3157
3176
|
SelectedEntriesTableContent,
|
@@ -3163,27 +3182,24 @@ const SelectedEntriesModalContent = ({
|
|
3163
3182
|
}
|
3164
3183
|
) })
|
3165
3184
|
] }),
|
3166
|
-
/* @__PURE__ */
|
3167
|
-
|
3168
|
-
|
3169
|
-
|
3170
|
-
|
3171
|
-
|
3172
|
-
}) }),
|
3173
|
-
|
3174
|
-
|
3175
|
-
|
3176
|
-
|
3177
|
-
|
3178
|
-
|
3179
|
-
|
3180
|
-
|
3181
|
-
|
3182
|
-
|
3183
|
-
|
3184
|
-
] })
|
3185
|
-
}
|
3186
|
-
),
|
3185
|
+
/* @__PURE__ */ jsxs(Modal.Footer, { children: [
|
3186
|
+
/* @__PURE__ */ jsx(Button, { onClick: toggleModal, variant: "tertiary", children: formatMessage({
|
3187
|
+
id: "app.components.Button.cancel",
|
3188
|
+
defaultMessage: "Cancel"
|
3189
|
+
}) }),
|
3190
|
+
/* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
3191
|
+
/* @__PURE__ */ jsx(Button, { onClick: refetch, variant: "tertiary", loading: isFetching, children: formatMessage({ id: "app.utils.refresh", defaultMessage: "Refresh" }) }),
|
3192
|
+
/* @__PURE__ */ jsx(
|
3193
|
+
Button,
|
3194
|
+
{
|
3195
|
+
onClick: toggleDialog,
|
3196
|
+
disabled: selectedEntries.length === 0 || selectedEntries.length === selectedEntriesWithErrorsCount || selectedEntriesPublished === selectedEntries.length || isLoading,
|
3197
|
+
loading: isSubmittingForm,
|
3198
|
+
children: formatMessage({ id: "app.utils.publish", defaultMessage: "Publish" })
|
3199
|
+
}
|
3200
|
+
)
|
3201
|
+
] })
|
3202
|
+
] }),
|
3187
3203
|
/* @__PURE__ */ jsx(
|
3188
3204
|
ConfirmDialogPublishAll,
|
3189
3205
|
{
|
@@ -3248,143 +3264,10 @@ const BulkActionsRenderer = () => {
|
|
3248
3264
|
documents: selectedRows
|
3249
3265
|
},
|
3250
3266
|
descriptions: plugins["content-manager"].apis.getBulkActions(),
|
3251
|
-
children: (actions2) => actions2.map((action) => /* @__PURE__ */ jsx(
|
3267
|
+
children: (actions2) => actions2.map((action) => /* @__PURE__ */ jsx(DocumentActionButton, { ...action }, action.id))
|
3252
3268
|
}
|
3253
3269
|
) });
|
3254
3270
|
};
|
3255
|
-
const BulkActionAction = (action) => {
|
3256
|
-
const [dialogId, setDialogId] = React.useState(null);
|
3257
|
-
const { toggleNotification } = useNotification();
|
3258
|
-
const handleClick = (action2) => (e) => {
|
3259
|
-
const { onClick, dialog, id } = action2;
|
3260
|
-
if (onClick) {
|
3261
|
-
onClick(e);
|
3262
|
-
}
|
3263
|
-
if (dialog) {
|
3264
|
-
switch (dialog.type) {
|
3265
|
-
case "notification":
|
3266
|
-
toggleNotification({
|
3267
|
-
title: dialog.title,
|
3268
|
-
message: dialog.content,
|
3269
|
-
type: dialog.status,
|
3270
|
-
timeout: dialog.timeout,
|
3271
|
-
onClose: dialog.onClose
|
3272
|
-
});
|
3273
|
-
break;
|
3274
|
-
case "dialog":
|
3275
|
-
case "modal": {
|
3276
|
-
e.preventDefault();
|
3277
|
-
setDialogId(id);
|
3278
|
-
}
|
3279
|
-
}
|
3280
|
-
}
|
3281
|
-
};
|
3282
|
-
const handleClose = () => {
|
3283
|
-
setDialogId(null);
|
3284
|
-
if (action.dialog?.type === "modal" && action.dialog?.onClose) {
|
3285
|
-
action.dialog.onClose();
|
3286
|
-
}
|
3287
|
-
};
|
3288
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
3289
|
-
/* @__PURE__ */ jsx(
|
3290
|
-
Button,
|
3291
|
-
{
|
3292
|
-
disabled: action.disabled,
|
3293
|
-
startIcon: action.icon,
|
3294
|
-
variant: action.variant,
|
3295
|
-
onClick: handleClick(action),
|
3296
|
-
children: action.label
|
3297
|
-
}
|
3298
|
-
),
|
3299
|
-
action.dialog?.type === "dialog" ? /* @__PURE__ */ jsx(
|
3300
|
-
BulkActionConfirmDialog,
|
3301
|
-
{
|
3302
|
-
...action.dialog,
|
3303
|
-
variant: action.variant,
|
3304
|
-
isOpen: dialogId === action.id,
|
3305
|
-
onClose: handleClose
|
3306
|
-
}
|
3307
|
-
) : null,
|
3308
|
-
action.dialog?.type === "modal" ? /* @__PURE__ */ jsx(
|
3309
|
-
BulkActionModal,
|
3310
|
-
{
|
3311
|
-
...action.dialog,
|
3312
|
-
onModalClose: handleClose,
|
3313
|
-
isOpen: dialogId === action.id
|
3314
|
-
}
|
3315
|
-
) : null
|
3316
|
-
] });
|
3317
|
-
};
|
3318
|
-
const BulkActionConfirmDialog = ({
|
3319
|
-
onClose,
|
3320
|
-
onCancel,
|
3321
|
-
onConfirm,
|
3322
|
-
title,
|
3323
|
-
content,
|
3324
|
-
confirmButton,
|
3325
|
-
isOpen,
|
3326
|
-
variant = "secondary"
|
3327
|
-
}) => {
|
3328
|
-
const { formatMessage } = useIntl();
|
3329
|
-
const handleClose = async () => {
|
3330
|
-
if (onCancel) {
|
3331
|
-
await onCancel();
|
3332
|
-
}
|
3333
|
-
onClose();
|
3334
|
-
};
|
3335
|
-
const handleConfirm = async () => {
|
3336
|
-
if (onConfirm) {
|
3337
|
-
await onConfirm();
|
3338
|
-
}
|
3339
|
-
onClose();
|
3340
|
-
};
|
3341
|
-
return /* @__PURE__ */ jsxs(Dialog, { isOpen, title, onClose: handleClose, children: [
|
3342
|
-
/* @__PURE__ */ jsx(DialogBody, { icon: /* @__PURE__ */ jsx(WarningCircle, {}), children: content }),
|
3343
|
-
/* @__PURE__ */ jsx(
|
3344
|
-
DialogFooter,
|
3345
|
-
{
|
3346
|
-
startAction: /* @__PURE__ */ jsx(Button, { onClick: handleClose, variant: "tertiary", children: formatMessage({
|
3347
|
-
id: "app.components.Button.cancel",
|
3348
|
-
defaultMessage: "Cancel"
|
3349
|
-
}) }),
|
3350
|
-
endAction: /* @__PURE__ */ jsx(
|
3351
|
-
Button,
|
3352
|
-
{
|
3353
|
-
onClick: handleConfirm,
|
3354
|
-
variant: variant === "danger-light" ? variant : "secondary",
|
3355
|
-
startIcon: variant === "danger-light" ? /* @__PURE__ */ jsx(Trash, {}) : /* @__PURE__ */ jsx(Check, {}),
|
3356
|
-
children: confirmButton ? confirmButton : formatMessage({
|
3357
|
-
id: "app.components.Button.confirm",
|
3358
|
-
defaultMessage: "Confirm"
|
3359
|
-
})
|
3360
|
-
}
|
3361
|
-
)
|
3362
|
-
}
|
3363
|
-
)
|
3364
|
-
] });
|
3365
|
-
};
|
3366
|
-
const BulkActionModal = ({
|
3367
|
-
isOpen,
|
3368
|
-
title,
|
3369
|
-
onClose,
|
3370
|
-
content: Content,
|
3371
|
-
onModalClose
|
3372
|
-
}) => {
|
3373
|
-
const id = React.useId();
|
3374
|
-
if (!isOpen) {
|
3375
|
-
return null;
|
3376
|
-
}
|
3377
|
-
const handleClose = () => {
|
3378
|
-
if (onClose) {
|
3379
|
-
onClose();
|
3380
|
-
}
|
3381
|
-
onModalClose();
|
3382
|
-
};
|
3383
|
-
return /* @__PURE__ */ jsxs(ModalLayout, { borderRadius: "4px", overflow: "hidden", onClose: handleClose, labelledBy: id, children: [
|
3384
|
-
/* @__PURE__ */ jsx(ModalHeader, { children: /* @__PURE__ */ jsx(Typography, { fontWeight: "bold", textColor: "neutral800", tag: "h2", id, children: title }) }),
|
3385
|
-
/* @__PURE__ */ jsx(Content, { onClose: handleClose })
|
3386
|
-
] });
|
3387
|
-
};
|
3388
3271
|
const DeleteAction = ({ documents, model }) => {
|
3389
3272
|
const { formatMessage } = useIntl();
|
3390
3273
|
const { schema: contentType } = useDoc();
|
@@ -3417,6 +3300,7 @@ const DeleteAction = ({ documents, model }) => {
|
|
3417
3300
|
defaultMessage: "Confirmation"
|
3418
3301
|
}),
|
3419
3302
|
content: /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "stretch", gap: 2, children: [
|
3303
|
+
/* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(WarningCircle, { width: "24px", height: "24px", fill: "danger600" }) }),
|
3420
3304
|
/* @__PURE__ */ jsx(Typography, { id: "confirm-description", textAlign: "center", children: formatMessage({
|
3421
3305
|
id: "popUpWarning.bodyMessage.contentType.delete.all",
|
3422
3306
|
defaultMessage: "Are you sure you want to delete these entries?"
|
@@ -3453,7 +3337,7 @@ const UnpublishAction = ({ documents, model }) => {
|
|
3453
3337
|
selectRow([]);
|
3454
3338
|
}
|
3455
3339
|
};
|
3456
|
-
const showUnpublishButton = hasDraftAndPublishEnabled && hasPublishPermission && documents.some((entry) => entry.status === "published");
|
3340
|
+
const showUnpublishButton = hasDraftAndPublishEnabled && hasPublishPermission && documents.some((entry) => entry.status === "published" || entry.status === "modified");
|
3457
3341
|
if (!showUnpublishButton)
|
3458
3342
|
return null;
|
3459
3343
|
return {
|
@@ -3466,6 +3350,7 @@ const UnpublishAction = ({ documents, model }) => {
|
|
3466
3350
|
defaultMessage: "Confirmation"
|
3467
3351
|
}),
|
3468
3352
|
content: /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "stretch", gap: 2, children: [
|
3353
|
+
/* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(WarningCircle, { width: "24px", height: "24px", fill: "danger600" }) }),
|
3469
3354
|
/* @__PURE__ */ jsx(Typography, { id: "confirm-description", textAlign: "center", children: formatMessage({
|
3470
3355
|
id: "popUpWarning.bodyMessage.contentType.unpublish.all",
|
3471
3356
|
defaultMessage: "Are you sure you want to unpublish these entries?"
|
@@ -3851,15 +3736,24 @@ const index = {
|
|
3851
3736
|
defaultMessage: "Content Manager"
|
3852
3737
|
},
|
3853
3738
|
permissions: [],
|
3854
|
-
Component: () => import("./layout-hInnLBbA.mjs").then((mod) => ({ default: mod.Layout })),
|
3855
3739
|
position: 1
|
3856
3740
|
});
|
3741
|
+
app.router.addRoute({
|
3742
|
+
path: "content-manager/*",
|
3743
|
+
lazy: async () => {
|
3744
|
+
const { Layout } = await import("./layout-ChVuUpa1.mjs");
|
3745
|
+
return {
|
3746
|
+
Component: Layout
|
3747
|
+
};
|
3748
|
+
},
|
3749
|
+
children: routes
|
3750
|
+
});
|
3857
3751
|
app.registerPlugin(cm.config);
|
3858
3752
|
},
|
3859
3753
|
async registerTrads({ locales }) {
|
3860
3754
|
const importedTrads = await Promise.all(
|
3861
3755
|
locales.map((locale) => {
|
3862
|
-
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-
|
3756
|
+
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-Ux26r5pl.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 }) => {
|
3863
3757
|
return {
|
3864
3758
|
data: prefixPluginTranslations(data, PLUGIN_ID),
|
3865
3759
|
locale
|
@@ -3880,43 +3774,42 @@ export {
|
|
3880
3774
|
BulkActionsRenderer as B,
|
3881
3775
|
COLLECTION_TYPES as C,
|
3882
3776
|
DocumentStatus as D,
|
3883
|
-
|
3884
|
-
|
3885
|
-
|
3777
|
+
DEFAULT_SETTINGS as E,
|
3778
|
+
convertEditLayoutToFieldLayouts as F,
|
3779
|
+
useDocument as G,
|
3886
3780
|
HOOKS as H,
|
3887
3781
|
InjectionZone as I,
|
3888
|
-
|
3889
|
-
|
3890
|
-
useDocumentActions as L,
|
3782
|
+
index as J,
|
3783
|
+
useDocumentActions as K,
|
3891
3784
|
Panels as P,
|
3892
3785
|
RelativeTime as R,
|
3893
3786
|
SINGLE_TYPES as S,
|
3894
3787
|
TableActions as T,
|
3895
|
-
|
3896
|
-
|
3897
|
-
|
3898
|
-
|
3899
|
-
|
3900
|
-
|
3788
|
+
useGetInitialDataQuery as a,
|
3789
|
+
useGetAllContentTypeSettingsQuery as b,
|
3790
|
+
useDoc as c,
|
3791
|
+
buildValidParams as d,
|
3792
|
+
contentManagerApi as e,
|
3793
|
+
useDocumentRBAC as f,
|
3901
3794
|
getTranslation as g,
|
3902
|
-
|
3903
|
-
|
3904
|
-
|
3905
|
-
|
3906
|
-
|
3907
|
-
|
3908
|
-
|
3795
|
+
useDocumentLayout as h,
|
3796
|
+
createYupSchema as i,
|
3797
|
+
Header as j,
|
3798
|
+
PERMISSIONS as k,
|
3799
|
+
DocumentRBAC as l,
|
3800
|
+
DOCUMENT_META_FIELDS as m,
|
3801
|
+
useDocLayout as n,
|
3909
3802
|
useGetContentTypeConfigurationQuery as o,
|
3910
3803
|
CREATOR_FIELDS as p,
|
3911
3804
|
getMainField as q,
|
3912
|
-
|
3805
|
+
getDisplayName as r,
|
3913
3806
|
setInitialData as s,
|
3914
|
-
|
3915
|
-
|
3916
|
-
|
3917
|
-
|
3918
|
-
|
3919
|
-
|
3920
|
-
|
3921
|
-
};
|
3922
|
-
//# sourceMappingURL=index-
|
3807
|
+
checkIfAttributeIsDisplayable as t,
|
3808
|
+
useContentTypeSchema as u,
|
3809
|
+
useGetAllDocumentsQuery as v,
|
3810
|
+
convertListLayoutToFieldLayouts as w,
|
3811
|
+
capitalise as x,
|
3812
|
+
useUpdateContentTypeConfigurationMutation as y,
|
3813
|
+
extractContentTypeComponents as z
|
3814
|
+
};
|
3815
|
+
//# sourceMappingURL=index-D1344xdw.mjs.map
|