@strapi/content-manager 0.0.0-experimental.edc24aaa3bb5a90fa5fd4fee208167dd4e2e38d4 → 0.0.0-experimental.f2351bcfa3965c60f063a492da51faa2c636eee8
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-5ukroXAh.js → ComponentConfigurationPage-BlAzljQ6.js} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-5ukroXAh.js.map → ComponentConfigurationPage-BlAzljQ6.js.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-BAgyHiMm.mjs → ComponentConfigurationPage-Ccwb19Qj.mjs} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-BAgyHiMm.mjs.map → ComponentConfigurationPage-Ccwb19Qj.mjs.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-Xp7lun0f.js → EditConfigurationPage-BPoOzhCM.js} +3 -3
- package/dist/_chunks/{EditConfigurationPage-Xp7lun0f.js.map → EditConfigurationPage-BPoOzhCM.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-DmoXawIh.mjs → EditConfigurationPage-C19b_9RL.mjs} +3 -3
- package/dist/_chunks/{EditConfigurationPage-DmoXawIh.mjs.map → EditConfigurationPage-C19b_9RL.mjs.map} +1 -1
- package/dist/_chunks/{EditViewPage-C-ukDOB7.js → EditViewPage-D9xH8HYD.js} +19 -8
- package/dist/_chunks/EditViewPage-D9xH8HYD.js.map +1 -0
- package/dist/_chunks/{EditViewPage-BLsjc5F-.mjs → EditViewPage-nmrHNiJ9.mjs} +19 -8
- package/dist/_chunks/EditViewPage-nmrHNiJ9.mjs.map +1 -0
- package/dist/_chunks/{Field-Cs7duwWd.mjs → Field--kmlJuSb.mjs} +118 -90
- package/dist/_chunks/Field--kmlJuSb.mjs.map +1 -0
- package/dist/_chunks/{Field-Bfph5SOd.js → Field-BB_pHo6D.js} +120 -92
- package/dist/_chunks/Field-BB_pHo6D.js.map +1 -0
- package/dist/_chunks/{Form-Dg_GS5TQ.mjs → Form-CUtOiC4S.mjs} +35 -16
- package/dist/_chunks/Form-CUtOiC4S.mjs.map +1 -0
- package/dist/_chunks/{Form-CPYqIWDG.js → Form-iwbkoaAF.js} +35 -16
- package/dist/_chunks/Form-iwbkoaAF.js.map +1 -0
- package/dist/_chunks/{History-wrnHqf09.mjs → History-BKR3KyU3.mjs} +4 -4
- package/dist/_chunks/{History-wrnHqf09.mjs.map → History-BKR3KyU3.mjs.map} +1 -1
- package/dist/_chunks/{History-DNQkXANT.js → History-guuZF4lR.js} +4 -4
- package/dist/_chunks/{History-DNQkXANT.js.map → History-guuZF4lR.js.map} +1 -1
- package/dist/_chunks/{ListConfigurationPage-DScmJVkW.mjs → ListConfigurationPage-B_O3hiLT.mjs} +14 -4
- package/dist/_chunks/ListConfigurationPage-B_O3hiLT.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-CUQxfpjT.js → ListConfigurationPage-Cu26t5sE.js} +14 -4
- package/dist/_chunks/ListConfigurationPage-Cu26t5sE.js.map +1 -0
- package/dist/_chunks/{ListViewPage-C4IvrMgY.mjs → ListViewPage-B4sTBfu6.mjs} +46 -37
- package/dist/_chunks/ListViewPage-B4sTBfu6.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-BsLiH2-2.js → ListViewPage-DWqqGno8.js} +48 -39
- package/dist/_chunks/ListViewPage-DWqqGno8.js.map +1 -0
- package/dist/_chunks/{NoContentTypePage-Djg8nPlj.mjs → NoContentTypePage-Daktt4t9.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-Djg8nPlj.mjs.map → NoContentTypePage-Daktt4t9.mjs.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-BZ-PnGAf.js → NoContentTypePage-TTkwA8uk.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-BZ-PnGAf.js.map → NoContentTypePage-TTkwA8uk.js.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-DSP7R-hv.mjs → NoPermissionsPage-CBUXY2Pt.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-DSP7R-hv.mjs.map → NoPermissionsPage-CBUXY2Pt.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-_lUqjGW3.js → NoPermissionsPage-D8_k39Q0.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-_lUqjGW3.js.map → NoPermissionsPage-D8_k39Q0.js.map} +1 -1
- package/dist/_chunks/{Relations-CtELXYIK.js → Relations-DjvmZ_XQ.js} +4 -4
- package/dist/_chunks/{Relations-CtELXYIK.js.map → Relations-DjvmZ_XQ.js.map} +1 -1
- package/dist/_chunks/{Relations-BZr8tL0R.mjs → Relations-HKmXF7eO.mjs} +4 -4
- package/dist/_chunks/{Relations-BZr8tL0R.mjs.map → Relations-HKmXF7eO.mjs.map} +1 -1
- package/dist/_chunks/{en-uOUIxfcQ.js → en-BVzUkPxZ.js} +6 -5
- package/dist/_chunks/{en-uOUIxfcQ.js.map → en-BVzUkPxZ.js.map} +1 -1
- package/dist/_chunks/{en-BrCTWlZv.mjs → en-CPTj6CjC.mjs} +6 -5
- package/dist/_chunks/{en-BrCTWlZv.mjs.map → en-CPTj6CjC.mjs.map} +1 -1
- package/dist/_chunks/{index-c_5DdJi-.mjs → index-CB1AN26E.mjs} +223 -125
- package/dist/_chunks/index-CB1AN26E.mjs.map +1 -0
- package/dist/_chunks/{index-OerGjbAN.js → index-jDJgW_Lf.js} +204 -106
- package/dist/_chunks/index-jDJgW_Lf.js.map +1 -0
- package/dist/_chunks/{layout-oPBiO7RY.mjs → layout-BCzDsMgN.mjs} +22 -9
- package/dist/_chunks/layout-BCzDsMgN.mjs.map +1 -0
- package/dist/_chunks/{layout-Ci7qHlFb.js → layout-D6A3K-ut.js} +21 -8
- package/dist/_chunks/layout-D6A3K-ut.js.map +1 -0
- package/dist/_chunks/{relations-BIdWFjdq.mjs → relations-B5Jnw32V.mjs} +2 -2
- package/dist/_chunks/{relations-BIdWFjdq.mjs.map → relations-B5Jnw32V.mjs.map} +1 -1
- package/dist/_chunks/{relations-COBpStiF.js → relations-C10QoukP.js} +2 -2
- package/dist/_chunks/{relations-COBpStiF.js.map → relations-C10QoukP.js.map} +1 -1
- package/dist/_chunks/{usePrev-B9w_-eYc.js → useDebounce-CtcjDB3L.js} +14 -1
- package/dist/_chunks/useDebounce-CtcjDB3L.js.map +1 -0
- package/dist/_chunks/useDebounce-DmuSJIF3.mjs +29 -0
- package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +4 -4
- package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +4 -48
- package/dist/admin/src/pages/EditView/components/Header.d.ts +10 -11
- package/dist/admin/src/services/api.d.ts +1 -1
- package/dist/admin/src/services/components.d.ts +2 -2
- package/dist/admin/src/services/contentTypes.d.ts +3 -3
- package/dist/admin/src/services/documents.d.ts +19 -17
- package/dist/admin/src/services/init.d.ts +1 -1
- package/dist/admin/src/services/relations.d.ts +2 -2
- package/dist/admin/src/services/uid.d.ts +3 -3
- package/dist/admin/src/utils/validation.d.ts +4 -1
- package/dist/server/index.js +143 -79
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +144 -80
- 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/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
- package/dist/server/src/history/services/utils.d.ts +2 -1
- package/dist/server/src/history/services/utils.d.ts.map +1 -1
- package/dist/server/src/policies/hasPermissions.d.ts.map +1 -1
- package/dist/server/src/services/document-metadata.d.ts.map +1 -1
- package/dist/server/src/services/permission-checker.d.ts.map +1 -1
- package/dist/shared/contracts/collection-types.d.ts +3 -1
- package/dist/shared/contracts/collection-types.d.ts.map +1 -1
- package/package.json +9 -9
- package/dist/_chunks/EditViewPage-BLsjc5F-.mjs.map +0 -1
- package/dist/_chunks/EditViewPage-C-ukDOB7.js.map +0 -1
- package/dist/_chunks/Field-Bfph5SOd.js.map +0 -1
- package/dist/_chunks/Field-Cs7duwWd.mjs.map +0 -1
- package/dist/_chunks/Form-CPYqIWDG.js.map +0 -1
- package/dist/_chunks/Form-Dg_GS5TQ.mjs.map +0 -1
- package/dist/_chunks/ListConfigurationPage-CUQxfpjT.js.map +0 -1
- package/dist/_chunks/ListConfigurationPage-DScmJVkW.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-BsLiH2-2.js.map +0 -1
- package/dist/_chunks/ListViewPage-C4IvrMgY.mjs.map +0 -1
- package/dist/_chunks/index-OerGjbAN.js.map +0 -1
- package/dist/_chunks/index-c_5DdJi-.mjs.map +0 -1
- package/dist/_chunks/layout-Ci7qHlFb.js.map +0 -1
- package/dist/_chunks/layout-oPBiO7RY.mjs.map +0 -1
- package/dist/_chunks/usePrev-B9w_-eYc.js.map +0 -1
- package/dist/_chunks/usePrev-DH6iah0A.mjs +0 -16
- package/dist/_chunks/usePrev-DH6iah0A.mjs.map +0 -1
@@ -1,16 +1,16 @@
|
|
1
|
-
import {
|
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
3
|
import { useStrapiApp, createContext, useAuth, useRBAC, Page, adminApi, translatedErrors, useNotification, useAPIErrorHandler, getYupValidationErrors, useQueryParams, useTracking, useForm, BackButton, DescriptionComponentRenderer, useTable, Table } from "@strapi/admin/strapi-admin";
|
4
4
|
import * as React from "react";
|
5
5
|
import { lazy } from "react";
|
6
|
-
import { Button, Menu, VisuallyHidden, Flex,
|
6
|
+
import { Button, Menu, VisuallyHidden, Flex, Typography, Dialog, Modal, Radio, Status, Box, SingleSelect, SingleSelectOption, IconButton, Loader, Tooltip, LinkButton } from "@strapi/design-system";
|
7
7
|
import { useIntl } from "react-intl";
|
8
|
-
import { useParams,
|
9
|
-
import { styled } from "styled-components";
|
8
|
+
import { useParams, useNavigate, Navigate, useMatch, useLocation, Link, NavLink } from "react-router-dom";
|
10
9
|
import * as yup from "yup";
|
11
10
|
import { ValidationError } from "yup";
|
12
11
|
import pipe from "lodash/fp/pipe";
|
13
12
|
import { intervalToDuration, isPast } from "date-fns";
|
13
|
+
import { styled } from "styled-components";
|
14
14
|
import { stringify } from "qs";
|
15
15
|
import { createSlice, combineReducers } from "@reduxjs/toolkit";
|
16
16
|
const __variableDynamicImportRuntimeHelper = (glob, path) => {
|
@@ -158,7 +158,8 @@ const contentManagerApi = adminApi.enhanceEndpoints({
|
|
158
158
|
"Document",
|
159
159
|
"InitialData",
|
160
160
|
"HistoryVersion",
|
161
|
-
"Relations"
|
161
|
+
"Relations",
|
162
|
+
"UidAvailability"
|
162
163
|
]
|
163
164
|
});
|
164
165
|
const documentApi = contentManagerApi.injectEndpoints({
|
@@ -188,7 +189,10 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
188
189
|
params
|
189
190
|
}
|
190
191
|
}),
|
191
|
-
invalidatesTags: (_result, _error, { model }) => [
|
192
|
+
invalidatesTags: (_result, _error, { model }) => [
|
193
|
+
{ type: "Document", id: `${model}_LIST` },
|
194
|
+
{ type: "UidAvailability", id: model }
|
195
|
+
]
|
192
196
|
}),
|
193
197
|
/**
|
194
198
|
* Creates a new collection-type document. This should ONLY be used for collection-types.
|
@@ -205,7 +209,8 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
205
209
|
}),
|
206
210
|
invalidatesTags: (result, _error, { model }) => [
|
207
211
|
{ type: "Document", id: `${model}_LIST` },
|
208
|
-
"Relations"
|
212
|
+
"Relations",
|
213
|
+
{ type: "UidAvailability", id: model }
|
209
214
|
]
|
210
215
|
}),
|
211
216
|
deleteDocument: builder.mutation({
|
@@ -246,7 +251,8 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
246
251
|
id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model
|
247
252
|
},
|
248
253
|
{ type: "Document", id: `${model}_LIST` },
|
249
|
-
"Relations"
|
254
|
+
"Relations",
|
255
|
+
{ type: "UidAvailability", id: model }
|
250
256
|
];
|
251
257
|
}
|
252
258
|
}),
|
@@ -264,6 +270,7 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
264
270
|
}),
|
265
271
|
providesTags: (result, _error, arg) => {
|
266
272
|
return [
|
273
|
+
{ type: "Document", id: `ALL_LIST` },
|
267
274
|
{ type: "Document", id: `${arg.model}_LIST` },
|
268
275
|
...result?.results.map(({ documentId }) => ({
|
269
276
|
type: "Document",
|
@@ -302,6 +309,11 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
302
309
|
{
|
303
310
|
type: "Document",
|
304
311
|
id: collectionType !== SINGLE_TYPES ? `${model}_${result && "documentId" in result ? result.documentId : documentId}` : model
|
312
|
+
},
|
313
|
+
// Make it easy to invalidate all individual documents queries for a model
|
314
|
+
{
|
315
|
+
type: "Document",
|
316
|
+
id: `${model}_ALL_ITEMS`
|
305
317
|
}
|
306
318
|
];
|
307
319
|
}
|
@@ -365,7 +377,8 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
365
377
|
type: "Document",
|
366
378
|
id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model
|
367
379
|
},
|
368
|
-
"Relations"
|
380
|
+
"Relations",
|
381
|
+
{ type: "UidAvailability", id: model }
|
369
382
|
];
|
370
383
|
},
|
371
384
|
async onQueryStarted({ data, ...patch }, { dispatch, queryFulfilled }) {
|
@@ -448,7 +461,7 @@ const buildValidParams = (query) => {
|
|
448
461
|
const isBaseQueryError = (error) => {
|
449
462
|
return error.name !== void 0;
|
450
463
|
};
|
451
|
-
const createYupSchema = (attributes = {}, components = {}) => {
|
464
|
+
const createYupSchema = (attributes = {}, components = {}, options = { status: null }) => {
|
452
465
|
const createModelSchema = (attributes2) => yup.object().shape(
|
453
466
|
Object.entries(attributes2).reduce((acc, [name, attribute]) => {
|
454
467
|
if (DOCUMENT_META_FIELDS.includes(name)) {
|
@@ -461,7 +474,7 @@ const createYupSchema = (attributes = {}, components = {}) => {
|
|
461
474
|
addMinValidation,
|
462
475
|
addMaxValidation,
|
463
476
|
addRegexValidation
|
464
|
-
].map((fn) => fn(attribute));
|
477
|
+
].map((fn) => fn(attribute, options));
|
465
478
|
const transformSchema = pipe(...validations);
|
466
479
|
switch (attribute.type) {
|
467
480
|
case "component": {
|
@@ -562,6 +575,14 @@ const createAttributeSchema = (attribute) => {
|
|
562
575
|
if (!value || typeof value === "string" && value.length === 0) {
|
563
576
|
return true;
|
564
577
|
}
|
578
|
+
if (typeof value === "object") {
|
579
|
+
try {
|
580
|
+
JSON.stringify(value);
|
581
|
+
return true;
|
582
|
+
} catch (err) {
|
583
|
+
return false;
|
584
|
+
}
|
585
|
+
}
|
565
586
|
try {
|
566
587
|
JSON.parse(value);
|
567
588
|
return true;
|
@@ -580,13 +601,7 @@ const createAttributeSchema = (attribute) => {
|
|
580
601
|
return yup.mixed();
|
581
602
|
}
|
582
603
|
};
|
583
|
-
const
|
584
|
-
if ((attribute.type === "component" && attribute.repeatable || attribute.type === "dynamiczone") && attribute.required && "min" in schema) {
|
585
|
-
return schema.min(1, translatedErrors.required);
|
586
|
-
}
|
587
|
-
if (attribute.required && attribute.type !== "relation") {
|
588
|
-
return schema.required(translatedErrors.required);
|
589
|
-
}
|
604
|
+
const nullableSchema = (schema) => {
|
590
605
|
return schema?.nullable ? schema.nullable() : (
|
591
606
|
// In some cases '.nullable' will not be available on the schema.
|
592
607
|
// e.g. when the schema has been built using yup.lazy (e.g. for relations).
|
@@ -594,7 +609,22 @@ const addRequiredValidation = (attribute) => (schema) => {
|
|
594
609
|
schema
|
595
610
|
);
|
596
611
|
};
|
597
|
-
const
|
612
|
+
const addRequiredValidation = (attribute, options) => (schema) => {
|
613
|
+
if (options.status === "draft") {
|
614
|
+
return nullableSchema(schema);
|
615
|
+
}
|
616
|
+
if ((attribute.type === "component" && attribute.repeatable || attribute.type === "dynamiczone") && attribute.required && "min" in schema) {
|
617
|
+
return schema.min(1, translatedErrors.required);
|
618
|
+
}
|
619
|
+
if (attribute.required && attribute.type !== "relation") {
|
620
|
+
return schema.required(translatedErrors.required);
|
621
|
+
}
|
622
|
+
return nullableSchema(schema);
|
623
|
+
};
|
624
|
+
const addMinLengthValidation = (attribute, options) => (schema) => {
|
625
|
+
if (options.status === "draft") {
|
626
|
+
return schema;
|
627
|
+
}
|
598
628
|
if ("minLength" in attribute && attribute.minLength && Number.isInteger(attribute.minLength) && "min" in schema) {
|
599
629
|
return schema.min(attribute.minLength, {
|
600
630
|
...translatedErrors.minLength,
|
@@ -616,11 +646,11 @@ const addMaxLengthValidation = (attribute) => (schema) => {
|
|
616
646
|
}
|
617
647
|
return schema;
|
618
648
|
};
|
619
|
-
const addMinValidation = (attribute) => (schema) => {
|
649
|
+
const addMinValidation = (attribute, options) => (schema) => {
|
620
650
|
if ("min" in attribute) {
|
621
651
|
const min = toInteger(attribute.min);
|
622
652
|
if (attribute.type === "component" && attribute.repeatable || attribute.type === "dynamiczone") {
|
623
|
-
if (!attribute.required && "test" in schema && min) {
|
653
|
+
if (options.status !== "draft" && !attribute.required && "test" in schema && min) {
|
624
654
|
return schema.test(
|
625
655
|
"custom-min",
|
626
656
|
{
|
@@ -856,6 +886,7 @@ const useDocumentActions = () => {
|
|
856
886
|
const { formatMessage } = useIntl();
|
857
887
|
const { trackUsage } = useTracking();
|
858
888
|
const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();
|
889
|
+
const navigate = useNavigate();
|
859
890
|
const [deleteDocument] = useDeleteDocumentMutation();
|
860
891
|
const _delete = React.useCallback(
|
861
892
|
async ({ collectionType, model, documentId, params }, trackerProperty) => {
|
@@ -1209,7 +1240,7 @@ const useDocumentActions = () => {
|
|
1209
1240
|
throw err;
|
1210
1241
|
}
|
1211
1242
|
},
|
1212
|
-
[autoCloneDocument,
|
1243
|
+
[autoCloneDocument, formatMessage, toggleNotification]
|
1213
1244
|
);
|
1214
1245
|
const [cloneDocument] = useCloneDocumentMutation();
|
1215
1246
|
const clone = React.useCallback(
|
@@ -1235,6 +1266,7 @@ const useDocumentActions = () => {
|
|
1235
1266
|
defaultMessage: "Cloned document"
|
1236
1267
|
})
|
1237
1268
|
});
|
1269
|
+
navigate(`../../${res.data.data.documentId}`, { relative: "path" });
|
1238
1270
|
return res.data;
|
1239
1271
|
} catch (err) {
|
1240
1272
|
toggleNotification({
|
@@ -1245,7 +1277,7 @@ const useDocumentActions = () => {
|
|
1245
1277
|
throw err;
|
1246
1278
|
}
|
1247
1279
|
},
|
1248
|
-
[cloneDocument, trackUsage, toggleNotification, formatMessage, formatAPIError]
|
1280
|
+
[cloneDocument, trackUsage, toggleNotification, formatMessage, formatAPIError, navigate]
|
1249
1281
|
);
|
1250
1282
|
const [getDoc] = useLazyGetDocumentQuery();
|
1251
1283
|
const getDocument = React.useCallback(
|
@@ -1271,7 +1303,7 @@ const useDocumentActions = () => {
|
|
1271
1303
|
};
|
1272
1304
|
};
|
1273
1305
|
const ProtectedHistoryPage = lazy(
|
1274
|
-
() => import("./History-
|
1306
|
+
() => import("./History-BKR3KyU3.mjs").then((mod) => ({ default: mod.ProtectedHistoryPage }))
|
1275
1307
|
);
|
1276
1308
|
const routes$1 = [
|
1277
1309
|
{
|
@@ -1284,31 +1316,31 @@ const routes$1 = [
|
|
1284
1316
|
}
|
1285
1317
|
];
|
1286
1318
|
const ProtectedEditViewPage = lazy(
|
1287
|
-
() => import("./EditViewPage-
|
1319
|
+
() => import("./EditViewPage-nmrHNiJ9.mjs").then((mod) => ({ default: mod.ProtectedEditViewPage }))
|
1288
1320
|
);
|
1289
1321
|
const ProtectedListViewPage = lazy(
|
1290
|
-
() => import("./ListViewPage-
|
1322
|
+
() => import("./ListViewPage-B4sTBfu6.mjs").then((mod) => ({ default: mod.ProtectedListViewPage }))
|
1291
1323
|
);
|
1292
1324
|
const ProtectedListConfiguration = lazy(
|
1293
|
-
() => import("./ListConfigurationPage-
|
1325
|
+
() => import("./ListConfigurationPage-B_O3hiLT.mjs").then((mod) => ({
|
1294
1326
|
default: mod.ProtectedListConfiguration
|
1295
1327
|
}))
|
1296
1328
|
);
|
1297
1329
|
const ProtectedEditConfigurationPage = lazy(
|
1298
|
-
() => import("./EditConfigurationPage-
|
1330
|
+
() => import("./EditConfigurationPage-C19b_9RL.mjs").then((mod) => ({
|
1299
1331
|
default: mod.ProtectedEditConfigurationPage
|
1300
1332
|
}))
|
1301
1333
|
);
|
1302
1334
|
const ProtectedComponentConfigurationPage = lazy(
|
1303
|
-
() => import("./ComponentConfigurationPage-
|
1335
|
+
() => import("./ComponentConfigurationPage-Ccwb19Qj.mjs").then((mod) => ({
|
1304
1336
|
default: mod.ProtectedComponentConfigurationPage
|
1305
1337
|
}))
|
1306
1338
|
);
|
1307
1339
|
const NoPermissions = lazy(
|
1308
|
-
() => import("./NoPermissionsPage-
|
1340
|
+
() => import("./NoPermissionsPage-CBUXY2Pt.mjs").then((mod) => ({ default: mod.NoPermissions }))
|
1309
1341
|
);
|
1310
1342
|
const NoContentType = lazy(
|
1311
|
-
() => import("./NoContentTypePage-
|
1343
|
+
() => import("./NoContentTypePage-Daktt4t9.mjs").then((mod) => ({ default: mod.NoContentType }))
|
1312
1344
|
);
|
1313
1345
|
const CollectionTypePages = () => {
|
1314
1346
|
const { collectionType } = useParams();
|
@@ -1422,12 +1454,14 @@ const DocumentActionButton = (action) => {
|
|
1422
1454
|
/* @__PURE__ */ jsx(
|
1423
1455
|
Button,
|
1424
1456
|
{
|
1425
|
-
flex:
|
1457
|
+
flex: "auto",
|
1426
1458
|
startIcon: action.icon,
|
1427
1459
|
disabled: action.disabled,
|
1428
1460
|
onClick: handleClick(action),
|
1429
1461
|
justifyContent: "center",
|
1430
1462
|
variant: action.variant || "default",
|
1463
|
+
paddingTop: "7px",
|
1464
|
+
paddingBottom: "7px",
|
1431
1465
|
children: action.label
|
1432
1466
|
}
|
1433
1467
|
),
|
@@ -1492,9 +1526,9 @@ const DocumentActionsMenu = ({
|
|
1492
1526
|
disabled: isDisabled,
|
1493
1527
|
size: "S",
|
1494
1528
|
endIcon: null,
|
1495
|
-
paddingTop: "
|
1496
|
-
paddingLeft: "
|
1497
|
-
paddingRight: "
|
1529
|
+
paddingTop: "4px",
|
1530
|
+
paddingLeft: "7px",
|
1531
|
+
paddingRight: "7px",
|
1498
1532
|
variant,
|
1499
1533
|
children: [
|
1500
1534
|
/* @__PURE__ */ jsx(More, { "aria-hidden": true, focusable: false }),
|
@@ -1514,10 +1548,25 @@ const DocumentActionsMenu = ({
|
|
1514
1548
|
onSelect: handleClick(action),
|
1515
1549
|
display: "block",
|
1516
1550
|
children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", gap: 4, children: [
|
1517
|
-
/* @__PURE__ */ jsxs(
|
1518
|
-
|
1519
|
-
|
1520
|
-
|
1551
|
+
/* @__PURE__ */ jsxs(
|
1552
|
+
Flex,
|
1553
|
+
{
|
1554
|
+
color: !action.disabled ? convertActionVariantToColor(action.variant) : "inherit",
|
1555
|
+
gap: 2,
|
1556
|
+
tag: "span",
|
1557
|
+
children: [
|
1558
|
+
/* @__PURE__ */ jsx(
|
1559
|
+
Flex,
|
1560
|
+
{
|
1561
|
+
tag: "span",
|
1562
|
+
color: !action.disabled ? convertActionVariantToIconColor(action.variant) : "inherit",
|
1563
|
+
children: action.icon
|
1564
|
+
}
|
1565
|
+
),
|
1566
|
+
action.label
|
1567
|
+
]
|
1568
|
+
}
|
1569
|
+
),
|
1521
1570
|
action.id.startsWith("HistoryAction") && /* @__PURE__ */ jsx(
|
1522
1571
|
Flex,
|
1523
1572
|
{
|
@@ -1614,11 +1663,11 @@ const DocumentActionConfirmDialog = ({
|
|
1614
1663
|
/* @__PURE__ */ jsx(Dialog.Header, { children: title }),
|
1615
1664
|
/* @__PURE__ */ jsx(Dialog.Body, { children: content }),
|
1616
1665
|
/* @__PURE__ */ jsxs(Dialog.Footer, { children: [
|
1617
|
-
/* @__PURE__ */ jsx(Dialog.Cancel, { children: /* @__PURE__ */ jsx(Button, { variant: "tertiary", children: formatMessage({
|
1666
|
+
/* @__PURE__ */ jsx(Dialog.Cancel, { children: /* @__PURE__ */ jsx(Button, { variant: "tertiary", fullWidth: true, children: formatMessage({
|
1618
1667
|
id: "app.components.Button.cancel",
|
1619
1668
|
defaultMessage: "Cancel"
|
1620
1669
|
}) }) }),
|
1621
|
-
/* @__PURE__ */ jsx(Button, { onClick: handleConfirm, variant, children: formatMessage({
|
1670
|
+
/* @__PURE__ */ jsx(Button, { onClick: handleConfirm, variant, fullWidth: true, children: formatMessage({
|
1622
1671
|
id: "app.components.Button.confirm",
|
1623
1672
|
defaultMessage: "Confirm"
|
1624
1673
|
}) })
|
@@ -1657,12 +1706,10 @@ const PublishAction$1 = ({
|
|
1657
1706
|
const navigate = useNavigate();
|
1658
1707
|
const { toggleNotification } = useNotification();
|
1659
1708
|
const { _unstableFormatValidationErrors: formatValidationErrors } = useAPIErrorHandler();
|
1709
|
+
const isListView = useMatch(LIST_PATH) !== null;
|
1660
1710
|
const isCloning = useMatch(CLONE_PATH) !== null;
|
1661
1711
|
const { formatMessage } = useIntl();
|
1662
|
-
const { canPublish
|
1663
|
-
"PublishAction",
|
1664
|
-
({ canPublish: canPublish2, canCreate: canCreate2, canUpdate: canUpdate2 }) => ({ canPublish: canPublish2, canCreate: canCreate2, canUpdate: canUpdate2 })
|
1665
|
-
);
|
1712
|
+
const canPublish = useDocumentRBAC("PublishAction", ({ canPublish: canPublish2 }) => canPublish2);
|
1666
1713
|
const { publish } = useDocumentActions();
|
1667
1714
|
const [
|
1668
1715
|
countDraftRelations,
|
@@ -1714,24 +1761,25 @@ const PublishAction$1 = ({
|
|
1714
1761
|
}
|
1715
1762
|
}, [documentId, modified, formValues, setLocalCountOfDraftRelations]);
|
1716
1763
|
React.useEffect(() => {
|
1717
|
-
if (documentId) {
|
1718
|
-
|
1719
|
-
const { data, error } = await countDraftRelations({
|
1720
|
-
collectionType,
|
1721
|
-
model,
|
1722
|
-
documentId,
|
1723
|
-
params
|
1724
|
-
});
|
1725
|
-
if (error) {
|
1726
|
-
throw error;
|
1727
|
-
}
|
1728
|
-
if (data) {
|
1729
|
-
setServerCountOfDraftRelations(data.data);
|
1730
|
-
}
|
1731
|
-
};
|
1732
|
-
fetchDraftRelationsCount();
|
1764
|
+
if (!document || !document.documentId || isListView) {
|
1765
|
+
return;
|
1733
1766
|
}
|
1734
|
-
|
1767
|
+
const fetchDraftRelationsCount = async () => {
|
1768
|
+
const { data, error } = await countDraftRelations({
|
1769
|
+
collectionType,
|
1770
|
+
model,
|
1771
|
+
documentId,
|
1772
|
+
params
|
1773
|
+
});
|
1774
|
+
if (error) {
|
1775
|
+
throw error;
|
1776
|
+
}
|
1777
|
+
if (data) {
|
1778
|
+
setServerCountOfDraftRelations(data.data);
|
1779
|
+
}
|
1780
|
+
};
|
1781
|
+
fetchDraftRelationsCount();
|
1782
|
+
}, [isListView, document, documentId, countDraftRelations, collectionType, model, params]);
|
1735
1783
|
const isDocumentPublished = (document?.[PUBLISHED_AT_ATTRIBUTE_NAME] || meta?.availableStatus.some((doc) => doc[PUBLISHED_AT_ATTRIBUTE_NAME] !== null)) && document?.status !== "modified";
|
1736
1784
|
if (!schema?.options?.draftAndPublish) {
|
1737
1785
|
return null;
|
@@ -1772,7 +1820,8 @@ const PublishAction$1 = ({
|
|
1772
1820
|
}
|
1773
1821
|
};
|
1774
1822
|
const totalDraftRelations = localCountOfDraftRelations + serverCountOfDraftRelations;
|
1775
|
-
const
|
1823
|
+
const enableDraftRelationsCount = false;
|
1824
|
+
const hasDraftRelations = enableDraftRelationsCount;
|
1776
1825
|
return {
|
1777
1826
|
/**
|
1778
1827
|
* Disabled when:
|
@@ -1782,18 +1831,13 @@ const PublishAction$1 = ({
|
|
1782
1831
|
* - the document is already published & not modified
|
1783
1832
|
* - the document is being created & not modified
|
1784
1833
|
* - the user doesn't have the permission to publish
|
1785
|
-
* - the user doesn't have the permission to create a new document
|
1786
|
-
* - the user doesn't have the permission to update the document
|
1787
1834
|
*/
|
1788
|
-
disabled: isCloning || isSubmitting || isLoadingDraftRelations || activeTab === "published" || !modified && isDocumentPublished || !modified && !document?.documentId || !canPublish
|
1835
|
+
disabled: isCloning || isSubmitting || isLoadingDraftRelations || activeTab === "published" || !modified && isDocumentPublished || !modified && !document?.documentId || !canPublish,
|
1789
1836
|
label: formatMessage({
|
1790
1837
|
id: "app.utils.publish",
|
1791
1838
|
defaultMessage: "Publish"
|
1792
1839
|
}),
|
1793
1840
|
onClick: async () => {
|
1794
|
-
if (hasDraftRelations) {
|
1795
|
-
return;
|
1796
|
-
}
|
1797
1841
|
await performPublish();
|
1798
1842
|
},
|
1799
1843
|
dialog: hasDraftRelations ? {
|
@@ -1832,10 +1876,6 @@ const UpdateAction = ({
|
|
1832
1876
|
const cloneMatch = useMatch(CLONE_PATH);
|
1833
1877
|
const isCloning = cloneMatch !== null;
|
1834
1878
|
const { formatMessage } = useIntl();
|
1835
|
-
const { canCreate, canUpdate } = useDocumentRBAC("UpdateAction", ({ canCreate: canCreate2, canUpdate: canUpdate2 }) => ({
|
1836
|
-
canCreate: canCreate2,
|
1837
|
-
canUpdate: canUpdate2
|
1838
|
-
}));
|
1839
1879
|
const { create, update, clone } = useDocumentActions();
|
1840
1880
|
const [{ query, rawQuery }] = useQueryParams();
|
1841
1881
|
const params = React.useMemo(() => buildValidParams(query), [query]);
|
@@ -1852,10 +1892,8 @@ const UpdateAction = ({
|
|
1852
1892
|
* - the form is submitting
|
1853
1893
|
* - the document is not modified & we're not cloning (you can save a clone entity straight away)
|
1854
1894
|
* - the active tab is the published tab
|
1855
|
-
* - the user doesn't have the permission to create a new document
|
1856
|
-
* - the user doesn't have the permission to update the document
|
1857
1895
|
*/
|
1858
|
-
disabled: isSubmitting || !modified && !isCloning || activeTab === "published"
|
1896
|
+
disabled: isSubmitting || !modified && !isCloning || activeTab === "published",
|
1859
1897
|
label: formatMessage({
|
1860
1898
|
id: "content-manager.containers.Edit.save",
|
1861
1899
|
defaultMessage: "Save"
|
@@ -1863,16 +1901,18 @@ const UpdateAction = ({
|
|
1863
1901
|
onClick: async () => {
|
1864
1902
|
setSubmitting(true);
|
1865
1903
|
try {
|
1866
|
-
|
1867
|
-
|
1868
|
-
|
1869
|
-
|
1870
|
-
|
1871
|
-
|
1872
|
-
|
1873
|
-
|
1874
|
-
|
1875
|
-
|
1904
|
+
if (activeTab !== "draft") {
|
1905
|
+
const { errors } = await validate();
|
1906
|
+
if (errors) {
|
1907
|
+
toggleNotification({
|
1908
|
+
type: "danger",
|
1909
|
+
message: formatMessage({
|
1910
|
+
id: "content-manager.validation.error",
|
1911
|
+
defaultMessage: "There are validation errors in your document. Please fix them before saving."
|
1912
|
+
})
|
1913
|
+
});
|
1914
|
+
return;
|
1915
|
+
}
|
1876
1916
|
}
|
1877
1917
|
if (isCloning) {
|
1878
1918
|
const res = await clone(
|
@@ -1968,7 +2008,7 @@ const UnpublishAction$1 = ({
|
|
1968
2008
|
id: "app.utils.unpublish",
|
1969
2009
|
defaultMessage: "Unpublish"
|
1970
2010
|
}),
|
1971
|
-
icon: /* @__PURE__ */ jsx(
|
2011
|
+
icon: /* @__PURE__ */ jsx(Cross, {}),
|
1972
2012
|
onClick: async () => {
|
1973
2013
|
if (!documentId && collectionType !== SINGLE_TYPES || isDocumentModified) {
|
1974
2014
|
if (!documentId) {
|
@@ -2080,7 +2120,7 @@ const DiscardAction = ({
|
|
2080
2120
|
id: "content-manager.actions.discard.label",
|
2081
2121
|
defaultMessage: "Discard changes"
|
2082
2122
|
}),
|
2083
|
-
icon: /* @__PURE__ */ jsx(
|
2123
|
+
icon: /* @__PURE__ */ jsx(Cross, {}),
|
2084
2124
|
position: ["panel", "table-row"],
|
2085
2125
|
variant: "danger",
|
2086
2126
|
dialog: {
|
@@ -2108,11 +2148,6 @@ const DiscardAction = ({
|
|
2108
2148
|
};
|
2109
2149
|
};
|
2110
2150
|
DiscardAction.type = "discard";
|
2111
|
-
const StyledCrossCircle = styled(CrossCircle)`
|
2112
|
-
path {
|
2113
|
-
fill: currentColor;
|
2114
|
-
}
|
2115
|
-
`;
|
2116
2151
|
const DEFAULT_ACTIONS = [PublishAction$1, UpdateAction, UnpublishAction$1, DiscardAction];
|
2117
2152
|
const intervals = ["years", "months", "days", "hours", "minutes", "seconds"];
|
2118
2153
|
const RelativeTime = React.forwardRef(
|
@@ -2160,7 +2195,7 @@ const getDisplayName = ({
|
|
2160
2195
|
};
|
2161
2196
|
const capitalise = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
2162
2197
|
const DocumentStatus = ({ status = "draft", ...restProps }) => {
|
2163
|
-
const statusVariant = status === "draft" ? "
|
2198
|
+
const statusVariant = status === "draft" ? "secondary" : status === "published" ? "success" : "alternative";
|
2164
2199
|
return /* @__PURE__ */ jsx(Status, { ...restProps, showBullet: false, size: "S", variant: statusVariant, children: /* @__PURE__ */ jsx(Typography, { tag: "span", variant: "omega", fontWeight: "bold", children: capitalise(status) }) });
|
2165
2200
|
};
|
2166
2201
|
const Header = ({ isCreating, status, title: documentTitle = "Untitled" }) => {
|
@@ -2343,8 +2378,22 @@ const Information = ({ activeTab }) => {
|
|
2343
2378
|
);
|
2344
2379
|
};
|
2345
2380
|
const HeaderActions = ({ actions: actions2 }) => {
|
2346
|
-
|
2347
|
-
|
2381
|
+
const [dialogId, setDialogId] = React.useState(null);
|
2382
|
+
const handleClick = (action) => async (e) => {
|
2383
|
+
if (!("options" in action)) {
|
2384
|
+
const { onClick = () => false, dialog, id } = action;
|
2385
|
+
const muteDialog = await onClick(e);
|
2386
|
+
if (dialog && !muteDialog) {
|
2387
|
+
e.preventDefault();
|
2388
|
+
setDialogId(id);
|
2389
|
+
}
|
2390
|
+
}
|
2391
|
+
};
|
2392
|
+
const handleClose = () => {
|
2393
|
+
setDialogId(null);
|
2394
|
+
};
|
2395
|
+
return /* @__PURE__ */ jsx(Flex, { gap: 1, children: actions2.map((action) => {
|
2396
|
+
if (action.options) {
|
2348
2397
|
return /* @__PURE__ */ jsx(
|
2349
2398
|
SingleSelect,
|
2350
2399
|
{
|
@@ -2358,10 +2407,49 @@ const HeaderActions = ({ actions: actions2 }) => {
|
|
2358
2407
|
action.id
|
2359
2408
|
);
|
2360
2409
|
} else {
|
2361
|
-
|
2410
|
+
if (action.type === "icon") {
|
2411
|
+
return /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
2412
|
+
/* @__PURE__ */ jsx(
|
2413
|
+
IconButton,
|
2414
|
+
{
|
2415
|
+
disabled: action.disabled,
|
2416
|
+
label: action.label,
|
2417
|
+
size: "S",
|
2418
|
+
onClick: handleClick(action),
|
2419
|
+
children: action.icon
|
2420
|
+
}
|
2421
|
+
),
|
2422
|
+
action.dialog ? /* @__PURE__ */ jsx(
|
2423
|
+
HeaderActionDialog,
|
2424
|
+
{
|
2425
|
+
...action.dialog,
|
2426
|
+
isOpen: dialogId === action.id,
|
2427
|
+
onClose: handleClose
|
2428
|
+
}
|
2429
|
+
) : null
|
2430
|
+
] }, action.id);
|
2431
|
+
}
|
2362
2432
|
}
|
2363
2433
|
}) });
|
2364
2434
|
};
|
2435
|
+
const HeaderActionDialog = ({
|
2436
|
+
onClose,
|
2437
|
+
onCancel,
|
2438
|
+
title,
|
2439
|
+
content: Content,
|
2440
|
+
isOpen
|
2441
|
+
}) => {
|
2442
|
+
const handleClose = async () => {
|
2443
|
+
if (onCancel) {
|
2444
|
+
await onCancel();
|
2445
|
+
}
|
2446
|
+
onClose();
|
2447
|
+
};
|
2448
|
+
return /* @__PURE__ */ jsx(Dialog.Root, { open: isOpen, onOpenChange: handleClose, children: /* @__PURE__ */ jsxs(Dialog.Content, { children: [
|
2449
|
+
/* @__PURE__ */ jsx(Dialog.Header, { children: title }),
|
2450
|
+
typeof Content === "function" ? /* @__PURE__ */ jsx(Content, { onClose: handleClose }) : Content
|
2451
|
+
] }) });
|
2452
|
+
};
|
2365
2453
|
const ConfigureTheViewAction = ({ collectionType, model }) => {
|
2366
2454
|
const navigate = useNavigate();
|
2367
2455
|
const { formatMessage } = useIntl();
|
@@ -2497,7 +2585,7 @@ const ActionsPanel = () => {
|
|
2497
2585
|
return {
|
2498
2586
|
title: formatMessage({
|
2499
2587
|
id: "content-manager.containers.edit.panels.default.title",
|
2500
|
-
defaultMessage: "
|
2588
|
+
defaultMessage: "Entry"
|
2501
2589
|
}),
|
2502
2590
|
content: /* @__PURE__ */ jsx(ActionsPanelContent, {})
|
2503
2591
|
};
|
@@ -2741,7 +2829,8 @@ const formatEditLayout = (data, {
|
|
2741
2829
|
layout: convertEditLayoutToFieldLayouts(
|
2742
2830
|
configuration.layouts.edit,
|
2743
2831
|
components[uid].attributes,
|
2744
|
-
configuration.metadatas
|
2832
|
+
configuration.metadatas,
|
2833
|
+
{ configurations: data.components, schemas: components }
|
2745
2834
|
),
|
2746
2835
|
settings: {
|
2747
2836
|
...configuration.settings,
|
@@ -2898,6 +2987,7 @@ const ConfirmDialogPublishAll = ({
|
|
2898
2987
|
const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler(getTranslation);
|
2899
2988
|
const { model, schema } = useDoc();
|
2900
2989
|
const [{ query }] = useQueryParams();
|
2990
|
+
const enableDraftRelationsCount = false;
|
2901
2991
|
const {
|
2902
2992
|
data: countDraftRelations = 0,
|
2903
2993
|
isLoading,
|
@@ -2909,7 +2999,7 @@ const ConfirmDialogPublishAll = ({
|
|
2909
2999
|
locale: query?.plugins?.i18n?.locale
|
2910
3000
|
},
|
2911
3001
|
{
|
2912
|
-
skip:
|
3002
|
+
skip: !enableDraftRelationsCount
|
2913
3003
|
}
|
2914
3004
|
);
|
2915
3005
|
React.useEffect(() => {
|
@@ -3094,7 +3184,7 @@ const SelectedEntriesTableContent = ({
|
|
3094
3184
|
status: row.status
|
3095
3185
|
}
|
3096
3186
|
) }),
|
3097
|
-
/* @__PURE__ */ jsx(Table.Cell, { children: /* @__PURE__ */ jsx(
|
3187
|
+
/* @__PURE__ */ jsx(Table.Cell, { children: /* @__PURE__ */ jsx(Flex, { children: /* @__PURE__ */ jsx(
|
3098
3188
|
IconButton,
|
3099
3189
|
{
|
3100
3190
|
tag: Link,
|
@@ -3117,9 +3207,10 @@ const SelectedEntriesTableContent = ({
|
|
3117
3207
|
),
|
3118
3208
|
target: "_blank",
|
3119
3209
|
marginLeft: "auto",
|
3120
|
-
|
3210
|
+
variant: "ghost",
|
3211
|
+
children: /* @__PURE__ */ jsx(Pencil, { width: "1.6rem", height: "1.6rem" })
|
3121
3212
|
}
|
3122
|
-
) })
|
3213
|
+
) }) })
|
3123
3214
|
] }, row.id)) })
|
3124
3215
|
] });
|
3125
3216
|
};
|
@@ -3156,7 +3247,13 @@ const SelectedEntriesModalContent = ({
|
|
3156
3247
|
);
|
3157
3248
|
const { rows, validationErrors } = React.useMemo(() => {
|
3158
3249
|
if (data.length > 0 && schema) {
|
3159
|
-
const validate = createYupSchema(
|
3250
|
+
const validate = createYupSchema(
|
3251
|
+
schema.attributes,
|
3252
|
+
components,
|
3253
|
+
// Since this is the "Publish" action, the validation
|
3254
|
+
// schema must enforce the rules for published entities
|
3255
|
+
{ status: "published" }
|
3256
|
+
);
|
3160
3257
|
const validationErrors2 = {};
|
3161
3258
|
const rows2 = data.map((entry) => {
|
3162
3259
|
try {
|
@@ -3506,7 +3603,7 @@ const TableActions = ({ document }) => {
|
|
3506
3603
|
DescriptionComponentRenderer,
|
3507
3604
|
{
|
3508
3605
|
props,
|
3509
|
-
descriptions: plugins["content-manager"].apis.getDocumentActions(),
|
3606
|
+
descriptions: plugins["content-manager"].apis.getDocumentActions().filter((action) => action.name !== "PublishAction"),
|
3510
3607
|
children: (actions2) => {
|
3511
3608
|
const tableRowActions = actions2.filter((action) => {
|
3512
3609
|
const positions = Array.isArray(action.position) ? action.position : [action.position];
|
@@ -3617,7 +3714,7 @@ const CloneAction = ({ model, documentId }) => {
|
|
3617
3714
|
}),
|
3618
3715
|
content: /* @__PURE__ */ jsx(AutoCloneFailureModalBody, { prohibitedFields }),
|
3619
3716
|
footer: ({ onClose }) => {
|
3620
|
-
return /* @__PURE__ */ jsxs(
|
3717
|
+
return /* @__PURE__ */ jsxs(Modal.Footer, { children: [
|
3621
3718
|
/* @__PURE__ */ jsx(Button, { onClick: onClose, variant: "tertiary", children: formatMessage({
|
3622
3719
|
id: "cancel",
|
3623
3720
|
defaultMessage: "Cancel"
|
@@ -3848,7 +3945,7 @@ const index = {
|
|
3848
3945
|
app.router.addRoute({
|
3849
3946
|
path: "content-manager/*",
|
3850
3947
|
lazy: async () => {
|
3851
|
-
const { Layout } = await import("./layout-
|
3948
|
+
const { Layout } = await import("./layout-BCzDsMgN.mjs");
|
3852
3949
|
return {
|
3853
3950
|
Component: Layout
|
3854
3951
|
};
|
@@ -3865,7 +3962,7 @@ const index = {
|
|
3865
3962
|
async registerTrads({ locales }) {
|
3866
3963
|
const importedTrads = await Promise.all(
|
3867
3964
|
locales.map((locale) => {
|
3868
|
-
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-
|
3965
|
+
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-CPTj6CjC.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 }) => {
|
3869
3966
|
return {
|
3870
3967
|
data: prefixPluginTranslations(data, PLUGIN_ID),
|
3871
3968
|
locale
|
@@ -3886,13 +3983,14 @@ export {
|
|
3886
3983
|
BulkActionsRenderer as B,
|
3887
3984
|
COLLECTION_TYPES as C,
|
3888
3985
|
DocumentStatus as D,
|
3889
|
-
|
3890
|
-
|
3891
|
-
|
3986
|
+
extractContentTypeComponents as E,
|
3987
|
+
DEFAULT_SETTINGS as F,
|
3988
|
+
convertEditLayoutToFieldLayouts as G,
|
3892
3989
|
HOOKS as H,
|
3893
3990
|
InjectionZone as I,
|
3894
|
-
|
3895
|
-
|
3991
|
+
useDocument as J,
|
3992
|
+
index as K,
|
3993
|
+
useDocumentActions as L,
|
3896
3994
|
Panels as P,
|
3897
3995
|
RelativeTime as R,
|
3898
3996
|
SINGLE_TYPES as S,
|
@@ -3910,18 +4008,18 @@ export {
|
|
3910
4008
|
PERMISSIONS as k,
|
3911
4009
|
DocumentRBAC as l,
|
3912
4010
|
DOCUMENT_META_FIELDS as m,
|
3913
|
-
|
3914
|
-
|
3915
|
-
|
3916
|
-
|
3917
|
-
|
4011
|
+
CLONE_PATH as n,
|
4012
|
+
useDocLayout as o,
|
4013
|
+
useGetContentTypeConfigurationQuery as p,
|
4014
|
+
CREATOR_FIELDS as q,
|
4015
|
+
getMainField as r,
|
3918
4016
|
setInitialData as s,
|
3919
|
-
|
4017
|
+
getDisplayName as t,
|
3920
4018
|
useContentTypeSchema as u,
|
3921
|
-
|
3922
|
-
|
3923
|
-
|
3924
|
-
|
3925
|
-
|
4019
|
+
checkIfAttributeIsDisplayable as v,
|
4020
|
+
useGetAllDocumentsQuery as w,
|
4021
|
+
convertListLayoutToFieldLayouts as x,
|
4022
|
+
capitalise as y,
|
4023
|
+
useUpdateContentTypeConfigurationMutation as z
|
3926
4024
|
};
|
3927
|
-
//# sourceMappingURL=index-
|
4025
|
+
//# sourceMappingURL=index-CB1AN26E.mjs.map
|