@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
@@ -6,10 +6,10 @@ const React = require("react");
|
|
6
6
|
const designSystem = require("@strapi/design-system");
|
7
7
|
const reactIntl = require("react-intl");
|
8
8
|
const reactRouterDom = require("react-router-dom");
|
9
|
-
const styledComponents = require("styled-components");
|
10
9
|
const yup = require("yup");
|
11
10
|
const pipe = require("lodash/fp/pipe");
|
12
11
|
const dateFns = require("date-fns");
|
12
|
+
const styledComponents = require("styled-components");
|
13
13
|
const qs = require("qs");
|
14
14
|
const toolkit = require("@reduxjs/toolkit");
|
15
15
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
@@ -179,7 +179,8 @@ const contentManagerApi = strapiAdmin.adminApi.enhanceEndpoints({
|
|
179
179
|
"Document",
|
180
180
|
"InitialData",
|
181
181
|
"HistoryVersion",
|
182
|
-
"Relations"
|
182
|
+
"Relations",
|
183
|
+
"UidAvailability"
|
183
184
|
]
|
184
185
|
});
|
185
186
|
const documentApi = contentManagerApi.injectEndpoints({
|
@@ -209,7 +210,10 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
209
210
|
params
|
210
211
|
}
|
211
212
|
}),
|
212
|
-
invalidatesTags: (_result, _error, { model }) => [
|
213
|
+
invalidatesTags: (_result, _error, { model }) => [
|
214
|
+
{ type: "Document", id: `${model}_LIST` },
|
215
|
+
{ type: "UidAvailability", id: model }
|
216
|
+
]
|
213
217
|
}),
|
214
218
|
/**
|
215
219
|
* Creates a new collection-type document. This should ONLY be used for collection-types.
|
@@ -226,7 +230,8 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
226
230
|
}),
|
227
231
|
invalidatesTags: (result, _error, { model }) => [
|
228
232
|
{ type: "Document", id: `${model}_LIST` },
|
229
|
-
"Relations"
|
233
|
+
"Relations",
|
234
|
+
{ type: "UidAvailability", id: model }
|
230
235
|
]
|
231
236
|
}),
|
232
237
|
deleteDocument: builder.mutation({
|
@@ -267,7 +272,8 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
267
272
|
id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model
|
268
273
|
},
|
269
274
|
{ type: "Document", id: `${model}_LIST` },
|
270
|
-
"Relations"
|
275
|
+
"Relations",
|
276
|
+
{ type: "UidAvailability", id: model }
|
271
277
|
];
|
272
278
|
}
|
273
279
|
}),
|
@@ -285,6 +291,7 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
285
291
|
}),
|
286
292
|
providesTags: (result, _error, arg) => {
|
287
293
|
return [
|
294
|
+
{ type: "Document", id: `ALL_LIST` },
|
288
295
|
{ type: "Document", id: `${arg.model}_LIST` },
|
289
296
|
...result?.results.map(({ documentId }) => ({
|
290
297
|
type: "Document",
|
@@ -323,6 +330,11 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
323
330
|
{
|
324
331
|
type: "Document",
|
325
332
|
id: collectionType !== SINGLE_TYPES ? `${model}_${result && "documentId" in result ? result.documentId : documentId}` : model
|
333
|
+
},
|
334
|
+
// Make it easy to invalidate all individual documents queries for a model
|
335
|
+
{
|
336
|
+
type: "Document",
|
337
|
+
id: `${model}_ALL_ITEMS`
|
326
338
|
}
|
327
339
|
];
|
328
340
|
}
|
@@ -386,7 +398,8 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
386
398
|
type: "Document",
|
387
399
|
id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model
|
388
400
|
},
|
389
|
-
"Relations"
|
401
|
+
"Relations",
|
402
|
+
{ type: "UidAvailability", id: model }
|
390
403
|
];
|
391
404
|
},
|
392
405
|
async onQueryStarted({ data, ...patch }, { dispatch, queryFulfilled }) {
|
@@ -469,7 +482,7 @@ const buildValidParams = (query) => {
|
|
469
482
|
const isBaseQueryError = (error) => {
|
470
483
|
return error.name !== void 0;
|
471
484
|
};
|
472
|
-
const createYupSchema = (attributes = {}, components = {}) => {
|
485
|
+
const createYupSchema = (attributes = {}, components = {}, options = { status: null }) => {
|
473
486
|
const createModelSchema = (attributes2) => yup__namespace.object().shape(
|
474
487
|
Object.entries(attributes2).reduce((acc, [name, attribute]) => {
|
475
488
|
if (DOCUMENT_META_FIELDS.includes(name)) {
|
@@ -482,7 +495,7 @@ const createYupSchema = (attributes = {}, components = {}) => {
|
|
482
495
|
addMinValidation,
|
483
496
|
addMaxValidation,
|
484
497
|
addRegexValidation
|
485
|
-
].map((fn) => fn(attribute));
|
498
|
+
].map((fn) => fn(attribute, options));
|
486
499
|
const transformSchema = pipe__default.default(...validations);
|
487
500
|
switch (attribute.type) {
|
488
501
|
case "component": {
|
@@ -583,6 +596,14 @@ const createAttributeSchema = (attribute) => {
|
|
583
596
|
if (!value || typeof value === "string" && value.length === 0) {
|
584
597
|
return true;
|
585
598
|
}
|
599
|
+
if (typeof value === "object") {
|
600
|
+
try {
|
601
|
+
JSON.stringify(value);
|
602
|
+
return true;
|
603
|
+
} catch (err) {
|
604
|
+
return false;
|
605
|
+
}
|
606
|
+
}
|
586
607
|
try {
|
587
608
|
JSON.parse(value);
|
588
609
|
return true;
|
@@ -601,13 +622,7 @@ const createAttributeSchema = (attribute) => {
|
|
601
622
|
return yup__namespace.mixed();
|
602
623
|
}
|
603
624
|
};
|
604
|
-
const
|
605
|
-
if ((attribute.type === "component" && attribute.repeatable || attribute.type === "dynamiczone") && attribute.required && "min" in schema) {
|
606
|
-
return schema.min(1, strapiAdmin.translatedErrors.required);
|
607
|
-
}
|
608
|
-
if (attribute.required && attribute.type !== "relation") {
|
609
|
-
return schema.required(strapiAdmin.translatedErrors.required);
|
610
|
-
}
|
625
|
+
const nullableSchema = (schema) => {
|
611
626
|
return schema?.nullable ? schema.nullable() : (
|
612
627
|
// In some cases '.nullable' will not be available on the schema.
|
613
628
|
// e.g. when the schema has been built using yup.lazy (e.g. for relations).
|
@@ -615,7 +630,22 @@ const addRequiredValidation = (attribute) => (schema) => {
|
|
615
630
|
schema
|
616
631
|
);
|
617
632
|
};
|
618
|
-
const
|
633
|
+
const addRequiredValidation = (attribute, options) => (schema) => {
|
634
|
+
if (options.status === "draft") {
|
635
|
+
return nullableSchema(schema);
|
636
|
+
}
|
637
|
+
if ((attribute.type === "component" && attribute.repeatable || attribute.type === "dynamiczone") && attribute.required && "min" in schema) {
|
638
|
+
return schema.min(1, strapiAdmin.translatedErrors.required);
|
639
|
+
}
|
640
|
+
if (attribute.required && attribute.type !== "relation") {
|
641
|
+
return schema.required(strapiAdmin.translatedErrors.required);
|
642
|
+
}
|
643
|
+
return nullableSchema(schema);
|
644
|
+
};
|
645
|
+
const addMinLengthValidation = (attribute, options) => (schema) => {
|
646
|
+
if (options.status === "draft") {
|
647
|
+
return schema;
|
648
|
+
}
|
619
649
|
if ("minLength" in attribute && attribute.minLength && Number.isInteger(attribute.minLength) && "min" in schema) {
|
620
650
|
return schema.min(attribute.minLength, {
|
621
651
|
...strapiAdmin.translatedErrors.minLength,
|
@@ -637,11 +667,11 @@ const addMaxLengthValidation = (attribute) => (schema) => {
|
|
637
667
|
}
|
638
668
|
return schema;
|
639
669
|
};
|
640
|
-
const addMinValidation = (attribute) => (schema) => {
|
670
|
+
const addMinValidation = (attribute, options) => (schema) => {
|
641
671
|
if ("min" in attribute) {
|
642
672
|
const min = toInteger(attribute.min);
|
643
673
|
if (attribute.type === "component" && attribute.repeatable || attribute.type === "dynamiczone") {
|
644
|
-
if (!attribute.required && "test" in schema && min) {
|
674
|
+
if (options.status !== "draft" && !attribute.required && "test" in schema && min) {
|
645
675
|
return schema.test(
|
646
676
|
"custom-min",
|
647
677
|
{
|
@@ -877,6 +907,7 @@ const useDocumentActions = () => {
|
|
877
907
|
const { formatMessage } = reactIntl.useIntl();
|
878
908
|
const { trackUsage } = strapiAdmin.useTracking();
|
879
909
|
const { _unstableFormatAPIError: formatAPIError } = strapiAdmin.useAPIErrorHandler();
|
910
|
+
const navigate = reactRouterDom.useNavigate();
|
880
911
|
const [deleteDocument] = useDeleteDocumentMutation();
|
881
912
|
const _delete = React__namespace.useCallback(
|
882
913
|
async ({ collectionType, model, documentId, params }, trackerProperty) => {
|
@@ -1230,7 +1261,7 @@ const useDocumentActions = () => {
|
|
1230
1261
|
throw err;
|
1231
1262
|
}
|
1232
1263
|
},
|
1233
|
-
[autoCloneDocument,
|
1264
|
+
[autoCloneDocument, formatMessage, toggleNotification]
|
1234
1265
|
);
|
1235
1266
|
const [cloneDocument] = useCloneDocumentMutation();
|
1236
1267
|
const clone = React__namespace.useCallback(
|
@@ -1256,6 +1287,7 @@ const useDocumentActions = () => {
|
|
1256
1287
|
defaultMessage: "Cloned document"
|
1257
1288
|
})
|
1258
1289
|
});
|
1290
|
+
navigate(`../../${res.data.data.documentId}`, { relative: "path" });
|
1259
1291
|
return res.data;
|
1260
1292
|
} catch (err) {
|
1261
1293
|
toggleNotification({
|
@@ -1266,7 +1298,7 @@ const useDocumentActions = () => {
|
|
1266
1298
|
throw err;
|
1267
1299
|
}
|
1268
1300
|
},
|
1269
|
-
[cloneDocument, trackUsage, toggleNotification, formatMessage, formatAPIError]
|
1301
|
+
[cloneDocument, trackUsage, toggleNotification, formatMessage, formatAPIError, navigate]
|
1270
1302
|
);
|
1271
1303
|
const [getDoc] = useLazyGetDocumentQuery();
|
1272
1304
|
const getDocument = React__namespace.useCallback(
|
@@ -1292,7 +1324,7 @@ const useDocumentActions = () => {
|
|
1292
1324
|
};
|
1293
1325
|
};
|
1294
1326
|
const ProtectedHistoryPage = React.lazy(
|
1295
|
-
() => Promise.resolve().then(() => require("./History-
|
1327
|
+
() => Promise.resolve().then(() => require("./History-guuZF4lR.js")).then((mod) => ({ default: mod.ProtectedHistoryPage }))
|
1296
1328
|
);
|
1297
1329
|
const routes$1 = [
|
1298
1330
|
{
|
@@ -1305,31 +1337,31 @@ const routes$1 = [
|
|
1305
1337
|
}
|
1306
1338
|
];
|
1307
1339
|
const ProtectedEditViewPage = React.lazy(
|
1308
|
-
() => Promise.resolve().then(() => require("./EditViewPage-
|
1340
|
+
() => Promise.resolve().then(() => require("./EditViewPage-D9xH8HYD.js")).then((mod) => ({ default: mod.ProtectedEditViewPage }))
|
1309
1341
|
);
|
1310
1342
|
const ProtectedListViewPage = React.lazy(
|
1311
|
-
() => Promise.resolve().then(() => require("./ListViewPage-
|
1343
|
+
() => Promise.resolve().then(() => require("./ListViewPage-DWqqGno8.js")).then((mod) => ({ default: mod.ProtectedListViewPage }))
|
1312
1344
|
);
|
1313
1345
|
const ProtectedListConfiguration = React.lazy(
|
1314
|
-
() => Promise.resolve().then(() => require("./ListConfigurationPage-
|
1346
|
+
() => Promise.resolve().then(() => require("./ListConfigurationPage-Cu26t5sE.js")).then((mod) => ({
|
1315
1347
|
default: mod.ProtectedListConfiguration
|
1316
1348
|
}))
|
1317
1349
|
);
|
1318
1350
|
const ProtectedEditConfigurationPage = React.lazy(
|
1319
|
-
() => Promise.resolve().then(() => require("./EditConfigurationPage-
|
1351
|
+
() => Promise.resolve().then(() => require("./EditConfigurationPage-BPoOzhCM.js")).then((mod) => ({
|
1320
1352
|
default: mod.ProtectedEditConfigurationPage
|
1321
1353
|
}))
|
1322
1354
|
);
|
1323
1355
|
const ProtectedComponentConfigurationPage = React.lazy(
|
1324
|
-
() => Promise.resolve().then(() => require("./ComponentConfigurationPage-
|
1356
|
+
() => Promise.resolve().then(() => require("./ComponentConfigurationPage-BlAzljQ6.js")).then((mod) => ({
|
1325
1357
|
default: mod.ProtectedComponentConfigurationPage
|
1326
1358
|
}))
|
1327
1359
|
);
|
1328
1360
|
const NoPermissions = React.lazy(
|
1329
|
-
() => Promise.resolve().then(() => require("./NoPermissionsPage-
|
1361
|
+
() => Promise.resolve().then(() => require("./NoPermissionsPage-D8_k39Q0.js")).then((mod) => ({ default: mod.NoPermissions }))
|
1330
1362
|
);
|
1331
1363
|
const NoContentType = React.lazy(
|
1332
|
-
() => Promise.resolve().then(() => require("./NoContentTypePage-
|
1364
|
+
() => Promise.resolve().then(() => require("./NoContentTypePage-TTkwA8uk.js")).then((mod) => ({ default: mod.NoContentType }))
|
1333
1365
|
);
|
1334
1366
|
const CollectionTypePages = () => {
|
1335
1367
|
const { collectionType } = reactRouterDom.useParams();
|
@@ -1443,12 +1475,14 @@ const DocumentActionButton = (action) => {
|
|
1443
1475
|
/* @__PURE__ */ jsxRuntime.jsx(
|
1444
1476
|
designSystem.Button,
|
1445
1477
|
{
|
1446
|
-
flex:
|
1478
|
+
flex: "auto",
|
1447
1479
|
startIcon: action.icon,
|
1448
1480
|
disabled: action.disabled,
|
1449
1481
|
onClick: handleClick(action),
|
1450
1482
|
justifyContent: "center",
|
1451
1483
|
variant: action.variant || "default",
|
1484
|
+
paddingTop: "7px",
|
1485
|
+
paddingBottom: "7px",
|
1452
1486
|
children: action.label
|
1453
1487
|
}
|
1454
1488
|
),
|
@@ -1513,9 +1547,9 @@ const DocumentActionsMenu = ({
|
|
1513
1547
|
disabled: isDisabled,
|
1514
1548
|
size: "S",
|
1515
1549
|
endIcon: null,
|
1516
|
-
paddingTop: "
|
1517
|
-
paddingLeft: "
|
1518
|
-
paddingRight: "
|
1550
|
+
paddingTop: "4px",
|
1551
|
+
paddingLeft: "7px",
|
1552
|
+
paddingRight: "7px",
|
1519
1553
|
variant,
|
1520
1554
|
children: [
|
1521
1555
|
/* @__PURE__ */ jsxRuntime.jsx(Icons.More, { "aria-hidden": true, focusable: false }),
|
@@ -1535,10 +1569,25 @@ const DocumentActionsMenu = ({
|
|
1535
1569
|
onSelect: handleClick(action),
|
1536
1570
|
display: "block",
|
1537
1571
|
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", gap: 4, children: [
|
1538
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
1539
|
-
|
1540
|
-
|
1541
|
-
|
1572
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
1573
|
+
designSystem.Flex,
|
1574
|
+
{
|
1575
|
+
color: !action.disabled ? convertActionVariantToColor(action.variant) : "inherit",
|
1576
|
+
gap: 2,
|
1577
|
+
tag: "span",
|
1578
|
+
children: [
|
1579
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
1580
|
+
designSystem.Flex,
|
1581
|
+
{
|
1582
|
+
tag: "span",
|
1583
|
+
color: !action.disabled ? convertActionVariantToIconColor(action.variant) : "inherit",
|
1584
|
+
children: action.icon
|
1585
|
+
}
|
1586
|
+
),
|
1587
|
+
action.label
|
1588
|
+
]
|
1589
|
+
}
|
1590
|
+
),
|
1542
1591
|
action.id.startsWith("HistoryAction") && /* @__PURE__ */ jsxRuntime.jsx(
|
1543
1592
|
designSystem.Flex,
|
1544
1593
|
{
|
@@ -1635,11 +1684,11 @@ const DocumentActionConfirmDialog = ({
|
|
1635
1684
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Header, { children: title }),
|
1636
1685
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Body, { children: content }),
|
1637
1686
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Footer, { children: [
|
1638
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Cancel, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", children: formatMessage({
|
1687
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Cancel, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", fullWidth: true, children: formatMessage({
|
1639
1688
|
id: "app.components.Button.cancel",
|
1640
1689
|
defaultMessage: "Cancel"
|
1641
1690
|
}) }) }),
|
1642
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: handleConfirm, variant, children: formatMessage({
|
1691
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: handleConfirm, variant, fullWidth: true, children: formatMessage({
|
1643
1692
|
id: "app.components.Button.confirm",
|
1644
1693
|
defaultMessage: "Confirm"
|
1645
1694
|
}) })
|
@@ -1678,12 +1727,10 @@ const PublishAction$1 = ({
|
|
1678
1727
|
const navigate = reactRouterDom.useNavigate();
|
1679
1728
|
const { toggleNotification } = strapiAdmin.useNotification();
|
1680
1729
|
const { _unstableFormatValidationErrors: formatValidationErrors } = strapiAdmin.useAPIErrorHandler();
|
1730
|
+
const isListView = reactRouterDom.useMatch(LIST_PATH) !== null;
|
1681
1731
|
const isCloning = reactRouterDom.useMatch(CLONE_PATH) !== null;
|
1682
1732
|
const { formatMessage } = reactIntl.useIntl();
|
1683
|
-
const { canPublish
|
1684
|
-
"PublishAction",
|
1685
|
-
({ canPublish: canPublish2, canCreate: canCreate2, canUpdate: canUpdate2 }) => ({ canPublish: canPublish2, canCreate: canCreate2, canUpdate: canUpdate2 })
|
1686
|
-
);
|
1733
|
+
const canPublish = useDocumentRBAC("PublishAction", ({ canPublish: canPublish2 }) => canPublish2);
|
1687
1734
|
const { publish } = useDocumentActions();
|
1688
1735
|
const [
|
1689
1736
|
countDraftRelations,
|
@@ -1735,24 +1782,25 @@ const PublishAction$1 = ({
|
|
1735
1782
|
}
|
1736
1783
|
}, [documentId, modified, formValues, setLocalCountOfDraftRelations]);
|
1737
1784
|
React__namespace.useEffect(() => {
|
1738
|
-
if (documentId) {
|
1739
|
-
|
1740
|
-
const { data, error } = await countDraftRelations({
|
1741
|
-
collectionType,
|
1742
|
-
model,
|
1743
|
-
documentId,
|
1744
|
-
params
|
1745
|
-
});
|
1746
|
-
if (error) {
|
1747
|
-
throw error;
|
1748
|
-
}
|
1749
|
-
if (data) {
|
1750
|
-
setServerCountOfDraftRelations(data.data);
|
1751
|
-
}
|
1752
|
-
};
|
1753
|
-
fetchDraftRelationsCount();
|
1785
|
+
if (!document || !document.documentId || isListView) {
|
1786
|
+
return;
|
1754
1787
|
}
|
1755
|
-
|
1788
|
+
const fetchDraftRelationsCount = async () => {
|
1789
|
+
const { data, error } = await countDraftRelations({
|
1790
|
+
collectionType,
|
1791
|
+
model,
|
1792
|
+
documentId,
|
1793
|
+
params
|
1794
|
+
});
|
1795
|
+
if (error) {
|
1796
|
+
throw error;
|
1797
|
+
}
|
1798
|
+
if (data) {
|
1799
|
+
setServerCountOfDraftRelations(data.data);
|
1800
|
+
}
|
1801
|
+
};
|
1802
|
+
fetchDraftRelationsCount();
|
1803
|
+
}, [isListView, document, documentId, countDraftRelations, collectionType, model, params]);
|
1756
1804
|
const isDocumentPublished = (document?.[PUBLISHED_AT_ATTRIBUTE_NAME] || meta?.availableStatus.some((doc) => doc[PUBLISHED_AT_ATTRIBUTE_NAME] !== null)) && document?.status !== "modified";
|
1757
1805
|
if (!schema?.options?.draftAndPublish) {
|
1758
1806
|
return null;
|
@@ -1793,7 +1841,8 @@ const PublishAction$1 = ({
|
|
1793
1841
|
}
|
1794
1842
|
};
|
1795
1843
|
const totalDraftRelations = localCountOfDraftRelations + serverCountOfDraftRelations;
|
1796
|
-
const
|
1844
|
+
const enableDraftRelationsCount = false;
|
1845
|
+
const hasDraftRelations = enableDraftRelationsCount;
|
1797
1846
|
return {
|
1798
1847
|
/**
|
1799
1848
|
* Disabled when:
|
@@ -1803,18 +1852,13 @@ const PublishAction$1 = ({
|
|
1803
1852
|
* - the document is already published & not modified
|
1804
1853
|
* - the document is being created & not modified
|
1805
1854
|
* - the user doesn't have the permission to publish
|
1806
|
-
* - the user doesn't have the permission to create a new document
|
1807
|
-
* - the user doesn't have the permission to update the document
|
1808
1855
|
*/
|
1809
|
-
disabled: isCloning || isSubmitting || isLoadingDraftRelations || activeTab === "published" || !modified && isDocumentPublished || !modified && !document?.documentId || !canPublish
|
1856
|
+
disabled: isCloning || isSubmitting || isLoadingDraftRelations || activeTab === "published" || !modified && isDocumentPublished || !modified && !document?.documentId || !canPublish,
|
1810
1857
|
label: formatMessage({
|
1811
1858
|
id: "app.utils.publish",
|
1812
1859
|
defaultMessage: "Publish"
|
1813
1860
|
}),
|
1814
1861
|
onClick: async () => {
|
1815
|
-
if (hasDraftRelations) {
|
1816
|
-
return;
|
1817
|
-
}
|
1818
1862
|
await performPublish();
|
1819
1863
|
},
|
1820
1864
|
dialog: hasDraftRelations ? {
|
@@ -1853,10 +1897,6 @@ const UpdateAction = ({
|
|
1853
1897
|
const cloneMatch = reactRouterDom.useMatch(CLONE_PATH);
|
1854
1898
|
const isCloning = cloneMatch !== null;
|
1855
1899
|
const { formatMessage } = reactIntl.useIntl();
|
1856
|
-
const { canCreate, canUpdate } = useDocumentRBAC("UpdateAction", ({ canCreate: canCreate2, canUpdate: canUpdate2 }) => ({
|
1857
|
-
canCreate: canCreate2,
|
1858
|
-
canUpdate: canUpdate2
|
1859
|
-
}));
|
1860
1900
|
const { create, update, clone } = useDocumentActions();
|
1861
1901
|
const [{ query, rawQuery }] = strapiAdmin.useQueryParams();
|
1862
1902
|
const params = React__namespace.useMemo(() => buildValidParams(query), [query]);
|
@@ -1873,10 +1913,8 @@ const UpdateAction = ({
|
|
1873
1913
|
* - the form is submitting
|
1874
1914
|
* - the document is not modified & we're not cloning (you can save a clone entity straight away)
|
1875
1915
|
* - the active tab is the published tab
|
1876
|
-
* - the user doesn't have the permission to create a new document
|
1877
|
-
* - the user doesn't have the permission to update the document
|
1878
1916
|
*/
|
1879
|
-
disabled: isSubmitting || !modified && !isCloning || activeTab === "published"
|
1917
|
+
disabled: isSubmitting || !modified && !isCloning || activeTab === "published",
|
1880
1918
|
label: formatMessage({
|
1881
1919
|
id: "content-manager.containers.Edit.save",
|
1882
1920
|
defaultMessage: "Save"
|
@@ -1884,16 +1922,18 @@ const UpdateAction = ({
|
|
1884
1922
|
onClick: async () => {
|
1885
1923
|
setSubmitting(true);
|
1886
1924
|
try {
|
1887
|
-
|
1888
|
-
|
1889
|
-
|
1890
|
-
|
1891
|
-
|
1892
|
-
|
1893
|
-
|
1894
|
-
|
1895
|
-
|
1896
|
-
|
1925
|
+
if (activeTab !== "draft") {
|
1926
|
+
const { errors } = await validate();
|
1927
|
+
if (errors) {
|
1928
|
+
toggleNotification({
|
1929
|
+
type: "danger",
|
1930
|
+
message: formatMessage({
|
1931
|
+
id: "content-manager.validation.error",
|
1932
|
+
defaultMessage: "There are validation errors in your document. Please fix them before saving."
|
1933
|
+
})
|
1934
|
+
});
|
1935
|
+
return;
|
1936
|
+
}
|
1897
1937
|
}
|
1898
1938
|
if (isCloning) {
|
1899
1939
|
const res = await clone(
|
@@ -1989,7 +2029,7 @@ const UnpublishAction$1 = ({
|
|
1989
2029
|
id: "app.utils.unpublish",
|
1990
2030
|
defaultMessage: "Unpublish"
|
1991
2031
|
}),
|
1992
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(
|
2032
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(Icons.Cross, {}),
|
1993
2033
|
onClick: async () => {
|
1994
2034
|
if (!documentId && collectionType !== SINGLE_TYPES || isDocumentModified) {
|
1995
2035
|
if (!documentId) {
|
@@ -2101,7 +2141,7 @@ const DiscardAction = ({
|
|
2101
2141
|
id: "content-manager.actions.discard.label",
|
2102
2142
|
defaultMessage: "Discard changes"
|
2103
2143
|
}),
|
2104
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(
|
2144
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(Icons.Cross, {}),
|
2105
2145
|
position: ["panel", "table-row"],
|
2106
2146
|
variant: "danger",
|
2107
2147
|
dialog: {
|
@@ -2129,11 +2169,6 @@ const DiscardAction = ({
|
|
2129
2169
|
};
|
2130
2170
|
};
|
2131
2171
|
DiscardAction.type = "discard";
|
2132
|
-
const StyledCrossCircle = styledComponents.styled(Icons.CrossCircle)`
|
2133
|
-
path {
|
2134
|
-
fill: currentColor;
|
2135
|
-
}
|
2136
|
-
`;
|
2137
2172
|
const DEFAULT_ACTIONS = [PublishAction$1, UpdateAction, UnpublishAction$1, DiscardAction];
|
2138
2173
|
const intervals = ["years", "months", "days", "hours", "minutes", "seconds"];
|
2139
2174
|
const RelativeTime = React__namespace.forwardRef(
|
@@ -2181,7 +2216,7 @@ const getDisplayName = ({
|
|
2181
2216
|
};
|
2182
2217
|
const capitalise = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
2183
2218
|
const DocumentStatus = ({ status = "draft", ...restProps }) => {
|
2184
|
-
const statusVariant = status === "draft" ? "
|
2219
|
+
const statusVariant = status === "draft" ? "secondary" : status === "published" ? "success" : "alternative";
|
2185
2220
|
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Status, { ...restProps, showBullet: false, size: "S", variant: statusVariant, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "span", variant: "omega", fontWeight: "bold", children: capitalise(status) }) });
|
2186
2221
|
};
|
2187
2222
|
const Header = ({ isCreating, status, title: documentTitle = "Untitled" }) => {
|
@@ -2364,8 +2399,22 @@ const Information = ({ activeTab }) => {
|
|
2364
2399
|
);
|
2365
2400
|
};
|
2366
2401
|
const HeaderActions = ({ actions: actions2 }) => {
|
2367
|
-
|
2368
|
-
|
2402
|
+
const [dialogId, setDialogId] = React__namespace.useState(null);
|
2403
|
+
const handleClick = (action) => async (e) => {
|
2404
|
+
if (!("options" in action)) {
|
2405
|
+
const { onClick = () => false, dialog, id } = action;
|
2406
|
+
const muteDialog = await onClick(e);
|
2407
|
+
if (dialog && !muteDialog) {
|
2408
|
+
e.preventDefault();
|
2409
|
+
setDialogId(id);
|
2410
|
+
}
|
2411
|
+
}
|
2412
|
+
};
|
2413
|
+
const handleClose = () => {
|
2414
|
+
setDialogId(null);
|
2415
|
+
};
|
2416
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { gap: 1, children: actions2.map((action) => {
|
2417
|
+
if (action.options) {
|
2369
2418
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
2370
2419
|
designSystem.SingleSelect,
|
2371
2420
|
{
|
@@ -2379,10 +2428,49 @@ const HeaderActions = ({ actions: actions2 }) => {
|
|
2379
2428
|
action.id
|
2380
2429
|
);
|
2381
2430
|
} else {
|
2382
|
-
|
2431
|
+
if (action.type === "icon") {
|
2432
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React__namespace.Fragment, { children: [
|
2433
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
2434
|
+
designSystem.IconButton,
|
2435
|
+
{
|
2436
|
+
disabled: action.disabled,
|
2437
|
+
label: action.label,
|
2438
|
+
size: "S",
|
2439
|
+
onClick: handleClick(action),
|
2440
|
+
children: action.icon
|
2441
|
+
}
|
2442
|
+
),
|
2443
|
+
action.dialog ? /* @__PURE__ */ jsxRuntime.jsx(
|
2444
|
+
HeaderActionDialog,
|
2445
|
+
{
|
2446
|
+
...action.dialog,
|
2447
|
+
isOpen: dialogId === action.id,
|
2448
|
+
onClose: handleClose
|
2449
|
+
}
|
2450
|
+
) : null
|
2451
|
+
] }, action.id);
|
2452
|
+
}
|
2383
2453
|
}
|
2384
2454
|
}) });
|
2385
2455
|
};
|
2456
|
+
const HeaderActionDialog = ({
|
2457
|
+
onClose,
|
2458
|
+
onCancel,
|
2459
|
+
title,
|
2460
|
+
content: Content,
|
2461
|
+
isOpen
|
2462
|
+
}) => {
|
2463
|
+
const handleClose = async () => {
|
2464
|
+
if (onCancel) {
|
2465
|
+
await onCancel();
|
2466
|
+
}
|
2467
|
+
onClose();
|
2468
|
+
};
|
2469
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Root, { open: isOpen, onOpenChange: handleClose, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Content, { children: [
|
2470
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Header, { children: title }),
|
2471
|
+
typeof Content === "function" ? /* @__PURE__ */ jsxRuntime.jsx(Content, { onClose: handleClose }) : Content
|
2472
|
+
] }) });
|
2473
|
+
};
|
2386
2474
|
const ConfigureTheViewAction = ({ collectionType, model }) => {
|
2387
2475
|
const navigate = reactRouterDom.useNavigate();
|
2388
2476
|
const { formatMessage } = reactIntl.useIntl();
|
@@ -2518,7 +2606,7 @@ const ActionsPanel = () => {
|
|
2518
2606
|
return {
|
2519
2607
|
title: formatMessage({
|
2520
2608
|
id: "content-manager.containers.edit.panels.default.title",
|
2521
|
-
defaultMessage: "
|
2609
|
+
defaultMessage: "Entry"
|
2522
2610
|
}),
|
2523
2611
|
content: /* @__PURE__ */ jsxRuntime.jsx(ActionsPanelContent, {})
|
2524
2612
|
};
|
@@ -2762,7 +2850,8 @@ const formatEditLayout = (data, {
|
|
2762
2850
|
layout: convertEditLayoutToFieldLayouts(
|
2763
2851
|
configuration.layouts.edit,
|
2764
2852
|
components[uid].attributes,
|
2765
|
-
configuration.metadatas
|
2853
|
+
configuration.metadatas,
|
2854
|
+
{ configurations: data.components, schemas: components }
|
2766
2855
|
),
|
2767
2856
|
settings: {
|
2768
2857
|
...configuration.settings,
|
@@ -2919,6 +3008,7 @@ const ConfirmDialogPublishAll = ({
|
|
2919
3008
|
const { _unstableFormatAPIError: formatAPIError } = strapiAdmin.useAPIErrorHandler(getTranslation);
|
2920
3009
|
const { model, schema } = useDoc();
|
2921
3010
|
const [{ query }] = strapiAdmin.useQueryParams();
|
3011
|
+
const enableDraftRelationsCount = false;
|
2922
3012
|
const {
|
2923
3013
|
data: countDraftRelations = 0,
|
2924
3014
|
isLoading,
|
@@ -2930,7 +3020,7 @@ const ConfirmDialogPublishAll = ({
|
|
2930
3020
|
locale: query?.plugins?.i18n?.locale
|
2931
3021
|
},
|
2932
3022
|
{
|
2933
|
-
skip:
|
3023
|
+
skip: !enableDraftRelationsCount
|
2934
3024
|
}
|
2935
3025
|
);
|
2936
3026
|
React__namespace.useEffect(() => {
|
@@ -3115,7 +3205,7 @@ const SelectedEntriesTableContent = ({
|
|
3115
3205
|
status: row.status
|
3116
3206
|
}
|
3117
3207
|
) }),
|
3118
|
-
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.Cell, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
3208
|
+
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.Cell, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
3119
3209
|
designSystem.IconButton,
|
3120
3210
|
{
|
3121
3211
|
tag: reactRouterDom.Link,
|
@@ -3138,9 +3228,10 @@ const SelectedEntriesTableContent = ({
|
|
3138
3228
|
),
|
3139
3229
|
target: "_blank",
|
3140
3230
|
marginLeft: "auto",
|
3141
|
-
|
3231
|
+
variant: "ghost",
|
3232
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Pencil, { width: "1.6rem", height: "1.6rem" })
|
3142
3233
|
}
|
3143
|
-
) })
|
3234
|
+
) }) })
|
3144
3235
|
] }, row.id)) })
|
3145
3236
|
] });
|
3146
3237
|
};
|
@@ -3177,7 +3268,13 @@ const SelectedEntriesModalContent = ({
|
|
3177
3268
|
);
|
3178
3269
|
const { rows, validationErrors } = React__namespace.useMemo(() => {
|
3179
3270
|
if (data.length > 0 && schema) {
|
3180
|
-
const validate = createYupSchema(
|
3271
|
+
const validate = createYupSchema(
|
3272
|
+
schema.attributes,
|
3273
|
+
components,
|
3274
|
+
// Since this is the "Publish" action, the validation
|
3275
|
+
// schema must enforce the rules for published entities
|
3276
|
+
{ status: "published" }
|
3277
|
+
);
|
3181
3278
|
const validationErrors2 = {};
|
3182
3279
|
const rows2 = data.map((entry) => {
|
3183
3280
|
try {
|
@@ -3527,7 +3624,7 @@ const TableActions = ({ document }) => {
|
|
3527
3624
|
strapiAdmin.DescriptionComponentRenderer,
|
3528
3625
|
{
|
3529
3626
|
props,
|
3530
|
-
descriptions: plugins["content-manager"].apis.getDocumentActions(),
|
3627
|
+
descriptions: plugins["content-manager"].apis.getDocumentActions().filter((action) => action.name !== "PublishAction"),
|
3531
3628
|
children: (actions2) => {
|
3532
3629
|
const tableRowActions = actions2.filter((action) => {
|
3533
3630
|
const positions = Array.isArray(action.position) ? action.position : [action.position];
|
@@ -3638,7 +3735,7 @@ const CloneAction = ({ model, documentId }) => {
|
|
3638
3735
|
}),
|
3639
3736
|
content: /* @__PURE__ */ jsxRuntime.jsx(AutoCloneFailureModalBody, { prohibitedFields }),
|
3640
3737
|
footer: ({ onClose }) => {
|
3641
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.
|
3738
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Modal.Footer, { children: [
|
3642
3739
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: onClose, variant: "tertiary", children: formatMessage({
|
3643
3740
|
id: "cancel",
|
3644
3741
|
defaultMessage: "Cancel"
|
@@ -3869,7 +3966,7 @@ const index = {
|
|
3869
3966
|
app.router.addRoute({
|
3870
3967
|
path: "content-manager/*",
|
3871
3968
|
lazy: async () => {
|
3872
|
-
const { Layout } = await Promise.resolve().then(() => require("./layout-
|
3969
|
+
const { Layout } = await Promise.resolve().then(() => require("./layout-D6A3K-ut.js"));
|
3873
3970
|
return {
|
3874
3971
|
Component: Layout
|
3875
3972
|
};
|
@@ -3886,7 +3983,7 @@ const index = {
|
|
3886
3983
|
async registerTrads({ locales }) {
|
3887
3984
|
const importedTrads = await Promise.all(
|
3888
3985
|
locales.map((locale) => {
|
3889
|
-
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/ar.json": () => Promise.resolve().then(() => require("./ar-BUUWXIYu.js")), "./translations/ca.json": () => Promise.resolve().then(() => require("./ca-Cmk45QO6.js")), "./translations/cs.json": () => Promise.resolve().then(() => require("./cs-CkJy6B2v.js")), "./translations/de.json": () => Promise.resolve().then(() => require("./de-CCEmbAah.js")), "./translations/en.json": () => Promise.resolve().then(() => require("./en-
|
3986
|
+
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/ar.json": () => Promise.resolve().then(() => require("./ar-BUUWXIYu.js")), "./translations/ca.json": () => Promise.resolve().then(() => require("./ca-Cmk45QO6.js")), "./translations/cs.json": () => Promise.resolve().then(() => require("./cs-CkJy6B2v.js")), "./translations/de.json": () => Promise.resolve().then(() => require("./de-CCEmbAah.js")), "./translations/en.json": () => Promise.resolve().then(() => require("./en-BVzUkPxZ.js")), "./translations/es.json": () => Promise.resolve().then(() => require("./es-EUonQTon.js")), "./translations/eu.json": () => Promise.resolve().then(() => require("./eu-VDH-3ovk.js")), "./translations/fr.json": () => Promise.resolve().then(() => require("./fr-B7kGGg3E.js")), "./translations/gu.json": () => Promise.resolve().then(() => require("./gu-BRmF601H.js")), "./translations/hi.json": () => Promise.resolve().then(() => require("./hi-CCJBptSq.js")), "./translations/hu.json": () => Promise.resolve().then(() => require("./hu-sNV_yLYy.js")), "./translations/id.json": () => Promise.resolve().then(() => require("./id-B5Ser98A.js")), "./translations/it.json": () => Promise.resolve().then(() => require("./it-DkBIs7vD.js")), "./translations/ja.json": () => Promise.resolve().then(() => require("./ja-CcFe8diO.js")), "./translations/ko.json": () => Promise.resolve().then(() => require("./ko-woFZPmLk.js")), "./translations/ml.json": () => Promise.resolve().then(() => require("./ml-C2W8N8k1.js")), "./translations/ms.json": () => Promise.resolve().then(() => require("./ms-BuFotyP_.js")), "./translations/nl.json": () => Promise.resolve().then(() => require("./nl-bbEOHChV.js")), "./translations/pl.json": () => Promise.resolve().then(() => require("./pl-uzwG-hk7.js")), "./translations/pt-BR.json": () => Promise.resolve().then(() => require("./pt-BR-BiOz37D9.js")), "./translations/pt.json": () => Promise.resolve().then(() => require("./pt-CeXQuq50.js")), "./translations/ru.json": () => Promise.resolve().then(() => require("./ru-BT3ybNny.js")), "./translations/sa.json": () => Promise.resolve().then(() => require("./sa-CcvkYInH.js")), "./translations/sk.json": () => Promise.resolve().then(() => require("./sk-CvY09Xjv.js")), "./translations/sv.json": () => Promise.resolve().then(() => require("./sv-MYDuzgvT.js")), "./translations/th.json": () => Promise.resolve().then(() => require("./th-D9_GfAjc.js")), "./translations/tr.json": () => Promise.resolve().then(() => require("./tr-D9UH-O_R.js")), "./translations/uk.json": () => Promise.resolve().then(() => require("./uk-C8EiqJY7.js")), "./translations/vi.json": () => Promise.resolve().then(() => require("./vi-CJlYDheJ.js")), "./translations/zh-Hans.json": () => Promise.resolve().then(() => require("./zh-Hans-9kOncHGw.js")), "./translations/zh.json": () => Promise.resolve().then(() => require("./zh-CQQfszqR.js")) }), `./translations/${locale}.json`).then(({ default: data }) => {
|
3890
3987
|
return {
|
3891
3988
|
data: prefixPluginTranslations(data, PLUGIN_ID),
|
3892
3989
|
locale
|
@@ -3904,6 +4001,7 @@ const index = {
|
|
3904
4001
|
};
|
3905
4002
|
exports.ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD = ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD;
|
3906
4003
|
exports.BulkActionsRenderer = BulkActionsRenderer;
|
4004
|
+
exports.CLONE_PATH = CLONE_PATH;
|
3907
4005
|
exports.COLLECTION_TYPES = COLLECTION_TYPES;
|
3908
4006
|
exports.CREATOR_FIELDS = CREATOR_FIELDS;
|
3909
4007
|
exports.DEFAULT_SETTINGS = DEFAULT_SETTINGS;
|
@@ -3943,4 +4041,4 @@ exports.useGetAllDocumentsQuery = useGetAllDocumentsQuery;
|
|
3943
4041
|
exports.useGetContentTypeConfigurationQuery = useGetContentTypeConfigurationQuery;
|
3944
4042
|
exports.useGetInitialDataQuery = useGetInitialDataQuery;
|
3945
4043
|
exports.useUpdateContentTypeConfigurationMutation = useUpdateContentTypeConfigurationMutation;
|
3946
|
-
//# sourceMappingURL=index-
|
4044
|
+
//# sourceMappingURL=index-jDJgW_Lf.js.map
|