@strapi/admin 4.6.0-alpha.1 → 4.6.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/admin/src/components/AuthenticatedApp/index.js +13 -2
- package/admin/src/components/GlobalStyle/index.js +0 -5
- package/admin/src/content-manager/components/ComponentIcon/ComponentIcon.js +49 -0
- package/admin/src/content-manager/components/ComponentIcon/index.js +1 -0
- package/admin/src/content-manager/components/ComponentInitializer/index.js +1 -7
- package/admin/src/content-manager/components/{RepeatableComponent/DragPreview.js → DragLayer/ComponentDragPreview.js} +10 -11
- package/admin/src/content-manager/components/DragLayer/RelationDragPreview.js +75 -0
- package/admin/src/content-manager/components/DragLayer/index.js +23 -7
- package/admin/src/content-manager/components/DynamicZone/components/ComponentCard.js +17 -31
- package/admin/src/content-manager/components/DynamicZone/components/ComponentCategory.js +2 -2
- package/admin/src/content-manager/components/DynamicZone/components/DynamicComponent.js +129 -85
- package/admin/src/content-manager/components/DynamicZone/index.js +99 -24
- package/admin/src/content-manager/components/DynamicZone/utils/select.js +9 -5
- package/admin/src/content-manager/components/EditViewDataManagerProvider/index.js +76 -14
- package/admin/src/content-manager/components/EditViewDataManagerProvider/reducer.js +42 -25
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/cleanData.js +24 -5
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/recursivelyFindPathsBasedOnCondition.js +8 -1
- package/admin/src/content-manager/components/InputJSON/FieldWrapper.js +10 -2
- package/admin/src/content-manager/components/InputJSON/Label.js +2 -18
- package/admin/src/content-manager/components/InputJSON/index.js +7 -3
- package/admin/src/content-manager/components/NonRepeatableComponent/index.js +4 -0
- package/admin/src/content-manager/components/RelationInput/RelationInput.js +205 -74
- package/admin/src/content-manager/components/RelationInput/components/RelationItem.js +136 -21
- package/admin/src/content-manager/components/RelationInput/components/RelationList.js +1 -2
- package/admin/src/content-manager/components/RelationInput/constants.js +1 -0
- package/admin/src/content-manager/components/RelationInput/index.js +1 -0
- package/admin/src/content-manager/components/RelationInputDataManager/RelationInputDataManager.js +132 -10
- package/admin/src/content-manager/components/RepeatableComponent/components/Accordion.js +77 -0
- package/admin/src/content-manager/components/RepeatableComponent/components/Component.js +262 -0
- package/admin/src/content-manager/components/RepeatableComponent/{DraggedItem → components}/Preview.js +0 -0
- package/admin/src/content-manager/components/RepeatableComponent/index.js +148 -90
- package/admin/src/content-manager/components/RepeatableComponent/utils/getComponentErrorKeys.js +1 -1
- package/admin/src/content-manager/components/SingleTypeFormWrapper/index.js +1 -1
- package/admin/src/content-manager/components/Wysiwyg/Editor.js +1 -1
- package/admin/src/content-manager/hooks/index.js +2 -0
- package/admin/src/content-manager/hooks/useDragAndDrop.js +134 -0
- package/admin/src/content-manager/hooks/useKeyboardDragAndDrop.js +98 -0
- package/admin/src/content-manager/hooks/useLazyComponents/index.js +40 -15
- package/admin/src/content-manager/pages/EditSettingsView/components/DynamicZoneList.js +18 -38
- package/admin/src/content-manager/sharedReducers/crudReducer/actions.js +5 -0
- package/admin/src/content-manager/sharedReducers/crudReducer/constants.js +2 -0
- package/admin/src/content-manager/sharedReducers/crudReducer/reducer.js +7 -0
- package/admin/src/content-manager/utils/ItemTypes.js +1 -1
- package/admin/src/content-manager/utils/composeRefs.js +28 -0
- package/admin/src/content-manager/utils/getMaxTempKey.js +1 -1
- package/admin/src/content-manager/utils/index.js +7 -0
- package/admin/src/core/utils/axiosInstance.js +4 -2
- package/admin/src/hooks/index.js +1 -0
- package/admin/src/hooks/useFetchClient/index.js +23 -0
- package/admin/src/hooks/useSettingsMenu/init.js +0 -7
- package/admin/src/pages/Admin/Onboarding/index.js +42 -44
- package/admin/src/pages/App/index.js +20 -13
- package/admin/src/pages/AuthPage/components/Register/index.js +1 -1
- package/admin/src/pages/AuthPage/components/ResetPassword/index.js +1 -1
- package/admin/src/pages/HomePage/SocialLinks.js +4 -4
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/index.js +2 -3
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/ModalForm/index.js +23 -18
- package/admin/src/pages/SettingsPage/utils/defaultRoutes.js +0 -11
- package/admin/src/permissions/defaultPermissions.js +0 -4
- package/admin/src/translations/en.json +8 -8
- package/admin/src/translations/sk.json +274 -52
- package/admin/src/translations/tr.json +485 -5
- package/admin/src/utils/fetchClient.js +45 -0
- package/admin/src/utils/getFetchClient.js +10 -0
- package/admin/src/utils/index.js +1 -0
- package/admin/src/utils/uniqueAdminHash.js +22 -0
- package/build/2235.06c13219.chunk.js +106 -0
- package/build/2598.962797b2.chunk.js +159 -0
- package/build/4318.0bbd3f4b.chunk.js +30 -0
- package/build/4958.7c118f5e.chunk.js +276 -0
- package/build/5052.712419ea.chunk.js +65 -0
- package/build/7295.04ac49dc.chunk.js +114 -0
- package/build/805.ddcead70.chunk.js +138 -0
- package/build/{8633.8da5488a.chunk.js → 8633.59223842.chunk.js} +1 -1
- package/build/874.bde3ea04.chunk.js +104 -0
- package/build/{1233.80b05d66.chunk.js → 9159.ac968e72.chunk.js} +67 -67
- package/build/9707.77e475ee.chunk.js +101 -0
- package/build/Admin-authenticatedApp.9dd415b8.chunk.js +72 -0
- package/build/{Admin_homePage.54e33c2d.chunk.js → Admin_homePage.8945f71a.chunk.js} +5 -5
- package/build/{Admin_marketplace.8219fda6.chunk.js → Admin_marketplace.ed754a4a.chunk.js} +1 -1
- package/build/Admin_pluginsPage.67728975.chunk.js +6 -0
- package/build/{Admin_profilePage.e9fcce92.chunk.js → Admin_profilePage.60ab80bb.chunk.js} +1 -1
- package/build/{Admin_settingsPage.d3f48e9e.chunk.js → Admin_settingsPage.9ce40fed.chunk.js} +15 -15
- package/build/Upload_ConfigureTheView.7cb2a3fd.chunk.js +1 -0
- package/build/admin-app.d8fc7c4d.chunk.js +112 -0
- package/build/admin-edit-roles-page.f407538c.chunk.js +1 -0
- package/build/admin-edit-users.5547b126.chunk.js +10 -0
- package/build/{admin-users.a0748674.chunk.js → admin-users.4b6b47f8.chunk.js} +2 -2
- package/build/api-tokens-create-page.dd4ddfcb.chunk.js +1 -0
- package/build/api-tokens-edit-page.821c5a6c.chunk.js +1 -0
- package/build/{api-tokens-list-page.700e575f.chunk.js → api-tokens-list-page.50519ed7.chunk.js} +1 -1
- package/build/content-manager.f2214e32.chunk.js +1166 -0
- package/build/content-type-builder-list-view.4aea46fa.chunk.js +198 -0
- package/build/content-type-builder-translation-de-json.a52482c7.chunk.js +1 -0
- package/build/content-type-builder-translation-dk-json.a8616510.chunk.js +1 -0
- package/build/content-type-builder-translation-en-json.1d9a3c14.chunk.js +1 -0
- package/build/content-type-builder-translation-es-json.c3ea46fb.chunk.js +1 -0
- package/build/content-type-builder-translation-ko-json.3fb7ddc8.chunk.js +1 -0
- package/build/content-type-builder-translation-pl-json.9b2993b2.chunk.js +1 -0
- package/build/content-type-builder-translation-pt-BR-json.6d255441.chunk.js +1 -0
- package/build/content-type-builder-translation-sv-json.c608b9ca.chunk.js +1 -0
- package/build/content-type-builder-translation-tr-json.949e22eb.chunk.js +1 -0
- package/build/content-type-builder-translation-zh-json.b79513e4.chunk.js +1 -0
- package/build/content-type-builder.8a9a77f9.chunk.js +127 -0
- package/build/email-settings-page.c6e62f6b.chunk.js +15 -0
- package/build/email-translation-tr-json.8aa034bb.chunk.js +1 -0
- package/build/en-json.1abdade9.chunk.js +1 -0
- package/build/{i18n-settings-page.195d42fe.chunk.js → i18n-settings-page.ee572037.chunk.js} +1 -1
- package/build/i18n-translation-tr-json.34ca9d61.chunk.js +1 -0
- package/build/index.html +1 -1
- package/build/main.91f6e21e.js +4099 -0
- package/build/runtime~main.447b0382.js +2 -0
- package/build/sk-json.2af48064.chunk.js +1 -0
- package/build/sso-settings-page.91924df1.chunk.js +41 -0
- package/build/tr-json.eac8bd79.chunk.js +1 -0
- package/build/upload-settings.326cd9fd.chunk.js +89 -0
- package/build/upload-translation-en-json.32cf9aff.chunk.js +1 -0
- package/build/upload-translation-sk-json.fe86c53b.chunk.js +1 -0
- package/build/upload-translation-tr-json.b173223a.chunk.js +1 -0
- package/build/upload.2977cb13.chunk.js +38 -0
- package/build/users-advanced-settings-page.0c0b8230.chunk.js +13 -0
- package/build/users-email-settings-page.18d4a475.chunk.js +28 -0
- package/build/{users-permissions-translation-dk-json.fe39c74b.chunk.js → users-permissions-translation-dk-json.bad0b786.chunk.js} +1 -1
- package/build/{users-permissions-translation-en-json.765abf48.chunk.js → users-permissions-translation-en-json.aeab388a.chunk.js} +1 -1
- package/build/{users-permissions-translation-es-json.1bb9cde2.chunk.js → users-permissions-translation-es-json.152a923f.chunk.js} +1 -1
- package/build/{users-permissions-translation-ko-json.3be77775.chunk.js → users-permissions-translation-ko-json.6bd0ae22.chunk.js} +1 -1
- package/build/{users-permissions-translation-pl-json.1dbdd4a1.chunk.js → users-permissions-translation-pl-json.c6a02992.chunk.js} +1 -1
- package/build/{users-permissions-translation-sv-json.d5d11648.chunk.js → users-permissions-translation-sv-json.370d6eee.chunk.js} +1 -1
- package/build/users-permissions-translation-tr-json.9bebc250.chunk.js +1 -0
- package/build/{users-permissions-translation-zh-json.92f406f9.chunk.js → users-permissions-translation-zh-json.1fea833f.chunk.js} +1 -1
- package/build/users-providers-settings-page.25dd858e.chunk.js +1 -0
- package/build/users-roles-settings-page.8482a999.chunk.js +30 -0
- package/build/{webhook-edit-page.14ad1e6e.chunk.js → webhook-edit-page.dcc3d145.chunk.js} +4 -4
- package/build/{webhook-list-page.b87821f2.chunk.js → webhook-list-page.894e6959.chunk.js} +1 -1
- package/ee/server/services/passport/provider-registry.js +1 -1
- package/package.json +16 -22
- package/server/controllers/admin.js +2 -0
- package/server/routes/admin.js +1 -1
- package/server/services/metrics.js +5 -2
- package/server/services/role.js +1 -0
- package/utils/get-plugins-path.js +17 -3
- package/webpack.alias.js +0 -2
- package/admin/src/content-manager/components/BackHeader/index.js +0 -8
- package/admin/src/content-manager/components/Block/components.js +0 -28
- package/admin/src/content-manager/components/Block/index.js +0 -43
- package/admin/src/content-manager/components/Container/index.js +0 -7
- package/admin/src/content-manager/components/CustomInputCheckbox/components.js +0 -77
- package/admin/src/content-manager/components/CustomInputCheckbox/index.js +0 -53
- package/admin/src/content-manager/components/DynamicComponentCard/Wrapper.js +0 -63
- package/admin/src/content-manager/components/FilterOptionsCTA/index.js +0 -14
- package/admin/src/content-manager/components/FormTitle/index.js +0 -22
- package/admin/src/content-manager/components/FormWrapper/index.js +0 -20
- package/admin/src/content-manager/components/InputJSON/FieldError.js +0 -38
- package/admin/src/content-manager/components/LayoutTitle/index.js +0 -19
- package/admin/src/content-manager/components/PlusButton/index.js +0 -52
- package/admin/src/content-manager/components/PreviewCarret/components.js +0 -27
- package/admin/src/content-manager/components/PreviewCarret/index.js +0 -22
- package/admin/src/content-manager/components/RepeatableComponent/AccordionGroupCustom/index.js +0 -122
- package/admin/src/content-manager/components/RepeatableComponent/AddFieldButton.js +0 -58
- package/admin/src/content-manager/components/RepeatableComponent/DraggedItem/DraggingSibling.js +0 -72
- package/admin/src/content-manager/components/RepeatableComponent/DraggedItem/IconButtonCustoms.js +0 -32
- package/admin/src/content-manager/components/RepeatableComponent/DraggedItem/index.js +0 -322
- package/admin/src/content-manager/components/RepeatableComponent/DraggedItem/utils/connect.js +0 -11
- package/admin/src/content-manager/components/RepeatableComponent/DraggedItem/utils/index.js +0 -2
- package/admin/src/content-manager/components/RepeatableComponent/DraggedItem/utils/select.js +0 -30
- package/admin/src/content-manager/components/RepeatableComponent/utils/connect.js +0 -11
- package/admin/src/content-manager/components/RepeatableComponent/utils/select.js +0 -12
- package/admin/src/content-manager/components/SectionTitle/Title.js +0 -11
- package/admin/src/content-manager/components/SectionTitle/index.js +0 -26
- package/admin/src/content-manager/hooks/__test__/usePrev.test.js +0 -26
- package/admin/src/pages/SettingsPage/pages/AuditLogs/ListView/DynamicTable/TableRows/CellValue.js +0 -19
- package/admin/src/pages/SettingsPage/pages/AuditLogs/ListView/DynamicTable/TableRows/index.js +0 -65
- package/admin/src/pages/SettingsPage/pages/AuditLogs/ListView/ModalDialog/ActionItem.js +0 -25
- package/admin/src/pages/SettingsPage/pages/AuditLogs/ListView/ModalDialog/index.js +0 -76
- package/admin/src/pages/SettingsPage/pages/AuditLogs/ListView/hooks/useFormatTimeStamp.js +0 -24
- package/admin/src/pages/SettingsPage/pages/AuditLogs/ListView/index.js +0 -84
- package/admin/src/pages/SettingsPage/pages/AuditLogs/ListView/utils/tableHeaders.js +0 -37
- package/admin/src/pages/SettingsPage/pages/AuditLogs/ProtectedListPage/index.js +0 -12
- package/build/1551f4f60c37af51121f.woff2 +0 -0
- package/build/1920.74a262e7.chunk.js +0 -245
- package/build/1e59d2330b4c6deb84b3.ttf +0 -0
- package/build/20fd1704ea223900efa9.woff2 +0 -0
- package/build/2285773e6b4b172f07d9.woff +0 -0
- package/build/23f19bb08961f37aaf69.eot +0 -0
- package/build/2438.61291207.chunk.js +0 -2183
- package/build/2517.9b4940f3.chunk.js +0 -117
- package/build/2f517e09eb2ca6650ff5.svg +0 -3717
- package/build/4306.f03c2b46.chunk.js +0 -98
- package/build/4318.7931eee7.chunk.js +0 -30
- package/build/4689f52cc96215721344.svg +0 -801
- package/build/491974d108fe4002b2aa.ttf +0 -0
- package/build/4986.3820d11d.chunk.js +0 -145
- package/build/504.9aeff724.chunk.js +0 -758
- package/build/527940b104eb2ea366c8.ttf +0 -0
- package/build/77206a6bb316fa0aded5.eot +0 -0
- package/build/7a3337626410ca2f4071.woff2 +0 -0
- package/build/7a8b4f130182d19a2d7c.svg +0 -5034
- package/build/805.e991a370.chunk.js +0 -138
- package/build/8b43027f47b20503057d.eot +0 -0
- package/build/9707.a0cc4ad8.chunk.js +0 -70
- package/build/9bbb245e67a133f6e486.eot +0 -0
- package/build/Admin-authenticatedApp.ac85652e.chunk.js +0 -80
- package/build/Admin_pluginsPage.3c872de7.chunk.js +0 -6
- package/build/admin-app.77179e07.chunk.js +0 -112
- package/build/admin-audit-logs.334ee871.chunk.js +0 -1
- package/build/admin-edit-roles-page.23f15909.chunk.js +0 -1
- package/build/admin-edit-users.283b49ed.chunk.js +0 -10
- package/build/api-tokens-create-page.93dd0689.chunk.js +0 -1
- package/build/api-tokens-edit-page.b0adac81.chunk.js +0 -1
- package/build/bb58e57c48a3e911f15f.woff +0 -0
- package/build/be9ee23c0c6390141475.ttf +0 -0
- package/build/c1e38fd9e0e74ba58f7a.svg +0 -2671
- package/build/content-manager.01e04e11.chunk.js +0 -1200
- package/build/content-type-builder-list-view.4412efc3.chunk.js +0 -201
- package/build/content-type-builder-translation-de-json.0d7696b9.chunk.js +0 -1
- package/build/content-type-builder-translation-dk-json.4729f055.chunk.js +0 -1
- package/build/content-type-builder-translation-en-json.f985c9c4.chunk.js +0 -1
- package/build/content-type-builder-translation-es-json.333cf47f.chunk.js +0 -1
- package/build/content-type-builder-translation-ko-json.51201b12.chunk.js +0 -1
- package/build/content-type-builder-translation-pl-json.4a42349b.chunk.js +0 -1
- package/build/content-type-builder-translation-pt-BR-json.6fe3b8d1.chunk.js +0 -1
- package/build/content-type-builder-translation-sv-json.6deff030.chunk.js +0 -1
- package/build/content-type-builder-translation-tr-json.2e52bc60.chunk.js +0 -1
- package/build/content-type-builder-translation-zh-json.3b0afd31.chunk.js +0 -1
- package/build/content-type-builder.aa4ec633.chunk.js +0 -145
- package/build/d878b0a6a1144760244f.woff2 +0 -0
- package/build/eeccf4f66002c6f2ba24.woff +0 -0
- package/build/email-settings-page.d44a57cb.chunk.js +0 -15
- package/build/email-translation-tr-json.87f2feb3.chunk.js +0 -1
- package/build/en-json.57917cb1.chunk.js +0 -1
- package/build/f691f37e57f04c152e23.woff +0 -0
- package/build/fontawesome-css-all.15068c6e.chunk.js +0 -4618
- package/build/fontawesome-css.418f40da.chunk.js +0 -6
- package/build/fontawesome-js.252cc5f3.chunk.js +0 -7
- package/build/main.f31112a5.js +0 -2034
- package/build/runtime~main.81f05721.js +0 -2
- package/build/sk-json.7ba4b330.chunk.js +0 -1
- package/build/sso-settings-page.9f091262.chunk.js +0 -1
- package/build/tr-json.9c44ea0c.chunk.js +0 -1
- package/build/upload-settings.450cab1a.chunk.js +0 -18
- package/build/upload-translation-en-json.86da7b0a.chunk.js +0 -1
- package/build/upload-translation-sk-json.b03d4904.chunk.js +0 -1
- package/build/upload.a73936d9.chunk.js +0 -64
- package/build/users-advanced-settings-page.dc23bc56.chunk.js +0 -13
- package/build/users-email-settings-page.6541d372.chunk.js +0 -28
- package/build/users-permissions-translation-tr-json.cdc49a3c.chunk.js +0 -1
- package/build/users-providers-settings-page.e11a2f64.chunk.js +0 -33
- package/build/users-roles-settings-page.445e5e16.chunk.js +0 -30
|
@@ -1,43 +1,31 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import get from 'lodash/get';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { Flex } from '@strapi/design-system/Flex';
|
|
5
|
-
import { Typography } from '@strapi/design-system/Typography';
|
|
6
|
-
import { Box } from '@strapi/design-system/Box';
|
|
7
|
-
import { Stack } from '@strapi/design-system/Stack';
|
|
8
|
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
9
2
|
import styled from 'styled-components';
|
|
10
3
|
import { Link } from 'react-router-dom';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import { Box, Flex, Typography, Stack } from '@strapi/design-system';
|
|
6
|
+
|
|
7
|
+
import { ComponentIcon } from '../../../components/ComponentIcon';
|
|
11
8
|
import useLayoutDnd from '../../../hooks/useLayoutDnd';
|
|
12
9
|
|
|
13
|
-
const CustomFlex = styled(Flex)`
|
|
14
|
-
border-radius: 50%;
|
|
15
|
-
svg {
|
|
16
|
-
& > * {
|
|
17
|
-
fill: ${({ theme }) => theme.colors.neutral500};
|
|
18
|
-
}
|
|
19
|
-
width: 12px;
|
|
20
|
-
height: 12px;
|
|
21
|
-
}
|
|
22
|
-
`;
|
|
23
10
|
const CustomLink = styled(Flex)`
|
|
24
11
|
text-decoration: none;
|
|
12
|
+
|
|
13
|
+
&:focus,
|
|
25
14
|
&:hover {
|
|
26
15
|
${({ theme }) => `
|
|
27
|
-
background: ${theme.colors.primary100};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
fill: ${theme.colors.primary600};
|
|
31
|
-
}
|
|
32
|
-
}
|
|
16
|
+
background-color: ${theme.colors.primary100};
|
|
17
|
+
border-color: ${theme.colors.primary200};
|
|
18
|
+
|
|
33
19
|
${Typography} {
|
|
34
20
|
color: ${theme.colors.primary600};
|
|
35
21
|
}
|
|
36
|
-
${CustomFlex} {
|
|
37
|
-
background: ${theme.colors.primary200};
|
|
38
|
-
}
|
|
39
|
-
border-color: ${theme.colors.primary200};
|
|
40
22
|
`}
|
|
23
|
+
|
|
24
|
+
/* > ComponentIcon */
|
|
25
|
+
> div:first-child {
|
|
26
|
+
background: ${({ theme }) => theme.colors.primary200};
|
|
27
|
+
color: ${({ theme }) => theme.colors.primary600};
|
|
28
|
+
}
|
|
41
29
|
}
|
|
42
30
|
`;
|
|
43
31
|
|
|
@@ -61,19 +49,11 @@ const DynamicZoneList = ({ components }) => {
|
|
|
61
49
|
as={Link}
|
|
62
50
|
to={`/content-manager/components/${componentUid}/configurations/edit`}
|
|
63
51
|
>
|
|
64
|
-
<
|
|
65
|
-
|
|
66
|
-
height={`${32 / 16}rem`}
|
|
67
|
-
background="neutral150"
|
|
68
|
-
justifyContent="center"
|
|
69
|
-
alignItems="center"
|
|
70
|
-
padding={2}
|
|
71
|
-
>
|
|
72
|
-
<FontAwesomeIcon icon={get(componentLayouts, [componentUid, 'info', 'icon'], '')} />
|
|
73
|
-
</CustomFlex>
|
|
52
|
+
<ComponentIcon />
|
|
53
|
+
|
|
74
54
|
<Box paddingTop={1}>
|
|
75
55
|
<Typography fontSize={1} textColor="neutral600" fontWeight="bold">
|
|
76
|
-
{
|
|
56
|
+
{componentLayouts?.[componentUid]?.info?.displayName ?? ''}
|
|
77
57
|
</Typography>
|
|
78
58
|
</Box>
|
|
79
59
|
</CustomLink>
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
SET_DATA_STRUCTURES,
|
|
7
7
|
SET_STATUS,
|
|
8
8
|
SUBMIT_SUCCEEDED,
|
|
9
|
+
CLEAR_SET_MODIFIED_DATA_ONLY,
|
|
9
10
|
} from './constants';
|
|
10
11
|
|
|
11
12
|
export const getData = () => {
|
|
@@ -42,3 +43,7 @@ export const submitSucceeded = (data) => ({
|
|
|
42
43
|
type: SUBMIT_SUCCEEDED,
|
|
43
44
|
data,
|
|
44
45
|
});
|
|
46
|
+
|
|
47
|
+
export const clearSetModifiedDataOnly = () => ({
|
|
48
|
+
type: CLEAR_SET_MODIFIED_DATA_ONLY,
|
|
49
|
+
});
|
|
@@ -5,3 +5,5 @@ export const RESET_PROPS = 'ContentManager/CrudReducer/RESET_PROPS';
|
|
|
5
5
|
export const SET_DATA_STRUCTURES = 'ContentManager/CrudReducer/SET_DATA_STRUCTURES';
|
|
6
6
|
export const SET_STATUS = 'ContentManager/CrudReducer/SET_STATUS';
|
|
7
7
|
export const SUBMIT_SUCCEEDED = 'ContentManager/CrudReducer/SUBMIT_SUCCEEDED';
|
|
8
|
+
export const CLEAR_SET_MODIFIED_DATA_ONLY =
|
|
9
|
+
'ContentManager/CrudReducer/CLEAR_SET_MODIFIED_DATA_ONLY';
|
|
@@ -8,6 +8,7 @@ import produce from 'immer';
|
|
|
8
8
|
// to do any of this.
|
|
9
9
|
|
|
10
10
|
import {
|
|
11
|
+
CLEAR_SET_MODIFIED_DATA_ONLY,
|
|
11
12
|
GET_DATA,
|
|
12
13
|
GET_DATA_SUCCEEDED,
|
|
13
14
|
INIT_FORM,
|
|
@@ -23,6 +24,7 @@ const crudInitialState = {
|
|
|
23
24
|
isLoading: true,
|
|
24
25
|
data: null,
|
|
25
26
|
status: 'resolved',
|
|
27
|
+
setModifiedDataOnly: false,
|
|
26
28
|
};
|
|
27
29
|
|
|
28
30
|
const crudReducer = (state = crudInitialState, action) =>
|
|
@@ -36,6 +38,7 @@ const crudReducer = (state = crudInitialState, action) =>
|
|
|
36
38
|
case GET_DATA_SUCCEEDED: {
|
|
37
39
|
draftState.isLoading = false;
|
|
38
40
|
draftState.data = action.data;
|
|
41
|
+
draftState.setModifiedDataOnly = action.setModifiedDataOnly ?? false;
|
|
39
42
|
break;
|
|
40
43
|
}
|
|
41
44
|
case INIT_FORM: {
|
|
@@ -66,6 +69,10 @@ const crudReducer = (state = crudInitialState, action) =>
|
|
|
66
69
|
draftState.data = action.data;
|
|
67
70
|
break;
|
|
68
71
|
}
|
|
72
|
+
case CLEAR_SET_MODIFIED_DATA_ONLY: {
|
|
73
|
+
draftState.setModifiedDataOnly = false;
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
69
76
|
default:
|
|
70
77
|
return draftState;
|
|
71
78
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef PossibleRef<T>
|
|
3
|
+
* @type {React.Ref<T> | undefined;}
|
|
4
|
+
*
|
|
5
|
+
* @typedef setRef
|
|
6
|
+
* @type {<T>(ref: PossibleRef<T>, value: T) => React.RefCallback<T>}
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @type {setRef}
|
|
11
|
+
*/
|
|
12
|
+
const setRef = (ref, value) => {
|
|
13
|
+
if (typeof ref === 'function') {
|
|
14
|
+
ref(value);
|
|
15
|
+
} else if (ref !== null && ref !== undefined) {
|
|
16
|
+
ref.current = value;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* A utility to compose multiple refs together
|
|
22
|
+
* Accepts callback refs and RefObject(s)
|
|
23
|
+
*
|
|
24
|
+
* @type {<T>(...refs: PossibleRef<T>[]) => (node: T) => void}
|
|
25
|
+
*/
|
|
26
|
+
export const composeRefs = (...refs) => {
|
|
27
|
+
return (node) => refs.forEach((ref) => setRef(ref, node));
|
|
28
|
+
};
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
export { default as arrayMoveItem } from './arrayMoveItem';
|
|
2
|
+
|
|
2
3
|
export { default as checkIfAttributeIsDisplayable } from './checkIfAttributeIsDisplayable';
|
|
4
|
+
export { composeRefs } from './composeRefs';
|
|
3
5
|
export { default as createDefaultForm } from './createDefaultForm';
|
|
6
|
+
|
|
4
7
|
export { default as formatLayoutToApi } from './formatLayoutToApi';
|
|
8
|
+
|
|
5
9
|
export { default as generatePermissionsObject } from './generatePermissionsObject';
|
|
6
10
|
export { default as getFieldName } from './getFieldName';
|
|
7
11
|
export { default as getMaxTempKey } from './getMaxTempKey';
|
|
8
12
|
export { default as getRequestUrl } from './getRequestUrl';
|
|
9
13
|
export { default as getTrad } from './getTrad';
|
|
14
|
+
|
|
10
15
|
export { default as ItemTypes } from './ItemTypes';
|
|
16
|
+
|
|
11
17
|
export { default as mergeMetasWithSchema } from './mergeMetasWithSchema';
|
|
18
|
+
|
|
12
19
|
export { default as removeKeyInObject } from './removeKeyInObject';
|
|
13
20
|
export { default as removePasswordFieldsFromData } from './removePasswordFieldsFromData';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
|
-
import { auth } from '@strapi/helper-plugin';
|
|
2
|
+
import { auth, wrapAxiosInstance } from '@strapi/helper-plugin';
|
|
3
3
|
|
|
4
4
|
const instance = axios.create({
|
|
5
5
|
baseURL: process.env.STRAPI_ADMIN_BACKEND_URL,
|
|
@@ -33,4 +33,6 @@ instance.interceptors.response.use(
|
|
|
33
33
|
}
|
|
34
34
|
);
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
const wrapper = wrapAxiosInstance(instance);
|
|
37
|
+
|
|
38
|
+
export default wrapper;
|
package/admin/src/hooks/index.js
CHANGED
|
@@ -10,3 +10,4 @@ export { default as usePermissionsDataManager } from './usePermissionsDataManage
|
|
|
10
10
|
export { default as useReleaseNotification } from './useReleaseNotification';
|
|
11
11
|
export { default as useThemeToggle } from './useThemeToggle';
|
|
12
12
|
export { default as useRegenerate } from './useRegenerate';
|
|
13
|
+
export { default as useFetchClient } from './useFetchClient';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
import { getFetchClient } from '../../utils/getFetchClient';
|
|
3
|
+
|
|
4
|
+
const useFetchClient = () => {
|
|
5
|
+
const controller = useRef(null);
|
|
6
|
+
|
|
7
|
+
if (controller.current === null) {
|
|
8
|
+
controller.current = new AbortController();
|
|
9
|
+
}
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
return () => {
|
|
12
|
+
controller.current.abort();
|
|
13
|
+
};
|
|
14
|
+
}, []);
|
|
15
|
+
|
|
16
|
+
const defaultOptions = {
|
|
17
|
+
signal: controller.current.signal,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return getFetchClient(defaultOptions);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default useFetchClient;
|
|
@@ -24,13 +24,6 @@ const init = (initialState, { settings, shouldUpdateStrapi }) => {
|
|
|
24
24
|
id: 'permissions',
|
|
25
25
|
intlLabel: { id: 'Settings.permissions', defaultMessage: 'Administration Panel' },
|
|
26
26
|
links: [
|
|
27
|
-
{
|
|
28
|
-
intlLabel: { id: 'global.auditLogs', defaultMessage: 'Audit Logs' },
|
|
29
|
-
to: '/settings/audit-logs',
|
|
30
|
-
id: 'auditLogs',
|
|
31
|
-
isDisplayed: false,
|
|
32
|
-
permissions: adminPermissions.settings.auditLogs.main,
|
|
33
|
-
},
|
|
34
27
|
{
|
|
35
28
|
intlLabel: { id: 'global.roles', defaultMessage: 'Roles' },
|
|
36
29
|
to: '/settings/roles',
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { useIntl } from 'react-intl';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
import { FocusTrap } from '@strapi/design-system/FocusTrap';
|
|
4
|
+
import { Box, Flex, FocusTrap, Typography, Icon, Stack } from '@strapi/design-system';
|
|
5
|
+
import { Book, Cross, Information, Question } from '@strapi/icons';
|
|
6
|
+
import { pxToRem } from '@strapi/helper-plugin';
|
|
7
|
+
|
|
9
8
|
import { useConfigurations } from '../../../hooks';
|
|
10
9
|
|
|
11
10
|
const OnboardingWrapper = styled(Box)`
|
|
@@ -14,52 +13,44 @@ const OnboardingWrapper = styled(Box)`
|
|
|
14
13
|
right: ${({ theme }) => theme.spaces[2]};
|
|
15
14
|
`;
|
|
16
15
|
|
|
17
|
-
const Button = styled
|
|
16
|
+
const Button = styled(Box)`
|
|
18
17
|
width: ${({ theme }) => theme.spaces[8]};
|
|
19
18
|
height: ${({ theme }) => theme.spaces[8]};
|
|
20
19
|
background: ${({ theme }) => theme.colors.primary600};
|
|
21
20
|
box-shadow: ${({ theme }) => theme.shadows.tableShadow};
|
|
22
21
|
border-radius: 50%;
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
|
|
23
|
+
svg path {
|
|
24
|
+
fill: ${({ theme }) => theme.colors.buttonNeutral0};
|
|
25
25
|
}
|
|
26
26
|
`;
|
|
27
27
|
|
|
28
28
|
const LinksWrapper = styled(Box)`
|
|
29
|
-
position: absolute;
|
|
30
29
|
bottom: ${({ theme }) => `${theme.spaces[9]}`};
|
|
30
|
+
min-width: ${200 / 16}rem;
|
|
31
|
+
position: absolute;
|
|
31
32
|
right: 0;
|
|
32
|
-
width: ${200 / 16}rem;
|
|
33
33
|
`;
|
|
34
34
|
|
|
35
|
-
const StyledLink = styled
|
|
36
|
-
display: flex;
|
|
37
|
-
align-items: center;
|
|
35
|
+
const StyledLink = styled(Flex)`
|
|
38
36
|
text-decoration: none;
|
|
39
|
-
padding: ${({ theme }) => theme.spaces[2]};
|
|
40
|
-
padding-left: ${({ theme }) => theme.spaces[5]};
|
|
41
37
|
|
|
42
|
-
svg {
|
|
43
|
-
|
|
44
|
-
margin-right: ${({ theme }) => theme.spaces[2]};
|
|
38
|
+
svg path {
|
|
39
|
+
fill: ${({ theme }) => theme.colors.neutral600};
|
|
45
40
|
}
|
|
46
41
|
|
|
42
|
+
&:focus,
|
|
47
43
|
&:hover {
|
|
48
44
|
background: ${({ theme }) => theme.colors.neutral100};
|
|
49
|
-
color: ${({ theme }) => theme.colors.neutral500};
|
|
50
45
|
|
|
51
|
-
svg {
|
|
52
|
-
|
|
46
|
+
svg path {
|
|
47
|
+
fill: ${({ theme }) => theme.colors.neutral700};
|
|
53
48
|
}
|
|
54
49
|
|
|
55
50
|
${[Typography]} {
|
|
56
51
|
color: ${({ theme }) => theme.colors.neutral700};
|
|
57
52
|
}
|
|
58
53
|
}
|
|
59
|
-
|
|
60
|
-
${[Typography]} {
|
|
61
|
-
color: ${({ theme }) => theme.colors.neutral600};
|
|
62
|
-
}
|
|
63
54
|
`;
|
|
64
55
|
|
|
65
56
|
const Onboarding = () => {
|
|
@@ -71,9 +62,9 @@ const Onboarding = () => {
|
|
|
71
62
|
return null;
|
|
72
63
|
}
|
|
73
64
|
|
|
74
|
-
const
|
|
65
|
+
const STATIC_LINKS = [
|
|
75
66
|
{
|
|
76
|
-
|
|
67
|
+
Icon: <Book />,
|
|
77
68
|
label: formatMessage({
|
|
78
69
|
id: 'global.documentation',
|
|
79
70
|
defaultMessage: 'Documentation',
|
|
@@ -81,7 +72,7 @@ const Onboarding = () => {
|
|
|
81
72
|
destination: 'https://docs.strapi.io',
|
|
82
73
|
},
|
|
83
74
|
{
|
|
84
|
-
|
|
75
|
+
Icon: <Information />,
|
|
85
76
|
label: formatMessage({ id: 'app.static.links.cheatsheet', defaultMessage: 'CheatSheet' }),
|
|
86
77
|
destination: 'https://strapi-showcase.s3-us-west-2.amazonaws.com/CheatSheet.pdf',
|
|
87
78
|
},
|
|
@@ -94,37 +85,44 @@ const Onboarding = () => {
|
|
|
94
85
|
return (
|
|
95
86
|
<OnboardingWrapper as="aside">
|
|
96
87
|
<Button
|
|
88
|
+
as="button"
|
|
97
89
|
id="onboarding"
|
|
98
|
-
aria-label={formatMessage(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
90
|
+
aria-label={formatMessage(
|
|
91
|
+
isOpen
|
|
92
|
+
? {
|
|
93
|
+
id: 'app.components.Onboarding.help.button-close',
|
|
94
|
+
defaultMessage: 'Close help menu',
|
|
95
|
+
}
|
|
96
|
+
: {
|
|
97
|
+
id: 'app.components.Onboarding.help.button',
|
|
98
|
+
defaultMessage: 'Open help menu',
|
|
99
|
+
}
|
|
100
|
+
)}
|
|
102
101
|
onClick={handleClick}
|
|
103
102
|
>
|
|
104
|
-
{
|
|
105
|
-
{isOpen && <FontAwesomeIcon icon={faTimes} />}
|
|
103
|
+
<Icon as={isOpen ? Cross : Question} height={pxToRem(16)} width={pxToRem(16)} />
|
|
106
104
|
</Button>
|
|
107
105
|
|
|
108
106
|
{/* FIX ME - replace with popover when overflow popover is fixed
|
|
109
107
|
+ when v4 mockups for onboarding component are ready */}
|
|
110
108
|
{isOpen && (
|
|
111
109
|
<FocusTrap onEscape={handleClick}>
|
|
112
|
-
<LinksWrapper
|
|
113
|
-
|
|
114
|
-
hasRadius
|
|
115
|
-
shadow="tableShadow"
|
|
116
|
-
paddingBottom={2}
|
|
117
|
-
paddingTop={2}
|
|
118
|
-
>
|
|
119
|
-
{staticLinks.map((link) => (
|
|
110
|
+
<LinksWrapper background="neutral0" hasRadius shadow="tableShadow" padding={2}>
|
|
111
|
+
{STATIC_LINKS.map((link) => (
|
|
120
112
|
<StyledLink
|
|
113
|
+
as="a"
|
|
121
114
|
key={link.label}
|
|
122
115
|
rel="nofollow noreferrer noopener"
|
|
123
116
|
target="_blank"
|
|
124
117
|
href={link.destination}
|
|
118
|
+
padding={2}
|
|
119
|
+
hasRadius
|
|
120
|
+
alignItems="center"
|
|
125
121
|
>
|
|
126
|
-
<
|
|
127
|
-
|
|
122
|
+
<Stack horizontal spacing={2}>
|
|
123
|
+
{link.Icon}
|
|
124
|
+
<Typography color="neutral600">{link.label}</Typography>
|
|
125
|
+
</Stack>
|
|
128
126
|
</StyledLink>
|
|
129
127
|
))}
|
|
130
128
|
</LinksWrapper>
|
|
@@ -25,7 +25,7 @@ import NotFoundPage from '../NotFoundPage';
|
|
|
25
25
|
import UseCasePage from '../UseCasePage';
|
|
26
26
|
import { getUID } from './utils';
|
|
27
27
|
import routes from './utils/routes';
|
|
28
|
-
import { useConfigurations } from '../../hooks';
|
|
28
|
+
import { useConfigurations, useFetchClient } from '../../hooks';
|
|
29
29
|
|
|
30
30
|
const AuthenticatedApp = lazy(() =>
|
|
31
31
|
import(/* webpackChunkName: "Admin-authenticatedApp" */ '../../components/AuthenticatedApp')
|
|
@@ -35,8 +35,12 @@ function App() {
|
|
|
35
35
|
const toggleNotification = useNotification();
|
|
36
36
|
const { updateProjectSettings } = useConfigurations();
|
|
37
37
|
const { formatMessage } = useIntl();
|
|
38
|
-
const [{ isLoading, hasAdmin, uuid }, setState] = useState({
|
|
38
|
+
const [{ isLoading, hasAdmin, uuid, deviceId }, setState] = useState({
|
|
39
|
+
isLoading: true,
|
|
40
|
+
hasAdmin: false,
|
|
41
|
+
});
|
|
39
42
|
const appInfo = useAppInfos();
|
|
43
|
+
const { get } = useFetchClient();
|
|
40
44
|
|
|
41
45
|
const authRoutes = useMemo(() => {
|
|
42
46
|
return makeUniqueRoutes(
|
|
@@ -80,27 +84,29 @@ function App() {
|
|
|
80
84
|
} = await axios.get(`${strapi.backendURL}/admin/init`);
|
|
81
85
|
|
|
82
86
|
updateProjectSettings({ menuLogo: prefixFileUrlWithBackendUrl(menuLogo) });
|
|
87
|
+
const deviceId = await getUID();
|
|
83
88
|
|
|
84
89
|
if (uuid) {
|
|
85
90
|
const {
|
|
86
91
|
data: { data: properties },
|
|
87
|
-
} = await
|
|
92
|
+
} = await get(`/admin/telemetry-properties`, {
|
|
93
|
+
// NOTE: needed because the interceptors of the fetchClient redirect to /login when receive a 401 and it would end up in an infinite loop when the user doesn't have a session.
|
|
94
|
+
validateStatus: (status) => status < 500,
|
|
95
|
+
});
|
|
88
96
|
|
|
89
97
|
setTelemetryProperties(properties);
|
|
90
98
|
|
|
91
99
|
try {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
await fetch('https://analytics.strapi.io/track', {
|
|
100
|
+
await fetch('https://analytics.strapi.io/api/v2/track', {
|
|
95
101
|
method: 'POST',
|
|
96
102
|
body: JSON.stringify({
|
|
103
|
+
// This event is anonymous
|
|
97
104
|
event: 'didInitializeAdministration',
|
|
98
|
-
|
|
105
|
+
userId: '',
|
|
99
106
|
deviceId,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
},
|
|
107
|
+
eventPropeties: {},
|
|
108
|
+
userProperties: { environment: appInfo.currentEnvironment },
|
|
109
|
+
groupProperties: { ...properties, projectId: uuid },
|
|
104
110
|
}),
|
|
105
111
|
headers: {
|
|
106
112
|
'Content-Type': 'application/json',
|
|
@@ -111,7 +117,7 @@ function App() {
|
|
|
111
117
|
}
|
|
112
118
|
}
|
|
113
119
|
|
|
114
|
-
setState({ isLoading: false, hasAdmin, uuid });
|
|
120
|
+
setState({ isLoading: false, hasAdmin, uuid, deviceId });
|
|
115
121
|
} catch (err) {
|
|
116
122
|
toggleNotification({
|
|
117
123
|
type: 'warning',
|
|
@@ -130,8 +136,9 @@ function App() {
|
|
|
130
136
|
() => ({
|
|
131
137
|
uuid,
|
|
132
138
|
telemetryProperties,
|
|
139
|
+
deviceId,
|
|
133
140
|
}),
|
|
134
|
-
[uuid, telemetryProperties]
|
|
141
|
+
[uuid, telemetryProperties, deviceId]
|
|
135
142
|
);
|
|
136
143
|
|
|
137
144
|
if (isLoading) {
|
|
@@ -268,7 +268,7 @@ const Register = ({ authType, fieldsToDisable, noSignin, onSubmit, schema }) =>
|
|
|
268
268
|
required
|
|
269
269
|
label={formatMessage({
|
|
270
270
|
id: 'Auth.form.confirmPassword.label',
|
|
271
|
-
defaultMessage: '
|
|
271
|
+
defaultMessage: 'Confirm Password',
|
|
272
272
|
})}
|
|
273
273
|
type={confirmPasswordShown ? 'text' : 'password'}
|
|
274
274
|
/>
|
|
@@ -154,7 +154,7 @@ const ForgotPassword = ({ onSubmit, schema }) => {
|
|
|
154
154
|
required
|
|
155
155
|
label={formatMessage({
|
|
156
156
|
id: 'Auth.form.confirmPassword.label',
|
|
157
|
-
defaultMessage: '
|
|
157
|
+
defaultMessage: 'Confirm Password',
|
|
158
158
|
})}
|
|
159
159
|
type={confirmPasswordShown ? 'text' : 'password'}
|
|
160
160
|
/>
|
|
@@ -33,13 +33,13 @@ const StyledReddit = styled(Reddit)`
|
|
|
33
33
|
`;
|
|
34
34
|
const StyledStrapi = styled(Strapi)`
|
|
35
35
|
> path:first-child {
|
|
36
|
-
fill: #
|
|
36
|
+
fill: #4945ff;
|
|
37
37
|
}
|
|
38
38
|
> path:nth-child(2) {
|
|
39
|
-
fill: #
|
|
39
|
+
fill: #fff;
|
|
40
40
|
}
|
|
41
|
-
> path:nth-child(
|
|
42
|
-
fill: #
|
|
41
|
+
> path:nth-child(4) {
|
|
42
|
+
fill: #9593ff;
|
|
43
43
|
}
|
|
44
44
|
`;
|
|
45
45
|
|
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
} from '@strapi/helper-plugin';
|
|
13
13
|
import { Main } from '@strapi/design-system/Main';
|
|
14
14
|
import { Formik } from 'formik';
|
|
15
|
-
import { get } from 'lodash';
|
|
16
15
|
import { useRouteMatch, useHistory } from 'react-router-dom';
|
|
17
16
|
import { useQuery } from 'react-query';
|
|
18
17
|
import { formatAPIErrors } from '../../../../../utils';
|
|
@@ -205,12 +204,12 @@ const ApiTokenCreateView = () => {
|
|
|
205
204
|
if (err?.response?.data?.error?.message === MSG_ERROR_NAME_TAKEN) {
|
|
206
205
|
toggleNotification({
|
|
207
206
|
type: 'warning',
|
|
208
|
-
message:
|
|
207
|
+
message: err.response.data.message || 'notification.error.tokennamenotunique',
|
|
209
208
|
});
|
|
210
209
|
} else {
|
|
211
210
|
toggleNotification({
|
|
212
211
|
type: 'warning',
|
|
213
|
-
message:
|
|
212
|
+
message: err?.response?.data?.message || 'notification.error',
|
|
214
213
|
});
|
|
215
214
|
}
|
|
216
215
|
unlockApp();
|
|
@@ -34,27 +34,32 @@ const ModalForm = ({ queryName, onToggle }) => {
|
|
|
34
34
|
const { formatMessage } = useIntl();
|
|
35
35
|
const toggleNotification = useNotification();
|
|
36
36
|
const { lockApp, unlockApp } = useOverlayBlocker();
|
|
37
|
-
const postMutation = useMutation(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
await queryClient.invalidateQueries(queryName);
|
|
41
|
-
goNext();
|
|
42
|
-
setIsSubmitting(false);
|
|
37
|
+
const postMutation = useMutation(
|
|
38
|
+
(body) => {
|
|
39
|
+
return axiosInstance.post('/admin/users', body);
|
|
43
40
|
},
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
{
|
|
42
|
+
async onSuccess({ data }) {
|
|
43
|
+
setRegistrationToken(data.data.registrationToken);
|
|
44
|
+
await queryClient.invalidateQueries(queryName);
|
|
45
|
+
goNext();
|
|
46
|
+
setIsSubmitting(false);
|
|
47
|
+
},
|
|
48
|
+
onError(err) {
|
|
49
|
+
setIsSubmitting(false);
|
|
46
50
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
toggleNotification({
|
|
52
|
+
type: 'warning',
|
|
53
|
+
message: { id: 'notification.error', defaultMessage: 'An error occured' },
|
|
54
|
+
});
|
|
51
55
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
throw err;
|
|
57
|
+
},
|
|
58
|
+
onSettled() {
|
|
59
|
+
unlockApp();
|
|
60
|
+
},
|
|
61
|
+
}
|
|
62
|
+
);
|
|
58
63
|
|
|
59
64
|
const headerTitle = formatMessage({
|
|
60
65
|
id: 'Settings.permissions.users.create',
|
|
@@ -57,17 +57,6 @@ const defaultRoutes = [
|
|
|
57
57
|
to: '/settings/users/:id',
|
|
58
58
|
exact: true,
|
|
59
59
|
},
|
|
60
|
-
{
|
|
61
|
-
async Component() {
|
|
62
|
-
const component = await import(
|
|
63
|
-
/* webpackChunkName: "admin-audit-logs" */ '../pages/AuditLogs/ProtectedListPage'
|
|
64
|
-
);
|
|
65
|
-
|
|
66
|
-
return component;
|
|
67
|
-
},
|
|
68
|
-
to: '/settings/audit-logs',
|
|
69
|
-
exact: true,
|
|
70
|
-
},
|
|
71
60
|
{
|
|
72
61
|
async Component() {
|
|
73
62
|
const component = await import(
|
|
@@ -34,10 +34,6 @@ const permissions = {
|
|
|
34
34
|
uninstall: [{ action: 'admin::marketplace.plugins.uninstall', subject: null }],
|
|
35
35
|
},
|
|
36
36
|
settings: {
|
|
37
|
-
auditLogs: {
|
|
38
|
-
// Note:update to admin::auditLogs permissions when set in BE
|
|
39
|
-
main: [{ action: 'admin::roles.create', subject: null }],
|
|
40
|
-
},
|
|
41
37
|
roles: {
|
|
42
38
|
main: [
|
|
43
39
|
{ action: 'admin::roles.create', subject: null },
|