@strapi/admin 4.10.0-beta.0 → 4.10.0-beta.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/.eslintignore +4 -0
- package/.eslintrc.js +14 -0
- package/admin/src/components/LanguageProvider/index.js +1 -1
- package/admin/src/components/LocalesProvider/__mocks__/useLocalesProvider.js +7 -0
- package/admin/src/components/LocalesProvider/index.js +2 -3
- package/admin/src/content-manager/components/CollectionTypeFormWrapper/index.js +3 -6
- package/admin/src/content-manager/components/DynamicTable/CellContent/ReviewWorkflowsStage/getTableColumn.js +2 -0
- package/admin/src/content-manager/components/DynamicTable/index.js +11 -29
- package/admin/src/content-manager/components/EditViewDataManagerProvider/reducer.js +12 -6
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/findAllAndReplace.js +10 -3
- package/admin/src/content-manager/components/InputUID/endActionStyle.js +4 -13
- package/admin/src/content-manager/components/InputUID/index.js +95 -72
- package/admin/src/content-manager/components/SingleTypeFormWrapper/index.js +4 -8
- package/admin/src/content-manager/pages/App/LeftMenu/index.js +56 -35
- package/admin/src/content-manager/pages/App/actions.js +19 -7
- package/admin/src/content-manager/pages/App/constants.js +3 -3
- package/admin/src/content-manager/pages/App/index.js +5 -4
- package/admin/src/content-manager/pages/App/reducer.js +7 -6
- package/admin/src/content-manager/pages/App/selectors.js +3 -0
- package/admin/src/content-manager/pages/App/{useModels.js → useContentManagerInitData.js} +29 -28
- package/admin/src/content-manager/pages/App/utils/generateModelsLinks.js +2 -2
- package/admin/src/content-manager/pages/App/utils/getContentTypeLinks.js +17 -15
- package/admin/src/content-manager/pages/EditSettingsView/components/ModalForm.js +4 -5
- package/admin/src/content-manager/pages/EditSettingsView/index.js +4 -0
- package/admin/src/content-manager/pages/EditSettingsView/reducer.js +6 -7
- package/admin/src/content-manager/pages/EditSettingsView/utils/layout.js +1 -30
- package/admin/src/content-manager/pages/EditView/DeleteLink/index.js +5 -11
- package/admin/src/content-manager/pages/EditView/index.js +2 -7
- package/admin/src/content-manager/pages/ListSettingsView/index.js +1 -0
- package/admin/src/content-manager/sharedReducers/crudReducer/actions.js +6 -0
- package/admin/src/content-manager/sharedReducers/crudReducer/constants.js +1 -0
- package/admin/src/content-manager/sharedReducers/crudReducer/reducer.js +5 -0
- package/admin/src/hooks/useConfigurations/__mocks__/index.js +7 -0
- package/admin/src/hooks/useFetchMarketplacePlugins/utils/api.js +7 -8
- package/admin/src/hooks/useFetchMarketplaceProviders/utils/api.js +5 -0
- package/admin/src/hooks/useRegenerate/index.js +12 -7
- package/admin/src/pages/AuthPage/components/Register/index.js +46 -38
- package/admin/src/pages/HomePage/SocialLinks.js +1 -1
- package/admin/src/pages/MarketplacePage/components/EmptyNpmPackageSearch/index.js +3 -3
- package/admin/src/pages/MarketplacePage/components/NpmPackagesGrid/index.js +42 -9
- package/admin/src/pages/MarketplacePage/components/NpmPackagesPagination/index.js +26 -0
- package/admin/src/pages/MarketplacePage/components/OfflineLayout/index.js +45 -0
- package/admin/src/pages/MarketplacePage/index.js +80 -175
- package/admin/src/pages/MarketplacePage/utils/useMarketplaceData.js +85 -0
- package/admin/src/pages/SettingsPage/components/Tokens/FormHead/index.js +4 -0
- package/admin/src/pages/SettingsPage/components/Tokens/Regenerate/index.js +5 -3
- package/admin/src/pages/SettingsPage/components/Tokens/TokenTypeSelect/index.js +7 -5
- package/admin/src/pages/SettingsPage/pages/Roles/ListPage/components/RoleRow/index.js +12 -4
- package/admin/src/pages/SettingsPage/pages/Roles/ListPage/index.js +21 -2
- package/admin/src/pages/SettingsPage/pages/TransferTokens/EditView/components/FormTransferTokenContainer/index.js +41 -0
- package/admin/src/pages/SettingsPage/pages/TransferTokens/EditView/index.js +53 -9
- package/admin/src/pages/SettingsPage/pages/TransferTokens/EditView/utils/schema.js +1 -0
- package/admin/src/pages/SettingsPage/pages/TransferTokens/ListView/index.js +27 -5
- package/admin/src/translations/en.json +51 -49
- package/admin/src/translations/ru.json +51 -19
- package/build/1387.84b454d3.chunk.js +1 -0
- package/build/1657.45231968.chunk.js +168 -0
- package/build/3081.bcf9a12f.chunk.js +108 -0
- package/build/462.8fff7f3b.chunk.js +71 -0
- package/build/4628.20631dd1.chunk.js +1 -0
- package/build/5542.b8240e3f.chunk.js +70 -0
- package/build/5563.905daa13.chunk.js +79 -0
- package/build/6404.68405699.chunk.js +100 -0
- package/build/7259.b7d00cea.chunk.js +1 -0
- package/build/8694.6522968d.chunk.js +247 -0
- package/build/Admin-authenticatedApp.52c88751.chunk.js +79 -0
- package/build/Admin_InternalErrorPage.15c6bf07.chunk.js +1 -0
- package/build/Admin_homePage.f9309c6d.chunk.js +73 -0
- package/build/Admin_marketplace.56bc1008.chunk.js +31 -0
- package/build/Admin_pluginsPage.f6b52ee9.chunk.js +6 -0
- package/build/Admin_profilePage.9112cffc.chunk.js +15 -0
- package/build/Admin_settingsPage.257b3477.chunk.js +79 -0
- package/build/Upload_ConfigureTheView.eaaec495.chunk.js +1 -0
- package/build/admin-app.dfaeea5d.chunk.js +110 -0
- package/build/admin-edit-roles-page.4f1858e9.chunk.js +280 -0
- package/build/admin-edit-users.7e14d85f.chunk.js +10 -0
- package/build/admin-roles-list.329c1f63.chunk.js +31 -0
- package/build/admin-users.d02de059.chunk.js +34 -0
- package/build/api-tokens-create-page.97595e12.chunk.js +1 -0
- package/build/api-tokens-edit-page.cd36e30e.chunk.js +1 -0
- package/build/api-tokens-list-page.6757c7b9.chunk.js +16 -0
- package/build/audit-logs-settings-page.19d90bda.chunk.js +76 -0
- package/build/content-manager.def692c2.chunk.js +1130 -0
- package/build/content-type-builder-list-view.9c2c020c.chunk.js +214 -0
- package/build/content-type-builder-translation-en-json.510e88ca.chunk.js +1 -0
- package/build/content-type-builder.5e1f4afc.chunk.js +126 -0
- package/build/email-settings-page.1095e1ab.chunk.js +10 -0
- package/build/en-json.08303b37.chunk.js +1 -0
- package/build/{highlight.js.26ef649f.chunk.js → highlight.js.28a1547e.chunk.js} +2 -2
- package/build/i18n-settings-page.7d80aae0.chunk.js +60 -0
- package/build/index.html +1 -1
- package/build/main.120be100.js +2280 -0
- package/build/review-workflows-settings.9092ed72.chunk.js +106 -0
- package/build/ru-json.e0662702.chunk.js +1 -0
- package/build/{runtime~main.5a95bee6.js → runtime~main.112b3101.js} +2 -2
- package/build/sso-settings-page.1dd4886e.chunk.js +1 -0
- package/build/transfer-tokens-create-page.ec2ca215.chunk.js +1 -0
- package/build/transfer-tokens-edit-page.22bf28e5.chunk.js +1 -0
- package/build/transfer-tokens-list-page.cf8c77f2.chunk.js +16 -0
- package/build/upload-settings.945fdcfa.chunk.js +13 -0
- package/build/{upload-translation-th-json.3847dae0.chunk.js → upload-translation-th-json.98d35574.chunk.js} +1 -1
- package/build/upload.a86b1054.chunk.js +33 -0
- package/build/users-advanced-settings-page.5b5a9baa.chunk.js +8 -0
- package/build/users-email-settings-page.e5506eb4.chunk.js +23 -0
- package/build/users-providers-settings-page.e32089c2.chunk.js +28 -0
- package/build/users-roles-settings-page.2f85dcec.chunk.js +30 -0
- package/build/webhook-edit-page.213f0075.chunk.js +75 -0
- package/build/webhook-list-page.5beb2a5c.chunk.js +71 -0
- package/{admin/src/content-manager/components/DynamicTable/CellContent/ReviewWorkflowsStage/ReviewWorkflowsStage.js → ee/admin/content-manager/components/DynamicTable/CellContent/ReviewWorkflowsStage/ReviewWorkflowsStageEE.js} +2 -2
- package/ee/admin/content-manager/components/DynamicTable/CellContent/ReviewWorkflowsStage/getTableColumn.js +45 -0
- package/ee/admin/content-manager/components/DynamicTable/CellContent/ReviewWorkflowsStage/index.js +3 -0
- package/ee/admin/content-manager/pages/EditView/InformationBox/InformationBoxEE.js +61 -18
- package/ee/admin/hooks/useLicenseLimitNotification/index.js +1 -1
- package/ee/admin/pages/SettingsPage/pages/AuditLogs/ListView/hooks/useAuditLogsData.js +6 -3
- package/ee/admin/pages/SettingsPage/pages/AuditLogs/ListView/index.js +15 -5
- package/ee/admin/pages/SettingsPage/pages/AuditLogs/ListView/utils/getDisplayedFilters.js +52 -45
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/ReviewWorkflows.js +8 -4
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/Stages/Stage/Stage.js +2 -2
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/hooks/useReviewWorkflows.js +2 -2
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/reducer/index.js +2 -1
- package/ee/server/content-types/workflow/index.js +0 -3
- package/ee/server/content-types/workflow-stage/index.js +0 -5
- package/ee/server/controllers/workflows/stages/index.js +8 -1
- package/ee/server/register.js +3 -1
- package/ee/server/services/audit-logs.js +75 -16
- package/ee/server/services/review-workflows/entity-service-decorator.js +17 -5
- package/ee/server/services/review-workflows/review-workflows.js +27 -91
- package/ee/server/services/review-workflows/stages.js +108 -7
- package/ee/server/utils/persisted-tables.js +114 -22
- package/ee/server/utils/review-workflows.js +9 -0
- package/jest.config.front.js +1 -6
- package/package.json +24 -22
- package/server/controllers/transfer/runner.js +4 -2
- package/server/middlewares/data-transfer.js +4 -1
- package/server/routes/transfer.js +13 -4
- package/server/services/constants.js +4 -0
- package/server/services/transfer/permission.js +1 -1
- package/server/services/transfer/token.js +33 -31
- package/server/validation/transfer/token.js +10 -2
- package/webpack.config.js +6 -2
- package/admin/src/content-manager/components/DynamicTable/CellContent/ReviewWorkflowsStage/index.js +0 -1
- package/admin/src/content-manager/pages/App/LeftMenu/utils/index.js +0 -1
- package/admin/src/content-manager/pages/App/LeftMenu/utils/matchByTitle.js +0 -24
- package/build/2263.4c5916f9.chunk.js +0 -98
- package/build/4049.64715f20.chunk.js +0 -1
- package/build/4649.213b8a3b.chunk.js +0 -30
- package/build/6985.66cca29c.chunk.js +0 -1
- package/build/7259.aefb51e8.chunk.js +0 -1
- package/build/8469.853c822b.chunk.js +0 -1
- package/build/9505.dbe702ab.chunk.js +0 -14
- package/build/9816.01ee964f.chunk.js +0 -2
- package/build/Admin-authenticatedApp.f50ad423.chunk.js +0 -79
- package/build/Admin_InternalErrorPage.4ad8b0df.chunk.js +0 -1
- package/build/Admin_homePage.1411fb7c.chunk.js +0 -68
- package/build/Admin_marketplace.02608d56.chunk.js +0 -22
- package/build/Admin_pluginsPage.15e3b0fd.chunk.js +0 -1
- package/build/Admin_profilePage.76afeca0.chunk.js +0 -15
- package/build/Admin_settingsPage.147755cd.chunk.js +0 -9
- package/build/Upload_ConfigureTheView.34dde278.chunk.js +0 -1
- package/build/admin-app.55dd7921.chunk.js +0 -112
- package/build/admin-edit-roles-page.cf543488.chunk.js +0 -216
- package/build/admin-edit-users.31c20712.chunk.js +0 -10
- package/build/admin-roles-list.489c501f.chunk.js +0 -2
- package/build/admin-users.3e111a7d.chunk.js +0 -11
- package/build/api-tokens-create-page.4328b852.chunk.js +0 -1
- package/build/api-tokens-edit-page.bce5050f.chunk.js +0 -1
- package/build/api-tokens-list-page.93f24348.chunk.js +0 -16
- package/build/audit-logs-settings-page.7be97e82.chunk.js +0 -1
- package/build/content-manager.4480ae88.chunk.js +0 -1137
- package/build/content-type-builder-list-view.cf38fe2f.chunk.js +0 -191
- package/build/content-type-builder-translation-en-json.7961593e.chunk.js +0 -1
- package/build/content-type-builder.af9abf1e.chunk.js +0 -126
- package/build/email-settings-page.4bdbef9a.chunk.js +0 -3
- package/build/en-json.697b4bcf.chunk.js +0 -1
- package/build/i18n-settings-page.2bb5be96.chunk.js +0 -1
- package/build/main.af8c0f31.js +0 -3790
- package/build/review-workflows-settings.7a7dc773.chunk.js +0 -57
- package/build/ru-json.6a01cea6.chunk.js +0 -1
- package/build/sso-settings-page.272b87c8.chunk.js +0 -1
- package/build/transfer-tokens-create-page.a1f14bb1.chunk.js +0 -1
- package/build/transfer-tokens-edit-page.00ee1c74.chunk.js +0 -1
- package/build/transfer-tokens-list-page.ce37354b.chunk.js +0 -16
- package/build/upload-settings.0875e973.chunk.js +0 -1
- package/build/upload.c7da1611.chunk.js +0 -13
- package/build/users-advanced-settings-page.1d3c14c7.chunk.js +0 -1
- package/build/users-email-settings-page.e8db68c4.chunk.js +0 -1
- package/build/users-providers-settings-page.14cac425.chunk.js +0 -1
- package/build/users-roles-settings-page.2ea4de84.chunk.js +0 -30
- package/build/webhook-edit-page.329141a5.chunk.js +0 -23
- package/build/webhook-list-page.029957a4.chunk.js +0 -1
- package/ee/server/migrations/review-workflows.js +0 -39
- package/ee/server/utils/test.js +0 -11
- /package/admin/src/{content-manager/components/InputUID/useDebounce.js → hooks/useDebounce/index.js} +0 -0
|
@@ -16,51 +16,72 @@ import {
|
|
|
16
16
|
SubNavSections,
|
|
17
17
|
SubNavLink,
|
|
18
18
|
} from '@strapi/design-system/v2';
|
|
19
|
+
import { useFilter, useCollator } from '@strapi/helper-plugin';
|
|
19
20
|
|
|
20
|
-
import { matchByTitle } from './utils';
|
|
21
21
|
import getTrad from '../../../utils/getTrad';
|
|
22
22
|
import { makeSelectModelLinks } from '../selectors';
|
|
23
23
|
|
|
24
24
|
const LeftMenu = () => {
|
|
25
25
|
const [search, setSearch] = useState('');
|
|
26
|
-
const { formatMessage } = useIntl();
|
|
26
|
+
const { formatMessage, locale } = useIntl();
|
|
27
27
|
const modelLinksSelector = useMemo(makeSelectModelLinks, []);
|
|
28
|
-
const { collectionTypeLinks, singleTypeLinks } = useSelector(
|
|
29
|
-
(state) => modelLinksSelector(state),
|
|
30
|
-
shallowEqual
|
|
31
|
-
);
|
|
28
|
+
const { collectionTypeLinks, singleTypeLinks } = useSelector(modelLinksSelector, shallowEqual);
|
|
32
29
|
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
...link,
|
|
37
|
-
title: formatMessage({ id: link.title, defaultMessage: link.title }),
|
|
38
|
-
};
|
|
39
|
-
});
|
|
30
|
+
const { startsWith } = useFilter(locale, {
|
|
31
|
+
sensitivity: 'base',
|
|
32
|
+
});
|
|
40
33
|
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
/**
|
|
35
|
+
* @type {Intl.Collator}
|
|
36
|
+
*/
|
|
37
|
+
const formatter = useCollator(locale, {
|
|
38
|
+
sensitivity: 'base',
|
|
39
|
+
});
|
|
43
40
|
|
|
44
|
-
const menu =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
41
|
+
const menu = useMemo(
|
|
42
|
+
() =>
|
|
43
|
+
[
|
|
44
|
+
{
|
|
45
|
+
id: 'collectionTypes',
|
|
46
|
+
title: {
|
|
47
|
+
id: getTrad('components.LeftMenu.collection-types'),
|
|
48
|
+
defaultMessage: 'Collection Types',
|
|
49
|
+
},
|
|
50
|
+
searchable: true,
|
|
51
|
+
links: collectionTypeLinks,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: 'singleTypes',
|
|
55
|
+
title: {
|
|
56
|
+
id: getTrad('components.LeftMenu.single-types'),
|
|
57
|
+
defaultMessage: 'Single Types',
|
|
58
|
+
},
|
|
59
|
+
searchable: true,
|
|
60
|
+
links: singleTypeLinks,
|
|
61
|
+
},
|
|
62
|
+
].map((section) => ({
|
|
63
|
+
...section,
|
|
64
|
+
links: section.links
|
|
65
|
+
/**
|
|
66
|
+
* Filter by the search value
|
|
67
|
+
*/
|
|
68
|
+
.filter((link) => startsWith(link.title, search))
|
|
69
|
+
/**
|
|
70
|
+
* Sort correctly using the language
|
|
71
|
+
*/
|
|
72
|
+
.sort((a, b) => formatter.compare(a.title, b.title))
|
|
73
|
+
/**
|
|
74
|
+
* Apply the formated strings to the links from react-intl
|
|
75
|
+
*/
|
|
76
|
+
.map((link) => {
|
|
77
|
+
return {
|
|
78
|
+
...link,
|
|
79
|
+
title: formatMessage({ id: link.title, defaultMessage: link.title }),
|
|
80
|
+
};
|
|
81
|
+
}),
|
|
82
|
+
})),
|
|
83
|
+
[collectionTypeLinks, search, singleTypeLinks, startsWith, formatMessage, formatter]
|
|
84
|
+
);
|
|
64
85
|
|
|
65
86
|
const handleClear = () => {
|
|
66
87
|
setSearch('');
|
|
@@ -1,12 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GET_INIT_DATA, RESET_INIT_DATA, SET_INIT_DATA } from './constants';
|
|
2
2
|
|
|
3
|
-
export const
|
|
4
|
-
type:
|
|
3
|
+
export const getInitData = () => ({
|
|
4
|
+
type: GET_INIT_DATA,
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
-
export const
|
|
7
|
+
export const resetInitData = () => ({ type: RESET_INIT_DATA });
|
|
8
8
|
|
|
9
|
-
export const
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
export const setInitData = ({
|
|
10
|
+
authorizedCollectionTypeLinks,
|
|
11
|
+
authorizedSingleTypeLinks,
|
|
12
|
+
contentTypeSchemas,
|
|
13
|
+
components,
|
|
14
|
+
fieldSizes,
|
|
15
|
+
}) => ({
|
|
16
|
+
type: SET_INIT_DATA,
|
|
17
|
+
data: {
|
|
18
|
+
authorizedCollectionTypeLinks,
|
|
19
|
+
authorizedSingleTypeLinks,
|
|
20
|
+
components,
|
|
21
|
+
contentTypeSchemas,
|
|
22
|
+
fieldSizes,
|
|
23
|
+
},
|
|
12
24
|
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export const
|
|
2
|
-
export const
|
|
3
|
-
export const
|
|
1
|
+
export const GET_INIT_DATA = 'ContentManager/App/GET_INIT_DATA';
|
|
2
|
+
export const RESET_INIT_DATA = 'ContentManager/App/RESET_INIT_DATA';
|
|
3
|
+
export const SET_INIT_DATA = 'ContentManager/App/SET_INIT_DATA';
|
|
@@ -4,7 +4,7 @@ import { Switch, Route, useRouteMatch, Redirect, useLocation } from 'react-route
|
|
|
4
4
|
import {
|
|
5
5
|
CheckPagePermissions,
|
|
6
6
|
LoadingIndicatorPage,
|
|
7
|
-
|
|
7
|
+
AnErrorOccurred,
|
|
8
8
|
useGuidedTour,
|
|
9
9
|
} from '@strapi/helper-plugin';
|
|
10
10
|
import { Layout, HeaderLayout, Main } from '@strapi/design-system';
|
|
@@ -20,13 +20,14 @@ import NoContentType from '../NoContentType';
|
|
|
20
20
|
import NoPermissions from '../NoPermissions';
|
|
21
21
|
import SingleTypeRecursivePath from '../SingleTypeRecursivePath';
|
|
22
22
|
import LeftMenu from './LeftMenu';
|
|
23
|
-
import
|
|
23
|
+
import useContentManagerInitData from './useContentManagerInitData';
|
|
24
24
|
|
|
25
25
|
const cmPermissions = permissions.contentManager;
|
|
26
26
|
|
|
27
27
|
const App = () => {
|
|
28
28
|
const contentTypeMatch = useRouteMatch(`/content-manager/:kind/:uid`);
|
|
29
|
-
const { status, collectionTypeLinks, singleTypeLinks, models, refetchData } =
|
|
29
|
+
const { status, collectionTypeLinks, singleTypeLinks, models, refetchData } =
|
|
30
|
+
useContentManagerInitData();
|
|
30
31
|
const authorisedModels = sortBy([...collectionTypeLinks, ...singleTypeLinks], (model) =>
|
|
31
32
|
model.title.toLowerCase()
|
|
32
33
|
);
|
|
@@ -104,7 +105,7 @@ const App = () => {
|
|
|
104
105
|
<Route path="/content-manager/no-content-types">
|
|
105
106
|
<NoContentType />
|
|
106
107
|
</Route>
|
|
107
|
-
<Route path="" component={
|
|
108
|
+
<Route path="" component={AnErrorOccurred} />
|
|
108
109
|
</Switch>
|
|
109
110
|
</ModelsContext.Provider>
|
|
110
111
|
</Layout>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
/* eslint-disable consistent-return */
|
|
6
6
|
import produce from 'immer';
|
|
7
|
-
import {
|
|
7
|
+
import { GET_INIT_DATA, RESET_INIT_DATA, SET_INIT_DATA } from './constants';
|
|
8
8
|
|
|
9
9
|
const initialState = {
|
|
10
10
|
components: [],
|
|
@@ -20,22 +20,23 @@ const initialState = {
|
|
|
20
20
|
const mainReducer = (state = initialState, action) =>
|
|
21
21
|
produce(state, (draftState) => {
|
|
22
22
|
switch (action.type) {
|
|
23
|
-
case
|
|
23
|
+
case GET_INIT_DATA: {
|
|
24
24
|
draftState.status = 'loading';
|
|
25
25
|
break;
|
|
26
26
|
}
|
|
27
|
-
case
|
|
27
|
+
case RESET_INIT_DATA: {
|
|
28
28
|
return initialState;
|
|
29
29
|
}
|
|
30
|
-
case
|
|
31
|
-
draftState.collectionTypeLinks = action.data.
|
|
30
|
+
case SET_INIT_DATA: {
|
|
31
|
+
draftState.collectionTypeLinks = action.data.authorizedCollectionTypeLinks.filter(
|
|
32
32
|
({ isDisplayed }) => isDisplayed
|
|
33
33
|
);
|
|
34
|
-
draftState.singleTypeLinks = action.data.
|
|
34
|
+
draftState.singleTypeLinks = action.data.authorizedSingleTypeLinks.filter(
|
|
35
35
|
({ isDisplayed }) => isDisplayed
|
|
36
36
|
);
|
|
37
37
|
draftState.components = action.data.components;
|
|
38
38
|
draftState.models = action.data.contentTypeSchemas;
|
|
39
|
+
draftState.fieldSizes = action.data.fieldSizes;
|
|
39
40
|
draftState.status = 'resolved';
|
|
40
41
|
break;
|
|
41
42
|
}
|
|
@@ -23,10 +23,13 @@ const makeSelectModelAndComponentSchemas = () =>
|
|
|
23
23
|
schemas: [...components, ...models],
|
|
24
24
|
}));
|
|
25
25
|
|
|
26
|
+
const selectFieldSizes = createSelector(selectAppDomain(), (state) => state.fieldSizes);
|
|
27
|
+
|
|
26
28
|
export default makeSelectApp;
|
|
27
29
|
export {
|
|
28
30
|
makeSelectModelAndComponentSchemas,
|
|
29
31
|
makeSelectModelLinks,
|
|
30
32
|
makeSelectModels,
|
|
33
|
+
selectFieldSizes,
|
|
31
34
|
selectAppDomain,
|
|
32
35
|
};
|
|
@@ -11,11 +11,11 @@ import axios from 'axios';
|
|
|
11
11
|
import { useIntl } from 'react-intl';
|
|
12
12
|
import { MUTATE_COLLECTION_TYPES_LINKS, MUTATE_SINGLE_TYPES_LINKS } from '../../../exposedHooks';
|
|
13
13
|
import { getRequestUrl, getTrad } from '../../utils';
|
|
14
|
-
import {
|
|
14
|
+
import { getInitData, resetInitData, setInitData } from './actions';
|
|
15
15
|
import { selectAppDomain } from './selectors';
|
|
16
16
|
import getContentTypeLinks from './utils/getContentTypeLinks';
|
|
17
17
|
|
|
18
|
-
const
|
|
18
|
+
const useContentManagerInitData = () => {
|
|
19
19
|
const dispatch = useDispatch();
|
|
20
20
|
const toggleNotification = useNotification();
|
|
21
21
|
const state = useSelector(selectAppDomain());
|
|
@@ -29,22 +29,14 @@ const useModels = () => {
|
|
|
29
29
|
const { get } = useFetchClient();
|
|
30
30
|
|
|
31
31
|
const fetchData = async () => {
|
|
32
|
-
dispatch(
|
|
32
|
+
dispatch(getInitData());
|
|
33
33
|
|
|
34
34
|
try {
|
|
35
|
-
const
|
|
36
|
-
{
|
|
37
|
-
data: {
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
data: { data: models },
|
|
35
|
+
const {
|
|
36
|
+
data: {
|
|
37
|
+
data: { components, contentTypes: models, fieldSizes },
|
|
41
38
|
},
|
|
42
|
-
|
|
43
|
-
['components', 'content-types'].map((endPoint) =>
|
|
44
|
-
get(getRequestUrl(endPoint), { cancelToken: source.token })
|
|
45
|
-
)
|
|
46
|
-
);
|
|
47
|
-
|
|
39
|
+
} = await get(getRequestUrl('init'), { cancelToken: source.token });
|
|
48
40
|
notifyStatus(
|
|
49
41
|
formatMessage({
|
|
50
42
|
id: getTrad('App.schemas.data-loaded'),
|
|
@@ -52,22 +44,31 @@ const useModels = () => {
|
|
|
52
44
|
})
|
|
53
45
|
);
|
|
54
46
|
|
|
55
|
-
const
|
|
56
|
-
models,
|
|
57
|
-
allPermissions,
|
|
58
|
-
toggleNotification
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
const { ctLinks } = runHookWaterfall(MUTATE_COLLECTION_TYPES_LINKS, {
|
|
62
|
-
ctLinks: authorizedCtLinks,
|
|
47
|
+
const unmutatedContentTypeLinks = await getContentTypeLinks({
|
|
63
48
|
models,
|
|
49
|
+
userPermissions: allPermissions,
|
|
50
|
+
toggleNotification,
|
|
64
51
|
});
|
|
65
|
-
|
|
66
|
-
|
|
52
|
+
|
|
53
|
+
const { ctLinks: authorizedCollectionTypeLinks } = runHookWaterfall(
|
|
54
|
+
MUTATE_COLLECTION_TYPES_LINKS,
|
|
55
|
+
{
|
|
56
|
+
ctLinks: unmutatedContentTypeLinks.authorizedCollectionTypeLinks,
|
|
57
|
+
models,
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
const { stLinks: authorizedSingleTypeLinks } = runHookWaterfall(MUTATE_SINGLE_TYPES_LINKS, {
|
|
61
|
+
stLinks: unmutatedContentTypeLinks.authorizedSingleTypeLinks,
|
|
67
62
|
models,
|
|
68
63
|
});
|
|
69
64
|
|
|
70
|
-
const actionToDispatch =
|
|
65
|
+
const actionToDispatch = setInitData({
|
|
66
|
+
authorizedCollectionTypeLinks,
|
|
67
|
+
authorizedSingleTypeLinks,
|
|
68
|
+
contentTypeSchemas: models,
|
|
69
|
+
components,
|
|
70
|
+
fieldSizes,
|
|
71
|
+
});
|
|
71
72
|
|
|
72
73
|
dispatch(actionToDispatch);
|
|
73
74
|
} catch (err) {
|
|
@@ -88,7 +89,7 @@ const useModels = () => {
|
|
|
88
89
|
|
|
89
90
|
return () => {
|
|
90
91
|
source.cancel('Operation canceled by the user.');
|
|
91
|
-
dispatch(
|
|
92
|
+
dispatch(resetInitData());
|
|
92
93
|
};
|
|
93
94
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
94
95
|
}, [dispatch, toggleNotification]);
|
|
@@ -96,4 +97,4 @@ const useModels = () => {
|
|
|
96
97
|
return { ...state, refetchData: fetchDataRef.current };
|
|
97
98
|
};
|
|
98
99
|
|
|
99
|
-
export default
|
|
100
|
+
export default useContentManagerInitData;
|
|
@@ -52,12 +52,12 @@ const generateModelsLinks = (models, modelsConfigurations) => {
|
|
|
52
52
|
const [collectionTypes, singleTypes] = sortBy(groupedModels, 'name');
|
|
53
53
|
|
|
54
54
|
return {
|
|
55
|
-
|
|
55
|
+
collectionTypeSectionLinks: generateLinks(
|
|
56
56
|
collectionTypes?.links || [],
|
|
57
57
|
'collectionTypes',
|
|
58
58
|
modelsConfigurations
|
|
59
59
|
),
|
|
60
|
-
|
|
60
|
+
singleTypeSectionLinks: generateLinks(singleTypes?.links ?? [], 'singleTypes'),
|
|
61
61
|
};
|
|
62
62
|
};
|
|
63
63
|
|
|
@@ -3,36 +3,38 @@ import generateModelsLinks from './generateModelsLinks';
|
|
|
3
3
|
import checkPermissions from './checkPermissions';
|
|
4
4
|
import { getRequestUrl } from '../../../utils';
|
|
5
5
|
|
|
6
|
-
const getContentTypeLinks = async (models, userPermissions, toggleNotification) => {
|
|
6
|
+
const getContentTypeLinks = async ({ models, userPermissions, toggleNotification }) => {
|
|
7
7
|
const { get } = getFetchClient();
|
|
8
8
|
try {
|
|
9
9
|
const {
|
|
10
10
|
data: { data: contentTypeConfigurations },
|
|
11
11
|
} = await get(getRequestUrl('content-types-settings'));
|
|
12
12
|
|
|
13
|
-
const {
|
|
13
|
+
const { collectionTypeSectionLinks, singleTypeSectionLinks } = generateModelsLinks(
|
|
14
14
|
models,
|
|
15
15
|
contentTypeConfigurations
|
|
16
16
|
);
|
|
17
17
|
|
|
18
|
-
//
|
|
19
|
-
const
|
|
20
|
-
userPermissions,
|
|
21
|
-
collectionTypesSectionLinks
|
|
18
|
+
// Collection Types verifications
|
|
19
|
+
const collectionTypeLinksPermissions = await Promise.all(
|
|
20
|
+
checkPermissions(userPermissions, collectionTypeSectionLinks)
|
|
22
21
|
);
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
(_, index) => ctLinksPermissions[index]
|
|
22
|
+
const authorizedCollectionTypeLinks = collectionTypeSectionLinks.filter(
|
|
23
|
+
(_, index) => collectionTypeLinksPermissions[index]
|
|
26
24
|
);
|
|
27
25
|
|
|
28
26
|
// Single Types verifications
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
const singleTypeLinksPermissions = await Promise.all(
|
|
28
|
+
checkPermissions(userPermissions, singleTypeSectionLinks)
|
|
29
|
+
);
|
|
30
|
+
const authorizedSingleTypeLinks = singleTypeSectionLinks.filter(
|
|
31
|
+
(_, index) => singleTypeLinksPermissions[index]
|
|
33
32
|
);
|
|
34
33
|
|
|
35
|
-
return {
|
|
34
|
+
return {
|
|
35
|
+
authorizedCollectionTypeLinks,
|
|
36
|
+
authorizedSingleTypeLinks,
|
|
37
|
+
};
|
|
36
38
|
} catch (err) {
|
|
37
39
|
console.error(err);
|
|
38
40
|
|
|
@@ -41,7 +43,7 @@ const getContentTypeLinks = async (models, userPermissions, toggleNotification)
|
|
|
41
43
|
message: { id: 'notification.error' },
|
|
42
44
|
});
|
|
43
45
|
|
|
44
|
-
return {
|
|
46
|
+
return { authorizedCollectionTypeLinks: [], authorizedSingleTypeLinks: [] };
|
|
45
47
|
}
|
|
46
48
|
};
|
|
47
49
|
|
|
@@ -6,7 +6,7 @@ import { useSelector, shallowEqual } from 'react-redux';
|
|
|
6
6
|
import { useIntl } from 'react-intl';
|
|
7
7
|
import { useLayoutDnd } from '../../../hooks';
|
|
8
8
|
import { createPossibleMainFieldsForModelsAndComponents, getInputProps } from '../utils';
|
|
9
|
-
import { makeSelectModelAndComponentSchemas } from '../../App/selectors';
|
|
9
|
+
import { makeSelectModelAndComponentSchemas, selectFieldSizes } from '../../App/selectors';
|
|
10
10
|
import getTrad from '../../../utils/getTrad';
|
|
11
11
|
import GenericInput from './GenericInput';
|
|
12
12
|
|
|
@@ -17,8 +17,6 @@ const FIELD_SIZES = [
|
|
|
17
17
|
[12, '100%'],
|
|
18
18
|
];
|
|
19
19
|
|
|
20
|
-
const NON_RESIZABLE_FIELD_TYPES = ['dynamiczone', 'component', 'json', 'richtext'];
|
|
21
|
-
|
|
22
20
|
const TIME_FIELD_OPTIONS = [1, 5, 10, 15, 30, 60];
|
|
23
21
|
|
|
24
22
|
const TIME_FIELD_TYPES = ['datetime', 'time'];
|
|
@@ -28,6 +26,7 @@ const ModalForm = ({ onMetaChange, onSizeChange }) => {
|
|
|
28
26
|
const { modifiedData, selectedField, attributes, fieldForm } = useLayoutDnd();
|
|
29
27
|
const schemasSelector = useMemo(makeSelectModelAndComponentSchemas, []);
|
|
30
28
|
const { schemas } = useSelector((state) => schemasSelector(state), shallowEqual);
|
|
29
|
+
const fieldSizes = useSelector(selectFieldSizes);
|
|
31
30
|
|
|
32
31
|
const formToDisplay = useMemo(() => {
|
|
33
32
|
if (!selectedField) {
|
|
@@ -103,7 +102,7 @@ const ModalForm = ({ onMetaChange, onSizeChange }) => {
|
|
|
103
102
|
);
|
|
104
103
|
});
|
|
105
104
|
|
|
106
|
-
const
|
|
105
|
+
const { isResizable } = fieldSizes[attributes[selectedField].type];
|
|
107
106
|
|
|
108
107
|
const sizeField = (
|
|
109
108
|
<GridItem col={6} key="size">
|
|
@@ -152,7 +151,7 @@ const ModalForm = ({ onMetaChange, onSizeChange }) => {
|
|
|
152
151
|
return (
|
|
153
152
|
<>
|
|
154
153
|
{metaFields}
|
|
155
|
-
{
|
|
154
|
+
{isResizable && sizeField}
|
|
156
155
|
{hasTimePicker && timeStepField}
|
|
157
156
|
</>
|
|
158
157
|
);
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
Divider,
|
|
27
27
|
} from '@strapi/design-system';
|
|
28
28
|
import { ArrowLeft, Check } from '@strapi/icons';
|
|
29
|
+
import { useSelector } from 'react-redux';
|
|
29
30
|
import { getTrad } from '../../utils';
|
|
30
31
|
import reducer, { initialState } from './reducer';
|
|
31
32
|
import init from './init';
|
|
@@ -34,6 +35,7 @@ import ModalForm from './components/FormModal';
|
|
|
34
35
|
import LayoutDndProvider from '../../components/LayoutDndProvider';
|
|
35
36
|
import { unformatLayout } from './utils/layout';
|
|
36
37
|
import putCMSettingsEV from './utils/api';
|
|
38
|
+
import { selectFieldSizes } from '../App/selectors';
|
|
37
39
|
|
|
38
40
|
const EditSettingsView = ({ mainLayout, components, isContentTypeView, slug, updateLayout }) => {
|
|
39
41
|
const [reducerState, dispatch] = useReducer(reducer, initialState, () =>
|
|
@@ -49,6 +51,7 @@ const EditSettingsView = ({ mainLayout, components, isContentTypeView, slug, upd
|
|
|
49
51
|
const { formatMessage } = useIntl();
|
|
50
52
|
const modelName = get(mainLayout, ['info', 'displayName'], '');
|
|
51
53
|
const attributes = get(modifiedData, ['attributes'], {});
|
|
54
|
+
const fieldSizes = useSelector(selectFieldSizes);
|
|
52
55
|
|
|
53
56
|
const entryTitleOptions = Object.keys(attributes).filter((attr) => {
|
|
54
57
|
const type = get(attributes, [attr, 'type'], '');
|
|
@@ -318,6 +321,7 @@ const EditSettingsView = ({ mainLayout, components, isContentTypeView, slug, upd
|
|
|
318
321
|
dispatch({
|
|
319
322
|
type: 'ON_ADD_FIELD',
|
|
320
323
|
name: field,
|
|
324
|
+
fieldSizes,
|
|
321
325
|
});
|
|
322
326
|
}}
|
|
323
327
|
onRemoveField={(rowId, index) => {
|
|
@@ -2,9 +2,10 @@ import produce from 'immer';
|
|
|
2
2
|
import set from 'lodash/set';
|
|
3
3
|
import get from 'lodash/get';
|
|
4
4
|
import cloneDeep from 'lodash/cloneDeep';
|
|
5
|
-
|
|
6
5
|
import { arrayMoveItem } from '../../utils';
|
|
7
|
-
import { formatLayout,
|
|
6
|
+
import { formatLayout, getFieldSize, setFieldSize } from './utils/layout';
|
|
7
|
+
|
|
8
|
+
const DEFAULT_FIELD_SIZE = 6;
|
|
8
9
|
|
|
9
10
|
const initialState = {
|
|
10
11
|
fieldForm: {},
|
|
@@ -29,9 +30,8 @@ const reducer = (state = initialState, action) =>
|
|
|
29
30
|
}
|
|
30
31
|
case 'ON_ADD_FIELD': {
|
|
31
32
|
const newState = cloneDeep(state);
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
);
|
|
33
|
+
const type = get(newState, ['modifiedData', 'attributes', action.name, 'type'], '');
|
|
34
|
+
const size = action.fieldSizes[type]?.default ?? DEFAULT_FIELD_SIZE;
|
|
35
35
|
const listSize = get(newState, layoutPathEdit, []).length;
|
|
36
36
|
const actualRowContentPath = [...layoutPathEdit, listSize - 1, 'rowContent'];
|
|
37
37
|
const rowContentToSet = get(newState, actualRowContentPath, []);
|
|
@@ -149,8 +149,7 @@ const reducer = (state = initialState, action) =>
|
|
|
149
149
|
draftState.metaToEdit = action.name;
|
|
150
150
|
draftState.metaForm = {
|
|
151
151
|
metadata: get(state, ['modifiedData', 'metadatas', action.name, 'edit'], {}),
|
|
152
|
-
size:
|
|
153
|
-
getFieldSize(action.name, state.modifiedData?.layouts?.edit) ?? getDefaultInputSize(),
|
|
152
|
+
size: getFieldSize(action.name, state.modifiedData?.layouts?.edit) ?? DEFAULT_FIELD_SIZE,
|
|
154
153
|
};
|
|
155
154
|
|
|
156
155
|
break;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable indent */
|
|
2
1
|
const getRowSize = (arr) => arr.reduce((sum, value) => sum + value.size, 0);
|
|
3
2
|
|
|
4
3
|
const createLayout = (arr) => {
|
|
@@ -75,26 +74,6 @@ const unformatLayout = (arr) => {
|
|
|
75
74
|
}, []);
|
|
76
75
|
};
|
|
77
76
|
|
|
78
|
-
const getDefaultInputSize = (type) => {
|
|
79
|
-
switch (type) {
|
|
80
|
-
case 'boolean':
|
|
81
|
-
case 'date':
|
|
82
|
-
case 'integer':
|
|
83
|
-
case 'float':
|
|
84
|
-
case 'biginteger':
|
|
85
|
-
case 'decimal':
|
|
86
|
-
case 'time':
|
|
87
|
-
return 4;
|
|
88
|
-
case 'json':
|
|
89
|
-
case 'component':
|
|
90
|
-
case 'richtext':
|
|
91
|
-
case 'dynamiczone':
|
|
92
|
-
return 12;
|
|
93
|
-
default:
|
|
94
|
-
return 6;
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
|
|
98
77
|
const getFieldSize = (name, layouts = []) => {
|
|
99
78
|
return layouts.reduce((acc, { rowContent }) => {
|
|
100
79
|
const size = rowContent.find((row) => row.name === name)?.size ?? null;
|
|
@@ -124,12 +103,4 @@ const setFieldSize = (name, size, layouts = []) => {
|
|
|
124
103
|
});
|
|
125
104
|
};
|
|
126
105
|
|
|
127
|
-
export {
|
|
128
|
-
createLayout,
|
|
129
|
-
formatLayout,
|
|
130
|
-
getDefaultInputSize,
|
|
131
|
-
getFieldSize,
|
|
132
|
-
setFieldSize,
|
|
133
|
-
getRowSize,
|
|
134
|
-
unformatLayout,
|
|
135
|
-
};
|
|
106
|
+
export { createLayout, formatLayout, getFieldSize, setFieldSize, getRowSize, unformatLayout };
|
|
@@ -8,14 +8,14 @@ import PropTypes from 'prop-types';
|
|
|
8
8
|
import { getTrad } from '../../../utils';
|
|
9
9
|
import { connect, select } from './utils';
|
|
10
10
|
|
|
11
|
-
const DeleteLink = ({
|
|
12
|
-
const [
|
|
11
|
+
const DeleteLink = ({ onDelete, trackerProperty }) => {
|
|
12
|
+
const [displayDeleteConfirmation, setDisplayDeleteConfirmation] = useState(false);
|
|
13
13
|
const [isModalConfirmButtonLoading, setIsModalConfirmButtonLoading] = useState(false);
|
|
14
14
|
const { formatMessage } = useIntl();
|
|
15
15
|
const { formatAPIError } = useAPIErrorHandler(getTrad);
|
|
16
16
|
const toggleNotification = useNotification();
|
|
17
17
|
|
|
18
|
-
const toggleWarningDelete = () =>
|
|
18
|
+
const toggleWarningDelete = () => setDisplayDeleteConfirmation((prevState) => !prevState);
|
|
19
19
|
|
|
20
20
|
const handleConfirmDelete = async () => {
|
|
21
21
|
try {
|
|
@@ -27,7 +27,6 @@ const DeleteLink = ({ isCreatingEntry, onDelete, onDeleteSucceeded, trackerPrope
|
|
|
27
27
|
setIsModalConfirmButtonLoading(false);
|
|
28
28
|
|
|
29
29
|
toggleWarningDelete();
|
|
30
|
-
onDeleteSucceeded();
|
|
31
30
|
} catch (err) {
|
|
32
31
|
setIsModalConfirmButtonLoading(false);
|
|
33
32
|
toggleWarningDelete();
|
|
@@ -38,10 +37,6 @@ const DeleteLink = ({ isCreatingEntry, onDelete, onDeleteSucceeded, trackerPrope
|
|
|
38
37
|
}
|
|
39
38
|
};
|
|
40
39
|
|
|
41
|
-
if (isCreatingEntry) {
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
40
|
return (
|
|
46
41
|
<>
|
|
47
42
|
<Button onClick={toggleWarningDelete} size="S" startIcon={<Trash />} variant="danger-light">
|
|
@@ -50,9 +45,10 @@ const DeleteLink = ({ isCreatingEntry, onDelete, onDeleteSucceeded, trackerPrope
|
|
|
50
45
|
defaultMessage: 'Delete this entry',
|
|
51
46
|
})}
|
|
52
47
|
</Button>
|
|
48
|
+
|
|
53
49
|
<ConfirmDialog
|
|
54
50
|
isConfirmButtonLoading={isModalConfirmButtonLoading}
|
|
55
|
-
isOpen={
|
|
51
|
+
isOpen={displayDeleteConfirmation}
|
|
56
52
|
onConfirm={handleConfirmDelete}
|
|
57
53
|
onToggleDialog={toggleWarningDelete}
|
|
58
54
|
/>
|
|
@@ -61,9 +57,7 @@ const DeleteLink = ({ isCreatingEntry, onDelete, onDeleteSucceeded, trackerPrope
|
|
|
61
57
|
};
|
|
62
58
|
|
|
63
59
|
DeleteLink.propTypes = {
|
|
64
|
-
isCreatingEntry: PropTypes.bool.isRequired,
|
|
65
60
|
onDelete: PropTypes.func.isRequired,
|
|
66
|
-
onDeleteSucceeded: PropTypes.func.isRequired,
|
|
67
61
|
trackerProperty: PropTypes.object.isRequired,
|
|
68
62
|
};
|
|
69
63
|
|
|
@@ -76,7 +76,6 @@ const EditView = ({ allowedActions, isSingleType, goBack, slug, id, origin, user
|
|
|
76
76
|
isCreatingEntry,
|
|
77
77
|
isLoadingForData,
|
|
78
78
|
onDelete,
|
|
79
|
-
onDeleteSucceeded,
|
|
80
79
|
onPost,
|
|
81
80
|
onPublish,
|
|
82
81
|
onDraftRelationCheck,
|
|
@@ -220,12 +219,8 @@ const EditView = ({ allowedActions, isSingleType, goBack, slug, id, origin, user
|
|
|
220
219
|
</LinkButton>
|
|
221
220
|
</CheckPermissions>
|
|
222
221
|
|
|
223
|
-
{allowedActions.canDelete && (
|
|
224
|
-
<DeleteLink
|
|
225
|
-
isCreatingEntry={isCreatingEntry}
|
|
226
|
-
onDelete={onDelete}
|
|
227
|
-
onDeleteSucceeded={onDeleteSucceeded}
|
|
228
|
-
/>
|
|
222
|
+
{allowedActions.canDelete && !isCreatingEntry && (
|
|
223
|
+
<DeleteLink onDelete={onDelete} />
|
|
229
224
|
)}
|
|
230
225
|
</Flex>
|
|
231
226
|
</Box>
|