@strapi/admin 4.1.2 → 4.1.4-alpha.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/admin/src/assets/images/icon_made-by-strapi.svg +5 -0
- package/admin/src/components/AuthenticatedApp/index.js +9 -2
- package/admin/src/components/AuthenticatedApp/utils/api.js +20 -1
- package/admin/src/components/AutoReloadOverlayBlockerProvider/Blocker.js +2 -2
- package/admin/src/components/GuidedTour/Homepage/index.js +1 -1
- package/admin/src/components/GuidedTour/Modal/components/Content.js +1 -1
- package/admin/src/components/GuidedTour/Modal/components/Modal.js +1 -1
- package/admin/src/components/LeftMenu/index.js +1 -1
- package/admin/src/components/Notifications/index.js +1 -1
- package/admin/src/components/UpgradePlanModal/index.js +2 -2
- package/admin/src/content-manager/components/CollectionTypeFormWrapper/index.js +4 -4
- package/admin/src/content-manager/components/ComponentInitializer/index.js +1 -1
- package/admin/src/content-manager/components/DynamicTable/ConfirmDialogDelete/index.js +1 -1
- package/admin/src/content-manager/components/DynamicTable/ConfirmDialogDeleteAll/index.js +1 -1
- package/admin/src/content-manager/components/DynamicZone/components/Component/index.js +2 -2
- package/admin/src/content-manager/components/DynamicZone/components/ComponentPicker/Category/ComponentCard/index.js +1 -1
- package/admin/src/content-manager/components/DynamicZone/components/ComponentPicker/Category/index.js +5 -2
- package/admin/src/content-manager/components/DynamicZone/index.js +2 -5
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/cleanData.js +1 -6
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/schema.js +0 -9
- package/admin/src/content-manager/components/FieldComponent/index.js +2 -5
- package/admin/src/content-manager/components/InputJSON/index.js +2 -5
- package/admin/src/content-manager/components/InputUID/index.js +1 -2
- package/admin/src/content-manager/components/NonRepeatableComponent/index.js +1 -1
- package/admin/src/content-manager/components/RepeatableComponent/DraggedItem/DraggingSibling.js +2 -2
- package/admin/src/content-manager/components/RepeatableComponent/DraggedItem/index.js +4 -7
- package/admin/src/content-manager/components/SelectMany/index.js +2 -2
- package/admin/src/content-manager/components/SelectOne/index.js +1 -1
- package/admin/src/content-manager/components/SelectWrapper/index.js +2 -5
- package/admin/src/content-manager/components/SingleTypeFormWrapper/index.js +4 -4
- package/admin/src/content-manager/components/Wysiwyg/EditorStylesContainer.js +1 -1
- package/admin/src/content-manager/components/Wysiwyg/WysiwygNav.js +2 -2
- package/admin/src/content-manager/components/Wysiwyg/index.js +2 -2
- package/admin/src/content-manager/pages/EditSettingsView/components/DisplayedFields.js +2 -2
- package/admin/src/content-manager/pages/EditSettingsView/components/DynamicZoneList.js +1 -1
- package/admin/src/content-manager/pages/EditSettingsView/components/RelationalFields.js +2 -2
- package/admin/src/content-manager/pages/EditSettingsView/index.js +1 -1
- package/admin/src/content-manager/pages/EditView/Header/index.js +4 -7
- package/admin/src/content-manager/pages/EditView/Informations/index.js +1 -1
- package/admin/src/content-manager/pages/EditView/index.js +5 -193
- package/admin/src/content-manager/pages/ListSettingsView/components/CardPreview.js +1 -1
- package/admin/src/content-manager/pages/ListSettingsView/components/DraggableCard.js +1 -1
- package/admin/src/content-manager/pages/ListSettingsView/components/SortDisplayedFields.js +1 -1
- package/admin/src/hooks/index.js +0 -1
- package/admin/src/hooks/useFetchInstalledPlugins/index.js +23 -0
- package/admin/src/{pages/InstalledPluginsPage → hooks/useFetchInstalledPlugins}/utils/api.js +2 -4
- package/admin/src/hooks/useFetchMarketplacePlugins/index.js +23 -0
- package/admin/src/hooks/useFetchMarketplacePlugins/utils/api.js +17 -0
- package/admin/src/hooks/useSettingsMenu/init.js +2 -2
- package/admin/src/pages/Admin/index.js +1 -3
- package/admin/src/pages/AuthPage/components/ForgotPassword/index.js +1 -1
- package/admin/src/pages/AuthPage/components/Login/BaseLogin.js +1 -1
- package/admin/src/pages/AuthPage/components/Register/index.js +219 -214
- package/admin/src/pages/AuthPage/components/ResetPassword/index.js +1 -1
- package/admin/src/pages/AuthPage/index.js +7 -1
- package/admin/src/pages/HomePage/ContentBlocks.js +1 -1
- package/admin/src/pages/HomePage/HomeHeader.js +1 -1
- package/admin/src/pages/HomePage/SocialLinks.js +2 -2
- package/admin/src/pages/InstalledPluginsPage/Plugins.js +6 -15
- package/admin/src/pages/MarketplacePage/components/EmptyPluginSearch/EmptyPluginGrid.js +27 -0
- package/admin/src/pages/MarketplacePage/components/EmptyPluginSearch/index.js +30 -0
- package/admin/src/pages/MarketplacePage/components/PluginCard/index.js +186 -0
- package/admin/src/pages/MarketplacePage/index.js +198 -109
- package/admin/src/pages/MarketplacePage/utils/api.js +9 -0
- package/admin/src/pages/ProfilePage/index.js +5 -5
- package/admin/src/pages/SettingsPage/components/SettingsNav/index.js +4 -1
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/index.js +2 -2
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/ConditionsModal/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/GlobalActions/index.js +2 -2
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/PluginsAndSettings/Row/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/RoleForm/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/index.js +2 -2
- package/admin/src/pages/SettingsPage/pages/Users/EditPage/index.js +3 -3
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/ModalForm/index.js +2 -2
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/EventInput/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/HeadersInput/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/TriggerContainer/index.js +4 -4
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/WebhookForm/index.js +3 -3
- package/admin/src/pages/SettingsPage/pages/Webhooks/ListView/index.js +1 -1
- package/admin/src/pages/UseCasePage/index.js +1 -1
- package/admin/src/translations/en.json +16 -13
- package/build/{1094.1087a368.chunk.js → 1094.e1db3a1a.chunk.js} +1 -1
- package/build/1454.f065d92a.chunk.js +2 -0
- package/build/{1454.c0f0c2df.chunk.js.LICENSE.txt → 1454.f065d92a.chunk.js.LICENSE.txt} +0 -0
- package/build/1856.a30bd09b.chunk.js +1 -0
- package/build/2481.4eae9408.chunk.js +1 -0
- package/build/{2912.38fb9bd1.chunk.js → 2912.c5f76e65.chunk.js} +1 -1
- package/build/4362.5c92d240.chunk.js +1 -0
- package/build/4715.8a2db02a.chunk.js +1 -0
- package/build/{4800.18e59c83.chunk.js → 4800.f4a1384a.chunk.js} +1 -1
- package/build/497.3fcf6196.chunk.js +1 -0
- package/build/4982.601f6196.chunk.js +1 -0
- package/build/6250.836851ca.chunk.js +1 -0
- package/build/{7841.ef9bcee9.chunk.js → 7841.490dbbf1.chunk.js} +1 -1
- package/build/{8042.9b85175a.chunk.js → 8042.1d66811a.chunk.js} +2 -2
- package/build/{8042.9b85175a.chunk.js.LICENSE.txt → 8042.1d66811a.chunk.js.LICENSE.txt} +0 -0
- package/build/849.17f011e8.chunk.js +1 -0
- package/build/90f49a385afb000fb1d4.svg +5 -0
- package/build/{2736.53cd9bba.chunk.js → 9260.fa40c7bd.chunk.js} +2 -2
- package/build/{2736.53cd9bba.chunk.js.LICENSE.txt → 9260.fa40c7bd.chunk.js.LICENSE.txt} +0 -0
- package/build/9853.6ff595fa.chunk.js +1 -0
- package/build/{9988.b4229043.chunk.js → 9988.fe838ba6.chunk.js} +2 -2
- package/build/{9988.b4229043.chunk.js.LICENSE.txt → 9988.fe838ba6.chunk.js.LICENSE.txt} +0 -0
- package/build/Admin-authenticatedApp.ae08fbaf.chunk.js +1 -0
- package/build/Admin_homePage.964ff5d7.chunk.js +1 -0
- package/build/Admin_marketplace.e83567ff.chunk.js +1 -0
- package/build/Admin_pluginsPage.97a514db.chunk.js +1 -0
- package/build/Admin_profilePage.c497b39d.chunk.js +1 -0
- package/build/Admin_settingsPage.55ec1f30.chunk.js +1 -0
- package/build/admin-edit-roles-page.49b6f01d.chunk.js +1 -0
- package/build/admin-edit-users.381e4a0d.chunk.js +1 -0
- package/build/admin-users.2740c223.chunk.js +1 -0
- package/build/{api-tokens-create-page.0981141a.chunk.js → api-tokens-create-page.db17bb39.chunk.js} +1 -1
- package/build/{api-tokens-edit-page.3faf1af1.chunk.js → api-tokens-edit-page.c7299a77.chunk.js} +1 -1
- package/build/content-manager.e1189026.chunk.js +1 -0
- package/build/content-type-builder-translation-en-json.8034dab6.chunk.js +1 -0
- package/build/content-type-builder.de5d18ad.chunk.js +1 -0
- package/build/{email-settings-page.4338588d.chunk.js → email-settings-page.27ee4a98.chunk.js} +1 -1
- package/build/en-json.086acf41.chunk.js +1 -0
- package/build/i18n-settings-page.c4018651.chunk.js +1 -0
- package/build/i18n-translation-de-json.c5c9054f.chunk.js +1 -0
- package/build/index.html +1 -1
- package/build/main.778a7700.js +2 -0
- package/build/{main.670c6b23.js.LICENSE.txt → main.778a7700.js.LICENSE.txt} +0 -0
- package/build/runtime~main.d6c03427.js +1 -0
- package/build/{sso-settings-page.c073b6d7.chunk.js → sso-settings-page.121dd0a6.chunk.js} +1 -1
- package/build/{upload-settings.8e7cbc3b.chunk.js → upload-settings.4401f36d.chunk.js} +1 -1
- package/build/{upload.803ab265.chunk.js → upload.5a2dded7.chunk.js} +1 -1
- package/build/{users-advanced-settings-page.7694d3c9.chunk.js → users-advanced-settings-page.8905d8d8.chunk.js} +1 -1
- package/build/users-permissions-translation-en-json.21b0fd2f.chunk.js +1 -0
- package/build/users-providers-settings-page.368893ed.chunk.js +1 -0
- package/build/users-roles-settings-page.a2f6277a.chunk.js +1 -0
- package/build/webhook-edit-page.d170eda1.chunk.js +1 -0
- package/build/{webhook-list-page.5c8f2a91.chunk.js → webhook-list-page.c21b5a9a.chunk.js} +1 -1
- package/ee/admin/pages/AuthPage/components/Login/index.js +1 -1
- package/ee/admin/pages/AuthPage/components/Providers/index.js +1 -1
- package/ee/admin/pages/SettingsPage/SingleSignOn/index.js +1 -1
- package/ee/admin/pages/SettingsPage/pages/Roles/CreatePage/index.js +3 -3
- package/package.json +7 -7
- package/server/controllers/admin.js +12 -1
- package/server/routes/serve-admin-panel.js +18 -6
- package/.env +0 -0
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/isValidJSONString.js +0 -15
- package/admin/src/hooks/useFetchPluginsFromMarketPlace/index.js +0 -49
- package/admin/src/pages/MarketplacePage/MarketplaceBanner/Wrapper.js +0 -28
- package/admin/src/pages/MarketplacePage/MarketplaceBanner/index.js +0 -37
- package/admin/src/pages/MarketplacePage/PluginCard/Wrapper.js +0 -148
- package/admin/src/pages/MarketplacePage/PluginCard/index.js +0 -185
- package/admin/src/pages/MarketplacePage/Wrapper.js +0 -5
- package/admin/src/pages/MarketplacePage/assets/marketplace-coming-soon.png +0 -0
- package/build/01a600d9e6e0dea21e33.png +0 -0
- package/build/1454.c0f0c2df.chunk.js +0 -2
- package/build/1856.a06395b4.chunk.js +0 -1
- package/build/2481.7d15bd79.chunk.js +0 -1
- package/build/4362.70618acb.chunk.js +0 -1
- package/build/4715.31ca1967.chunk.js +0 -1
- package/build/497.8f30da61.chunk.js +0 -1
- package/build/4982.da4adb38.chunk.js +0 -1
- package/build/6250.dc6d7a58.chunk.js +0 -1
- package/build/849.9075d399.chunk.js +0 -1
- package/build/9853.b75be3f0.chunk.js +0 -1
- package/build/Admin-authenticatedApp.ce381f88.chunk.js +0 -1
- package/build/Admin_homePage.e4779166.chunk.js +0 -1
- package/build/Admin_marketplace.e8654056.chunk.js +0 -1
- package/build/Admin_pluginsPage.7d1bd7ce.chunk.js +0 -1
- package/build/Admin_profilePage.67dd744c.chunk.js +0 -1
- package/build/Admin_settingsPage.2d0d2cca.chunk.js +0 -1
- package/build/admin-edit-roles-page.2d1b6461.chunk.js +0 -1
- package/build/admin-edit-users.e736db15.chunk.js +0 -1
- package/build/admin-users.5f79c031.chunk.js +0 -1
- package/build/content-manager.141d110d.chunk.js +0 -1
- package/build/content-type-builder-translation-en-json.b3d8e9d4.chunk.js +0 -1
- package/build/content-type-builder.f1cef05c.chunk.js +0 -1
- package/build/en-json.5aa9e5ec.chunk.js +0 -1
- package/build/i18n-settings-page.51e37957.chunk.js +0 -1
- package/build/main.670c6b23.js +0 -2
- package/build/runtime~main.2e70453d.js +0 -1
- package/build/users-permissions-translation-en-json.1993655e.chunk.js +0 -1
- package/build/users-providers-settings-page.47f97b06.chunk.js +0 -1
- package/build/users-roles-settings-page.b67e2b4d.chunk.js +0 -1
- package/build/webhook-edit-page.b2e22743.chunk.js +0 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect x="3" y="3" width="18" height="18" rx="4" fill="#4945FF"/>
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.8075 7.625H9.03058V11.1792H12.2533C12.4977 11.1792 12.6958 11.3773 12.6958 11.6216V14.8444H16.25V8.06746C16.25 7.82309 16.0519 7.625 15.8075 7.625Z" fill="white"/>
|
|
4
|
+
<path opacity="0.4" fill-rule="evenodd" clip-rule="evenodd" d="M9.0308 7.625V11.1792H6.01073C5.81364 11.1792 5.71494 10.9409 5.8543 10.8015L9.0308 7.625ZM13.0735 18.0209C12.9342 18.1603 12.6959 18.0616 12.6959 17.8645V14.8444H16.25L13.0735 18.0209ZM12.4746 11.1792H9.03058V14.4019C9.03058 14.6463 9.22868 14.8444 9.47304 14.8444H12.6958V11.4004C12.6958 11.2782 12.5968 11.1792 12.4746 11.1792Z" fill="#DAD9FF"/>
|
|
5
|
+
</svg>
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import React, { useMemo, useState, useEffect, useRef } from 'react';
|
|
2
2
|
// TODO: DS add loader
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
auth,
|
|
5
|
+
LoadingIndicatorPage,
|
|
6
|
+
AppInfosContext,
|
|
7
|
+
useGuidedTour,
|
|
8
|
+
useNotification,
|
|
9
|
+
} from '@strapi/helper-plugin';
|
|
4
10
|
import { useQueries } from 'react-query';
|
|
5
11
|
import get from 'lodash/get';
|
|
6
12
|
import packageJSON from '../../../../package.json';
|
|
@@ -20,6 +26,7 @@ const strapiVersion = packageJSON.version;
|
|
|
20
26
|
|
|
21
27
|
const AuthenticatedApp = () => {
|
|
22
28
|
const { setGuidedTourVisibility } = useGuidedTour();
|
|
29
|
+
const toggleNotification = useNotification();
|
|
23
30
|
const setGuidedTourVisibilityRef = useRef(setGuidedTourVisibility);
|
|
24
31
|
const userInfo = auth.getUserInfo();
|
|
25
32
|
const userName = get(userInfo, 'username') || getFullName(userInfo.firstname, userInfo.lastname);
|
|
@@ -34,7 +41,7 @@ const AuthenticatedApp = () => {
|
|
|
34
41
|
{ queryKey: 'app-infos', queryFn: fetchAppInfo },
|
|
35
42
|
{
|
|
36
43
|
queryKey: 'strapi-release',
|
|
37
|
-
queryFn: fetchStrapiLatestRelease,
|
|
44
|
+
queryFn: () => fetchStrapiLatestRelease(toggleNotification),
|
|
38
45
|
enabled: showReleaseNotification,
|
|
39
46
|
initialData: strapiVersion,
|
|
40
47
|
},
|
|
@@ -1,15 +1,34 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
|
+
import checkLatestStrapiVersion from './checkLatestStrapiVersion';
|
|
2
3
|
import { axiosInstance } from '../../../core/utils';
|
|
3
4
|
import packageJSON from '../../../../../package.json';
|
|
4
5
|
|
|
5
6
|
const strapiVersion = packageJSON.version;
|
|
7
|
+
const showUpdateNotif = !JSON.parse(localStorage.getItem('STRAPI_UPDATE_NOTIF'));
|
|
6
8
|
|
|
7
|
-
const fetchStrapiLatestRelease = async
|
|
9
|
+
const fetchStrapiLatestRelease = async toggleNotification => {
|
|
8
10
|
try {
|
|
9
11
|
const {
|
|
10
12
|
data: { tag_name },
|
|
11
13
|
} = await axios.get('https://api.github.com/repos/strapi/strapi/releases/latest');
|
|
12
14
|
|
|
15
|
+
const shouldUpdateStrapi = checkLatestStrapiVersion(strapiVersion, tag_name);
|
|
16
|
+
|
|
17
|
+
if (shouldUpdateStrapi && showUpdateNotif) {
|
|
18
|
+
toggleNotification({
|
|
19
|
+
type: 'info',
|
|
20
|
+
message: { id: 'notification.version.update.message' },
|
|
21
|
+
link: {
|
|
22
|
+
url: `https://github.com/strapi/strapi/releases/tag/${tag_name}`,
|
|
23
|
+
label: {
|
|
24
|
+
id: 'notification.version.update.link',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
blockTransition: true,
|
|
28
|
+
onClose: () => localStorage.setItem('STRAPI_UPDATE_NOTIF', true),
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
13
32
|
return tag_name;
|
|
14
33
|
} catch (err) {
|
|
15
34
|
// Don't throw an error
|
|
@@ -44,8 +44,8 @@ const Blocker = ({ displayedIcon, description, title, isOpen }) => {
|
|
|
44
44
|
if (isOpen) {
|
|
45
45
|
return ReactDOM.createPortal(
|
|
46
46
|
<Overlay>
|
|
47
|
-
<Content
|
|
48
|
-
<Stack
|
|
47
|
+
<Content spacing={6}>
|
|
48
|
+
<Stack spacing={2}>
|
|
49
49
|
<Flex justifyContent="center">
|
|
50
50
|
<Typography as="h1" variant="alpha">
|
|
51
51
|
{formatMessage(title)}
|
|
@@ -156,7 +156,7 @@ const LeftMenu = ({ generalSectionLinks, pluginsSectionLinks }) => {
|
|
|
156
156
|
hasRadius
|
|
157
157
|
>
|
|
158
158
|
<FocusTrap onEscape={handleToggleUserLinks}>
|
|
159
|
-
<Stack
|
|
159
|
+
<Stack spacing={0}>
|
|
160
160
|
<LinkUser tabIndex={0} onClick={handleToggleUserLinks} to="/me">
|
|
161
161
|
<Typography>
|
|
162
162
|
{formatMessage({
|
|
@@ -82,14 +82,14 @@ const UpgradePlanModal = ({ onClose, isOpen }) => {
|
|
|
82
82
|
<CloseButtonContainer>
|
|
83
83
|
<IconButton onClick={onClose} aria-label="Close" icon={<Cross />} />
|
|
84
84
|
</CloseButtonContainer>
|
|
85
|
-
<StackFlexStart
|
|
85
|
+
<StackFlexStart spacing={6}>
|
|
86
86
|
<Typography fontWeight="bold" textColor="primary600">
|
|
87
87
|
{formatMessage({
|
|
88
88
|
id: 'app.components.UpgradePlanModal.text-ce',
|
|
89
89
|
defaultMessage: 'COMMUNITY EDITION',
|
|
90
90
|
})}
|
|
91
91
|
</Typography>
|
|
92
|
-
<Stack
|
|
92
|
+
<Stack spacing={2}>
|
|
93
93
|
<Typography variant="alpha" as="h2" id="upgrade-plan">
|
|
94
94
|
{formatMessage({
|
|
95
95
|
id: 'app.components.UpgradePlanModal.limit-reached',
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
useTracking,
|
|
7
7
|
useNotification,
|
|
8
8
|
useQueryParams,
|
|
9
|
-
|
|
9
|
+
formatContentTypeData,
|
|
10
10
|
contentManagementUtilRemoveFieldsFromData,
|
|
11
11
|
useGuidedTour,
|
|
12
12
|
} from '@strapi/helper-plugin';
|
|
@@ -88,7 +88,7 @@ const CollectionTypeFormWrapper = ({ allLayoutData, children, slug, id, origin }
|
|
|
88
88
|
allLayoutDataRef.current.components
|
|
89
89
|
);
|
|
90
90
|
|
|
91
|
-
return
|
|
91
|
+
return formatContentTypeData(
|
|
92
92
|
cleaned,
|
|
93
93
|
allLayoutDataRef.current.contentType,
|
|
94
94
|
allLayoutDataRef.current.components
|
|
@@ -103,7 +103,7 @@ const CollectionTypeFormWrapper = ({ allLayoutData, children, slug, id, origin }
|
|
|
103
103
|
allLayoutData.components
|
|
104
104
|
);
|
|
105
105
|
|
|
106
|
-
acc[current] =
|
|
106
|
+
acc[current] = formatContentTypeData(
|
|
107
107
|
defaultComponentForm,
|
|
108
108
|
allLayoutData.components[current],
|
|
109
109
|
allLayoutData.components
|
|
@@ -117,7 +117,7 @@ const CollectionTypeFormWrapper = ({ allLayoutData, children, slug, id, origin }
|
|
|
117
117
|
allLayoutData.components
|
|
118
118
|
);
|
|
119
119
|
|
|
120
|
-
const contentTypeDataStructureFormatted =
|
|
120
|
+
const contentTypeDataStructureFormatted = formatContentTypeData(
|
|
121
121
|
contentTypeDataStructure,
|
|
122
122
|
allLayoutData.contentType,
|
|
123
123
|
allLayoutData.components
|
|
@@ -39,7 +39,7 @@ const ComponentInitializer = ({ error, isReadOnly, onClick }) => {
|
|
|
39
39
|
paddingBottom={9}
|
|
40
40
|
type="button"
|
|
41
41
|
>
|
|
42
|
-
<Stack
|
|
42
|
+
<Stack spacing={2}>
|
|
43
43
|
<Flex justifyContent="center" style={{ cursor: isReadOnly ? 'not-allowed' : 'inherit' }}>
|
|
44
44
|
<IconWrapper>
|
|
45
45
|
<PlusCircle />
|
|
@@ -25,7 +25,7 @@ const ConfirmDialogDelete = ({ isConfirmButtonLoading, isOpen, onToggleDialog, o
|
|
|
25
25
|
isOpen={isOpen}
|
|
26
26
|
>
|
|
27
27
|
<DialogBody icon={<ExclamationMarkCircle />}>
|
|
28
|
-
<Stack
|
|
28
|
+
<Stack spacing={2}>
|
|
29
29
|
<Flex justifyContent="center">
|
|
30
30
|
<Typography id="confirm-description">
|
|
31
31
|
{formatMessage({
|
|
@@ -26,7 +26,7 @@ const ConfirmDialogDeleteAll = ({ isConfirmButtonLoading, isOpen, onToggleDialog
|
|
|
26
26
|
isOpen={isOpen}
|
|
27
27
|
>
|
|
28
28
|
<DialogBody icon={<ExclamationMarkCircle />}>
|
|
29
|
-
<Stack
|
|
29
|
+
<Stack spacing={2}>
|
|
30
30
|
<Flex justifyContent="center">
|
|
31
31
|
<Typography id="confirm-description">
|
|
32
32
|
{formatMessage({
|
|
@@ -111,11 +111,11 @@ const Component = ({
|
|
|
111
111
|
<Box>
|
|
112
112
|
<Rectangle />
|
|
113
113
|
<StyledBox hasRadius>
|
|
114
|
-
<Accordion expanded={isOpen}
|
|
114
|
+
<Accordion expanded={isOpen} onToggle={() => onToggle(index)} size="S" error={errorMessage}>
|
|
115
115
|
<AccordionToggle
|
|
116
116
|
startIcon={<FontAwesomeIcon icon={icon} />}
|
|
117
117
|
action={
|
|
118
|
-
<ActionStack horizontal
|
|
118
|
+
<ActionStack horizontal spacing={0} expanded={isOpen}>
|
|
119
119
|
{showDownIcon && (
|
|
120
120
|
<IconButtonCustom
|
|
121
121
|
noBorder
|
|
@@ -62,7 +62,7 @@ function ComponentCard({ componentUid, intlLabel, icon, onClick }) {
|
|
|
62
62
|
return (
|
|
63
63
|
<button type="button" onClick={handleClick}>
|
|
64
64
|
<ComponentBox borderRadius="borderRadius">
|
|
65
|
-
<Stack
|
|
65
|
+
<Stack spacing={1} style={{ justifyContent: 'center', alignItems: 'center' }}>
|
|
66
66
|
<StyledFontAwesomeIcon icon={icon} />
|
|
67
67
|
<Typography variant="pi" fontWeight="bold" textColor="neutral600">
|
|
68
68
|
{formatMessage(intlLabel)}
|
|
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { Accordion, AccordionToggle, AccordionContent } from '@strapi/design-system/Accordion';
|
|
4
4
|
import { Box } from '@strapi/design-system/Box';
|
|
5
5
|
import styled from 'styled-components';
|
|
6
|
+
import { useIntl } from 'react-intl';
|
|
6
7
|
import ComponentCard from './ComponentCard';
|
|
7
8
|
|
|
8
9
|
const Grid = styled.div`
|
|
@@ -12,15 +13,17 @@ const Grid = styled.div`
|
|
|
12
13
|
`;
|
|
13
14
|
|
|
14
15
|
const Category = ({ category, components, isOdd, isOpen, onAddComponent, onToggle }) => {
|
|
16
|
+
const { formatMessage } = useIntl();
|
|
17
|
+
|
|
15
18
|
const handleToggle = () => {
|
|
16
19
|
onToggle(category);
|
|
17
20
|
};
|
|
18
21
|
|
|
19
22
|
return (
|
|
20
|
-
<Accordion expanded={isOpen}
|
|
23
|
+
<Accordion expanded={isOpen} onToggle={handleToggle} size="S">
|
|
21
24
|
<AccordionToggle
|
|
22
25
|
variant={isOdd ? 'primary' : 'secondary'}
|
|
23
|
-
title={category}
|
|
26
|
+
title={formatMessage({ id: category, defaultMessage: category })}
|
|
24
27
|
togglePosition="left"
|
|
25
28
|
/>
|
|
26
29
|
<AccordionContent>
|
|
@@ -182,7 +182,7 @@ const DynamicZone = ({
|
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
return (
|
|
185
|
-
<Stack
|
|
185
|
+
<Stack spacing={6}>
|
|
186
186
|
{dynamicDisplayedComponentsLength > 0 && (
|
|
187
187
|
<Box>
|
|
188
188
|
<DzLabel
|
|
@@ -277,9 +277,6 @@ DynamicZone.propTypes = {
|
|
|
277
277
|
|
|
278
278
|
const Memoized = memo(DynamicZone, isEqual);
|
|
279
279
|
|
|
280
|
-
export default connect(
|
|
281
|
-
Memoized,
|
|
282
|
-
select
|
|
283
|
-
);
|
|
280
|
+
export default connect(Memoized, select);
|
|
284
281
|
|
|
285
282
|
export { DynamicZone };
|
|
@@ -18,12 +18,7 @@ const cleanData = (retrievedData, currentSchema, componentsSchema) => {
|
|
|
18
18
|
|
|
19
19
|
switch (attrType) {
|
|
20
20
|
case 'json':
|
|
21
|
-
|
|
22
|
-
cleanedData = JSON.parse(value);
|
|
23
|
-
} catch (err) {
|
|
24
|
-
cleanedData = value;
|
|
25
|
-
}
|
|
26
|
-
|
|
21
|
+
cleanedData = JSON.parse(value);
|
|
27
22
|
break;
|
|
28
23
|
// TODO
|
|
29
24
|
// case 'date':
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import get from 'lodash/get';
|
|
2
2
|
import isBoolean from 'lodash/isBoolean';
|
|
3
|
-
import isNumber from 'lodash/isNumber';
|
|
4
|
-
import isNull from 'lodash/isNull';
|
|
5
|
-
import isObject from 'lodash/isObject';
|
|
6
3
|
import isEmpty from 'lodash/isEmpty';
|
|
7
4
|
import isNaN from 'lodash/isNaN';
|
|
8
5
|
import toNumber from 'lodash/toNumber';
|
|
@@ -10,8 +7,6 @@ import toNumber from 'lodash/toNumber';
|
|
|
10
7
|
import * as yup from 'yup';
|
|
11
8
|
import { translatedErrors as errorsTrads } from '@strapi/helper-plugin';
|
|
12
9
|
|
|
13
|
-
import isValidJSONString from './isValidJSONString';
|
|
14
|
-
|
|
15
10
|
yup.addMethod(yup.mixed, 'defined', function() {
|
|
16
11
|
return this.test('defined', errorsTrads.required, value => value !== undefined);
|
|
17
12
|
});
|
|
@@ -223,10 +218,6 @@ const createYupSchemaAttribute = (type, validations, options) => {
|
|
|
223
218
|
return true;
|
|
224
219
|
}
|
|
225
220
|
|
|
226
|
-
if (isValidJSONString(value) || isNumber(value) || isNull(value) || isObject(value)) {
|
|
227
|
-
return true;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
221
|
try {
|
|
231
222
|
JSON.parse(value);
|
|
232
223
|
|
|
@@ -86,7 +86,7 @@ const FieldComponent = ({
|
|
|
86
86
|
/>
|
|
87
87
|
)}
|
|
88
88
|
</Flex>
|
|
89
|
-
<Stack
|
|
89
|
+
<Stack spacing={1}>
|
|
90
90
|
{!isRepeatable && !isInitialized && (
|
|
91
91
|
<ComponentInitializer
|
|
92
92
|
isReadOnly={isReadOnly}
|
|
@@ -159,7 +159,4 @@ FieldComponent.propTypes = {
|
|
|
159
159
|
|
|
160
160
|
const Memoized = memo(FieldComponent, isEqual);
|
|
161
161
|
|
|
162
|
-
export default connect(
|
|
163
|
-
Memoized,
|
|
164
|
-
select
|
|
165
|
-
);
|
|
162
|
+
export default connect(Memoized, select);
|
|
@@ -16,7 +16,6 @@ import Label from './Label';
|
|
|
16
16
|
import FieldWrapper from './FieldWrapper';
|
|
17
17
|
|
|
18
18
|
const WAIT = 600;
|
|
19
|
-
const stringify = JSON.stringify;
|
|
20
19
|
const DEFAULT_THEME = 'blackboard';
|
|
21
20
|
|
|
22
21
|
const loadCss = async () => {
|
|
@@ -80,9 +79,7 @@ class InputJSON extends React.Component {
|
|
|
80
79
|
try {
|
|
81
80
|
if (value === null) return this.codeMirror.setValue('');
|
|
82
81
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
return this.codeMirror.setValue(nextValue);
|
|
82
|
+
return this.codeMirror.setValue(value);
|
|
86
83
|
} catch (err) {
|
|
87
84
|
return this.setState({ error: true });
|
|
88
85
|
}
|
|
@@ -160,7 +157,7 @@ class InputJSON extends React.Component {
|
|
|
160
157
|
|
|
161
158
|
return (
|
|
162
159
|
<FieldWrapper name={this.props.name} hint={this.props.description} error={this.props.error}>
|
|
163
|
-
<Stack
|
|
160
|
+
<Stack spacing={1}>
|
|
164
161
|
<Label
|
|
165
162
|
intlLabel={this.props.intlLabel}
|
|
166
163
|
labelAction={this.props.labelAction}
|
|
@@ -28,7 +28,7 @@ const NonRepeatableComponent = ({ componentUid, isFromDynamicZone, isNested, nam
|
|
|
28
28
|
hasRadius={isNested}
|
|
29
29
|
borderColor={isNested ? 'neutral200' : ''}
|
|
30
30
|
>
|
|
31
|
-
<Stack
|
|
31
|
+
<Stack spacing={6}>
|
|
32
32
|
{fields.map((fieldRow, key) => {
|
|
33
33
|
return (
|
|
34
34
|
<Grid gap={4} key={key}>
|
package/admin/src/content-manager/components/RepeatableComponent/DraggedItem/DraggingSibling.js
CHANGED
|
@@ -37,7 +37,7 @@ const ToggleButton = styled(TextButton)`
|
|
|
37
37
|
const DraggingSibling = ({ displayedValue }) => {
|
|
38
38
|
return (
|
|
39
39
|
<SiblingWrapper>
|
|
40
|
-
<Stack horizontal
|
|
40
|
+
<Stack horizontal spacing={3} flex={1}>
|
|
41
41
|
<Flex
|
|
42
42
|
justifyContent="center"
|
|
43
43
|
borderRadius="50%"
|
|
@@ -57,7 +57,7 @@ const DraggingSibling = ({ displayedValue }) => {
|
|
|
57
57
|
</ToggleButton>
|
|
58
58
|
</Stack>
|
|
59
59
|
|
|
60
|
-
<Stack horizontal
|
|
60
|
+
<Stack horizontal spacing={0}>
|
|
61
61
|
<CustomIconButtonSibling noBorder onClick={() => {}} icon={<Trash />} />
|
|
62
62
|
<CustomIconButtonSibling icon={<Drag />} noBorder />
|
|
63
63
|
</Stack>
|
|
@@ -194,14 +194,14 @@ const DraggedItem = ({
|
|
|
194
194
|
error={accordionHasError}
|
|
195
195
|
hasErrorMessage={hasErrorMessage}
|
|
196
196
|
expanded={isOpen}
|
|
197
|
-
|
|
197
|
+
onToggle={onClickToggle}
|
|
198
198
|
id={componentFieldName}
|
|
199
199
|
size="S"
|
|
200
200
|
>
|
|
201
201
|
<AccordionToggle
|
|
202
202
|
action={
|
|
203
203
|
isReadOnly ? null : (
|
|
204
|
-
<Stack horizontal
|
|
204
|
+
<Stack horizontal spacing={0}>
|
|
205
205
|
<CustomIconButton
|
|
206
206
|
expanded={isOpen}
|
|
207
207
|
noBorder
|
|
@@ -238,7 +238,7 @@ const DraggedItem = ({
|
|
|
238
238
|
togglePosition="left"
|
|
239
239
|
/>
|
|
240
240
|
<AccordionContent>
|
|
241
|
-
<Stack background="neutral100" padding={6}
|
|
241
|
+
<Stack background="neutral100" padding={6} spacing={6}>
|
|
242
242
|
{fields.map((fieldRow, key) => {
|
|
243
243
|
return (
|
|
244
244
|
<Grid gap={4} key={key}>
|
|
@@ -318,9 +318,6 @@ DraggedItem.propTypes = {
|
|
|
318
318
|
|
|
319
319
|
const Memoized = memo(DraggedItem);
|
|
320
320
|
|
|
321
|
-
export default connect(
|
|
322
|
-
Memoized,
|
|
323
|
-
select
|
|
324
|
-
);
|
|
321
|
+
export default connect(Memoized, select);
|
|
325
322
|
|
|
326
323
|
export { DraggedItem };
|
|
@@ -39,7 +39,7 @@ function SelectMany({
|
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
return (
|
|
42
|
-
<Stack
|
|
42
|
+
<Stack spacing={1}>
|
|
43
43
|
<Select
|
|
44
44
|
components={components}
|
|
45
45
|
isDisabled={isDisabled}
|
|
@@ -76,7 +76,7 @@ function SelectMany({
|
|
|
76
76
|
value={[]}
|
|
77
77
|
/>
|
|
78
78
|
<Box paddingTop={3} style={{ overflow: 'auto' }}>
|
|
79
|
-
<Stack as="ul"
|
|
79
|
+
<Stack as="ul" spacing={4} style={{ maxHeight: '128px', overflowX: 'hidden' }}>
|
|
80
80
|
{value?.map((data, index) => {
|
|
81
81
|
return (
|
|
82
82
|
<ListItem
|
|
@@ -280,7 +280,7 @@ function SelectWrapper({
|
|
|
280
280
|
const styles = getSelectStyles(theme);
|
|
281
281
|
|
|
282
282
|
return (
|
|
283
|
-
<Stack
|
|
283
|
+
<Stack spacing={1}>
|
|
284
284
|
<Label
|
|
285
285
|
intlLabel={intlLabel}
|
|
286
286
|
isSingle={isSingle}
|
|
@@ -368,7 +368,4 @@ SelectWrapper.propTypes = {
|
|
|
368
368
|
|
|
369
369
|
const Memoized = memo(SelectWrapper);
|
|
370
370
|
|
|
371
|
-
export default connect(
|
|
372
|
-
Memoized,
|
|
373
|
-
select
|
|
374
|
-
);
|
|
371
|
+
export default connect(Memoized, select);
|
|
@@ -3,7 +3,7 @@ import { useHistory } from 'react-router-dom';
|
|
|
3
3
|
import get from 'lodash/get';
|
|
4
4
|
import {
|
|
5
5
|
useTracking,
|
|
6
|
-
|
|
6
|
+
formatContentTypeData,
|
|
7
7
|
useQueryParams,
|
|
8
8
|
useNotification,
|
|
9
9
|
useGuidedTour,
|
|
@@ -55,7 +55,7 @@ const SingleTypeFormWrapper = ({ allLayoutData, children, slug }) => {
|
|
|
55
55
|
);
|
|
56
56
|
|
|
57
57
|
// This is needed in order to add a unique id for the repeatable components, in order to make the reorder easier
|
|
58
|
-
return
|
|
58
|
+
return formatContentTypeData(cleaned, allLayoutData.contentType, allLayoutData.components);
|
|
59
59
|
},
|
|
60
60
|
[allLayoutData]
|
|
61
61
|
);
|
|
@@ -73,7 +73,7 @@ const SingleTypeFormWrapper = ({ allLayoutData, children, slug }) => {
|
|
|
73
73
|
allLayoutData.components
|
|
74
74
|
);
|
|
75
75
|
|
|
76
|
-
acc[current] =
|
|
76
|
+
acc[current] = formatContentTypeData(
|
|
77
77
|
defaultComponentForm,
|
|
78
78
|
allLayoutData.components[current],
|
|
79
79
|
allLayoutData.components
|
|
@@ -86,7 +86,7 @@ const SingleTypeFormWrapper = ({ allLayoutData, children, slug }) => {
|
|
|
86
86
|
allLayoutData.contentType.attributes,
|
|
87
87
|
allLayoutData.components
|
|
88
88
|
);
|
|
89
|
-
const contentTypeDataStructureFormatted =
|
|
89
|
+
const contentTypeDataStructureFormatted = formatContentTypeData(
|
|
90
90
|
contentTypeDataStructure,
|
|
91
91
|
allLayoutData.contentType,
|
|
92
92
|
allLayoutData.components
|
|
@@ -11,7 +11,7 @@ import { Flex } from '@strapi/design-system/Flex';
|
|
|
11
11
|
import Bold from '@strapi/icons/Bold';
|
|
12
12
|
import Italic from '@strapi/icons/Italic';
|
|
13
13
|
import Underline from '@strapi/icons/Underline';
|
|
14
|
-
import
|
|
14
|
+
import StrikeThrough from '@strapi/icons/StrikeThrough';
|
|
15
15
|
import BulletList from '@strapi/icons/BulletList';
|
|
16
16
|
import NumberList from '@strapi/icons/NumberList';
|
|
17
17
|
import Code from '@strapi/icons/Code';
|
|
@@ -161,7 +161,7 @@ const WysiwygNav = ({
|
|
|
161
161
|
id="Strikethrough"
|
|
162
162
|
label="Strikethrough"
|
|
163
163
|
name="Strikethrough"
|
|
164
|
-
icon={<
|
|
164
|
+
icon={<StrikeThrough />}
|
|
165
165
|
/>
|
|
166
166
|
<CustomIconButton
|
|
167
167
|
onClick={() => onActionClick('BulletList', editorRef, handleTogglePopover)}
|
|
@@ -128,8 +128,8 @@ const Wysiwyg = ({
|
|
|
128
128
|
|
|
129
129
|
return (
|
|
130
130
|
<>
|
|
131
|
-
<Stack
|
|
132
|
-
<Stack horizontal
|
|
131
|
+
<Stack spacing={1}>
|
|
132
|
+
<Stack horizontal spacing={1}>
|
|
133
133
|
<Typography variant="pi" fontWeight="bold" textColor="neutral800">
|
|
134
134
|
{label}
|
|
135
135
|
{required && <TypographyAsterisk textColor="danger600">*</TypographyAsterisk>}
|
|
@@ -16,7 +16,7 @@ const DisplayedFields = ({ editLayout, editLayoutRemainingFields, onRemoveField,
|
|
|
16
16
|
const { formatMessage } = useIntl();
|
|
17
17
|
|
|
18
18
|
return (
|
|
19
|
-
<Stack
|
|
19
|
+
<Stack spacing={4}>
|
|
20
20
|
<Flex justifyContent="space-between">
|
|
21
21
|
<div>
|
|
22
22
|
<Box>
|
|
@@ -39,7 +39,7 @@ const DisplayedFields = ({ editLayout, editLayoutRemainingFields, onRemoveField,
|
|
|
39
39
|
<LinkToCTB />
|
|
40
40
|
</Flex>
|
|
41
41
|
<Box padding={4} hasRadius borderStyle="dashed" borderWidth="1px" borderColor="neutral300">
|
|
42
|
-
<Stack
|
|
42
|
+
<Stack spacing={2}>
|
|
43
43
|
{editLayout.map((row, index) => (
|
|
44
44
|
<RowsLayout key={row.rowId} row={row} rowIndex={index} onRemoveField={onRemoveField} />
|
|
45
45
|
))}
|
|
@@ -45,7 +45,7 @@ const DynamicZoneList = ({ components }) => {
|
|
|
45
45
|
const { componentLayouts } = useLayoutDnd();
|
|
46
46
|
|
|
47
47
|
return (
|
|
48
|
-
<Stack
|
|
48
|
+
<Stack spacing={2} horizontal overflow="scroll hidden" padding={3}>
|
|
49
49
|
{components.map(componentUid => (
|
|
50
50
|
<CustomLink
|
|
51
51
|
hasRadius
|
|
@@ -22,7 +22,7 @@ const RelationalFields = ({
|
|
|
22
22
|
const { setEditFieldToSelect, modifiedData, onMoveRelation } = useLayoutDnd();
|
|
23
23
|
|
|
24
24
|
return (
|
|
25
|
-
<Stack
|
|
25
|
+
<Stack spacing={4}>
|
|
26
26
|
<div>
|
|
27
27
|
<Box>
|
|
28
28
|
<Typography fontWeight="bold">
|
|
@@ -42,7 +42,7 @@ const RelationalFields = ({
|
|
|
42
42
|
</Box>
|
|
43
43
|
</div>
|
|
44
44
|
<Box padding={4} hasRadius borderStyle="dashed" borderWidth="1px" borderColor="neutral300">
|
|
45
|
-
<Stack
|
|
45
|
+
<Stack spacing={2}>
|
|
46
46
|
{relationsLayout.map((relationName, index) => {
|
|
47
47
|
const relationLabel = get(
|
|
48
48
|
modifiedData,
|
|
@@ -275,7 +275,7 @@ const EditSettingsView = ({ mainLayout, components, isContentTypeView, slug, upd
|
|
|
275
275
|
paddingLeft={7}
|
|
276
276
|
paddingRight={7}
|
|
277
277
|
>
|
|
278
|
-
<Stack
|
|
278
|
+
<Stack spacing={4}>
|
|
279
279
|
<Typography variant="delta" as="h2">
|
|
280
280
|
{formatMessage({
|
|
281
281
|
id: getTrad('containers.SettingPage.settings'),
|