@strapi/content-manager 5.0.0-beta.6 → 5.0.0-beta.8
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/{CardDragPreview-DSVYodBX.js → CardDragPreview-C0QyJgRA.js} +10 -14
- package/dist/_chunks/CardDragPreview-C0QyJgRA.js.map +1 -0
- package/dist/_chunks/{CardDragPreview-ikSG4M46.mjs → CardDragPreview-DOxamsuj.mjs} +7 -9
- package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +1 -0
- package/dist/_chunks/{ComponentConfigurationPage--2aLCv-G.mjs → ComponentConfigurationPage-CuWgXugY.mjs} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage--2aLCv-G.mjs.map → ComponentConfigurationPage-CuWgXugY.mjs.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-43KmCNQE.js → ComponentConfigurationPage-by0e_kNd.js} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-43KmCNQE.js.map → ComponentConfigurationPage-by0e_kNd.js.map} +1 -1
- package/dist/_chunks/{ComponentIcon-BBQsYCVn.js → ComponentIcon-BXdiCGQp.js} +8 -2
- package/dist/_chunks/ComponentIcon-BXdiCGQp.js.map +1 -0
- package/dist/_chunks/{ComponentIcon-BOFnK76n.mjs → ComponentIcon-u4bIXTFY.mjs} +9 -3
- package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +1 -0
- package/dist/_chunks/{EditConfigurationPage-BfFzJ4Br.js → EditConfigurationPage-CqBeCPGH.js} +3 -3
- package/dist/_chunks/{EditConfigurationPage-BfFzJ4Br.js.map → EditConfigurationPage-CqBeCPGH.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-CUcGHHvQ.mjs → EditConfigurationPage-DbI4KMyz.mjs} +3 -3
- package/dist/_chunks/{EditConfigurationPage-CUcGHHvQ.mjs.map → EditConfigurationPage-DbI4KMyz.mjs.map} +1 -1
- package/dist/_chunks/{EditViewPage-CzOT5Kpj.js → EditViewPage-ChgloMyO.js} +7 -9
- package/dist/_chunks/EditViewPage-ChgloMyO.js.map +1 -0
- package/dist/_chunks/{EditViewPage-Bm8lgcm6.mjs → EditViewPage-dFPBya9U.mjs} +6 -6
- package/dist/_chunks/EditViewPage-dFPBya9U.mjs.map +1 -0
- package/dist/_chunks/{Field-Dlh0uGnL.mjs → Field-C1nUKcdS.mjs} +500 -608
- package/dist/_chunks/Field-C1nUKcdS.mjs.map +1 -0
- package/dist/_chunks/{Field-Caef4JjM.js → Field-dLk-vgLL.js} +552 -661
- package/dist/_chunks/Field-dLk-vgLL.js.map +1 -0
- package/dist/_chunks/{Form-BzuAjtRq.js → Form-CbXtmHC_.js} +21 -19
- package/dist/_chunks/Form-CbXtmHC_.js.map +1 -0
- package/dist/_chunks/{Form-EnaQL_6L.mjs → Form-DOlpi7Js.mjs} +21 -18
- package/dist/_chunks/Form-DOlpi7Js.mjs.map +1 -0
- package/dist/_chunks/{History-D6sbCJvo.mjs → History-BFNUAiGc.mjs} +32 -43
- package/dist/_chunks/History-BFNUAiGc.mjs.map +1 -0
- package/dist/_chunks/{History-C17LiyRg.js → History-BjDfohBr.js} +32 -44
- package/dist/_chunks/History-BjDfohBr.js.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-Ce4qs7qE.mjs → ListConfigurationPage-DDi0KqFm.mjs} +14 -14
- package/dist/_chunks/ListConfigurationPage-DDi0KqFm.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-Dks5SX6f.js → ListConfigurationPage-IQBgWTaa.js} +17 -19
- package/dist/_chunks/ListConfigurationPage-IQBgWTaa.js.map +1 -0
- package/dist/_chunks/{ListViewPage-Be7S5aKL.mjs → ListViewPage-BPjljUsH.mjs} +25 -45
- package/dist/_chunks/ListViewPage-BPjljUsH.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-BwrZrPsh.js → ListViewPage-CZYGqlvF.js} +31 -51
- package/dist/_chunks/ListViewPage-CZYGqlvF.js.map +1 -0
- package/dist/_chunks/{NoContentTypePage-Cu5r1-JT.js → NoContentTypePage-BOAI6VZ1.js} +5 -5
- package/dist/_chunks/NoContentTypePage-BOAI6VZ1.js.map +1 -0
- package/dist/_chunks/{NoContentTypePage-CIPmYQMm.mjs → NoContentTypePage-DaWw67K-.mjs} +7 -7
- package/dist/_chunks/NoContentTypePage-DaWw67K-.mjs.map +1 -0
- package/dist/_chunks/{NoPermissionsPage-DhJ7LYrr.mjs → NoPermissionsPage-CZrJH00p.mjs} +5 -6
- package/dist/_chunks/NoPermissionsPage-CZrJH00p.mjs.map +1 -0
- package/dist/_chunks/{NoPermissionsPage-C-j6TEUF.js → NoPermissionsPage-cYEtLc_e.js} +4 -5
- package/dist/_chunks/NoPermissionsPage-cYEtLc_e.js.map +1 -0
- package/dist/_chunks/{Relations-CY7AtkDA.mjs → Relations-DTowyge2.mjs} +66 -56
- package/dist/_chunks/Relations-DTowyge2.mjs.map +1 -0
- package/dist/_chunks/{Relations-Czs-uZ-s.js → Relations-DU6B7irU.js} +70 -61
- package/dist/_chunks/Relations-DU6B7irU.js.map +1 -0
- package/dist/_chunks/{en-C-V1_90f.js → en-DTULi5-d.js} +3 -1
- package/dist/_chunks/{en-C-V1_90f.js.map → en-DTULi5-d.js.map} +1 -1
- package/dist/_chunks/{en-MBPul9Su.mjs → en-GCOTL6jR.mjs} +3 -1
- package/dist/_chunks/{en-MBPul9Su.mjs.map → en-GCOTL6jR.mjs.map} +1 -1
- package/dist/_chunks/{index-DNVx8ssZ.mjs → index-BaGHmIir.mjs} +507 -202
- package/dist/_chunks/index-BaGHmIir.mjs.map +1 -0
- package/dist/_chunks/{index-X_2tafck.js → index-CCJeB7Rw.js} +502 -198
- package/dist/_chunks/index-CCJeB7Rw.js.map +1 -0
- package/dist/_chunks/{layout-Dnh0PNp9.mjs → layout-BinjszSQ.mjs} +13 -13
- package/dist/_chunks/layout-BinjszSQ.mjs.map +1 -0
- package/dist/_chunks/{layout-dBc7wN7L.js → layout-ni_L9kT1.js} +14 -16
- package/dist/_chunks/layout-ni_L9kT1.js.map +1 -0
- package/dist/_chunks/{relations-4pHtBrHJ.js → relations-CeJAJc5I.js} +2 -2
- package/dist/_chunks/{relations-4pHtBrHJ.js.map → relations-CeJAJc5I.js.map} +1 -1
- package/dist/_chunks/{relations-Dx7tMKJN.mjs → relations-c91ji5eR.mjs} +2 -2
- package/dist/_chunks/{relations-Dx7tMKJN.mjs.map → relations-c91ji5eR.mjs.map} +1 -1
- package/dist/_chunks/useDragAndDrop-DdHgKsqq.mjs.map +1 -1
- package/dist/_chunks/useDragAndDrop-J0TUUbR6.js.map +1 -1
- package/dist/_chunks/usePrev-B9w_-eYc.js +15 -0
- package/dist/_chunks/usePrev-B9w_-eYc.js.map +1 -0
- package/dist/_chunks/usePrev-DH6iah0A.mjs +16 -0
- package/dist/_chunks/usePrev-DH6iah0A.mjs.map +1 -0
- package/dist/admin/index.js +2 -1
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +5 -4
- package/dist/admin/src/components/ComponentIcon.d.ts +6 -3
- package/dist/admin/src/content-manager.d.ts +3 -3
- package/dist/admin/src/exports.d.ts +1 -0
- package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
- package/dist/admin/src/hooks/useDocument.d.ts +5 -8
- package/dist/admin/src/hooks/useDocumentActions.d.ts +24 -3
- package/dist/admin/src/hooks/useDocumentLayout.d.ts +2 -2
- package/dist/admin/src/hooks/useDragAndDrop.d.ts +4 -4
- package/dist/admin/src/hooks/useKeyboardDragAndDrop.d.ts +1 -1
- package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +3 -1
- package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/BlocksInput.d.ts +3 -3
- package/dist/admin/src/pages/EditView/components/FormInputs/Component/Input.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/ComponentCategory.d.ts +3 -5
- package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/Field.d.ts +1 -1
- package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +10 -18
- package/dist/admin/src/pages/EditView/components/FormInputs/UID.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.d.ts +3 -49
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/Field.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +67 -52
- package/dist/admin/src/pages/EditView/components/InputRenderer.d.ts +2 -10
- package/dist/admin/src/services/api.d.ts +2 -3
- package/dist/admin/src/services/components.d.ts +2 -2
- package/dist/admin/src/services/contentTypes.d.ts +5 -5
- package/dist/admin/src/services/documents.d.ts +29 -17
- package/dist/admin/src/services/init.d.ts +2 -2
- package/dist/admin/src/services/relations.d.ts +3 -3
- package/dist/admin/src/services/uid.d.ts +3 -3
- package/dist/admin/src/utils/api.d.ts +4 -18
- package/dist/admin/src/utils/validation.d.ts +1 -6
- package/dist/server/index.js +529 -407
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +537 -415
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
- package/dist/server/src/controllers/single-types.d.ts.map +1 -1
- package/dist/server/src/controllers/utils/metadata.d.ts +8 -0
- package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -0
- package/dist/server/src/controllers/validation/dimensions.d.ts +9 -0
- package/dist/server/src/controllers/validation/dimensions.d.ts.map +1 -0
- package/dist/server/src/controllers/validation/index.d.ts +1 -1
- package/dist/server/src/history/services/history.d.ts +2 -4
- package/dist/server/src/history/services/history.d.ts.map +1 -1
- package/dist/server/src/history/services/index.d.ts +6 -2
- package/dist/server/src/history/services/index.d.ts.map +1 -1
- package/dist/server/src/history/services/lifecycles.d.ts +9 -0
- package/dist/server/src/history/services/lifecycles.d.ts.map +1 -0
- package/dist/server/src/history/services/utils.d.ts +41 -9
- package/dist/server/src/history/services/utils.d.ts.map +1 -1
- package/dist/server/src/history/utils.d.ts +6 -2
- package/dist/server/src/history/utils.d.ts.map +1 -1
- package/dist/server/src/index.d.ts +18 -39
- package/dist/server/src/index.d.ts.map +1 -1
- package/dist/server/src/services/document-manager.d.ts +13 -12
- package/dist/server/src/services/document-manager.d.ts.map +1 -1
- package/dist/server/src/services/document-metadata.d.ts +8 -29
- package/dist/server/src/services/document-metadata.d.ts.map +1 -1
- package/dist/server/src/services/index.d.ts +18 -39
- package/dist/server/src/services/index.d.ts.map +1 -1
- package/dist/server/src/services/utils/populate.d.ts +8 -1
- package/dist/server/src/services/utils/populate.d.ts.map +1 -1
- package/dist/shared/contracts/collection-types.d.ts +14 -6
- package/dist/shared/contracts/collection-types.d.ts.map +1 -1
- package/dist/shared/contracts/relations.d.ts +2 -2
- package/dist/shared/contracts/relations.d.ts.map +1 -1
- package/package.json +13 -14
- package/dist/_chunks/CardDragPreview-DSVYodBX.js.map +0 -1
- package/dist/_chunks/CardDragPreview-ikSG4M46.mjs.map +0 -1
- package/dist/_chunks/ComponentIcon-BBQsYCVn.js.map +0 -1
- package/dist/_chunks/ComponentIcon-BOFnK76n.mjs.map +0 -1
- package/dist/_chunks/EditViewPage-Bm8lgcm6.mjs.map +0 -1
- package/dist/_chunks/EditViewPage-CzOT5Kpj.js.map +0 -1
- package/dist/_chunks/Field-Caef4JjM.js.map +0 -1
- package/dist/_chunks/Field-Dlh0uGnL.mjs.map +0 -1
- package/dist/_chunks/Form-BzuAjtRq.js.map +0 -1
- package/dist/_chunks/Form-EnaQL_6L.mjs.map +0 -1
- package/dist/_chunks/History-C17LiyRg.js.map +0 -1
- package/dist/_chunks/History-D6sbCJvo.mjs.map +0 -1
- package/dist/_chunks/ListConfigurationPage-Ce4qs7qE.mjs.map +0 -1
- package/dist/_chunks/ListConfigurationPage-Dks5SX6f.js.map +0 -1
- package/dist/_chunks/ListViewPage-Be7S5aKL.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-BwrZrPsh.js.map +0 -1
- package/dist/_chunks/NoContentTypePage-CIPmYQMm.mjs.map +0 -1
- package/dist/_chunks/NoContentTypePage-Cu5r1-JT.js.map +0 -1
- package/dist/_chunks/NoPermissionsPage-C-j6TEUF.js.map +0 -1
- package/dist/_chunks/NoPermissionsPage-DhJ7LYrr.mjs.map +0 -1
- package/dist/_chunks/Relations-CY7AtkDA.mjs.map +0 -1
- package/dist/_chunks/Relations-Czs-uZ-s.js.map +0 -1
- package/dist/_chunks/index-DNVx8ssZ.mjs.map +0 -1
- package/dist/_chunks/index-X_2tafck.js.map +0 -1
- package/dist/_chunks/layout-Dnh0PNp9.mjs.map +0 -1
- package/dist/_chunks/layout-dBc7wN7L.js.map +0 -1
- package/dist/_chunks/urls-CbOsUOoW.mjs +0 -7
- package/dist/_chunks/urls-CbOsUOoW.mjs.map +0 -1
- package/dist/_chunks/urls-DzZya_gm.js +0 -6
- package/dist/_chunks/urls-DzZya_gm.js.map +0 -1
- package/dist/admin/src/pages/ListView/components/BulkActions/PublishAction.d.ts +0 -31
- package/dist/server/src/controllers/utils/dimensions.d.ts +0 -5
- package/dist/server/src/controllers/utils/dimensions.d.ts.map +0 -1
@@ -1,17 +1,15 @@
|
|
1
|
-
import { ClockCounterClockwise, CrossCircle, More, WarningCircle,
|
1
|
+
import { ClockCounterClockwise, CrossCircle, More, WarningCircle, ListPlus, Pencil, Trash, Check, ChevronRight, Duplicate, Feather } from "@strapi/icons";
|
2
2
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
3
|
-
import { useStrapiApp, useQueryParams, createContext, useAuth, useRBAC, Page,
|
3
|
+
import { useStrapiApp, useQueryParams, createContext, useAuth, useRBAC, Page, adminApi, translatedErrors, useNotification, useAPIErrorHandler, getYupValidationErrors, useTracking, useForm, BackButton, DescriptionComponentRenderer, useTable } from "@strapi/admin/strapi-admin";
|
4
4
|
import { stringify } from "qs";
|
5
5
|
import { useIntl } from "react-intl";
|
6
6
|
import { useNavigate, useParams, Navigate, useMatch, NavLink } from "react-router-dom";
|
7
7
|
import * as React from "react";
|
8
8
|
import { lazy } from "react";
|
9
9
|
import { Menu, VisuallyHidden, Flex, Typography, Dialog, DialogBody, DialogFooter, Button, ModalLayout, ModalHeader, ModalBody, Box, Radio, Status, SingleSelect, SingleSelectOption, LinkButton } from "@strapi/design-system";
|
10
|
-
import styled from "styled-components";
|
10
|
+
import { styled } from "styled-components";
|
11
11
|
import * as yup from "yup";
|
12
12
|
import { ValidationError } from "yup";
|
13
|
-
import { createApi } from "@reduxjs/toolkit/query/react";
|
14
|
-
import { isAxiosError } from "axios";
|
15
13
|
import pipe from "lodash/fp/pipe";
|
16
14
|
import { intervalToDuration, isPast } from "date-fns";
|
17
15
|
import { createSlice, combineReducers } from "@reduxjs/toolkit";
|
@@ -157,9 +155,8 @@ const DocumentRBAC = ({ children, permissions }) => {
|
|
157
155
|
const name = removeNumericalStrings(fieldName.split("."));
|
158
156
|
const componentFieldNames = fieldsUserCanAction.filter((field) => field.split(".").length > 1);
|
159
157
|
if (fieldType === "component") {
|
160
|
-
|
161
|
-
|
162
|
-
return field.includes(fieldName);
|
158
|
+
return componentFieldNames.some((field) => {
|
159
|
+
return field.includes(name.join("."));
|
163
160
|
});
|
164
161
|
}
|
165
162
|
if (name.length > 1) {
|
@@ -189,78 +186,8 @@ const extractAndDedupeFields = (permissions = []) => permissions.flatMap((permis
|
|
189
186
|
(field, index2, arr) => arr.indexOf(field) === index2 && typeof field === "string"
|
190
187
|
);
|
191
188
|
const removeNumericalStrings = (arr) => arr.filter((item) => isNaN(Number(item)));
|
192
|
-
const
|
193
|
-
|
194
|
-
return query;
|
195
|
-
const { plugins: _, ...validQueryParams } = {
|
196
|
-
...query,
|
197
|
-
...Object.values(query?.plugins ?? {}).reduce(
|
198
|
-
(acc, current) => Object.assign(acc, current),
|
199
|
-
{}
|
200
|
-
)
|
201
|
-
};
|
202
|
-
if ("_q" in validQueryParams) {
|
203
|
-
validQueryParams._q = encodeURIComponent(validQueryParams._q);
|
204
|
-
}
|
205
|
-
return validQueryParams;
|
206
|
-
};
|
207
|
-
const axiosBaseQuery = () => async (query, { signal }) => {
|
208
|
-
try {
|
209
|
-
const { get, post, del, put } = getFetchClient();
|
210
|
-
if (typeof query === "string") {
|
211
|
-
const result = await get(query, { signal });
|
212
|
-
return { data: result.data };
|
213
|
-
} else {
|
214
|
-
const { url, method = "GET", data, config } = query;
|
215
|
-
if (method === "POST") {
|
216
|
-
const result2 = await post(url, data, { ...config, signal });
|
217
|
-
return { data: result2.data };
|
218
|
-
}
|
219
|
-
if (method === "DELETE") {
|
220
|
-
const result2 = await del(url, { ...config, signal });
|
221
|
-
return { data: result2.data };
|
222
|
-
}
|
223
|
-
if (method === "PUT") {
|
224
|
-
const result2 = await put(url, data, { ...config, signal });
|
225
|
-
return { data: result2.data };
|
226
|
-
}
|
227
|
-
const result = await get(url, { ...config, signal });
|
228
|
-
return { data: result.data };
|
229
|
-
}
|
230
|
-
} catch (err) {
|
231
|
-
if (isAxiosError(err)) {
|
232
|
-
if (typeof err.response?.data === "object" && err.response?.data !== null && "error" in err.response?.data) {
|
233
|
-
return { data: void 0, error: err.response?.data.error };
|
234
|
-
} else {
|
235
|
-
return {
|
236
|
-
data: void 0,
|
237
|
-
error: {
|
238
|
-
name: "UnknownError",
|
239
|
-
message: "There was an unknown error response from the API",
|
240
|
-
details: err.response?.data,
|
241
|
-
status: err.response?.status
|
242
|
-
}
|
243
|
-
};
|
244
|
-
}
|
245
|
-
}
|
246
|
-
const error = err;
|
247
|
-
return {
|
248
|
-
data: void 0,
|
249
|
-
error: {
|
250
|
-
name: error.name,
|
251
|
-
message: error.message,
|
252
|
-
stack: error.stack
|
253
|
-
}
|
254
|
-
};
|
255
|
-
}
|
256
|
-
};
|
257
|
-
const isBaseQueryError = (error) => {
|
258
|
-
return error.name !== void 0;
|
259
|
-
};
|
260
|
-
const contentManagerApi = createApi({
|
261
|
-
reducerPath: "contentManagerApi",
|
262
|
-
baseQuery: axiosBaseQuery(),
|
263
|
-
tagTypes: [
|
189
|
+
const contentManagerApi = adminApi.enhanceEndpoints({
|
190
|
+
addTagTypes: [
|
264
191
|
"ComponentConfiguration",
|
265
192
|
"ContentTypesConfiguration",
|
266
193
|
"ContentTypeSettings",
|
@@ -268,8 +195,7 @@ const contentManagerApi = createApi({
|
|
268
195
|
"InitialData",
|
269
196
|
"HistoryVersion",
|
270
197
|
"Relations"
|
271
|
-
]
|
272
|
-
endpoints: () => ({})
|
198
|
+
]
|
273
199
|
});
|
274
200
|
const documentApi = contentManagerApi.injectEndpoints({
|
275
201
|
endpoints: (builder) => ({
|
@@ -325,12 +251,15 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
325
251
|
]
|
326
252
|
}),
|
327
253
|
deleteManyDocuments: builder.mutation({
|
328
|
-
query: ({ model, ...body }) => ({
|
254
|
+
query: ({ model, params, ...body }) => ({
|
329
255
|
url: `/content-manager/collection-types/${model}/actions/bulkDelete`,
|
330
256
|
method: "POST",
|
331
|
-
data: body
|
257
|
+
data: body,
|
258
|
+
config: {
|
259
|
+
params
|
260
|
+
}
|
332
261
|
}),
|
333
|
-
invalidatesTags: (_res, _error, { model
|
262
|
+
invalidatesTags: (_res, _error, { model }) => [{ type: "Document", id: `${model}_LIST` }]
|
334
263
|
}),
|
335
264
|
discardDocument: builder.mutation({
|
336
265
|
query: ({ collectionType, model, documentId, params }) => ({
|
@@ -441,10 +370,13 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
441
370
|
}
|
442
371
|
}),
|
443
372
|
publishManyDocuments: builder.mutation({
|
444
|
-
query: ({ model, ...body }) => ({
|
373
|
+
query: ({ model, params, ...body }) => ({
|
445
374
|
url: `/content-manager/collection-types/${model}/actions/bulkPublish`,
|
446
375
|
method: "POST",
|
447
|
-
data: body
|
376
|
+
data: body,
|
377
|
+
config: {
|
378
|
+
params
|
379
|
+
}
|
448
380
|
}),
|
449
381
|
invalidatesTags: (_res, _error, { model, documentIds }) => documentIds.map((id) => ({ type: "Document", id: `${model}_${id}` }))
|
450
382
|
}),
|
@@ -486,10 +418,13 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
486
418
|
}
|
487
419
|
}),
|
488
420
|
unpublishManyDocuments: builder.mutation({
|
489
|
-
query: ({ model, ...body }) => ({
|
421
|
+
query: ({ model, params, ...body }) => ({
|
490
422
|
url: `/content-manager/collection-types/${model}/actions/bulkUnpublish`,
|
491
423
|
method: "POST",
|
492
|
-
data: body
|
424
|
+
data: body,
|
425
|
+
config: {
|
426
|
+
params
|
427
|
+
}
|
493
428
|
}),
|
494
429
|
invalidatesTags: (_res, _error, { model, documentIds }) => documentIds.map((id) => ({ type: "Document", id: `${model}_${id}` }))
|
495
430
|
})
|
@@ -513,6 +448,24 @@ const {
|
|
513
448
|
useUnpublishDocumentMutation,
|
514
449
|
useUnpublishManyDocumentsMutation
|
515
450
|
} = documentApi;
|
451
|
+
const buildValidParams = (query) => {
|
452
|
+
if (!query)
|
453
|
+
return query;
|
454
|
+
const { plugins: _, ...validQueryParams } = {
|
455
|
+
...query,
|
456
|
+
...Object.values(query?.plugins ?? {}).reduce(
|
457
|
+
(acc, current) => Object.assign(acc, current),
|
458
|
+
{}
|
459
|
+
)
|
460
|
+
};
|
461
|
+
if ("_q" in validQueryParams) {
|
462
|
+
validQueryParams._q = encodeURIComponent(validQueryParams._q);
|
463
|
+
}
|
464
|
+
return validQueryParams;
|
465
|
+
};
|
466
|
+
const isBaseQueryError = (error) => {
|
467
|
+
return error.name !== void 0;
|
468
|
+
};
|
516
469
|
const createYupSchema = (attributes = {}, components = {}) => {
|
517
470
|
const createModelSchema = (attributes2) => yup.object().shape(
|
518
471
|
Object.entries(attributes2).reduce((acc, [name, attribute]) => {
|
@@ -552,10 +505,14 @@ const createYupSchema = (attributes = {}, components = {}) => {
|
|
552
505
|
yup.array().of(
|
553
506
|
yup.lazy(
|
554
507
|
(data) => {
|
555
|
-
const
|
556
|
-
|
508
|
+
const attributes3 = components?.[data?.__component]?.attributes;
|
509
|
+
const validation = yup.object().shape({
|
557
510
|
__component: yup.string().required().oneOf(Object.keys(components))
|
558
|
-
}).nullable(false)
|
511
|
+
}).nullable(false);
|
512
|
+
if (!attributes3) {
|
513
|
+
return validation;
|
514
|
+
}
|
515
|
+
return validation.concat(createModelSchema(attributes3));
|
559
516
|
}
|
560
517
|
)
|
561
518
|
)
|
@@ -565,11 +522,25 @@ const createYupSchema = (attributes = {}, components = {}) => {
|
|
565
522
|
return {
|
566
523
|
...acc,
|
567
524
|
[name]: transformSchema(
|
568
|
-
yup.
|
569
|
-
|
570
|
-
|
571
|
-
})
|
572
|
-
|
525
|
+
yup.lazy((value) => {
|
526
|
+
if (!value) {
|
527
|
+
return yup.mixed().nullable(true);
|
528
|
+
} else if (Array.isArray(value)) {
|
529
|
+
return yup.array().of(
|
530
|
+
yup.object().shape({
|
531
|
+
id: yup.string().required()
|
532
|
+
})
|
533
|
+
);
|
534
|
+
} else if (typeof value === "object") {
|
535
|
+
return yup.object();
|
536
|
+
} else {
|
537
|
+
return yup.mixed().test(
|
538
|
+
"type-error",
|
539
|
+
"Relation values must be either null, an array of objects with {id} or an object.",
|
540
|
+
() => false
|
541
|
+
);
|
542
|
+
}
|
543
|
+
})
|
573
544
|
)
|
574
545
|
};
|
575
546
|
default:
|
@@ -634,7 +605,12 @@ const addRequiredValidation = (attribute) => (schema) => {
|
|
634
605
|
defaultMessage: "This field is required."
|
635
606
|
});
|
636
607
|
}
|
637
|
-
return schema.nullable()
|
608
|
+
return schema?.nullable ? schema.nullable() : (
|
609
|
+
// In some cases '.nullable' will not be available on the schema.
|
610
|
+
// e.g. when the schema has been built using yup.lazy (e.g. for relations).
|
611
|
+
// In these cases we should just return the schema as it is.
|
612
|
+
schema
|
613
|
+
);
|
638
614
|
};
|
639
615
|
const addMinLengthValidation = (attribute) => (schema) => {
|
640
616
|
if ("minLength" in attribute && attribute.minLength && Number.isInteger(attribute.minLength) && "min" in schema) {
|
@@ -706,24 +682,6 @@ const addRegexValidation = (attribute) => (schema) => {
|
|
706
682
|
}
|
707
683
|
return schema;
|
708
684
|
};
|
709
|
-
const extractValuesFromYupError = (errorType, errorParams) => {
|
710
|
-
if (!errorType || !errorParams) {
|
711
|
-
return {};
|
712
|
-
}
|
713
|
-
return {
|
714
|
-
[errorType]: errorParams[errorType]
|
715
|
-
};
|
716
|
-
};
|
717
|
-
const getInnerErrors = (error) => (error?.inner || []).reduce((acc, currentError) => {
|
718
|
-
if (currentError.path) {
|
719
|
-
acc[currentError.path.split("[").join(".").split("]").join("")] = {
|
720
|
-
id: currentError.message,
|
721
|
-
defaultMessage: currentError.message,
|
722
|
-
values: extractValuesFromYupError(currentError?.type, currentError?.params)
|
723
|
-
};
|
724
|
-
}
|
725
|
-
return acc;
|
726
|
-
}, {});
|
727
685
|
const initApi = contentManagerApi.injectEndpoints({
|
728
686
|
endpoints: (builder) => ({
|
729
687
|
getInitialData: builder.query({
|
@@ -737,27 +695,20 @@ const { useGetInitialDataQuery } = initApi;
|
|
737
695
|
const useContentTypeSchema = (model) => {
|
738
696
|
const { toggleNotification } = useNotification();
|
739
697
|
const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();
|
740
|
-
const {
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
)
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
error: res.error,
|
755
|
-
components: Object.keys(components2).length === 0 ? void 0 : components2,
|
756
|
-
contentType: contentType2,
|
757
|
-
contentTypes: res.data?.contentTypes ?? []
|
758
|
-
};
|
759
|
-
}
|
760
|
-
});
|
698
|
+
const { data, error, isLoading, isFetching } = useGetInitialDataQuery(void 0);
|
699
|
+
const { components, contentType, contentTypes } = React.useMemo(() => {
|
700
|
+
const contentType2 = data?.contentTypes.find((ct) => ct.uid === model);
|
701
|
+
const componentsByKey = data?.components.reduce((acc, component) => {
|
702
|
+
acc[component.uid] = component;
|
703
|
+
return acc;
|
704
|
+
}, {});
|
705
|
+
const components2 = extractContentTypeComponents(contentType2?.attributes, componentsByKey);
|
706
|
+
return {
|
707
|
+
components: Object.keys(components2).length === 0 ? void 0 : components2,
|
708
|
+
contentType: contentType2,
|
709
|
+
contentTypes: data?.contentTypes ?? []
|
710
|
+
};
|
711
|
+
}, [model, data]);
|
761
712
|
React.useEffect(() => {
|
762
713
|
if (error) {
|
763
714
|
toggleNotification({
|
@@ -840,7 +791,7 @@ const useDocument = (args, opts) => {
|
|
840
791
|
return null;
|
841
792
|
} catch (error2) {
|
842
793
|
if (error2 instanceof ValidationError) {
|
843
|
-
return
|
794
|
+
return getYupValidationErrors(error2);
|
844
795
|
}
|
845
796
|
throw error2;
|
846
797
|
}
|
@@ -936,6 +887,44 @@ const useDocumentActions = () => {
|
|
936
887
|
},
|
937
888
|
[trackUsage, deleteDocument, toggleNotification, formatMessage, formatAPIError]
|
938
889
|
);
|
890
|
+
const [deleteManyDocuments] = useDeleteManyDocumentsMutation();
|
891
|
+
const deleteMany = React.useCallback(
|
892
|
+
async ({ model, documentIds, params }) => {
|
893
|
+
try {
|
894
|
+
trackUsage("willBulkDeleteEntries");
|
895
|
+
const res = await deleteManyDocuments({
|
896
|
+
model,
|
897
|
+
documentIds,
|
898
|
+
params
|
899
|
+
});
|
900
|
+
if ("error" in res) {
|
901
|
+
toggleNotification({
|
902
|
+
type: "danger",
|
903
|
+
message: formatAPIError(res.error)
|
904
|
+
});
|
905
|
+
return { error: res.error };
|
906
|
+
}
|
907
|
+
toggleNotification({
|
908
|
+
type: "success",
|
909
|
+
title: formatMessage({
|
910
|
+
id: getTranslation("success.records.delete"),
|
911
|
+
defaultMessage: "Successfully deleted."
|
912
|
+
}),
|
913
|
+
message: ""
|
914
|
+
});
|
915
|
+
trackUsage("didBulkDeleteEntries");
|
916
|
+
return res.data;
|
917
|
+
} catch (err) {
|
918
|
+
toggleNotification({
|
919
|
+
type: "danger",
|
920
|
+
message: formatMessage(DEFAULT_UNEXPECTED_ERROR_MSG)
|
921
|
+
});
|
922
|
+
trackUsage("didNotBulkDeleteEntries");
|
923
|
+
throw err;
|
924
|
+
}
|
925
|
+
},
|
926
|
+
[trackUsage, deleteManyDocuments, toggleNotification, formatMessage, formatAPIError]
|
927
|
+
);
|
939
928
|
const [discardDocument] = useDiscardDocumentMutation();
|
940
929
|
const discard = React.useCallback(
|
941
930
|
async ({ collectionType, model, documentId }) => {
|
@@ -1005,6 +994,43 @@ const useDocumentActions = () => {
|
|
1005
994
|
},
|
1006
995
|
[trackUsage, publishDocument, toggleNotification, formatMessage, formatAPIError]
|
1007
996
|
);
|
997
|
+
const [publishManyDocuments] = usePublishManyDocumentsMutation();
|
998
|
+
const publishMany = React.useCallback(
|
999
|
+
async ({ model, documentIds, params }) => {
|
1000
|
+
try {
|
1001
|
+
const res = await publishManyDocuments({
|
1002
|
+
model,
|
1003
|
+
documentIds,
|
1004
|
+
params
|
1005
|
+
});
|
1006
|
+
if ("error" in res) {
|
1007
|
+
toggleNotification({ type: "danger", message: formatAPIError(res.error) });
|
1008
|
+
return { error: res.error };
|
1009
|
+
}
|
1010
|
+
toggleNotification({
|
1011
|
+
type: "success",
|
1012
|
+
message: formatMessage({
|
1013
|
+
id: getTranslation("success.record.publish"),
|
1014
|
+
defaultMessage: "Published document"
|
1015
|
+
})
|
1016
|
+
});
|
1017
|
+
return res.data;
|
1018
|
+
} catch (err) {
|
1019
|
+
toggleNotification({
|
1020
|
+
type: "danger",
|
1021
|
+
message: formatMessage(DEFAULT_UNEXPECTED_ERROR_MSG)
|
1022
|
+
});
|
1023
|
+
throw err;
|
1024
|
+
}
|
1025
|
+
},
|
1026
|
+
[
|
1027
|
+
// trackUsage,
|
1028
|
+
publishManyDocuments,
|
1029
|
+
toggleNotification,
|
1030
|
+
formatMessage,
|
1031
|
+
formatAPIError
|
1032
|
+
]
|
1033
|
+
);
|
1008
1034
|
const [updateDocument] = useUpdateDocumentMutation();
|
1009
1035
|
const update = React.useCallback(
|
1010
1036
|
async ({ collectionType, model, documentId, params }, data, trackerProperty) => {
|
@@ -1079,6 +1105,41 @@ const useDocumentActions = () => {
|
|
1079
1105
|
},
|
1080
1106
|
[trackUsage, unpublishDocument, toggleNotification, formatMessage, formatAPIError]
|
1081
1107
|
);
|
1108
|
+
const [unpublishManyDocuments] = useUnpublishManyDocumentsMutation();
|
1109
|
+
const unpublishMany = React.useCallback(
|
1110
|
+
async ({ model, documentIds, params }) => {
|
1111
|
+
try {
|
1112
|
+
trackUsage("willBulkUnpublishEntries");
|
1113
|
+
const res = await unpublishManyDocuments({
|
1114
|
+
model,
|
1115
|
+
documentIds,
|
1116
|
+
params
|
1117
|
+
});
|
1118
|
+
if ("error" in res) {
|
1119
|
+
toggleNotification({ type: "danger", message: formatAPIError(res.error) });
|
1120
|
+
return { error: res.error };
|
1121
|
+
}
|
1122
|
+
trackUsage("didBulkUnpublishEntries");
|
1123
|
+
toggleNotification({
|
1124
|
+
type: "success",
|
1125
|
+
title: formatMessage({
|
1126
|
+
id: getTranslation("success.records.unpublish"),
|
1127
|
+
defaultMessage: "Successfully unpublished."
|
1128
|
+
}),
|
1129
|
+
message: ""
|
1130
|
+
});
|
1131
|
+
return res.data;
|
1132
|
+
} catch (err) {
|
1133
|
+
toggleNotification({
|
1134
|
+
type: "danger",
|
1135
|
+
message: formatMessage(DEFAULT_UNEXPECTED_ERROR_MSG)
|
1136
|
+
});
|
1137
|
+
trackUsage("didNotBulkUnpublishEntries");
|
1138
|
+
throw err;
|
1139
|
+
}
|
1140
|
+
},
|
1141
|
+
[trackUsage, unpublishManyDocuments, toggleNotification, formatMessage, formatAPIError]
|
1142
|
+
);
|
1082
1143
|
const [createDocument] = useCreateDocumentMutation();
|
1083
1144
|
const create = React.useCallback(
|
1084
1145
|
async ({ model, params }, data, trackerProperty) => {
|
@@ -1192,15 +1253,18 @@ const useDocumentActions = () => {
|
|
1192
1253
|
clone,
|
1193
1254
|
create,
|
1194
1255
|
delete: _delete,
|
1256
|
+
deleteMany,
|
1195
1257
|
discard,
|
1196
1258
|
getDocument,
|
1197
1259
|
publish,
|
1260
|
+
publishMany,
|
1198
1261
|
unpublish,
|
1262
|
+
unpublishMany,
|
1199
1263
|
update
|
1200
1264
|
};
|
1201
1265
|
};
|
1202
1266
|
const ProtectedHistoryPage = lazy(
|
1203
|
-
() => import("./History-
|
1267
|
+
() => import("./History-BFNUAiGc.mjs").then((mod) => ({ default: mod.ProtectedHistoryPage }))
|
1204
1268
|
);
|
1205
1269
|
const routes$1 = [
|
1206
1270
|
{
|
@@ -1213,31 +1277,31 @@ const routes$1 = [
|
|
1213
1277
|
}
|
1214
1278
|
];
|
1215
1279
|
const ProtectedEditViewPage = lazy(
|
1216
|
-
() => import("./EditViewPage-
|
1280
|
+
() => import("./EditViewPage-dFPBya9U.mjs").then((mod) => ({ default: mod.ProtectedEditViewPage }))
|
1217
1281
|
);
|
1218
1282
|
const ProtectedListViewPage = lazy(
|
1219
|
-
() => import("./ListViewPage-
|
1283
|
+
() => import("./ListViewPage-BPjljUsH.mjs").then((mod) => ({ default: mod.ProtectedListViewPage }))
|
1220
1284
|
);
|
1221
1285
|
const ProtectedListConfiguration = lazy(
|
1222
|
-
() => import("./ListConfigurationPage-
|
1286
|
+
() => import("./ListConfigurationPage-DDi0KqFm.mjs").then((mod) => ({
|
1223
1287
|
default: mod.ProtectedListConfiguration
|
1224
1288
|
}))
|
1225
1289
|
);
|
1226
1290
|
const ProtectedEditConfigurationPage = lazy(
|
1227
|
-
() => import("./EditConfigurationPage-
|
1291
|
+
() => import("./EditConfigurationPage-DbI4KMyz.mjs").then((mod) => ({
|
1228
1292
|
default: mod.ProtectedEditConfigurationPage
|
1229
1293
|
}))
|
1230
1294
|
);
|
1231
1295
|
const ProtectedComponentConfigurationPage = lazy(
|
1232
|
-
() => import("./ComponentConfigurationPage
|
1296
|
+
() => import("./ComponentConfigurationPage-CuWgXugY.mjs").then((mod) => ({
|
1233
1297
|
default: mod.ProtectedComponentConfigurationPage
|
1234
1298
|
}))
|
1235
1299
|
);
|
1236
1300
|
const NoPermissions = lazy(
|
1237
|
-
() => import("./NoPermissionsPage-
|
1301
|
+
() => import("./NoPermissionsPage-CZrJH00p.mjs").then((mod) => ({ default: mod.NoPermissions }))
|
1238
1302
|
);
|
1239
1303
|
const NoContentType = lazy(
|
1240
|
-
() => import("./NoContentTypePage-
|
1304
|
+
() => import("./NoContentTypePage-DaWw67K-.mjs").then((mod) => ({ default: mod.NoContentType }))
|
1241
1305
|
);
|
1242
1306
|
const CollectionTypePages = () => {
|
1243
1307
|
const { collectionType } = useParams();
|
@@ -1427,7 +1491,7 @@ const DocumentActionsMenu = ({
|
|
1427
1491
|
variant,
|
1428
1492
|
children: [
|
1429
1493
|
/* @__PURE__ */ jsx(More, { "aria-hidden": true, focusable: false }),
|
1430
|
-
/* @__PURE__ */ jsx(VisuallyHidden, {
|
1494
|
+
/* @__PURE__ */ jsx(VisuallyHidden, { tag: "span", children: label || formatMessage({
|
1431
1495
|
id: "content-manager.containers.edit.panels.default.more-actions",
|
1432
1496
|
defaultMessage: "More document actions"
|
1433
1497
|
}) })
|
@@ -1443,7 +1507,7 @@ const DocumentActionsMenu = ({
|
|
1443
1507
|
onSelect: handleClick(action),
|
1444
1508
|
display: "block",
|
1445
1509
|
children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", gap: 4, children: [
|
1446
|
-
/* @__PURE__ */ jsxs(Flex, { color: convertActionVariantToColor(action.variant), gap: 2,
|
1510
|
+
/* @__PURE__ */ jsxs(Flex, { color: convertActionVariantToColor(action.variant), gap: 2, tag: "span", children: [
|
1447
1511
|
action.icon,
|
1448
1512
|
action.label
|
1449
1513
|
] }),
|
@@ -1549,7 +1613,7 @@ const DocumentActionModal = ({
|
|
1549
1613
|
title,
|
1550
1614
|
onClose,
|
1551
1615
|
footer: Footer,
|
1552
|
-
content,
|
1616
|
+
content: Content,
|
1553
1617
|
onModalClose
|
1554
1618
|
}) => {
|
1555
1619
|
const id = React.useId();
|
@@ -1563,8 +1627,8 @@ const DocumentActionModal = ({
|
|
1563
1627
|
onModalClose();
|
1564
1628
|
};
|
1565
1629
|
return /* @__PURE__ */ jsxs(ModalLayout, { borderRadius: "4px", overflow: "hidden", onClose: handleClose, labelledBy: id, children: [
|
1566
|
-
/* @__PURE__ */ jsx(ModalHeader, { children: /* @__PURE__ */ jsx(Typography, { fontWeight: "bold", textColor: "neutral800",
|
1567
|
-
/* @__PURE__ */ jsx(ModalBody, { children:
|
1630
|
+
/* @__PURE__ */ jsx(ModalHeader, { children: /* @__PURE__ */ jsx(Typography, { fontWeight: "bold", textColor: "neutral800", tag: "h2", id, children: title }) }),
|
1631
|
+
/* @__PURE__ */ jsx(ModalBody, { children: typeof Content === "function" ? /* @__PURE__ */ jsx(Content, { onClose: handleClose }) : Content }),
|
1568
1632
|
/* @__PURE__ */ jsx(
|
1569
1633
|
Box,
|
1570
1634
|
{
|
@@ -1781,7 +1845,7 @@ const UNPUBLISH_DRAFT_OPTIONS = {
|
|
1781
1845
|
KEEP: "keep",
|
1782
1846
|
DISCARD: "discard"
|
1783
1847
|
};
|
1784
|
-
const UnpublishAction = ({
|
1848
|
+
const UnpublishAction$1 = ({
|
1785
1849
|
activeTab,
|
1786
1850
|
documentId,
|
1787
1851
|
model,
|
@@ -1844,7 +1908,7 @@ const UnpublishAction = ({
|
|
1844
1908
|
content: /* @__PURE__ */ jsxs(Flex, { alignItems: "flex-start", direction: "column", gap: 6, children: [
|
1845
1909
|
/* @__PURE__ */ jsxs(Flex, { width: "100%", direction: "column", gap: 2, children: [
|
1846
1910
|
/* @__PURE__ */ jsx(WarningCircle, { width: "24px", height: "24px", fill: "danger600" }),
|
1847
|
-
/* @__PURE__ */ jsx(Typography, {
|
1911
|
+
/* @__PURE__ */ jsx(Typography, { tag: "p", variant: "omega", textAlign: "center", children: formatMessage({
|
1848
1912
|
id: "content-manager.actions.unpublish.dialog.body",
|
1849
1913
|
defaultMessage: "Are you sure?"
|
1850
1914
|
}) })
|
@@ -1855,10 +1919,11 @@ const UnpublishAction = ({
|
|
1855
1919
|
onChange: handleChange,
|
1856
1920
|
direction: "column",
|
1857
1921
|
alignItems: "flex-start",
|
1858
|
-
|
1922
|
+
tag: "fieldset",
|
1923
|
+
borderWidth: 0,
|
1859
1924
|
gap: 3,
|
1860
1925
|
children: [
|
1861
|
-
/* @__PURE__ */ jsx(VisuallyHidden, {
|
1926
|
+
/* @__PURE__ */ jsx(VisuallyHidden, { tag: "legend" }),
|
1862
1927
|
/* @__PURE__ */ jsx(
|
1863
1928
|
Radio,
|
1864
1929
|
{
|
@@ -1915,7 +1980,7 @@ const UnpublishAction = ({
|
|
1915
1980
|
position: ["panel", "table-row"]
|
1916
1981
|
};
|
1917
1982
|
};
|
1918
|
-
UnpublishAction.type = "unpublish";
|
1983
|
+
UnpublishAction$1.type = "unpublish";
|
1919
1984
|
const DiscardAction = ({
|
1920
1985
|
activeTab,
|
1921
1986
|
documentId,
|
@@ -1949,7 +2014,7 @@ const DiscardAction = ({
|
|
1949
2014
|
}),
|
1950
2015
|
content: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, children: [
|
1951
2016
|
/* @__PURE__ */ jsx(WarningCircle, { width: "24px", height: "24px", fill: "danger600" }),
|
1952
|
-
/* @__PURE__ */ jsx(Typography, {
|
2017
|
+
/* @__PURE__ */ jsx(Typography, { tag: "p", variant: "omega", textAlign: "center", children: formatMessage({
|
1953
2018
|
id: "content-manager.actions.discard.dialog.body",
|
1954
2019
|
defaultMessage: "Are you sure?"
|
1955
2020
|
}) })
|
@@ -1971,7 +2036,7 @@ const StyledCrossCircle = styled(CrossCircle)`
|
|
1971
2036
|
fill: currentColor;
|
1972
2037
|
}
|
1973
2038
|
`;
|
1974
|
-
const DEFAULT_ACTIONS = [PublishAction, UpdateAction, UnpublishAction, DiscardAction];
|
2039
|
+
const DEFAULT_ACTIONS = [PublishAction, UpdateAction, UnpublishAction$1, DiscardAction];
|
1975
2040
|
const intervals = ["years", "months", "days", "hours", "minutes", "seconds"];
|
1976
2041
|
const RelativeTime = React.forwardRef(
|
1977
2042
|
({ timestamp, customIntervals = [], ...restProps }, forwardedRef) => {
|
@@ -2019,7 +2084,7 @@ const getDisplayName = ({
|
|
2019
2084
|
const capitalise = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
2020
2085
|
const DocumentStatus = ({ status = "draft", ...restProps }) => {
|
2021
2086
|
const statusVariant = status === "draft" ? "primary" : status === "published" ? "success" : "alternative";
|
2022
|
-
return /* @__PURE__ */ jsx(Status, { ...restProps, showBullet: false, size: "S", variant: statusVariant, children: /* @__PURE__ */ jsx(Typography, {
|
2087
|
+
return /* @__PURE__ */ jsx(Status, { ...restProps, showBullet: false, size: "S", variant: statusVariant, children: /* @__PURE__ */ jsx(Typography, { tag: "span", variant: "omega", fontWeight: "bold", children: capitalise(status) }) });
|
2023
2088
|
};
|
2024
2089
|
const Header = ({ isCreating, status, title: documentTitle = "Untitled" }) => {
|
2025
2090
|
const { formatMessage } = useIntl();
|
@@ -2039,7 +2104,7 @@ const Header = ({ isCreating, status, title: documentTitle = "Untitled" }) => {
|
|
2039
2104
|
gap: "80px",
|
2040
2105
|
alignItems: "flex-start",
|
2041
2106
|
children: [
|
2042
|
-
/* @__PURE__ */ jsx(Typography, { variant: "alpha",
|
2107
|
+
/* @__PURE__ */ jsx(Typography, { variant: "alpha", tag: "h1", children: title }),
|
2043
2108
|
/* @__PURE__ */ jsx(HeaderToolbar, {})
|
2044
2109
|
]
|
2045
2110
|
}
|
@@ -2196,7 +2261,7 @@ const Information = ({ activeTab }) => {
|
|
2196
2261
|
borderColor: "neutral150",
|
2197
2262
|
direction: "column",
|
2198
2263
|
marginTop: 2,
|
2199
|
-
|
2264
|
+
tag: "dl",
|
2200
2265
|
padding: 5,
|
2201
2266
|
gap: 3,
|
2202
2267
|
alignItems: "flex-start",
|
@@ -2204,8 +2269,8 @@ const Information = ({ activeTab }) => {
|
|
2204
2269
|
marginRight: "-0.4rem",
|
2205
2270
|
width: "calc(100% + 8px)",
|
2206
2271
|
children: information.map((info) => /* @__PURE__ */ jsxs(Flex, { gap: 1, direction: "column", alignItems: "flex-start", children: [
|
2207
|
-
/* @__PURE__ */ jsx(Typography, {
|
2208
|
-
/* @__PURE__ */ jsx(Typography, {
|
2272
|
+
/* @__PURE__ */ jsx(Typography, { tag: "dt", variant: "pi", fontWeight: "bold", children: info.label }),
|
2273
|
+
/* @__PURE__ */ jsx(Typography, { tag: "dd", variant: "pi", textColor: "neutral600", children: info.value })
|
2209
2274
|
] }, info.label))
|
2210
2275
|
}
|
2211
2276
|
);
|
@@ -2238,7 +2303,7 @@ const ConfigureTheViewAction = ({ collectionType, model }) => {
|
|
2238
2303
|
id: "app.links.configure-view",
|
2239
2304
|
defaultMessage: "Configure the view"
|
2240
2305
|
}),
|
2241
|
-
icon: /* @__PURE__ */ jsx(
|
2306
|
+
icon: /* @__PURE__ */ jsx(ListPlus, {}),
|
2242
2307
|
onClick: () => {
|
2243
2308
|
navigate(`../${collectionType}/${model}/configurations/edit`);
|
2244
2309
|
},
|
@@ -2246,11 +2311,6 @@ const ConfigureTheViewAction = ({ collectionType, model }) => {
|
|
2246
2311
|
};
|
2247
2312
|
};
|
2248
2313
|
ConfigureTheViewAction.type = "configure-the-view";
|
2249
|
-
const StyledCog = styled(Cog)`
|
2250
|
-
path {
|
2251
|
-
fill: currentColor;
|
2252
|
-
}
|
2253
|
-
`;
|
2254
2314
|
const EditTheModelAction = ({ model }) => {
|
2255
2315
|
const navigate = useNavigate();
|
2256
2316
|
const { formatMessage } = useIntl();
|
@@ -2259,7 +2319,7 @@ const EditTheModelAction = ({ model }) => {
|
|
2259
2319
|
id: "content-manager.link-to-ctb",
|
2260
2320
|
defaultMessage: "Edit the model"
|
2261
2321
|
}),
|
2262
|
-
icon: /* @__PURE__ */ jsx(
|
2322
|
+
icon: /* @__PURE__ */ jsx(Pencil, {}),
|
2263
2323
|
onClick: () => {
|
2264
2324
|
navigate(`/plugins/content-type-builder/content-types/${model}`);
|
2265
2325
|
},
|
@@ -2267,12 +2327,7 @@ const EditTheModelAction = ({ model }) => {
|
|
2267
2327
|
};
|
2268
2328
|
};
|
2269
2329
|
EditTheModelAction.type = "edit-the-model";
|
2270
|
-
const
|
2271
|
-
path {
|
2272
|
-
fill: currentColor;
|
2273
|
-
}
|
2274
|
-
`;
|
2275
|
-
const DeleteAction = ({ documentId, model, collectionType, document }) => {
|
2330
|
+
const DeleteAction$1 = ({ documentId, model, collectionType, document }) => {
|
2276
2331
|
const navigate = useNavigate();
|
2277
2332
|
const { formatMessage } = useIntl();
|
2278
2333
|
const listViewPathMatch = useMatch(LIST_PATH);
|
@@ -2286,7 +2341,7 @@ const DeleteAction = ({ documentId, model, collectionType, document }) => {
|
|
2286
2341
|
id: "content-manager.actions.delete.label",
|
2287
2342
|
defaultMessage: "Delete document"
|
2288
2343
|
}),
|
2289
|
-
icon: /* @__PURE__ */ jsx(
|
2344
|
+
icon: /* @__PURE__ */ jsx(Trash, {}),
|
2290
2345
|
dialog: {
|
2291
2346
|
type: "dialog",
|
2292
2347
|
title: formatMessage({
|
@@ -2295,7 +2350,7 @@ const DeleteAction = ({ documentId, model, collectionType, document }) => {
|
|
2295
2350
|
}),
|
2296
2351
|
content: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, children: [
|
2297
2352
|
/* @__PURE__ */ jsx(WarningCircle, { width: "24px", height: "24px", fill: "danger600" }),
|
2298
|
-
/* @__PURE__ */ jsx(Typography, {
|
2353
|
+
/* @__PURE__ */ jsx(Typography, { tag: "p", variant: "omega", textAlign: "center", children: formatMessage({
|
2299
2354
|
id: "content-manager.actions.delete.dialog.body",
|
2300
2355
|
defaultMessage: "Are you sure?"
|
2301
2356
|
}) })
|
@@ -2340,13 +2395,8 @@ const DeleteAction = ({ documentId, model, collectionType, document }) => {
|
|
2340
2395
|
position: ["header", "table-row"]
|
2341
2396
|
};
|
2342
2397
|
};
|
2343
|
-
DeleteAction.type = "delete";
|
2344
|
-
const
|
2345
|
-
path {
|
2346
|
-
fill: currentColor;
|
2347
|
-
}
|
2348
|
-
`;
|
2349
|
-
const DEFAULT_HEADER_ACTIONS = [EditTheModelAction, ConfigureTheViewAction, DeleteAction];
|
2398
|
+
DeleteAction$1.type = "delete";
|
2399
|
+
const DEFAULT_HEADER_ACTIONS = [EditTheModelAction, ConfigureTheViewAction, DeleteAction$1];
|
2350
2400
|
const Panels = () => {
|
2351
2401
|
const isCloning = useMatch(CLONE_PATH) !== null;
|
2352
2402
|
const [
|
@@ -2420,7 +2470,7 @@ const Panel = React.forwardRef(({ children, title }, ref) => {
|
|
2420
2470
|
Flex,
|
2421
2471
|
{
|
2422
2472
|
ref,
|
2423
|
-
|
2473
|
+
tag: "aside",
|
2424
2474
|
"aria-labelledby": "additional-information",
|
2425
2475
|
background: "neutral0",
|
2426
2476
|
borderColor: "neutral150",
|
@@ -2435,13 +2485,268 @@ const Panel = React.forwardRef(({ children, title }, ref) => {
|
|
2435
2485
|
justifyContent: "stretch",
|
2436
2486
|
alignItems: "flex-start",
|
2437
2487
|
children: [
|
2438
|
-
/* @__PURE__ */ jsx(Typography, {
|
2488
|
+
/* @__PURE__ */ jsx(Typography, { tag: "h2", variant: "sigma", textTransform: "uppercase", children: title }),
|
2439
2489
|
children
|
2440
2490
|
]
|
2441
2491
|
}
|
2442
2492
|
);
|
2443
2493
|
});
|
2444
|
-
const
|
2494
|
+
const BulkActionsRenderer = () => {
|
2495
|
+
const plugins = useStrapiApp("BulkActionsRenderer", (state) => state.plugins);
|
2496
|
+
const { model, collectionType } = useDoc();
|
2497
|
+
const { selectedRows } = useTable("BulkActionsRenderer", (state) => state);
|
2498
|
+
return /* @__PURE__ */ jsx(Flex, { gap: 2, children: /* @__PURE__ */ jsx(
|
2499
|
+
DescriptionComponentRenderer,
|
2500
|
+
{
|
2501
|
+
props: {
|
2502
|
+
model,
|
2503
|
+
collectionType,
|
2504
|
+
documents: selectedRows
|
2505
|
+
},
|
2506
|
+
descriptions: plugins["content-manager"].apis.getBulkActions(),
|
2507
|
+
children: (actions2) => actions2.map((action) => /* @__PURE__ */ jsx(BulkActionAction, { ...action }, action.id))
|
2508
|
+
}
|
2509
|
+
) });
|
2510
|
+
};
|
2511
|
+
const BulkActionAction = (action) => {
|
2512
|
+
const [dialogId, setDialogId] = React.useState(null);
|
2513
|
+
const { toggleNotification } = useNotification();
|
2514
|
+
const handleClick = (action2) => (e) => {
|
2515
|
+
const { onClick, dialog, id } = action2;
|
2516
|
+
if (onClick) {
|
2517
|
+
onClick(e);
|
2518
|
+
}
|
2519
|
+
if (dialog) {
|
2520
|
+
switch (dialog.type) {
|
2521
|
+
case "notification":
|
2522
|
+
toggleNotification({
|
2523
|
+
title: dialog.title,
|
2524
|
+
message: dialog.content,
|
2525
|
+
type: dialog.status,
|
2526
|
+
timeout: dialog.timeout,
|
2527
|
+
onClose: dialog.onClose
|
2528
|
+
});
|
2529
|
+
break;
|
2530
|
+
case "dialog":
|
2531
|
+
case "modal": {
|
2532
|
+
e.preventDefault();
|
2533
|
+
setDialogId(id);
|
2534
|
+
}
|
2535
|
+
}
|
2536
|
+
}
|
2537
|
+
};
|
2538
|
+
const handleClose = () => {
|
2539
|
+
setDialogId(null);
|
2540
|
+
if (action.dialog?.type === "modal" && action.dialog?.onClose) {
|
2541
|
+
action.dialog.onClose();
|
2542
|
+
}
|
2543
|
+
};
|
2544
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
2545
|
+
/* @__PURE__ */ jsx(
|
2546
|
+
Button,
|
2547
|
+
{
|
2548
|
+
disabled: action.disabled,
|
2549
|
+
startIcon: action.icon,
|
2550
|
+
variant: action.variant,
|
2551
|
+
onClick: handleClick(action),
|
2552
|
+
children: action.label
|
2553
|
+
}
|
2554
|
+
),
|
2555
|
+
action.dialog?.type === "dialog" ? /* @__PURE__ */ jsx(
|
2556
|
+
BulkActionConfirmDialog,
|
2557
|
+
{
|
2558
|
+
...action.dialog,
|
2559
|
+
variant: action.variant,
|
2560
|
+
isOpen: dialogId === action.id,
|
2561
|
+
onClose: handleClose
|
2562
|
+
}
|
2563
|
+
) : null,
|
2564
|
+
action.dialog?.type === "modal" ? /* @__PURE__ */ jsx(
|
2565
|
+
BulkActionModal,
|
2566
|
+
{
|
2567
|
+
...action.dialog,
|
2568
|
+
onModalClose: handleClose,
|
2569
|
+
isOpen: dialogId === action.id
|
2570
|
+
}
|
2571
|
+
) : null
|
2572
|
+
] });
|
2573
|
+
};
|
2574
|
+
const BulkActionConfirmDialog = ({
|
2575
|
+
onClose,
|
2576
|
+
onCancel,
|
2577
|
+
onConfirm,
|
2578
|
+
title,
|
2579
|
+
content,
|
2580
|
+
confirmButton,
|
2581
|
+
isOpen,
|
2582
|
+
variant = "secondary"
|
2583
|
+
}) => {
|
2584
|
+
const { formatMessage } = useIntl();
|
2585
|
+
const handleClose = async () => {
|
2586
|
+
if (onCancel) {
|
2587
|
+
await onCancel();
|
2588
|
+
}
|
2589
|
+
onClose();
|
2590
|
+
};
|
2591
|
+
const handleConfirm = async () => {
|
2592
|
+
if (onConfirm) {
|
2593
|
+
await onConfirm();
|
2594
|
+
}
|
2595
|
+
onClose();
|
2596
|
+
};
|
2597
|
+
return /* @__PURE__ */ jsxs(Dialog, { isOpen, title, onClose: handleClose, children: [
|
2598
|
+
/* @__PURE__ */ jsx(DialogBody, { icon: /* @__PURE__ */ jsx(WarningCircle, {}), children: content }),
|
2599
|
+
/* @__PURE__ */ jsx(
|
2600
|
+
DialogFooter,
|
2601
|
+
{
|
2602
|
+
startAction: /* @__PURE__ */ jsx(Button, { onClick: handleClose, variant: "tertiary", children: formatMessage({
|
2603
|
+
id: "app.components.Button.cancel",
|
2604
|
+
defaultMessage: "Cancel"
|
2605
|
+
}) }),
|
2606
|
+
endAction: /* @__PURE__ */ jsx(
|
2607
|
+
Button,
|
2608
|
+
{
|
2609
|
+
onClick: handleConfirm,
|
2610
|
+
variant: variant === "danger-light" ? variant : "secondary",
|
2611
|
+
startIcon: variant === "danger-light" ? /* @__PURE__ */ jsx(Trash, {}) : /* @__PURE__ */ jsx(Check, {}),
|
2612
|
+
children: confirmButton ? confirmButton : formatMessage({
|
2613
|
+
id: "app.components.Button.confirm",
|
2614
|
+
defaultMessage: "Confirm"
|
2615
|
+
})
|
2616
|
+
}
|
2617
|
+
)
|
2618
|
+
}
|
2619
|
+
)
|
2620
|
+
] });
|
2621
|
+
};
|
2622
|
+
const BulkActionModal = ({
|
2623
|
+
isOpen,
|
2624
|
+
title,
|
2625
|
+
onClose,
|
2626
|
+
content: Content,
|
2627
|
+
onModalClose
|
2628
|
+
}) => {
|
2629
|
+
const id = React.useId();
|
2630
|
+
if (!isOpen) {
|
2631
|
+
return null;
|
2632
|
+
}
|
2633
|
+
const handleClose = () => {
|
2634
|
+
if (onClose) {
|
2635
|
+
onClose();
|
2636
|
+
}
|
2637
|
+
onModalClose();
|
2638
|
+
};
|
2639
|
+
return /* @__PURE__ */ jsxs(ModalLayout, { borderRadius: "4px", overflow: "hidden", onClose: handleClose, labelledBy: id, children: [
|
2640
|
+
/* @__PURE__ */ jsx(ModalHeader, { children: /* @__PURE__ */ jsx(Typography, { fontWeight: "bold", textColor: "neutral800", tag: "h2", id, children: title }) }),
|
2641
|
+
/* @__PURE__ */ jsx(Content, { onClose: handleClose })
|
2642
|
+
] });
|
2643
|
+
};
|
2644
|
+
const DeleteAction = ({ documents, model }) => {
|
2645
|
+
const { formatMessage } = useIntl();
|
2646
|
+
const { schema: contentType } = useDoc();
|
2647
|
+
const selectRow = useTable("DeleteAction", (state) => state.selectRow);
|
2648
|
+
const hasI18nEnabled = Boolean(contentType?.pluginOptions?.i18n);
|
2649
|
+
const [{ query }] = useQueryParams();
|
2650
|
+
const params = React.useMemo(() => buildValidParams(query), [query]);
|
2651
|
+
const hasDeletePermission = useDocumentRBAC("deleteAction", (state) => state.canDelete);
|
2652
|
+
const { deleteMany: bulkDeleteAction } = useDocumentActions();
|
2653
|
+
const documentIds = documents.map(({ documentId }) => documentId);
|
2654
|
+
const handleConfirmBulkDelete = async () => {
|
2655
|
+
const res = await bulkDeleteAction({
|
2656
|
+
documentIds,
|
2657
|
+
model,
|
2658
|
+
params
|
2659
|
+
});
|
2660
|
+
if (!("error" in res)) {
|
2661
|
+
selectRow([]);
|
2662
|
+
}
|
2663
|
+
};
|
2664
|
+
if (!hasDeletePermission)
|
2665
|
+
return null;
|
2666
|
+
return {
|
2667
|
+
variant: "danger-light",
|
2668
|
+
label: formatMessage({ id: "global.delete", defaultMessage: "Delete" }),
|
2669
|
+
dialog: {
|
2670
|
+
type: "dialog",
|
2671
|
+
title: formatMessage({
|
2672
|
+
id: "app.components.ConfirmDialog.title",
|
2673
|
+
defaultMessage: "Confirmation"
|
2674
|
+
}),
|
2675
|
+
content: /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "stretch", gap: 2, children: [
|
2676
|
+
/* @__PURE__ */ jsx(Typography, { id: "confirm-description", textAlign: "center", children: formatMessage({
|
2677
|
+
id: "popUpWarning.bodyMessage.contentType.delete.all",
|
2678
|
+
defaultMessage: "Are you sure you want to delete these entries?"
|
2679
|
+
}) }),
|
2680
|
+
hasI18nEnabled && /* @__PURE__ */ jsx(Box, { textAlign: "center", padding: 3, children: /* @__PURE__ */ jsx(Typography, { textColor: "danger500", children: formatMessage(
|
2681
|
+
{
|
2682
|
+
id: getTranslation("Settings.list.actions.deleteAdditionalInfos"),
|
2683
|
+
defaultMessage: "This will delete the active locale versions <em>(from Internationalization)</em>"
|
2684
|
+
},
|
2685
|
+
{
|
2686
|
+
em: Emphasis
|
2687
|
+
}
|
2688
|
+
) }) })
|
2689
|
+
] }),
|
2690
|
+
onConfirm: handleConfirmBulkDelete
|
2691
|
+
}
|
2692
|
+
};
|
2693
|
+
};
|
2694
|
+
DeleteAction.type = "delete";
|
2695
|
+
const UnpublishAction = ({ documents, model }) => {
|
2696
|
+
const { formatMessage } = useIntl();
|
2697
|
+
const { schema } = useDoc();
|
2698
|
+
const selectRow = useTable("UnpublishAction", (state) => state.selectRow);
|
2699
|
+
const hasPublishPermission = useDocumentRBAC("unpublishAction", (state) => state.canPublish);
|
2700
|
+
const hasI18nEnabled = Boolean(schema?.pluginOptions?.i18n);
|
2701
|
+
const hasDraftAndPublishEnabled = Boolean(schema?.options?.draftAndPublish);
|
2702
|
+
const { unpublishMany: bulkUnpublishAction } = useDocumentActions();
|
2703
|
+
const documentIds = documents.map(({ documentId }) => documentId);
|
2704
|
+
const [{ query }] = useQueryParams();
|
2705
|
+
const params = React.useMemo(() => buildValidParams(query), [query]);
|
2706
|
+
const handleConfirmBulkUnpublish = async () => {
|
2707
|
+
const data = await bulkUnpublishAction({ documentIds, model, params });
|
2708
|
+
if (!("error" in data)) {
|
2709
|
+
selectRow([]);
|
2710
|
+
}
|
2711
|
+
};
|
2712
|
+
const showUnpublishButton = hasDraftAndPublishEnabled && hasPublishPermission && documents.some((entry) => entry.status === "published");
|
2713
|
+
if (!showUnpublishButton)
|
2714
|
+
return null;
|
2715
|
+
return {
|
2716
|
+
variant: "tertiary",
|
2717
|
+
label: formatMessage({ id: "app.utils.unpublish", defaultMessage: "Unpublish" }),
|
2718
|
+
dialog: {
|
2719
|
+
type: "dialog",
|
2720
|
+
title: formatMessage({
|
2721
|
+
id: "app.components.ConfirmDialog.title",
|
2722
|
+
defaultMessage: "Confirmation"
|
2723
|
+
}),
|
2724
|
+
content: /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "stretch", gap: 2, children: [
|
2725
|
+
/* @__PURE__ */ jsx(Typography, { id: "confirm-description", textAlign: "center", children: formatMessage({
|
2726
|
+
id: "popUpWarning.bodyMessage.contentType.unpublish.all",
|
2727
|
+
defaultMessage: "Are you sure you want to unpublish these entries?"
|
2728
|
+
}) }),
|
2729
|
+
hasI18nEnabled && /* @__PURE__ */ jsx(Box, { textAlign: "center", padding: 3, children: /* @__PURE__ */ jsx(Typography, { textColor: "danger500", children: formatMessage(
|
2730
|
+
{
|
2731
|
+
id: getTranslation("Settings.list.actions.unpublishAdditionalInfos"),
|
2732
|
+
defaultMessage: "This will unpublish the active locale versions <em>(from Internationalization)</em>"
|
2733
|
+
},
|
2734
|
+
{
|
2735
|
+
em: Emphasis
|
2736
|
+
}
|
2737
|
+
) }) })
|
2738
|
+
] }),
|
2739
|
+
confirmButton: formatMessage({
|
2740
|
+
id: "app.utils.unpublish",
|
2741
|
+
defaultMessage: "Unpublish"
|
2742
|
+
}),
|
2743
|
+
onConfirm: handleConfirmBulkUnpublish
|
2744
|
+
}
|
2745
|
+
};
|
2746
|
+
};
|
2747
|
+
UnpublishAction.type = "unpublish";
|
2748
|
+
const Emphasis = (chunks) => /* @__PURE__ */ jsx(Typography, { fontWeight: "semiBold", textColor: "danger500", children: chunks });
|
2749
|
+
const DEFAULT_BULK_ACTIONS = [UnpublishAction, DeleteAction];
|
2445
2750
|
const AutoCloneFailureModalBody = ({ prohibitedFields }) => {
|
2446
2751
|
const { formatMessage } = useIntl();
|
2447
2752
|
const getDefaultErrorMessage = (reason) => {
|
@@ -2473,7 +2778,7 @@ const AutoCloneFailureModalBody = ({ prohibitedFields }) => {
|
|
2473
2778
|
hasRadius: true,
|
2474
2779
|
padding: 6,
|
2475
2780
|
children: [
|
2476
|
-
/* @__PURE__ */ jsx(Flex, { direction: "row",
|
2781
|
+
/* @__PURE__ */ jsx(Flex, { direction: "row", tag: "ol", children: fieldPath.map((pathSegment, index2) => /* @__PURE__ */ jsxs(Typography, { fontWeight: "semiBold", tag: "li", children: [
|
2477
2782
|
pathSegment,
|
2478
2783
|
index2 !== fieldPath.length - 1 && /* @__PURE__ */ jsx(
|
2479
2784
|
ChevronRight,
|
@@ -2485,7 +2790,7 @@ const AutoCloneFailureModalBody = ({ prohibitedFields }) => {
|
|
2485
2790
|
}
|
2486
2791
|
)
|
2487
2792
|
] }, index2)) }),
|
2488
|
-
/* @__PURE__ */ jsx(Typography, {
|
2793
|
+
/* @__PURE__ */ jsx(Typography, { tag: "p", textColor: "neutral600", children: formatMessage({
|
2489
2794
|
id: getTranslation(`containers.list.autoCloneModal.error.${reason}`),
|
2490
2795
|
defaultMessage: getDefaultErrorMessage(reason)
|
2491
2796
|
}) })
|
@@ -2629,7 +2934,7 @@ const CloneAction = ({ model, documentId }) => {
|
|
2629
2934
|
/* @__PURE__ */ jsx(
|
2630
2935
|
LinkButton,
|
2631
2936
|
{
|
2632
|
-
|
2937
|
+
tag: NavLink,
|
2633
2938
|
to: {
|
2634
2939
|
pathname: `clone/${documentId}`
|
2635
2940
|
},
|
@@ -3094,10 +3399,8 @@ const index = {
|
|
3094
3399
|
register(app) {
|
3095
3400
|
const cm = new ContentManagerPlugin();
|
3096
3401
|
app.addReducers({
|
3097
|
-
[contentManagerApi.reducerPath]: contentManagerApi.reducer,
|
3098
3402
|
[PLUGIN_ID]: reducer
|
3099
3403
|
});
|
3100
|
-
app.addMiddlewares([() => contentManagerApi.middleware]);
|
3101
3404
|
app.addMenuLink({
|
3102
3405
|
to: PLUGIN_ID,
|
3103
3406
|
icon: Feather,
|
@@ -3106,14 +3409,15 @@ const index = {
|
|
3106
3409
|
defaultMessage: "Content Manager"
|
3107
3410
|
},
|
3108
3411
|
permissions: [],
|
3109
|
-
Component: () => import("./layout-
|
3412
|
+
Component: () => import("./layout-BinjszSQ.mjs").then((mod) => ({ default: mod.Layout })),
|
3413
|
+
position: 1
|
3110
3414
|
});
|
3111
3415
|
app.registerPlugin(cm.config);
|
3112
3416
|
},
|
3113
3417
|
async registerTrads({ locales }) {
|
3114
3418
|
const importedTrads = await Promise.all(
|
3115
3419
|
locales.map((locale) => {
|
3116
|
-
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/ar.json": () => import("./ar-CCEVvqGG.mjs"), "./translations/ca.json": () => import("./ca-5U32ON2v.mjs"), "./translations/cs.json": () => import("./cs-CM2aBUar.mjs"), "./translations/de.json": () => import("./de-C72KDNOl.mjs"), "./translations/en.json": () => import("./en-
|
3420
|
+
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/ar.json": () => import("./ar-CCEVvqGG.mjs"), "./translations/ca.json": () => import("./ca-5U32ON2v.mjs"), "./translations/cs.json": () => import("./cs-CM2aBUar.mjs"), "./translations/de.json": () => import("./de-C72KDNOl.mjs"), "./translations/en.json": () => import("./en-GCOTL6jR.mjs"), "./translations/es.json": () => import("./es-CeXiYflN.mjs"), "./translations/eu.json": () => import("./eu-CdALomew.mjs"), "./translations/fr.json": () => import("./fr-CD9VFbPM.mjs"), "./translations/gu.json": () => import("./gu-CNpaMDpH.mjs"), "./translations/hi.json": () => import("./hi-Dwvd04m3.mjs"), "./translations/hu.json": () => import("./hu-CeYvaaO0.mjs"), "./translations/id.json": () => import("./id-BtwA9WJT.mjs"), "./translations/it.json": () => import("./it-BrVPqaf1.mjs"), "./translations/ja.json": () => import("./ja-CtsUxOvk.mjs"), "./translations/ko.json": () => import("./ko-HVQRlfUI.mjs"), "./translations/ml.json": () => import("./ml-BihZwQit.mjs"), "./translations/ms.json": () => import("./ms-m_WjyWx7.mjs"), "./translations/nl.json": () => import("./nl-D4R9gHx5.mjs"), "./translations/pl.json": () => import("./pl-sbx9mSt_.mjs"), "./translations/pt-BR.json": () => import("./pt-BR-C71iDxnh.mjs"), "./translations/pt.json": () => import("./pt-BsaFvS8-.mjs"), "./translations/ru.json": () => import("./ru-BE6A4Exp.mjs"), "./translations/sa.json": () => import("./sa-Dag0k-Z8.mjs"), "./translations/sk.json": () => import("./sk-BFg-R8qJ.mjs"), "./translations/sv.json": () => import("./sv-CUnfWGsh.mjs"), "./translations/th.json": () => import("./th-BqbI8lIT.mjs"), "./translations/tr.json": () => import("./tr-CgeK3wJM.mjs"), "./translations/uk.json": () => import("./uk-CR-zDhAY.mjs"), "./translations/vi.json": () => import("./vi-DUXIk_fw.mjs"), "./translations/zh-Hans.json": () => import("./zh-Hans-BPQcRIyH.mjs"), "./translations/zh.json": () => import("./zh-BWZspA60.mjs") }), `./translations/${locale}.json`).then(({ default: data }) => {
|
3117
3421
|
return {
|
3118
3422
|
data: prefixPluginTranslations(data, PLUGIN_ID),
|
3119
3423
|
locale
|
@@ -3131,16 +3435,17 @@ const index = {
|
|
3131
3435
|
};
|
3132
3436
|
export {
|
3133
3437
|
ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD as A,
|
3134
|
-
|
3438
|
+
BulkActionsRenderer as B,
|
3135
3439
|
COLLECTION_TYPES as C,
|
3136
3440
|
DocumentStatus as D,
|
3137
|
-
|
3138
|
-
|
3139
|
-
|
3441
|
+
extractContentTypeComponents as E,
|
3442
|
+
DEFAULT_SETTINGS as F,
|
3443
|
+
convertEditLayoutToFieldLayouts as G,
|
3140
3444
|
HOOKS as H,
|
3141
3445
|
InjectionZone as I,
|
3142
|
-
|
3143
|
-
|
3446
|
+
useDocument as J,
|
3447
|
+
index as K,
|
3448
|
+
useDocumentActions as L,
|
3144
3449
|
Panels as P,
|
3145
3450
|
RelativeTime as R,
|
3146
3451
|
SINGLE_TYPES as S,
|
@@ -3172,4 +3477,4 @@ export {
|
|
3172
3477
|
capitalise as y,
|
3173
3478
|
useUpdateContentTypeConfigurationMutation as z
|
3174
3479
|
};
|
3175
|
-
//# sourceMappingURL=index-
|
3480
|
+
//# sourceMappingURL=index-BaGHmIir.mjs.map
|