@strapi/content-manager 5.0.0-rc.0 → 5.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{ComponentConfigurationPage-DVY3LwHo.js → ComponentConfigurationPage-D8RyVgJC.js} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-DVY3LwHo.js.map → ComponentConfigurationPage-D8RyVgJC.js.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-Dy9BQQ2V.mjs → ComponentConfigurationPage-DLuACgva.mjs} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-Dy9BQQ2V.mjs.map → ComponentConfigurationPage-DLuACgva.mjs.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-DbR8mWH5.mjs → EditConfigurationPage-CuCAsHWR.mjs} +3 -3
- package/dist/_chunks/{EditConfigurationPage-DbR8mWH5.mjs.map → EditConfigurationPage-CuCAsHWR.mjs.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-b6V7YHfo.js → EditConfigurationPage-fOm5AebB.js} +3 -3
- package/dist/_chunks/{EditConfigurationPage-b6V7YHfo.js.map → EditConfigurationPage-fOm5AebB.js.map} +1 -1
- package/dist/_chunks/{EditViewPage-CPrukwtO.mjs → EditViewPage-BqDlT9w0.mjs} +3 -3
- package/dist/_chunks/{EditViewPage-CPrukwtO.mjs.map → EditViewPage-BqDlT9w0.mjs.map} +1 -1
- package/dist/_chunks/{EditViewPage-DhttErmY.js → EditViewPage-Or0fpTwh.js} +3 -3
- package/dist/_chunks/{EditViewPage-DhttErmY.js.map → EditViewPage-Or0fpTwh.js.map} +1 -1
- package/dist/_chunks/{Field-CBRV4uan.js → Field-Bix2HU_O.js} +8 -8
- package/dist/_chunks/Field-Bix2HU_O.js.map +1 -0
- package/dist/_chunks/{Field-DrgIgQPw.mjs → Field-OfBJ6x59.mjs} +8 -8
- package/dist/_chunks/Field-OfBJ6x59.mjs.map +1 -0
- package/dist/_chunks/{Form-Bk3v7Frl.js → Form-Bv5ABnqE.js} +2 -2
- package/dist/_chunks/{Form-Bk3v7Frl.js.map → Form-Bv5ABnqE.js.map} +1 -1
- package/dist/_chunks/{Form-Dxk4txLJ.mjs → Form-DyMXqj_v.mjs} +2 -2
- package/dist/_chunks/{Form-Dxk4txLJ.mjs.map → Form-DyMXqj_v.mjs.map} +1 -1
- package/dist/_chunks/{History-xNH_9UuV.js → History-fnln26gA.js} +21 -11
- package/dist/_chunks/History-fnln26gA.js.map +1 -0
- package/dist/_chunks/{History-DSU-y4Hg.mjs → History-rvLnluF0.mjs} +21 -11
- package/dist/_chunks/History-rvLnluF0.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-BCPzXk5W.js → ListConfigurationPage-BtCBP_L_.js} +2 -2
- package/dist/_chunks/{ListConfigurationPage-BCPzXk5W.js.map → ListConfigurationPage-BtCBP_L_.js.map} +1 -1
- package/dist/_chunks/{ListConfigurationPage-BWwZ-uMJ.mjs → ListConfigurationPage-DdKfJRdq.mjs} +2 -2
- package/dist/_chunks/{ListConfigurationPage-BWwZ-uMJ.mjs.map → ListConfigurationPage-DdKfJRdq.mjs.map} +1 -1
- package/dist/_chunks/{ListViewPage-D9UmehuA.mjs → ListViewPage-B8cPO1bK.mjs} +3 -3
- package/dist/_chunks/{ListViewPage-D9UmehuA.mjs.map → ListViewPage-B8cPO1bK.mjs.map} +1 -1
- package/dist/_chunks/{ListViewPage-ZIvstfvl.js → ListViewPage-CGZWD2qn.js} +3 -3
- package/dist/_chunks/{ListViewPage-ZIvstfvl.js.map → ListViewPage-CGZWD2qn.js.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-CstnyWv2.mjs → NoContentTypePage-CVqYTeML.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-CstnyWv2.mjs.map → NoContentTypePage-CVqYTeML.mjs.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-h7FcuMjI.js → NoContentTypePage-oJxX0WCQ.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-h7FcuMjI.js.map → NoContentTypePage-oJxX0WCQ.js.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-DofU68cO.js → NoPermissionsPage-BB11jqM_.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-DofU68cO.js.map → NoPermissionsPage-BB11jqM_.js.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-aFCCLbsf.mjs → NoPermissionsPage-mlXqh8p6.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-aFCCLbsf.mjs.map → NoPermissionsPage-mlXqh8p6.mjs.map} +1 -1
- package/dist/_chunks/{Relations-DAS_DKG5.js → Relations-6xIumgbN.js} +3 -3
- package/dist/_chunks/{Relations-DAS_DKG5.js.map → Relations-6xIumgbN.js.map} +1 -1
- package/dist/_chunks/{Relations-7v66IP7b.mjs → Relations-DWscdjKO.mjs} +3 -3
- package/dist/_chunks/{Relations-7v66IP7b.mjs.map → Relations-DWscdjKO.mjs.map} +1 -1
- package/dist/_chunks/{index-CAlLHIrI.js → index-BzUwgKUj.js} +75 -58
- package/dist/_chunks/index-BzUwgKUj.js.map +1 -0
- package/dist/_chunks/{index-DIQ7Io-l.mjs → index-JSJrqmB9.mjs} +77 -60
- package/dist/_chunks/index-JSJrqmB9.mjs.map +1 -0
- package/dist/_chunks/{layout-DHe2GdT4.mjs → layout-Dewoec1b.mjs} +3 -3
- package/dist/_chunks/{layout-DHe2GdT4.mjs.map → layout-Dewoec1b.mjs.map} +1 -1
- package/dist/_chunks/{layout-B1ZS-usI.js → layout-U4xJd8Oi.js} +3 -3
- package/dist/_chunks/{layout-B1ZS-usI.js.map → layout-U4xJd8Oi.js.map} +1 -1
- package/dist/_chunks/{relations-yXHkSG1Z.js → relations-BifGhhuo.js} +2 -2
- package/dist/_chunks/{relations-yXHkSG1Z.js.map → relations-BifGhhuo.js.map} +1 -1
- package/dist/_chunks/{relations-BUieBWhT.mjs → relations-DMxeUp5V.mjs} +2 -2
- package/dist/_chunks/{relations-BUieBWhT.mjs.map → relations-DMxeUp5V.mjs.map} +1 -1
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/history/index.d.ts +3 -0
- package/dist/admin/src/index.d.ts +1 -0
- package/dist/server/index.js +4 -0
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +4 -0
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/services/utils/populate.d.ts.map +1 -1
- package/package.json +6 -6
- package/dist/_chunks/Field-CBRV4uan.js.map +0 -1
- package/dist/_chunks/Field-DrgIgQPw.mjs.map +0 -1
- package/dist/_chunks/History-DSU-y4Hg.mjs.map +0 -1
- package/dist/_chunks/History-xNH_9UuV.js.map +0 -1
- package/dist/_chunks/index-CAlLHIrI.js.map +0 -1
- package/dist/_chunks/index-DIQ7Io-l.mjs.map +0 -1
@@ -1,17 +1,17 @@
|
|
1
|
-
import {
|
1
|
+
import { CrossCircle, More, WarningCircle, ListPlus, Pencil, Trash, Check, CheckCircle, ArrowsCounterClockwise, ChevronRight, Duplicate, ClockCounterClockwise, Feather } from "@strapi/icons";
|
2
2
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
3
|
-
import { useStrapiApp,
|
4
|
-
import { stringify } from "qs";
|
5
|
-
import { useIntl } from "react-intl";
|
6
|
-
import { useNavigate, useParams, Navigate, useMatch, useLocation, Link, NavLink } from "react-router-dom";
|
3
|
+
import { useStrapiApp, createContext, useAuth, useRBAC, Page, adminApi, translatedErrors, useNotification, useAPIErrorHandler, getYupValidationErrors, useQueryParams, useTracking, useForm, BackButton, DescriptionComponentRenderer, useTable, Table } from "@strapi/admin/strapi-admin";
|
7
4
|
import * as React from "react";
|
8
5
|
import { lazy } from "react";
|
9
6
|
import { Button, Menu, VisuallyHidden, Flex, Box, Typography, Dialog, Modal, Radio, Status, SingleSelect, SingleSelectOption, Loader, IconButton, Tooltip, LinkButton } from "@strapi/design-system";
|
7
|
+
import { useIntl } from "react-intl";
|
8
|
+
import { useParams, Navigate, useNavigate, useMatch, useLocation, Link, NavLink } from "react-router-dom";
|
10
9
|
import { styled } from "styled-components";
|
11
10
|
import * as yup from "yup";
|
12
11
|
import { ValidationError } from "yup";
|
13
12
|
import pipe from "lodash/fp/pipe";
|
14
13
|
import { intervalToDuration, isPast } from "date-fns";
|
14
|
+
import { stringify } from "qs";
|
15
15
|
import { createSlice, combineReducers } from "@reduxjs/toolkit";
|
16
16
|
const __variableDynamicImportRuntimeHelper = (glob, path) => {
|
17
17
|
const v = glob[path];
|
@@ -49,42 +49,6 @@ const useInjectionZone = (area) => {
|
|
49
49
|
const [page, position] = area.split(".");
|
50
50
|
return contentManagerPlugin.getInjectedComponents(page, position);
|
51
51
|
};
|
52
|
-
const HistoryAction = ({ model, document }) => {
|
53
|
-
const { formatMessage } = useIntl();
|
54
|
-
const [{ query }] = useQueryParams();
|
55
|
-
const navigate = useNavigate();
|
56
|
-
const pluginsQueryParams = stringify({ plugins: query.plugins }, { encode: false });
|
57
|
-
if (!window.strapi.features.isEnabled("cms-content-history")) {
|
58
|
-
return null;
|
59
|
-
}
|
60
|
-
return {
|
61
|
-
icon: /* @__PURE__ */ jsx(ClockCounterClockwise, {}),
|
62
|
-
label: formatMessage({
|
63
|
-
id: "content-manager.history.document-action",
|
64
|
-
defaultMessage: "Content History"
|
65
|
-
}),
|
66
|
-
onClick: () => navigate({ pathname: "history", search: pluginsQueryParams }),
|
67
|
-
disabled: (
|
68
|
-
/**
|
69
|
-
* The user is creating a new document.
|
70
|
-
* It hasn't been saved yet, so there's no history to go to
|
71
|
-
*/
|
72
|
-
!document || /**
|
73
|
-
* The document has been created but the current dimension has never been saved.
|
74
|
-
* For example, the user is creating a new locale in an existing document,
|
75
|
-
* so there's no history for the document in that locale
|
76
|
-
*/
|
77
|
-
!document.id || /**
|
78
|
-
* History is only available for content types created by the user.
|
79
|
-
* These have the `api::` prefix, as opposed to the ones created by Strapi or plugins,
|
80
|
-
* which start with `admin::` or `plugin::`
|
81
|
-
*/
|
82
|
-
!model.startsWith("api::")
|
83
|
-
),
|
84
|
-
position: "header"
|
85
|
-
};
|
86
|
-
};
|
87
|
-
HistoryAction.type = "history";
|
88
52
|
const ID = "id";
|
89
53
|
const CREATED_BY_ATTRIBUTE_NAME = "createdBy";
|
90
54
|
const UPDATED_BY_ATTRIBUTE_NAME = "updatedBy";
|
@@ -1291,7 +1255,7 @@ const useDocumentActions = () => {
|
|
1291
1255
|
};
|
1292
1256
|
};
|
1293
1257
|
const ProtectedHistoryPage = lazy(
|
1294
|
-
() => import("./History-
|
1258
|
+
() => import("./History-rvLnluF0.mjs").then((mod) => ({ default: mod.ProtectedHistoryPage }))
|
1295
1259
|
);
|
1296
1260
|
const routes$1 = [
|
1297
1261
|
{
|
@@ -1304,31 +1268,31 @@ const routes$1 = [
|
|
1304
1268
|
}
|
1305
1269
|
];
|
1306
1270
|
const ProtectedEditViewPage = lazy(
|
1307
|
-
() => import("./EditViewPage-
|
1271
|
+
() => import("./EditViewPage-BqDlT9w0.mjs").then((mod) => ({ default: mod.ProtectedEditViewPage }))
|
1308
1272
|
);
|
1309
1273
|
const ProtectedListViewPage = lazy(
|
1310
|
-
() => import("./ListViewPage-
|
1274
|
+
() => import("./ListViewPage-B8cPO1bK.mjs").then((mod) => ({ default: mod.ProtectedListViewPage }))
|
1311
1275
|
);
|
1312
1276
|
const ProtectedListConfiguration = lazy(
|
1313
|
-
() => import("./ListConfigurationPage-
|
1277
|
+
() => import("./ListConfigurationPage-DdKfJRdq.mjs").then((mod) => ({
|
1314
1278
|
default: mod.ProtectedListConfiguration
|
1315
1279
|
}))
|
1316
1280
|
);
|
1317
1281
|
const ProtectedEditConfigurationPage = lazy(
|
1318
|
-
() => import("./EditConfigurationPage-
|
1282
|
+
() => import("./EditConfigurationPage-CuCAsHWR.mjs").then((mod) => ({
|
1319
1283
|
default: mod.ProtectedEditConfigurationPage
|
1320
1284
|
}))
|
1321
1285
|
);
|
1322
1286
|
const ProtectedComponentConfigurationPage = lazy(
|
1323
|
-
() => import("./ComponentConfigurationPage-
|
1287
|
+
() => import("./ComponentConfigurationPage-DLuACgva.mjs").then((mod) => ({
|
1324
1288
|
default: mod.ProtectedComponentConfigurationPage
|
1325
1289
|
}))
|
1326
1290
|
);
|
1327
1291
|
const NoPermissions = lazy(
|
1328
|
-
() => import("./NoPermissionsPage-
|
1292
|
+
() => import("./NoPermissionsPage-mlXqh8p6.mjs").then((mod) => ({ default: mod.NoPermissions }))
|
1329
1293
|
);
|
1330
1294
|
const NoContentType = lazy(
|
1331
|
-
() => import("./NoContentTypePage-
|
1295
|
+
() => import("./NoContentTypePage-CVqYTeML.mjs").then((mod) => ({ default: mod.NoContentType }))
|
1332
1296
|
);
|
1333
1297
|
const CollectionTypePages = () => {
|
1334
1298
|
const { collectionType } = useParams();
|
@@ -1904,10 +1868,13 @@ const UpdateAction = ({
|
|
1904
1868
|
document
|
1905
1869
|
);
|
1906
1870
|
if ("data" in res) {
|
1907
|
-
navigate(
|
1908
|
-
|
1909
|
-
|
1910
|
-
|
1871
|
+
navigate(
|
1872
|
+
{
|
1873
|
+
pathname: `../${res.data.documentId}`,
|
1874
|
+
search: rawQuery
|
1875
|
+
},
|
1876
|
+
{ relative: "path" }
|
1877
|
+
);
|
1911
1878
|
} else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
1912
1879
|
setErrors(formatValidationErrors(res.error));
|
1913
1880
|
}
|
@@ -1937,10 +1904,10 @@ const UpdateAction = ({
|
|
1937
1904
|
if ("data" in res && collectionType !== SINGLE_TYPES) {
|
1938
1905
|
navigate(
|
1939
1906
|
{
|
1940
|
-
pathname: `../${
|
1907
|
+
pathname: `../${res.data.documentId}`,
|
1941
1908
|
search: rawQuery
|
1942
1909
|
},
|
1943
|
-
{ replace: true }
|
1910
|
+
{ replace: true, relative: "path" }
|
1944
1911
|
);
|
1945
1912
|
} else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
1946
1913
|
setErrors(formatValidationErrors(res.error));
|
@@ -2884,7 +2851,7 @@ const ConfirmBulkActionDialog = ({
|
|
2884
2851
|
endAction
|
2885
2852
|
}) => {
|
2886
2853
|
const { formatMessage } = useIntl();
|
2887
|
-
return /* @__PURE__ */ jsx(Dialog.Root, {
|
2854
|
+
return /* @__PURE__ */ jsx(Dialog.Root, { open: isOpen, children: /* @__PURE__ */ jsxs(Dialog.Content, { children: [
|
2888
2855
|
/* @__PURE__ */ jsx(Dialog.Header, { children: formatMessage({
|
2889
2856
|
id: "app.components.ConfirmDialog.title",
|
2890
2857
|
defaultMessage: "Confirmation"
|
@@ -3675,8 +3642,7 @@ class ContentManagerPlugin {
|
|
3675
3642
|
documentActions = [
|
3676
3643
|
...DEFAULT_ACTIONS,
|
3677
3644
|
...DEFAULT_TABLE_ROW_ACTIONS,
|
3678
|
-
...DEFAULT_HEADER_ACTIONS
|
3679
|
-
HistoryAction
|
3645
|
+
...DEFAULT_HEADER_ACTIONS
|
3680
3646
|
];
|
3681
3647
|
editViewSidePanels = [ActionsPanel];
|
3682
3648
|
headerActions = [];
|
@@ -3765,6 +3731,52 @@ const getPrintableType = (value) => {
|
|
3765
3731
|
}
|
3766
3732
|
return nativeType;
|
3767
3733
|
};
|
3734
|
+
const HistoryAction = ({ model, document }) => {
|
3735
|
+
const { formatMessage } = useIntl();
|
3736
|
+
const [{ query }] = useQueryParams();
|
3737
|
+
const navigate = useNavigate();
|
3738
|
+
const pluginsQueryParams = stringify({ plugins: query.plugins }, { encode: false });
|
3739
|
+
if (!window.strapi.features.isEnabled("cms-content-history")) {
|
3740
|
+
return null;
|
3741
|
+
}
|
3742
|
+
return {
|
3743
|
+
icon: /* @__PURE__ */ jsx(ClockCounterClockwise, {}),
|
3744
|
+
label: formatMessage({
|
3745
|
+
id: "content-manager.history.document-action",
|
3746
|
+
defaultMessage: "Content History"
|
3747
|
+
}),
|
3748
|
+
onClick: () => navigate({ pathname: "history", search: pluginsQueryParams }),
|
3749
|
+
disabled: (
|
3750
|
+
/**
|
3751
|
+
* The user is creating a new document.
|
3752
|
+
* It hasn't been saved yet, so there's no history to go to
|
3753
|
+
*/
|
3754
|
+
!document || /**
|
3755
|
+
* The document has been created but the current dimension has never been saved.
|
3756
|
+
* For example, the user is creating a new locale in an existing document,
|
3757
|
+
* so there's no history for the document in that locale
|
3758
|
+
*/
|
3759
|
+
!document.id || /**
|
3760
|
+
* History is only available for content types created by the user.
|
3761
|
+
* These have the `api::` prefix, as opposed to the ones created by Strapi or plugins,
|
3762
|
+
* which start with `admin::` or `plugin::`
|
3763
|
+
*/
|
3764
|
+
!model.startsWith("api::")
|
3765
|
+
),
|
3766
|
+
position: "header"
|
3767
|
+
};
|
3768
|
+
};
|
3769
|
+
HistoryAction.type = "history";
|
3770
|
+
const historyAdmin = {
|
3771
|
+
bootstrap(app) {
|
3772
|
+
const { addDocumentAction } = app.getPlugin("content-manager").apis;
|
3773
|
+
addDocumentAction((actions2) => {
|
3774
|
+
const indexOfDeleteAction = actions2.findIndex((action) => action.type === "delete");
|
3775
|
+
actions2.splice(indexOfDeleteAction, 0, HistoryAction);
|
3776
|
+
return actions2;
|
3777
|
+
});
|
3778
|
+
}
|
3779
|
+
};
|
3768
3780
|
const initialState = {
|
3769
3781
|
collectionTypeLinks: [],
|
3770
3782
|
components: [],
|
@@ -3820,7 +3832,7 @@ const index = {
|
|
3820
3832
|
app.router.addRoute({
|
3821
3833
|
path: "content-manager/*",
|
3822
3834
|
lazy: async () => {
|
3823
|
-
const { Layout } = await import("./layout-
|
3835
|
+
const { Layout } = await import("./layout-Dewoec1b.mjs");
|
3824
3836
|
return {
|
3825
3837
|
Component: Layout
|
3826
3838
|
};
|
@@ -3829,6 +3841,11 @@ const index = {
|
|
3829
3841
|
});
|
3830
3842
|
app.registerPlugin(cm.config);
|
3831
3843
|
},
|
3844
|
+
bootstrap(app) {
|
3845
|
+
if (typeof historyAdmin.bootstrap === "function") {
|
3846
|
+
historyAdmin.bootstrap(app);
|
3847
|
+
}
|
3848
|
+
},
|
3832
3849
|
async registerTrads({ locales }) {
|
3833
3850
|
const importedTrads = await Promise.all(
|
3834
3851
|
locales.map((locale) => {
|
@@ -3891,4 +3908,4 @@ export {
|
|
3891
3908
|
useUpdateContentTypeConfigurationMutation as y,
|
3892
3909
|
extractContentTypeComponents as z
|
3893
3910
|
};
|
3894
|
-
//# sourceMappingURL=index-
|
3911
|
+
//# sourceMappingURL=index-JSJrqmB9.mjs.map
|