@strapi/content-manager 0.0.0-experimental.9612538209f3c68285c5dea8fe26f96e7e470afd → 0.0.0-experimental.997c519cb311bf692e8971f4bbd2e4a92694abee
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-DHNM3YBz.mjs → ComponentConfigurationPage-CnL10QYC.mjs} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-DHNM3YBz.mjs.map → ComponentConfigurationPage-CnL10QYC.mjs.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-BvHtG7uH.js → ComponentConfigurationPage-G4EIirP8.js} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-BvHtG7uH.js.map → ComponentConfigurationPage-G4EIirP8.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-DOmfCEMo.js → EditConfigurationPage-B2AA1kVF.js} +3 -3
- package/dist/_chunks/{EditConfigurationPage-DOmfCEMo.js.map → EditConfigurationPage-B2AA1kVF.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-Cp6HAEzN.mjs → EditConfigurationPage-I2kKh9dx.mjs} +3 -3
- package/dist/_chunks/{EditConfigurationPage-Cp6HAEzN.mjs.map → EditConfigurationPage-I2kKh9dx.mjs.map} +1 -1
- package/dist/_chunks/{EditViewPage-BqNpC6hO.js → EditViewPage-CHgoNwlc.js} +19 -8
- package/dist/_chunks/EditViewPage-CHgoNwlc.js.map +1 -0
- package/dist/_chunks/{EditViewPage-BtkEx339.mjs → EditViewPage-zFjJK0s8.mjs} +19 -8
- package/dist/_chunks/EditViewPage-zFjJK0s8.mjs.map +1 -0
- package/dist/_chunks/{Field-lsPFnAmH.js → Field-9DePZh-0.js} +196 -143
- package/dist/_chunks/Field-9DePZh-0.js.map +1 -0
- package/dist/_chunks/{Field-R5NbffTB.mjs → Field-DPAzUS1M.mjs} +194 -141
- package/dist/_chunks/Field-DPAzUS1M.mjs.map +1 -0
- package/dist/_chunks/{Form-BHmXSfyy.mjs → Form-CEkENbkF.mjs} +35 -16
- package/dist/_chunks/Form-CEkENbkF.mjs.map +1 -0
- package/dist/_chunks/{Form-CcGboku8.js → Form-DPm-KZ1A.js} +35 -16
- package/dist/_chunks/Form-DPm-KZ1A.js.map +1 -0
- package/dist/_chunks/{History-Bsud8jwh.js → History-DXSbTWez.js} +28 -18
- package/dist/_chunks/History-DXSbTWez.js.map +1 -0
- package/dist/_chunks/{History-ByUPL3T3.mjs → History-utls71em.mjs} +28 -18
- package/dist/_chunks/History-utls71em.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-Bm5HACXf.mjs → ListConfigurationPage-CuMXWWqb.mjs} +20 -8
- package/dist/_chunks/ListConfigurationPage-CuMXWWqb.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-DiT463qx.js → ListConfigurationPage-D5C7ACZ_.js} +20 -8
- package/dist/_chunks/ListConfigurationPage-D5C7ACZ_.js.map +1 -0
- package/dist/_chunks/{ListViewPage-JSyNAAYu.mjs → ListViewPage-CdKd-PS_.mjs} +46 -37
- package/dist/_chunks/ListViewPage-CdKd-PS_.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-CsrC9L_d.js → ListViewPage-DfuwH1tt.js} +48 -39
- package/dist/_chunks/ListViewPage-DfuwH1tt.js.map +1 -0
- package/dist/_chunks/{NoContentTypePage-Bsvng4II.js → NoContentTypePage-BIxlkWWi.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-Bsvng4II.js.map → NoContentTypePage-BIxlkWWi.js.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-CsrQUpBE.mjs → NoContentTypePage-DkToTT7u.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-CsrQUpBE.mjs.map → NoContentTypePage-DkToTT7u.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-CdHNJtEf.js → NoPermissionsPage-Bu4GWYb-.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-CdHNJtEf.js.map → NoPermissionsPage-Bu4GWYb-.js.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-DNmf_pj0.mjs → NoPermissionsPage-DlWi4BAH.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-DNmf_pj0.mjs.map → NoPermissionsPage-DlWi4BAH.mjs.map} +1 -1
- package/dist/_chunks/{Relations-CghaPv2D.js → Relations-CFjTESWQ.js} +4 -4
- package/dist/_chunks/Relations-CFjTESWQ.js.map +1 -0
- package/dist/_chunks/{Relations-u8-37jK0.mjs → Relations-QP5yn9_z.mjs} +4 -4
- package/dist/_chunks/Relations-QP5yn9_z.mjs.map +1 -0
- package/dist/_chunks/{en-fbKQxLGn.js → en-BVzUkPxZ.js} +10 -8
- package/dist/_chunks/{en-fbKQxLGn.js.map → en-BVzUkPxZ.js.map} +1 -1
- package/dist/_chunks/{en-Ux26r5pl.mjs → en-CPTj6CjC.mjs} +10 -8
- package/dist/_chunks/{en-Ux26r5pl.mjs.map → en-CPTj6CjC.mjs.map} +1 -1
- package/dist/_chunks/{index-CaE6NG4a.mjs → index-BHfS6_D5.mjs} +437 -205
- package/dist/_chunks/index-BHfS6_D5.mjs.map +1 -0
- package/dist/_chunks/{index-BOZx6IMg.js → index-DXiHxy70.js} +418 -186
- package/dist/_chunks/index-DXiHxy70.js.map +1 -0
- package/dist/_chunks/{layout-Bx7svTbY.mjs → layout-DX_52HSH.mjs} +23 -10
- package/dist/_chunks/layout-DX_52HSH.mjs.map +1 -0
- package/dist/_chunks/{layout-Ciz224q5.js → layout-bE-WUnQ0.js} +22 -9
- package/dist/_chunks/layout-bE-WUnQ0.js.map +1 -0
- package/dist/_chunks/{relations-CP8sB2YZ.js → relations-D706vblp.js} +2 -2
- package/dist/_chunks/{relations-CP8sB2YZ.js.map → relations-D706vblp.js.map} +1 -1
- package/dist/_chunks/{relations-Cxc1cEv3.mjs → relations-SCVAL_aJ.mjs} +2 -2
- package/dist/_chunks/{relations-Cxc1cEv3.mjs.map → relations-SCVAL_aJ.mjs.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/index.d.ts +3 -0
- package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
- package/dist/admin/src/index.d.ts +1 -0
- package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +1 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +20 -0
- 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 +174 -105
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +175 -106
- 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/controllers/uid.d.ts.map +1 -1
- package/dist/server/src/controllers/validation/dimensions.d.ts +4 -2
- package/dist/server/src/controllers/validation/dimensions.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-manager.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/server/src/services/utils/populate.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-BqNpC6hO.js.map +0 -1
- package/dist/_chunks/EditViewPage-BtkEx339.mjs.map +0 -1
- package/dist/_chunks/Field-R5NbffTB.mjs.map +0 -1
- package/dist/_chunks/Field-lsPFnAmH.js.map +0 -1
- package/dist/_chunks/Form-BHmXSfyy.mjs.map +0 -1
- package/dist/_chunks/Form-CcGboku8.js.map +0 -1
- package/dist/_chunks/History-Bsud8jwh.js.map +0 -1
- package/dist/_chunks/History-ByUPL3T3.mjs.map +0 -1
- package/dist/_chunks/ListConfigurationPage-Bm5HACXf.mjs.map +0 -1
- package/dist/_chunks/ListConfigurationPage-DiT463qx.js.map +0 -1
- package/dist/_chunks/ListViewPage-CsrC9L_d.js.map +0 -1
- package/dist/_chunks/ListViewPage-JSyNAAYu.mjs.map +0 -1
- package/dist/_chunks/Relations-CghaPv2D.js.map +0 -1
- package/dist/_chunks/Relations-u8-37jK0.mjs.map +0 -1
- package/dist/_chunks/index-BOZx6IMg.js.map +0 -1
- package/dist/_chunks/index-CaE6NG4a.mjs.map +0 -1
- package/dist/_chunks/layout-Bx7svTbY.mjs.map +0 -1
- package/dist/_chunks/layout-Ciz224q5.js.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
@@ -2,15 +2,15 @@
|
|
2
2
|
const Icons = require("@strapi/icons");
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
4
4
|
const strapiAdmin = require("@strapi/admin/strapi-admin");
|
5
|
-
const qs = require("qs");
|
6
|
-
const reactIntl = require("react-intl");
|
7
|
-
const reactRouterDom = require("react-router-dom");
|
8
5
|
const React = require("react");
|
9
6
|
const designSystem = require("@strapi/design-system");
|
10
|
-
const
|
7
|
+
const reactIntl = require("react-intl");
|
8
|
+
const reactRouterDom = require("react-router-dom");
|
11
9
|
const yup = require("yup");
|
12
10
|
const pipe = require("lodash/fp/pipe");
|
13
11
|
const dateFns = require("date-fns");
|
12
|
+
const styledComponents = require("styled-components");
|
13
|
+
const qs = require("qs");
|
14
14
|
const toolkit = require("@reduxjs/toolkit");
|
15
15
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
16
16
|
function _interopNamespace(e) {
|
@@ -70,42 +70,6 @@ const useInjectionZone = (area) => {
|
|
70
70
|
const [page, position] = area.split(".");
|
71
71
|
return contentManagerPlugin.getInjectedComponents(page, position);
|
72
72
|
};
|
73
|
-
const HistoryAction = ({ model, document }) => {
|
74
|
-
const { formatMessage } = reactIntl.useIntl();
|
75
|
-
const [{ query }] = strapiAdmin.useQueryParams();
|
76
|
-
const navigate = reactRouterDom.useNavigate();
|
77
|
-
const pluginsQueryParams = qs.stringify({ plugins: query.plugins }, { encode: false });
|
78
|
-
if (!window.strapi.features.isEnabled("cms-content-history")) {
|
79
|
-
return null;
|
80
|
-
}
|
81
|
-
return {
|
82
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(Icons.ClockCounterClockwise, {}),
|
83
|
-
label: formatMessage({
|
84
|
-
id: "content-manager.history.document-action",
|
85
|
-
defaultMessage: "Content History"
|
86
|
-
}),
|
87
|
-
onClick: () => navigate({ pathname: "history", search: pluginsQueryParams }),
|
88
|
-
disabled: (
|
89
|
-
/**
|
90
|
-
* The user is creating a new document.
|
91
|
-
* It hasn't been saved yet, so there's no history to go to
|
92
|
-
*/
|
93
|
-
!document || /**
|
94
|
-
* The document has been created but the current dimension has never been saved.
|
95
|
-
* For example, the user is creating a new locale in an existing document,
|
96
|
-
* so there's no history for the document in that locale
|
97
|
-
*/
|
98
|
-
!document.id || /**
|
99
|
-
* History is only available for content types created by the user.
|
100
|
-
* These have the `api::` prefix, as opposed to the ones created by Strapi or plugins,
|
101
|
-
* which start with `admin::` or `plugin::`
|
102
|
-
*/
|
103
|
-
!model.startsWith("api::")
|
104
|
-
),
|
105
|
-
position: "header"
|
106
|
-
};
|
107
|
-
};
|
108
|
-
HistoryAction.type = "history";
|
109
73
|
const ID = "id";
|
110
74
|
const CREATED_BY_ATTRIBUTE_NAME = "createdBy";
|
111
75
|
const UPDATED_BY_ATTRIBUTE_NAME = "updatedBy";
|
@@ -215,7 +179,8 @@ const contentManagerApi = strapiAdmin.adminApi.enhanceEndpoints({
|
|
215
179
|
"Document",
|
216
180
|
"InitialData",
|
217
181
|
"HistoryVersion",
|
218
|
-
"Relations"
|
182
|
+
"Relations",
|
183
|
+
"UidAvailability"
|
219
184
|
]
|
220
185
|
});
|
221
186
|
const documentApi = contentManagerApi.injectEndpoints({
|
@@ -229,7 +194,12 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
229
194
|
params: query
|
230
195
|
}
|
231
196
|
}),
|
232
|
-
invalidatesTags: (_result,
|
197
|
+
invalidatesTags: (_result, error, { model }) => {
|
198
|
+
if (error) {
|
199
|
+
return [];
|
200
|
+
}
|
201
|
+
return [{ type: "Document", id: `${model}_LIST` }];
|
202
|
+
}
|
233
203
|
}),
|
234
204
|
cloneDocument: builder.mutation({
|
235
205
|
query: ({ model, sourceId, data, params }) => ({
|
@@ -240,7 +210,10 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
240
210
|
params
|
241
211
|
}
|
242
212
|
}),
|
243
|
-
invalidatesTags: (_result, _error, { model }) => [
|
213
|
+
invalidatesTags: (_result, _error, { model }) => [
|
214
|
+
{ type: "Document", id: `${model}_LIST` },
|
215
|
+
{ type: "UidAvailability", id: model }
|
216
|
+
]
|
244
217
|
}),
|
245
218
|
/**
|
246
219
|
* Creates a new collection-type document. This should ONLY be used for collection-types.
|
@@ -257,7 +230,8 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
257
230
|
}),
|
258
231
|
invalidatesTags: (result, _error, { model }) => [
|
259
232
|
{ type: "Document", id: `${model}_LIST` },
|
260
|
-
"Relations"
|
233
|
+
"Relations",
|
234
|
+
{ type: "UidAvailability", id: model }
|
261
235
|
]
|
262
236
|
}),
|
263
237
|
deleteDocument: builder.mutation({
|
@@ -298,7 +272,8 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
298
272
|
id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model
|
299
273
|
},
|
300
274
|
{ type: "Document", id: `${model}_LIST` },
|
301
|
-
"Relations"
|
275
|
+
"Relations",
|
276
|
+
{ type: "UidAvailability", id: model }
|
302
277
|
];
|
303
278
|
}
|
304
279
|
}),
|
@@ -316,6 +291,7 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
316
291
|
}),
|
317
292
|
providesTags: (result, _error, arg) => {
|
318
293
|
return [
|
294
|
+
{ type: "Document", id: `ALL_LIST` },
|
319
295
|
{ type: "Document", id: `${arg.model}_LIST` },
|
320
296
|
...result?.results.map(({ documentId }) => ({
|
321
297
|
type: "Document",
|
@@ -354,6 +330,11 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
354
330
|
{
|
355
331
|
type: "Document",
|
356
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`
|
357
338
|
}
|
358
339
|
];
|
359
340
|
}
|
@@ -417,8 +398,21 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
417
398
|
type: "Document",
|
418
399
|
id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model
|
419
400
|
},
|
420
|
-
"Relations"
|
401
|
+
"Relations",
|
402
|
+
{ type: "UidAvailability", id: model }
|
421
403
|
];
|
404
|
+
},
|
405
|
+
async onQueryStarted({ data, ...patch }, { dispatch, queryFulfilled }) {
|
406
|
+
const patchResult = dispatch(
|
407
|
+
documentApi.util.updateQueryData("getDocument", patch, (draft) => {
|
408
|
+
Object.assign(draft.data, data);
|
409
|
+
})
|
410
|
+
);
|
411
|
+
try {
|
412
|
+
await queryFulfilled;
|
413
|
+
} catch {
|
414
|
+
patchResult.undo();
|
415
|
+
}
|
422
416
|
}
|
423
417
|
}),
|
424
418
|
unpublishDocument: builder.mutation({
|
@@ -488,7 +482,7 @@ const buildValidParams = (query) => {
|
|
488
482
|
const isBaseQueryError = (error) => {
|
489
483
|
return error.name !== void 0;
|
490
484
|
};
|
491
|
-
const createYupSchema = (attributes = {}, components = {}) => {
|
485
|
+
const createYupSchema = (attributes = {}, components = {}, options = { status: null }) => {
|
492
486
|
const createModelSchema = (attributes2) => yup__namespace.object().shape(
|
493
487
|
Object.entries(attributes2).reduce((acc, [name, attribute]) => {
|
494
488
|
if (DOCUMENT_META_FIELDS.includes(name)) {
|
@@ -501,7 +495,7 @@ const createYupSchema = (attributes = {}, components = {}) => {
|
|
501
495
|
addMinValidation,
|
502
496
|
addMaxValidation,
|
503
497
|
addRegexValidation
|
504
|
-
].map((fn) => fn(attribute));
|
498
|
+
].map((fn) => fn(attribute, options));
|
505
499
|
const transformSchema = pipe__default.default(...validations);
|
506
500
|
switch (attribute.type) {
|
507
501
|
case "component": {
|
@@ -602,6 +596,14 @@ const createAttributeSchema = (attribute) => {
|
|
602
596
|
if (!value || typeof value === "string" && value.length === 0) {
|
603
597
|
return true;
|
604
598
|
}
|
599
|
+
if (typeof value === "object") {
|
600
|
+
try {
|
601
|
+
JSON.stringify(value);
|
602
|
+
return true;
|
603
|
+
} catch (err) {
|
604
|
+
return false;
|
605
|
+
}
|
606
|
+
}
|
605
607
|
try {
|
606
608
|
JSON.parse(value);
|
607
609
|
return true;
|
@@ -620,13 +622,7 @@ const createAttributeSchema = (attribute) => {
|
|
620
622
|
return yup__namespace.mixed();
|
621
623
|
}
|
622
624
|
};
|
623
|
-
const
|
624
|
-
if (attribute.required && attribute.type !== "relation") {
|
625
|
-
return schema.required({
|
626
|
-
id: strapiAdmin.translatedErrors.required.id,
|
627
|
-
defaultMessage: "This field is required."
|
628
|
-
});
|
629
|
-
}
|
625
|
+
const nullableSchema = (schema) => {
|
630
626
|
return schema?.nullable ? schema.nullable() : (
|
631
627
|
// In some cases '.nullable' will not be available on the schema.
|
632
628
|
// e.g. when the schema has been built using yup.lazy (e.g. for relations).
|
@@ -634,7 +630,22 @@ const addRequiredValidation = (attribute) => (schema) => {
|
|
634
630
|
schema
|
635
631
|
);
|
636
632
|
};
|
637
|
-
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
|
+
}
|
638
649
|
if ("minLength" in attribute && attribute.minLength && Number.isInteger(attribute.minLength) && "min" in schema) {
|
639
650
|
return schema.min(attribute.minLength, {
|
640
651
|
...strapiAdmin.translatedErrors.minLength,
|
@@ -656,9 +667,31 @@ const addMaxLengthValidation = (attribute) => (schema) => {
|
|
656
667
|
}
|
657
668
|
return schema;
|
658
669
|
};
|
659
|
-
const addMinValidation = (attribute) => (schema) => {
|
670
|
+
const addMinValidation = (attribute, options) => (schema) => {
|
660
671
|
if ("min" in attribute) {
|
661
672
|
const min = toInteger(attribute.min);
|
673
|
+
if (attribute.type === "component" && attribute.repeatable || attribute.type === "dynamiczone") {
|
674
|
+
if (options.status !== "draft" && !attribute.required && "test" in schema && min) {
|
675
|
+
return schema.test(
|
676
|
+
"custom-min",
|
677
|
+
{
|
678
|
+
...strapiAdmin.translatedErrors.min,
|
679
|
+
values: {
|
680
|
+
min: attribute.min
|
681
|
+
}
|
682
|
+
},
|
683
|
+
(value) => {
|
684
|
+
if (!value) {
|
685
|
+
return true;
|
686
|
+
}
|
687
|
+
if (Array.isArray(value) && value.length === 0) {
|
688
|
+
return true;
|
689
|
+
}
|
690
|
+
return value.length >= min;
|
691
|
+
}
|
692
|
+
);
|
693
|
+
}
|
694
|
+
}
|
662
695
|
if ("min" in schema && min) {
|
663
696
|
return schema.min(min, {
|
664
697
|
...strapiAdmin.translatedErrors.min,
|
@@ -874,6 +907,7 @@ const useDocumentActions = () => {
|
|
874
907
|
const { formatMessage } = reactIntl.useIntl();
|
875
908
|
const { trackUsage } = strapiAdmin.useTracking();
|
876
909
|
const { _unstableFormatAPIError: formatAPIError } = strapiAdmin.useAPIErrorHandler();
|
910
|
+
const navigate = reactRouterDom.useNavigate();
|
877
911
|
const [deleteDocument] = useDeleteDocumentMutation();
|
878
912
|
const _delete = React__namespace.useCallback(
|
879
913
|
async ({ collectionType, model, documentId, params }, trackerProperty) => {
|
@@ -1209,7 +1243,6 @@ const useDocumentActions = () => {
|
|
1209
1243
|
sourceId
|
1210
1244
|
});
|
1211
1245
|
if ("error" in res) {
|
1212
|
-
toggleNotification({ type: "danger", message: formatAPIError(res.error) });
|
1213
1246
|
return { error: res.error };
|
1214
1247
|
}
|
1215
1248
|
toggleNotification({
|
@@ -1228,7 +1261,7 @@ const useDocumentActions = () => {
|
|
1228
1261
|
throw err;
|
1229
1262
|
}
|
1230
1263
|
},
|
1231
|
-
[autoCloneDocument,
|
1264
|
+
[autoCloneDocument, formatMessage, toggleNotification]
|
1232
1265
|
);
|
1233
1266
|
const [cloneDocument] = useCloneDocumentMutation();
|
1234
1267
|
const clone = React__namespace.useCallback(
|
@@ -1254,6 +1287,7 @@ const useDocumentActions = () => {
|
|
1254
1287
|
defaultMessage: "Cloned document"
|
1255
1288
|
})
|
1256
1289
|
});
|
1290
|
+
navigate(`../../${res.data.data.documentId}`, { relative: "path" });
|
1257
1291
|
return res.data;
|
1258
1292
|
} catch (err) {
|
1259
1293
|
toggleNotification({
|
@@ -1264,7 +1298,7 @@ const useDocumentActions = () => {
|
|
1264
1298
|
throw err;
|
1265
1299
|
}
|
1266
1300
|
},
|
1267
|
-
[cloneDocument, trackUsage, toggleNotification, formatMessage, formatAPIError]
|
1301
|
+
[cloneDocument, trackUsage, toggleNotification, formatMessage, formatAPIError, navigate]
|
1268
1302
|
);
|
1269
1303
|
const [getDoc] = useLazyGetDocumentQuery();
|
1270
1304
|
const getDocument = React__namespace.useCallback(
|
@@ -1290,7 +1324,7 @@ const useDocumentActions = () => {
|
|
1290
1324
|
};
|
1291
1325
|
};
|
1292
1326
|
const ProtectedHistoryPage = React.lazy(
|
1293
|
-
() => Promise.resolve().then(() => require("./History-
|
1327
|
+
() => Promise.resolve().then(() => require("./History-DXSbTWez.js")).then((mod) => ({ default: mod.ProtectedHistoryPage }))
|
1294
1328
|
);
|
1295
1329
|
const routes$1 = [
|
1296
1330
|
{
|
@@ -1303,31 +1337,31 @@ const routes$1 = [
|
|
1303
1337
|
}
|
1304
1338
|
];
|
1305
1339
|
const ProtectedEditViewPage = React.lazy(
|
1306
|
-
() => Promise.resolve().then(() => require("./EditViewPage-
|
1340
|
+
() => Promise.resolve().then(() => require("./EditViewPage-CHgoNwlc.js")).then((mod) => ({ default: mod.ProtectedEditViewPage }))
|
1307
1341
|
);
|
1308
1342
|
const ProtectedListViewPage = React.lazy(
|
1309
|
-
() => Promise.resolve().then(() => require("./ListViewPage-
|
1343
|
+
() => Promise.resolve().then(() => require("./ListViewPage-DfuwH1tt.js")).then((mod) => ({ default: mod.ProtectedListViewPage }))
|
1310
1344
|
);
|
1311
1345
|
const ProtectedListConfiguration = React.lazy(
|
1312
|
-
() => Promise.resolve().then(() => require("./ListConfigurationPage-
|
1346
|
+
() => Promise.resolve().then(() => require("./ListConfigurationPage-D5C7ACZ_.js")).then((mod) => ({
|
1313
1347
|
default: mod.ProtectedListConfiguration
|
1314
1348
|
}))
|
1315
1349
|
);
|
1316
1350
|
const ProtectedEditConfigurationPage = React.lazy(
|
1317
|
-
() => Promise.resolve().then(() => require("./EditConfigurationPage-
|
1351
|
+
() => Promise.resolve().then(() => require("./EditConfigurationPage-B2AA1kVF.js")).then((mod) => ({
|
1318
1352
|
default: mod.ProtectedEditConfigurationPage
|
1319
1353
|
}))
|
1320
1354
|
);
|
1321
1355
|
const ProtectedComponentConfigurationPage = React.lazy(
|
1322
|
-
() => Promise.resolve().then(() => require("./ComponentConfigurationPage-
|
1356
|
+
() => Promise.resolve().then(() => require("./ComponentConfigurationPage-G4EIirP8.js")).then((mod) => ({
|
1323
1357
|
default: mod.ProtectedComponentConfigurationPage
|
1324
1358
|
}))
|
1325
1359
|
);
|
1326
1360
|
const NoPermissions = React.lazy(
|
1327
|
-
() => Promise.resolve().then(() => require("./NoPermissionsPage-
|
1361
|
+
() => Promise.resolve().then(() => require("./NoPermissionsPage-Bu4GWYb-.js")).then((mod) => ({ default: mod.NoPermissions }))
|
1328
1362
|
);
|
1329
1363
|
const NoContentType = React.lazy(
|
1330
|
-
() => Promise.resolve().then(() => require("./NoContentTypePage-
|
1364
|
+
() => Promise.resolve().then(() => require("./NoContentTypePage-BIxlkWWi.js")).then((mod) => ({ default: mod.NoContentType }))
|
1331
1365
|
);
|
1332
1366
|
const CollectionTypePages = () => {
|
1333
1367
|
const { collectionType } = reactRouterDom.useParams();
|
@@ -1441,12 +1475,14 @@ const DocumentActionButton = (action) => {
|
|
1441
1475
|
/* @__PURE__ */ jsxRuntime.jsx(
|
1442
1476
|
designSystem.Button,
|
1443
1477
|
{
|
1444
|
-
flex:
|
1478
|
+
flex: "auto",
|
1445
1479
|
startIcon: action.icon,
|
1446
1480
|
disabled: action.disabled,
|
1447
1481
|
onClick: handleClick(action),
|
1448
1482
|
justifyContent: "center",
|
1449
1483
|
variant: action.variant || "default",
|
1484
|
+
paddingTop: "7px",
|
1485
|
+
paddingBottom: "7px",
|
1450
1486
|
children: action.label
|
1451
1487
|
}
|
1452
1488
|
),
|
@@ -1454,7 +1490,7 @@ const DocumentActionButton = (action) => {
|
|
1454
1490
|
DocumentActionConfirmDialog,
|
1455
1491
|
{
|
1456
1492
|
...action.dialog,
|
1457
|
-
variant: action.variant,
|
1493
|
+
variant: action.dialog?.variant ?? action.variant,
|
1458
1494
|
isOpen: dialogId === action.id,
|
1459
1495
|
onClose: handleClose
|
1460
1496
|
}
|
@@ -1511,9 +1547,9 @@ const DocumentActionsMenu = ({
|
|
1511
1547
|
disabled: isDisabled,
|
1512
1548
|
size: "S",
|
1513
1549
|
endIcon: null,
|
1514
|
-
paddingTop: "
|
1515
|
-
paddingLeft: "
|
1516
|
-
paddingRight: "
|
1550
|
+
paddingTop: "4px",
|
1551
|
+
paddingLeft: "7px",
|
1552
|
+
paddingRight: "7px",
|
1517
1553
|
variant,
|
1518
1554
|
children: [
|
1519
1555
|
/* @__PURE__ */ jsxRuntime.jsx(Icons.More, { "aria-hidden": true, focusable: false }),
|
@@ -1524,7 +1560,7 @@ const DocumentActionsMenu = ({
|
|
1524
1560
|
]
|
1525
1561
|
}
|
1526
1562
|
),
|
1527
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Content, {
|
1563
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Content, { maxHeight: void 0, popoverPlacement: "bottom-end", children: [
|
1528
1564
|
actions2.map((action) => {
|
1529
1565
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
1530
1566
|
designSystem.Menu.Item,
|
@@ -1533,10 +1569,25 @@ const DocumentActionsMenu = ({
|
|
1533
1569
|
onSelect: handleClick(action),
|
1534
1570
|
display: "block",
|
1535
1571
|
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", gap: 4, children: [
|
1536
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
1537
|
-
|
1538
|
-
|
1539
|
-
|
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
|
+
),
|
1540
1591
|
action.id.startsWith("HistoryAction") && /* @__PURE__ */ jsxRuntime.jsx(
|
1541
1592
|
designSystem.Flex,
|
1542
1593
|
{
|
@@ -1633,11 +1684,11 @@ const DocumentActionConfirmDialog = ({
|
|
1633
1684
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Header, { children: title }),
|
1634
1685
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Body, { children: content }),
|
1635
1686
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Footer, { children: [
|
1636
|
-
/* @__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({
|
1637
1688
|
id: "app.components.Button.cancel",
|
1638
1689
|
defaultMessage: "Cancel"
|
1639
1690
|
}) }) }),
|
1640
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: handleConfirm, variant, children: formatMessage({
|
1691
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: handleConfirm, variant, fullWidth: true, children: formatMessage({
|
1641
1692
|
id: "app.components.Button.confirm",
|
1642
1693
|
defaultMessage: "Confirm"
|
1643
1694
|
}) })
|
@@ -1660,8 +1711,8 @@ const DocumentActionModal = ({
|
|
1660
1711
|
};
|
1661
1712
|
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Root, { open: isOpen, onOpenChange: handleClose, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Modal.Content, { children: [
|
1662
1713
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Title, { children: title }) }),
|
1663
|
-
|
1664
|
-
|
1714
|
+
typeof Content === "function" ? /* @__PURE__ */ jsxRuntime.jsx(Content, { onClose: handleClose }) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Body, { children: Content }),
|
1715
|
+
typeof Footer === "function" ? /* @__PURE__ */ jsxRuntime.jsx(Footer, { onClose: handleClose }) : Footer
|
1665
1716
|
] }) });
|
1666
1717
|
};
|
1667
1718
|
const PublishAction$1 = ({
|
@@ -1676,13 +1727,17 @@ const PublishAction$1 = ({
|
|
1676
1727
|
const navigate = reactRouterDom.useNavigate();
|
1677
1728
|
const { toggleNotification } = strapiAdmin.useNotification();
|
1678
1729
|
const { _unstableFormatValidationErrors: formatValidationErrors } = strapiAdmin.useAPIErrorHandler();
|
1730
|
+
const isListView = reactRouterDom.useMatch(LIST_PATH) !== null;
|
1679
1731
|
const isCloning = reactRouterDom.useMatch(CLONE_PATH) !== null;
|
1680
1732
|
const { formatMessage } = reactIntl.useIntl();
|
1681
|
-
const { canPublish
|
1682
|
-
"PublishAction",
|
1683
|
-
({ canPublish: canPublish2, canCreate: canCreate2, canUpdate: canUpdate2 }) => ({ canPublish: canPublish2, canCreate: canCreate2, canUpdate: canUpdate2 })
|
1684
|
-
);
|
1733
|
+
const canPublish = useDocumentRBAC("PublishAction", ({ canPublish: canPublish2 }) => canPublish2);
|
1685
1734
|
const { publish } = useDocumentActions();
|
1735
|
+
const [
|
1736
|
+
countDraftRelations,
|
1737
|
+
{ isLoading: isLoadingDraftRelations, isError: isErrorDraftRelations }
|
1738
|
+
] = useLazyGetDraftRelationCountQuery();
|
1739
|
+
const [localCountOfDraftRelations, setLocalCountOfDraftRelations] = React__namespace.useState(0);
|
1740
|
+
const [serverCountOfDraftRelations, setServerCountOfDraftRelations] = React__namespace.useState(0);
|
1686
1741
|
const [{ query, rawQuery }] = strapiAdmin.useQueryParams();
|
1687
1742
|
const params = React__namespace.useMemo(() => buildValidParams(query), [query]);
|
1688
1743
|
const modified = strapiAdmin.useForm("PublishAction", ({ modified: modified2 }) => modified2);
|
@@ -1691,10 +1746,103 @@ const PublishAction$1 = ({
|
|
1691
1746
|
const validate = strapiAdmin.useForm("PublishAction", (state) => state.validate);
|
1692
1747
|
const setErrors = strapiAdmin.useForm("PublishAction", (state) => state.setErrors);
|
1693
1748
|
const formValues = strapiAdmin.useForm("PublishAction", ({ values }) => values);
|
1749
|
+
React__namespace.useEffect(() => {
|
1750
|
+
if (isErrorDraftRelations) {
|
1751
|
+
toggleNotification({
|
1752
|
+
type: "danger",
|
1753
|
+
message: formatMessage({
|
1754
|
+
id: getTranslation("error.records.fetch-draft-relatons"),
|
1755
|
+
defaultMessage: "An error occurred while fetching draft relations on this document."
|
1756
|
+
})
|
1757
|
+
});
|
1758
|
+
}
|
1759
|
+
}, [isErrorDraftRelations, toggleNotification, formatMessage]);
|
1760
|
+
React__namespace.useEffect(() => {
|
1761
|
+
const localDraftRelations = /* @__PURE__ */ new Set();
|
1762
|
+
const extractDraftRelations = (data) => {
|
1763
|
+
const relations = data.connect || [];
|
1764
|
+
relations.forEach((relation) => {
|
1765
|
+
if (relation.status === "draft") {
|
1766
|
+
localDraftRelations.add(relation.id);
|
1767
|
+
}
|
1768
|
+
});
|
1769
|
+
};
|
1770
|
+
const traverseAndExtract = (data) => {
|
1771
|
+
Object.entries(data).forEach(([key, value]) => {
|
1772
|
+
if (key === "connect" && Array.isArray(value)) {
|
1773
|
+
extractDraftRelations({ connect: value });
|
1774
|
+
} else if (typeof value === "object" && value !== null) {
|
1775
|
+
traverseAndExtract(value);
|
1776
|
+
}
|
1777
|
+
});
|
1778
|
+
};
|
1779
|
+
if (!documentId || modified) {
|
1780
|
+
traverseAndExtract(formValues);
|
1781
|
+
setLocalCountOfDraftRelations(localDraftRelations.size);
|
1782
|
+
}
|
1783
|
+
}, [documentId, modified, formValues, setLocalCountOfDraftRelations]);
|
1784
|
+
React__namespace.useEffect(() => {
|
1785
|
+
if (!document || !document.documentId || isListView) {
|
1786
|
+
return;
|
1787
|
+
}
|
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]);
|
1694
1804
|
const isDocumentPublished = (document?.[PUBLISHED_AT_ATTRIBUTE_NAME] || meta?.availableStatus.some((doc) => doc[PUBLISHED_AT_ATTRIBUTE_NAME] !== null)) && document?.status !== "modified";
|
1695
1805
|
if (!schema?.options?.draftAndPublish) {
|
1696
1806
|
return null;
|
1697
1807
|
}
|
1808
|
+
const performPublish = async () => {
|
1809
|
+
setSubmitting(true);
|
1810
|
+
try {
|
1811
|
+
const { errors } = await validate();
|
1812
|
+
if (errors) {
|
1813
|
+
toggleNotification({
|
1814
|
+
type: "danger",
|
1815
|
+
message: formatMessage({
|
1816
|
+
id: "content-manager.validation.error",
|
1817
|
+
defaultMessage: "There are validation errors in your document. Please fix them before saving."
|
1818
|
+
})
|
1819
|
+
});
|
1820
|
+
return;
|
1821
|
+
}
|
1822
|
+
const res = await publish(
|
1823
|
+
{
|
1824
|
+
collectionType,
|
1825
|
+
model,
|
1826
|
+
documentId,
|
1827
|
+
params
|
1828
|
+
},
|
1829
|
+
formValues
|
1830
|
+
);
|
1831
|
+
if ("data" in res && collectionType !== SINGLE_TYPES) {
|
1832
|
+
navigate({
|
1833
|
+
pathname: `../${collectionType}/${model}/${res.data.documentId}`,
|
1834
|
+
search: rawQuery
|
1835
|
+
});
|
1836
|
+
} else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
1837
|
+
setErrors(formatValidationErrors(res.error));
|
1838
|
+
}
|
1839
|
+
} finally {
|
1840
|
+
setSubmitting(false);
|
1841
|
+
}
|
1842
|
+
};
|
1843
|
+
const totalDraftRelations = localCountOfDraftRelations + serverCountOfDraftRelations;
|
1844
|
+
const enableDraftRelationsCount = false;
|
1845
|
+
const hasDraftRelations = enableDraftRelationsCount;
|
1698
1846
|
return {
|
1699
1847
|
/**
|
1700
1848
|
* Disabled when:
|
@@ -1704,49 +1852,36 @@ const PublishAction$1 = ({
|
|
1704
1852
|
* - the document is already published & not modified
|
1705
1853
|
* - the document is being created & not modified
|
1706
1854
|
* - the user doesn't have the permission to publish
|
1707
|
-
* - the user doesn't have the permission to create a new document
|
1708
|
-
* - the user doesn't have the permission to update the document
|
1709
1855
|
*/
|
1710
|
-
disabled: isCloning || isSubmitting || activeTab === "published" || !modified && isDocumentPublished || !modified && !document?.documentId || !canPublish
|
1856
|
+
disabled: isCloning || isSubmitting || isLoadingDraftRelations || activeTab === "published" || !modified && isDocumentPublished || !modified && !document?.documentId || !canPublish,
|
1711
1857
|
label: formatMessage({
|
1712
1858
|
id: "app.utils.publish",
|
1713
1859
|
defaultMessage: "Publish"
|
1714
1860
|
}),
|
1715
1861
|
onClick: async () => {
|
1716
|
-
|
1717
|
-
|
1718
|
-
|
1719
|
-
|
1720
|
-
|
1721
|
-
|
1722
|
-
|
1723
|
-
|
1724
|
-
|
1725
|
-
|
1726
|
-
|
1727
|
-
|
1728
|
-
|
1729
|
-
|
1730
|
-
|
1731
|
-
|
1732
|
-
|
1733
|
-
documentId,
|
1734
|
-
params
|
1735
|
-
},
|
1736
|
-
formValues
|
1737
|
-
);
|
1738
|
-
if ("data" in res && collectionType !== SINGLE_TYPES) {
|
1739
|
-
navigate({
|
1740
|
-
pathname: `../${collectionType}/${model}/${res.data.documentId}`,
|
1741
|
-
search: rawQuery
|
1742
|
-
});
|
1743
|
-
} else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
1744
|
-
setErrors(formatValidationErrors(res.error));
|
1862
|
+
await performPublish();
|
1863
|
+
},
|
1864
|
+
dialog: hasDraftRelations ? {
|
1865
|
+
type: "dialog",
|
1866
|
+
variant: "danger",
|
1867
|
+
footer: null,
|
1868
|
+
title: formatMessage({
|
1869
|
+
id: getTranslation(`popUpwarning.warning.bulk-has-draft-relations.title`),
|
1870
|
+
defaultMessage: "Confirmation"
|
1871
|
+
}),
|
1872
|
+
content: formatMessage(
|
1873
|
+
{
|
1874
|
+
id: getTranslation(`popUpwarning.warning.bulk-has-draft-relations.message`),
|
1875
|
+
defaultMessage: "This entry is related to {count, plural, one {# draft entry} other {# draft entries}}. Publishing it could leave broken links in your app."
|
1876
|
+
},
|
1877
|
+
{
|
1878
|
+
count: totalDraftRelations
|
1745
1879
|
}
|
1746
|
-
|
1747
|
-
|
1880
|
+
),
|
1881
|
+
onConfirm: async () => {
|
1882
|
+
await performPublish();
|
1748
1883
|
}
|
1749
|
-
}
|
1884
|
+
} : void 0
|
1750
1885
|
};
|
1751
1886
|
};
|
1752
1887
|
PublishAction$1.type = "publish";
|
@@ -1762,10 +1897,6 @@ const UpdateAction = ({
|
|
1762
1897
|
const cloneMatch = reactRouterDom.useMatch(CLONE_PATH);
|
1763
1898
|
const isCloning = cloneMatch !== null;
|
1764
1899
|
const { formatMessage } = reactIntl.useIntl();
|
1765
|
-
const { canCreate, canUpdate } = useDocumentRBAC("UpdateAction", ({ canCreate: canCreate2, canUpdate: canUpdate2 }) => ({
|
1766
|
-
canCreate: canCreate2,
|
1767
|
-
canUpdate: canUpdate2
|
1768
|
-
}));
|
1769
1900
|
const { create, update, clone } = useDocumentActions();
|
1770
1901
|
const [{ query, rawQuery }] = strapiAdmin.useQueryParams();
|
1771
1902
|
const params = React__namespace.useMemo(() => buildValidParams(query), [query]);
|
@@ -1782,10 +1913,8 @@ const UpdateAction = ({
|
|
1782
1913
|
* - the form is submitting
|
1783
1914
|
* - the document is not modified & we're not cloning (you can save a clone entity straight away)
|
1784
1915
|
* - the active tab is the published tab
|
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
1916
|
*/
|
1788
|
-
disabled: isSubmitting || !modified && !isCloning || activeTab === "published"
|
1917
|
+
disabled: isSubmitting || !modified && !isCloning || activeTab === "published",
|
1789
1918
|
label: formatMessage({
|
1790
1919
|
id: "content-manager.containers.Edit.save",
|
1791
1920
|
defaultMessage: "Save"
|
@@ -1793,16 +1922,18 @@ const UpdateAction = ({
|
|
1793
1922
|
onClick: async () => {
|
1794
1923
|
setSubmitting(true);
|
1795
1924
|
try {
|
1796
|
-
|
1797
|
-
|
1798
|
-
|
1799
|
-
|
1800
|
-
|
1801
|
-
|
1802
|
-
|
1803
|
-
|
1804
|
-
|
1805
|
-
|
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
|
+
}
|
1806
1937
|
}
|
1807
1938
|
if (isCloning) {
|
1808
1939
|
const res = await clone(
|
@@ -1814,10 +1945,13 @@ const UpdateAction = ({
|
|
1814
1945
|
document
|
1815
1946
|
);
|
1816
1947
|
if ("data" in res) {
|
1817
|
-
navigate(
|
1818
|
-
|
1819
|
-
|
1820
|
-
|
1948
|
+
navigate(
|
1949
|
+
{
|
1950
|
+
pathname: `../${res.data.documentId}`,
|
1951
|
+
search: rawQuery
|
1952
|
+
},
|
1953
|
+
{ relative: "path" }
|
1954
|
+
);
|
1821
1955
|
} else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
1822
1956
|
setErrors(formatValidationErrors(res.error));
|
1823
1957
|
}
|
@@ -1847,10 +1981,10 @@ const UpdateAction = ({
|
|
1847
1981
|
if ("data" in res && collectionType !== SINGLE_TYPES) {
|
1848
1982
|
navigate(
|
1849
1983
|
{
|
1850
|
-
pathname: `../${
|
1984
|
+
pathname: `../${res.data.documentId}`,
|
1851
1985
|
search: rawQuery
|
1852
1986
|
},
|
1853
|
-
{ replace: true }
|
1987
|
+
{ replace: true, relative: "path" }
|
1854
1988
|
);
|
1855
1989
|
} else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
1856
1990
|
setErrors(formatValidationErrors(res.error));
|
@@ -1895,7 +2029,7 @@ const UnpublishAction$1 = ({
|
|
1895
2029
|
id: "app.utils.unpublish",
|
1896
2030
|
defaultMessage: "Unpublish"
|
1897
2031
|
}),
|
1898
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(
|
2032
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(Icons.Cross, {}),
|
1899
2033
|
onClick: async () => {
|
1900
2034
|
if (!documentId && collectionType !== SINGLE_TYPES || isDocumentModified) {
|
1901
2035
|
if (!documentId) {
|
@@ -2007,7 +2141,7 @@ const DiscardAction = ({
|
|
2007
2141
|
id: "content-manager.actions.discard.label",
|
2008
2142
|
defaultMessage: "Discard changes"
|
2009
2143
|
}),
|
2010
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(
|
2144
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(Icons.Cross, {}),
|
2011
2145
|
position: ["panel", "table-row"],
|
2012
2146
|
variant: "danger",
|
2013
2147
|
dialog: {
|
@@ -2035,11 +2169,6 @@ const DiscardAction = ({
|
|
2035
2169
|
};
|
2036
2170
|
};
|
2037
2171
|
DiscardAction.type = "discard";
|
2038
|
-
const StyledCrossCircle = styledComponents.styled(Icons.CrossCircle)`
|
2039
|
-
path {
|
2040
|
-
fill: currentColor;
|
2041
|
-
}
|
2042
|
-
`;
|
2043
2172
|
const DEFAULT_ACTIONS = [PublishAction$1, UpdateAction, UnpublishAction$1, DiscardAction];
|
2044
2173
|
const intervals = ["years", "months", "days", "hours", "minutes", "seconds"];
|
2045
2174
|
const RelativeTime = React__namespace.forwardRef(
|
@@ -2087,7 +2216,7 @@ const getDisplayName = ({
|
|
2087
2216
|
};
|
2088
2217
|
const capitalise = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
2089
2218
|
const DocumentStatus = ({ status = "draft", ...restProps }) => {
|
2090
|
-
const statusVariant = status === "draft" ? "
|
2219
|
+
const statusVariant = status === "draft" ? "secondary" : status === "published" ? "success" : "alternative";
|
2091
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) }) });
|
2092
2221
|
};
|
2093
2222
|
const Header = ({ isCreating, status, title: documentTitle = "Untitled" }) => {
|
@@ -2097,23 +2226,13 @@ const Header = ({ isCreating, status, title: documentTitle = "Untitled" }) => {
|
|
2097
2226
|
id: "content-manager.containers.edit.title.new",
|
2098
2227
|
defaultMessage: "Create an entry"
|
2099
2228
|
}) : documentTitle;
|
2100
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "flex-start", paddingTop:
|
2229
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "flex-start", paddingTop: 6, paddingBottom: 4, gap: 2, children: [
|
2101
2230
|
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.BackButton, {}),
|
2102
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
2103
|
-
designSystem.
|
2104
|
-
{
|
2105
|
-
|
2106
|
-
|
2107
|
-
paddingTop: 1,
|
2108
|
-
gap: "80px",
|
2109
|
-
alignItems: "flex-start",
|
2110
|
-
children: [
|
2111
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "alpha", tag: "h1", children: title }),
|
2112
|
-
/* @__PURE__ */ jsxRuntime.jsx(HeaderToolbar, {})
|
2113
|
-
]
|
2114
|
-
}
|
2115
|
-
),
|
2116
|
-
status ? /* @__PURE__ */ jsxRuntime.jsx(DocumentStatus, { status: isCloning ? "draft" : status }) : null
|
2231
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { width: "100%", justifyContent: "space-between", gap: "80px", alignItems: "flex-start", children: [
|
2232
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "alpha", tag: "h1", children: title }),
|
2233
|
+
/* @__PURE__ */ jsxRuntime.jsx(HeaderToolbar, {})
|
2234
|
+
] }),
|
2235
|
+
status ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { marginTop: 1, children: /* @__PURE__ */ jsxRuntime.jsx(DocumentStatus, { status: isCloning ? "draft" : status }) }) : null
|
2117
2236
|
] });
|
2118
2237
|
};
|
2119
2238
|
const HeaderToolbar = () => {
|
@@ -2280,8 +2399,22 @@ const Information = ({ activeTab }) => {
|
|
2280
2399
|
);
|
2281
2400
|
};
|
2282
2401
|
const HeaderActions = ({ actions: actions2 }) => {
|
2283
|
-
|
2284
|
-
|
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) {
|
2285
2418
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
2286
2419
|
designSystem.SingleSelect,
|
2287
2420
|
{
|
@@ -2295,10 +2428,49 @@ const HeaderActions = ({ actions: actions2 }) => {
|
|
2295
2428
|
action.id
|
2296
2429
|
);
|
2297
2430
|
} else {
|
2298
|
-
|
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
|
+
}
|
2299
2453
|
}
|
2300
2454
|
}) });
|
2301
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
|
+
};
|
2302
2474
|
const ConfigureTheViewAction = ({ collectionType, model }) => {
|
2303
2475
|
const navigate = reactRouterDom.useNavigate();
|
2304
2476
|
const { formatMessage } = reactIntl.useIntl();
|
@@ -2434,7 +2606,7 @@ const ActionsPanel = () => {
|
|
2434
2606
|
return {
|
2435
2607
|
title: formatMessage({
|
2436
2608
|
id: "content-manager.containers.edit.panels.default.title",
|
2437
|
-
defaultMessage: "
|
2609
|
+
defaultMessage: "Entry"
|
2438
2610
|
}),
|
2439
2611
|
content: /* @__PURE__ */ jsxRuntime.jsx(ActionsPanelContent, {})
|
2440
2612
|
};
|
@@ -2678,7 +2850,8 @@ const formatEditLayout = (data, {
|
|
2678
2850
|
layout: convertEditLayoutToFieldLayouts(
|
2679
2851
|
configuration.layouts.edit,
|
2680
2852
|
components[uid].attributes,
|
2681
|
-
configuration.metadatas
|
2853
|
+
configuration.metadatas,
|
2854
|
+
{ configurations: data.components, schemas: components }
|
2682
2855
|
),
|
2683
2856
|
settings: {
|
2684
2857
|
...configuration.settings,
|
@@ -2804,7 +2977,7 @@ const ConfirmBulkActionDialog = ({
|
|
2804
2977
|
endAction
|
2805
2978
|
}) => {
|
2806
2979
|
const { formatMessage } = reactIntl.useIntl();
|
2807
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Root, {
|
2980
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Root, { open: isOpen, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Content, { children: [
|
2808
2981
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Header, { children: formatMessage({
|
2809
2982
|
id: "app.components.ConfirmDialog.title",
|
2810
2983
|
defaultMessage: "Confirmation"
|
@@ -2835,6 +3008,7 @@ const ConfirmDialogPublishAll = ({
|
|
2835
3008
|
const { _unstableFormatAPIError: formatAPIError } = strapiAdmin.useAPIErrorHandler(getTranslation);
|
2836
3009
|
const { model, schema } = useDoc();
|
2837
3010
|
const [{ query }] = strapiAdmin.useQueryParams();
|
3011
|
+
const enableDraftRelationsCount = false;
|
2838
3012
|
const {
|
2839
3013
|
data: countDraftRelations = 0,
|
2840
3014
|
isLoading,
|
@@ -2846,7 +3020,7 @@ const ConfirmDialogPublishAll = ({
|
|
2846
3020
|
locale: query?.plugins?.i18n?.locale
|
2847
3021
|
},
|
2848
3022
|
{
|
2849
|
-
skip:
|
3023
|
+
skip: !enableDraftRelationsCount
|
2850
3024
|
}
|
2851
3025
|
);
|
2852
3026
|
React__namespace.useEffect(() => {
|
@@ -3031,7 +3205,7 @@ const SelectedEntriesTableContent = ({
|
|
3031
3205
|
status: row.status
|
3032
3206
|
}
|
3033
3207
|
) }),
|
3034
|
-
/* @__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(
|
3035
3209
|
designSystem.IconButton,
|
3036
3210
|
{
|
3037
3211
|
tag: reactRouterDom.Link,
|
@@ -3054,9 +3228,10 @@ const SelectedEntriesTableContent = ({
|
|
3054
3228
|
),
|
3055
3229
|
target: "_blank",
|
3056
3230
|
marginLeft: "auto",
|
3057
|
-
|
3231
|
+
variant: "ghost",
|
3232
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Pencil, { width: "1.6rem", height: "1.6rem" })
|
3058
3233
|
}
|
3059
|
-
) })
|
3234
|
+
) }) })
|
3060
3235
|
] }, row.id)) })
|
3061
3236
|
] });
|
3062
3237
|
};
|
@@ -3093,7 +3268,13 @@ const SelectedEntriesModalContent = ({
|
|
3093
3268
|
);
|
3094
3269
|
const { rows, validationErrors } = React__namespace.useMemo(() => {
|
3095
3270
|
if (data.length > 0 && schema) {
|
3096
|
-
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
|
+
);
|
3097
3278
|
const validationErrors2 = {};
|
3098
3279
|
const rows2 = data.map((entry) => {
|
3099
3280
|
try {
|
@@ -3443,7 +3624,7 @@ const TableActions = ({ document }) => {
|
|
3443
3624
|
strapiAdmin.DescriptionComponentRenderer,
|
3444
3625
|
{
|
3445
3626
|
props,
|
3446
|
-
descriptions: plugins["content-manager"].apis.getDocumentActions(),
|
3627
|
+
descriptions: plugins["content-manager"].apis.getDocumentActions().filter((action) => action.name !== "PublishAction"),
|
3447
3628
|
children: (actions2) => {
|
3448
3629
|
const tableRowActions = actions2.filter((action) => {
|
3449
3630
|
const positions = Array.isArray(action.position) ? action.position : [action.position];
|
@@ -3554,7 +3735,7 @@ const CloneAction = ({ model, documentId }) => {
|
|
3554
3735
|
}),
|
3555
3736
|
content: /* @__PURE__ */ jsxRuntime.jsx(AutoCloneFailureModalBody, { prohibitedFields }),
|
3556
3737
|
footer: ({ onClose }) => {
|
3557
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.
|
3738
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Modal.Footer, { children: [
|
3558
3739
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: onClose, variant: "tertiary", children: formatMessage({
|
3559
3740
|
id: "cancel",
|
3560
3741
|
defaultMessage: "Cancel"
|
@@ -3595,8 +3776,7 @@ class ContentManagerPlugin {
|
|
3595
3776
|
documentActions = [
|
3596
3777
|
...DEFAULT_ACTIONS,
|
3597
3778
|
...DEFAULT_TABLE_ROW_ACTIONS,
|
3598
|
-
...DEFAULT_HEADER_ACTIONS
|
3599
|
-
HistoryAction
|
3779
|
+
...DEFAULT_HEADER_ACTIONS
|
3600
3780
|
];
|
3601
3781
|
editViewSidePanels = [ActionsPanel];
|
3602
3782
|
headerActions = [];
|
@@ -3685,6 +3865,52 @@ const getPrintableType = (value) => {
|
|
3685
3865
|
}
|
3686
3866
|
return nativeType;
|
3687
3867
|
};
|
3868
|
+
const HistoryAction = ({ model, document }) => {
|
3869
|
+
const { formatMessage } = reactIntl.useIntl();
|
3870
|
+
const [{ query }] = strapiAdmin.useQueryParams();
|
3871
|
+
const navigate = reactRouterDom.useNavigate();
|
3872
|
+
const pluginsQueryParams = qs.stringify({ plugins: query.plugins }, { encode: false });
|
3873
|
+
if (!window.strapi.features.isEnabled("cms-content-history")) {
|
3874
|
+
return null;
|
3875
|
+
}
|
3876
|
+
return {
|
3877
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(Icons.ClockCounterClockwise, {}),
|
3878
|
+
label: formatMessage({
|
3879
|
+
id: "content-manager.history.document-action",
|
3880
|
+
defaultMessage: "Content History"
|
3881
|
+
}),
|
3882
|
+
onClick: () => navigate({ pathname: "history", search: pluginsQueryParams }),
|
3883
|
+
disabled: (
|
3884
|
+
/**
|
3885
|
+
* The user is creating a new document.
|
3886
|
+
* It hasn't been saved yet, so there's no history to go to
|
3887
|
+
*/
|
3888
|
+
!document || /**
|
3889
|
+
* The document has been created but the current dimension has never been saved.
|
3890
|
+
* For example, the user is creating a new locale in an existing document,
|
3891
|
+
* so there's no history for the document in that locale
|
3892
|
+
*/
|
3893
|
+
!document.id || /**
|
3894
|
+
* History is only available for content types created by the user.
|
3895
|
+
* These have the `api::` prefix, as opposed to the ones created by Strapi or plugins,
|
3896
|
+
* which start with `admin::` or `plugin::`
|
3897
|
+
*/
|
3898
|
+
!model.startsWith("api::")
|
3899
|
+
),
|
3900
|
+
position: "header"
|
3901
|
+
};
|
3902
|
+
};
|
3903
|
+
HistoryAction.type = "history";
|
3904
|
+
const historyAdmin = {
|
3905
|
+
bootstrap(app) {
|
3906
|
+
const { addDocumentAction } = app.getPlugin("content-manager").apis;
|
3907
|
+
addDocumentAction((actions2) => {
|
3908
|
+
const indexOfDeleteAction = actions2.findIndex((action) => action.type === "delete");
|
3909
|
+
actions2.splice(indexOfDeleteAction, 0, HistoryAction);
|
3910
|
+
return actions2;
|
3911
|
+
});
|
3912
|
+
}
|
3913
|
+
};
|
3688
3914
|
const initialState = {
|
3689
3915
|
collectionTypeLinks: [],
|
3690
3916
|
components: [],
|
@@ -3740,7 +3966,7 @@ const index = {
|
|
3740
3966
|
app.router.addRoute({
|
3741
3967
|
path: "content-manager/*",
|
3742
3968
|
lazy: async () => {
|
3743
|
-
const { Layout } = await Promise.resolve().then(() => require("./layout-
|
3969
|
+
const { Layout } = await Promise.resolve().then(() => require("./layout-bE-WUnQ0.js"));
|
3744
3970
|
return {
|
3745
3971
|
Component: Layout
|
3746
3972
|
};
|
@@ -3749,10 +3975,15 @@ const index = {
|
|
3749
3975
|
});
|
3750
3976
|
app.registerPlugin(cm.config);
|
3751
3977
|
},
|
3978
|
+
bootstrap(app) {
|
3979
|
+
if (typeof historyAdmin.bootstrap === "function") {
|
3980
|
+
historyAdmin.bootstrap(app);
|
3981
|
+
}
|
3982
|
+
},
|
3752
3983
|
async registerTrads({ locales }) {
|
3753
3984
|
const importedTrads = await Promise.all(
|
3754
3985
|
locales.map((locale) => {
|
3755
|
-
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 }) => {
|
3756
3987
|
return {
|
3757
3988
|
data: prefixPluginTranslations(data, PLUGIN_ID),
|
3758
3989
|
locale
|
@@ -3770,6 +4001,7 @@ const index = {
|
|
3770
4001
|
};
|
3771
4002
|
exports.ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD = ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD;
|
3772
4003
|
exports.BulkActionsRenderer = BulkActionsRenderer;
|
4004
|
+
exports.CLONE_PATH = CLONE_PATH;
|
3773
4005
|
exports.COLLECTION_TYPES = COLLECTION_TYPES;
|
3774
4006
|
exports.CREATOR_FIELDS = CREATOR_FIELDS;
|
3775
4007
|
exports.DEFAULT_SETTINGS = DEFAULT_SETTINGS;
|
@@ -3809,4 +4041,4 @@ exports.useGetAllDocumentsQuery = useGetAllDocumentsQuery;
|
|
3809
4041
|
exports.useGetContentTypeConfigurationQuery = useGetContentTypeConfigurationQuery;
|
3810
4042
|
exports.useGetInitialDataQuery = useGetInitialDataQuery;
|
3811
4043
|
exports.useUpdateContentTypeConfigurationMutation = useUpdateContentTypeConfigurationMutation;
|
3812
|
-
//# sourceMappingURL=index-
|
4044
|
+
//# sourceMappingURL=index-DXiHxy70.js.map
|