@strapi/admin 4.0.0-beta.13 → 4.0.0-beta.17
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 +2 -1
- package/admin/src/components/AutoReloadOverlayBlockerProvider/Blocker.js +3 -2
- package/admin/src/components/LeftMenu/index.js +5 -5
- package/admin/src/components/{UpgradePlanModal /index.js → UpgradePlanModal/index.js} +7 -11
- package/admin/src/content-manager/components/ComponentInitializer/index.js +5 -5
- package/admin/src/content-manager/components/DragLayer/index.js +3 -1
- package/admin/src/content-manager/components/DynamicTable/CellContent/Media/FileWrapper.js +4 -2
- package/admin/src/content-manager/components/DynamicTable/CellContent/Relation/PopoverContent.js +4 -4
- package/admin/src/content-manager/components/DynamicTable/CellContent/Relation/index.js +5 -5
- package/admin/src/content-manager/components/DynamicTable/CellContent/index.js +5 -5
- package/admin/src/content-manager/components/DynamicTable/ConfirmDialogDelete/index.js +3 -3
- package/admin/src/content-manager/components/DynamicTable/ConfirmDialogDeleteAll/index.js +3 -3
- package/admin/src/content-manager/components/DynamicTable/TableRows/index.js +2 -1
- package/admin/src/content-manager/components/DynamicZone/components/AddComponentButton/index.js +14 -6
- package/admin/src/content-manager/components/DynamicZone/components/Component/Rectangle.js +1 -1
- package/admin/src/content-manager/components/DynamicZone/components/Component/index.js +11 -2
- package/admin/src/content-manager/components/DynamicZone/components/ComponentPicker/Category/ComponentCard/index.js +4 -4
- package/admin/src/content-manager/components/DynamicZone/components/ComponentPicker/Category/index.js +1 -1
- package/admin/src/content-manager/components/DynamicZone/components/ComponentPicker/index.js +3 -3
- package/admin/src/content-manager/components/DynamicZone/components/DzLabel/index.js +10 -3
- package/admin/src/content-manager/components/EditViewDataManagerProvider/index.js +3 -1
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/schema.js +20 -20
- package/admin/src/content-manager/components/FieldComponent/Label.js +10 -4
- package/admin/src/content-manager/components/{InputJSON/Hint.js → Hint/index.js} +3 -3
- package/admin/src/content-manager/components/InputJSON/FieldError.js +9 -3
- package/admin/src/content-manager/components/InputJSON/Label.js +9 -3
- package/admin/src/content-manager/components/InputJSON/index.js +1 -1
- package/admin/src/content-manager/components/InputUID/index.js +7 -7
- package/admin/src/content-manager/components/Inputs/index.js +10 -4
- package/admin/src/content-manager/components/RepeatableComponent/AccordionGroupCustom/index.js +11 -3
- package/admin/src/content-manager/components/RepeatableComponent/AddFieldButton.js +3 -3
- package/admin/src/content-manager/components/RepeatableComponent/DragPreview.js +12 -7
- package/admin/src/content-manager/components/RepeatableComponent/DraggedItem/DraggingSibling.js +3 -3
- package/admin/src/content-manager/components/RepeatableComponent/index.js +1 -1
- package/admin/src/content-manager/components/SelectMany/ListItem.js +2 -2
- package/admin/src/content-manager/components/SelectMany/index.js +11 -2
- package/admin/src/content-manager/components/SelectOne/SingleValue.js +2 -2
- package/admin/src/content-manager/components/SelectOne/index.js +34 -21
- package/admin/src/content-manager/components/SelectWrapper/Label.js +9 -3
- package/admin/src/content-manager/components/SelectWrapper/Option.js +2 -2
- package/admin/src/content-manager/components/SelectWrapper/index.js +4 -7
- package/admin/src/content-manager/components/State/index.js +3 -3
- package/admin/src/content-manager/components/Wysiwyg/Editor.js +3 -2
- package/admin/src/content-manager/components/Wysiwyg/EditorLayout.js +3 -3
- package/admin/src/content-manager/components/Wysiwyg/EditorStylesContainer.js +5 -2
- package/admin/src/content-manager/components/Wysiwyg/WysiwygFooter.js +3 -3
- package/admin/src/content-manager/components/Wysiwyg/index.js +5 -12
- package/admin/src/content-manager/pages/EditSettingsView/components/ComponentFieldList.js +2 -2
- package/admin/src/content-manager/pages/EditSettingsView/components/DisplayedFieldButton.js +393 -0
- package/admin/src/content-manager/pages/EditSettingsView/components/DisplayedFields.js +12 -41
- package/admin/src/content-manager/pages/EditSettingsView/components/FieldButtonContent.js +84 -0
- package/admin/src/content-manager/pages/EditSettingsView/components/FormModal.js +3 -3
- package/admin/src/content-manager/pages/EditSettingsView/components/RelationalFieldButton.js +135 -0
- package/admin/src/content-manager/pages/EditSettingsView/components/RelationalFields.js +14 -12
- package/admin/src/content-manager/pages/EditSettingsView/components/RowItemsLayout.js +39 -0
- package/admin/src/content-manager/pages/EditSettingsView/components/RowsLayout.js +32 -0
- package/admin/src/content-manager/pages/EditSettingsView/index.js +56 -5
- package/admin/src/content-manager/pages/EditView/DraftAndPublishBadge/index.js +5 -5
- package/admin/src/content-manager/pages/EditView/Header/index.js +10 -10
- package/admin/src/content-manager/pages/EditView/Informations/index.js +11 -10
- package/admin/src/content-manager/pages/EditView/index.js +7 -8
- package/admin/src/content-manager/pages/ListSettingsView/components/CardPreview.js +3 -3
- package/admin/src/content-manager/pages/ListSettingsView/components/DraggableCard.js +3 -3
- package/admin/src/content-manager/pages/ListSettingsView/components/EditFieldForm.js +3 -3
- package/admin/src/content-manager/pages/ListSettingsView/components/Settings.js +3 -3
- package/admin/src/content-manager/pages/ListSettingsView/components/SortDisplayedFields.js +3 -3
- package/admin/src/content-manager/pages/ListView/PaginationFooter/index.js +1 -1
- package/admin/src/content-manager/pages/ListView/index.js +4 -0
- package/admin/src/index.js +1 -0
- package/admin/src/pages/Admin/Onboarding/index.js +4 -4
- package/admin/src/pages/AuthPage/components/ForgotPassword/index.js +10 -5
- package/admin/src/pages/AuthPage/components/ForgotPasswordSuccess/index.js +7 -7
- package/admin/src/pages/AuthPage/components/Login/BaseLogin.js +12 -7
- package/admin/src/pages/AuthPage/components/Oops/index.js +6 -6
- package/admin/src/pages/AuthPage/components/Register/index.js +5 -14
- package/admin/src/pages/AuthPage/components/ResetPassword/index.js +10 -5
- package/admin/src/pages/AuthPage/utils/forms.js +2 -2
- package/admin/src/pages/HomePage/HomeHeader.js +5 -5
- package/admin/src/pages/HomePage/SocialLinks.js +5 -9
- package/admin/src/pages/InstalledPluginsPage/Plugins.js +111 -0
- package/admin/src/pages/InstalledPluginsPage/index.js +4 -25
- package/admin/src/pages/InstalledPluginsPage/utils/api.js +11 -0
- package/admin/src/pages/ProfilePage/index.js +10 -9
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/ContentBox/index.js +5 -2
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/index.js +13 -1
- package/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/DynamicTable/DeleteButton/index.js +6 -2
- package/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/DynamicTable/index.js +12 -2
- package/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/index.js +7 -0
- package/admin/src/pages/SettingsPage/pages/Roles/ListPage/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Users/EditPage/index.js +3 -3
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/DynamicTable/TableRows/index.js +4 -3
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/ModalForm/index.js +2 -0
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/ModalForm/utils/schema.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/PaginationFooter/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Users/utils/validations/users/edit.js +2 -2
- package/admin/src/pages/SettingsPage/pages/Users/utils/validations/users/profile.js +6 -2
- package/admin/src/pages/SettingsPage/pages/Webhooks/ListView/index.js +0 -1
- package/admin/src/plugins.js +14 -18
- package/admin/src/translations/en.json +1 -0
- package/admin/src/utils/getFullName.js +9 -0
- package/admin/src/utils/index.js +1 -1
- package/build/1024.1b15fbb5.chunk.js +1 -0
- package/build/1024.664cd4ee.chunk.js +1 -0
- package/build/1856.53d42ce5.chunk.js +1 -0
- package/build/1856.e06c9787.chunk.js +1 -0
- package/build/2912.591ddc96.chunk.js +1 -0
- package/build/2912.b0ac46e0.chunk.js +1 -0
- package/build/3226.0dc582b2.chunk.js +2 -0
- package/build/3226.0dc582b2.chunk.js.LICENSE.txt +15 -0
- package/build/3226.e8fe1445.chunk.js +2 -0
- package/build/3226.e8fe1445.chunk.js.LICENSE.txt +15 -0
- package/build/3471.327fa7e3.chunk.js +2 -0
- package/build/3471.327fa7e3.chunk.js.LICENSE.txt +13 -0
- package/build/4064.2683bcce.chunk.js +1 -0
- package/build/4064.56677f11.chunk.js +1 -0
- package/build/4261.a08a535e.chunk.js +1 -0
- package/build/4261.b7b7ac00.chunk.js +1 -0
- package/build/4362.60f0937a.chunk.js +1 -0
- package/build/4362.aefff6ad.chunk.js +1 -0
- package/build/4362.fd69112c.chunk.js +1 -0
- package/build/4715.2f51454b.chunk.js +1 -0
- package/build/4715.35096dd7.chunk.js +1 -0
- package/build/4715.bb03cfd8.chunk.js +1 -0
- package/build/4741.1fb6ad6e.chunk.js +2 -0
- package/build/4741.1fb6ad6e.chunk.js.LICENSE.txt +9 -0
- package/build/4741.45afdeda.chunk.js +2 -0
- package/build/4741.45afdeda.chunk.js.LICENSE.txt +9 -0
- package/build/497.05fa226b.chunk.js +1 -0
- package/build/497.838781d7.chunk.js +1 -0
- package/build/4982.5031302b.chunk.js +1 -0
- package/build/4982.a7f87e6c.chunk.js +1 -0
- package/build/5881.4bf14a31.chunk.js +2 -0
- package/build/5881.4bf14a31.chunk.js.LICENSE.txt +4 -0
- package/build/5881.deb18c91.chunk.js +2 -0
- package/build/5881.deb18c91.chunk.js.LICENSE.txt +4 -0
- package/build/6250.11ba8b50.chunk.js +1 -0
- package/build/6250.50133e63.chunk.js +1 -0
- package/build/6250.785ba0da.chunk.js +1 -0
- package/build/6925.4767e761.chunk.js +2 -0
- package/build/6925.4767e761.chunk.js.LICENSE.txt +4 -0
- package/build/7841.736189f7.chunk.js +1 -0
- package/build/7841.cc8241a5.chunk.js +1 -0
- package/build/8447.32ee17be.chunk.js +2 -0
- package/build/8447.32ee17be.chunk.js.LICENSE.txt +22 -0
- package/build/8447.686f702c.chunk.js +2 -0
- package/build/8447.686f702c.chunk.js.LICENSE.txt +22 -0
- package/build/8469.8d819a3c.chunk.js +1 -0
- package/build/849.abcc3b07.chunk.js +1 -0
- package/build/849.fc26299c.chunk.js +1 -0
- package/build/9138.86a2c5ad.chunk.js +2 -0
- package/build/9138.86a2c5ad.chunk.js.LICENSE.txt +15 -0
- package/build/9238.9258f79b.chunk.js +1 -0
- package/build/9238.f112d6c9.chunk.js +1 -0
- package/build/9964.345994e8.chunk.js +2 -0
- package/build/9964.345994e8.chunk.js.LICENSE.txt +15 -0
- package/build/Admin-authenticatedApp.62e5ca51.chunk.js +1 -0
- package/build/Admin-authenticatedApp.7bdfbab4.chunk.js +1 -0
- package/build/Admin-authenticatedApp.7e29e95b.chunk.js +1 -0
- package/build/Admin-authenticatedApp.b1104a6a.chunk.js +1 -0
- package/build/Admin-authenticatedApp.bfdec496.chunk.js +1 -0
- package/build/Admin_homePage.31e37124.chunk.js +1 -0
- package/build/Admin_homePage.4398cf1a.chunk.js +1 -0
- package/build/Admin_marketplace.201373e2.chunk.js +1 -0
- package/build/Admin_pluginsPage.db5748e1.chunk.js +1 -0
- package/build/Admin_profilePage.3aa61921.chunk.js +1 -0
- package/build/Admin_profilePage.e941f627.chunk.js +1 -0
- package/build/Admin_profilePage.f9369a69.chunk.js +1 -0
- package/build/Admin_settingsPage.363ad01d.chunk.js +1 -0
- package/build/Admin_settingsPage.60a92e51.chunk.js +1 -0
- package/build/Admin_settingsPage.ea6de611.chunk.js +1 -0
- package/build/admin-edit-roles-page.e91bd9e5.chunk.js +1 -0
- package/build/admin-edit-users.110f6f05.chunk.js +1 -0
- package/build/admin-edit-users.bcdd2e4d.chunk.js +1 -0
- package/build/admin-users.640b6123.chunk.js +1 -0
- package/build/admin-users.a2d08780.chunk.js +1 -0
- package/build/admin-users.fcabe1ed.chunk.js +1 -0
- package/build/api-tokens-create-page.451be52c.chunk.js +1 -0
- package/build/api-tokens-create-page.57119445.chunk.js +1 -0
- package/build/api-tokens-create-page.ac4285ba.chunk.js +1 -0
- package/build/api-tokens-edit-page.7b419f29.chunk.js +1 -0
- package/build/api-tokens-edit-page.b1c3ef5c.chunk.js +1 -0
- package/build/api-tokens-edit-page.b8900ddd.chunk.js +1 -0
- package/build/api-tokens-list-page.b053ddcd.chunk.js +1 -0
- package/build/api-tokens-list-page.d451255e.chunk.js +1 -0
- package/build/codemirror-addon-lint.91580cda.chunk.js +1 -0
- package/build/codemirror-theme.4a209ed5.chunk.js +1 -0
- package/build/content-manager.08eae196.chunk.js +1 -0
- package/build/content-manager.196287ea.chunk.js +1 -0
- package/build/content-manager.473d2b84.chunk.js +1 -0
- package/build/content-manager.a6c34b64.chunk.js +1 -0
- package/build/content-manager.d09d2a3a.chunk.js +1 -0
- package/build/content-type-builder.0e689f6b.chunk.js +1 -0
- package/build/content-type-builder.2a6a7156.chunk.js +1 -0
- package/build/content-type-builder.e9231547.chunk.js +1 -0
- package/build/email-settings-page.8f0ee2a7.chunk.js +1 -0
- package/build/email-settings-page.b1048dc6.chunk.js +1 -0
- package/build/en-json.6282a00f.chunk.js +1 -0
- package/build/fontawesome-css-all.162c8569.chunk.js +1 -0
- package/build/fontawesome-css.b1736497.chunk.js +1 -0
- package/build/fontawesome-js.2639263c.chunk.js +2 -0
- package/build/fontawesome-js.2639263c.chunk.js.LICENSE.txt +4 -0
- package/build/i18n-settings-page.5fe86c22.chunk.js +1 -0
- package/build/i18n-settings-page.acc3a212.chunk.js +1 -0
- package/build/index.html +1 -1
- package/build/main.3414cc4f.js +2 -0
- package/build/main.3414cc4f.js.LICENSE.txt +91 -0
- package/build/main.e21a82f5.js +2 -0
- package/build/main.e21a82f5.js.LICENSE.txt +91 -0
- package/build/main.f425e7e8.js +2 -0
- package/build/main.f425e7e8.js.LICENSE.txt +91 -0
- package/build/main.fa2000bd.js +2 -0
- package/build/main.fa2000bd.js.LICENSE.txt +82 -0
- package/build/main.ff33c0c2.js +2 -0
- package/build/main.ff33c0c2.js.LICENSE.txt +91 -0
- package/build/runtime~main.0685316b.js +1 -0
- package/build/runtime~main.15acd133.js +1 -0
- package/build/runtime~main.3f600349.js +1 -0
- package/build/runtime~main.44db7ede.js +1 -0
- package/build/runtime~main.cc96a027.js +1 -0
- package/build/sso-settings-page.bd7a8fd7.chunk.js +1 -0
- package/build/upload-settings.4daf6206.chunk.js +1 -0
- package/build/upload-settings.7d40d236.chunk.js +1 -0
- package/build/upload.c11a292c.chunk.js +1 -0
- package/build/upload.e53f8430.chunk.js +1 -0
- package/build/users-advanced-settings-page.2dfeffe8.chunk.js +1 -0
- package/build/users-advanced-settings-page.669b059c.chunk.js +1 -0
- package/build/users-email-settings-page.a4e19b13.chunk.js +1 -0
- package/build/users-email-settings-page.b1d1f551.chunk.js +1 -0
- package/build/users-providers-settings-page.733a51ec.chunk.js +1 -0
- package/build/users-providers-settings-page.866ddeed.chunk.js +1 -0
- package/build/users-roles-settings-page.2f12885b.chunk.js +1 -0
- package/build/users-roles-settings-page.3629c123.chunk.js +1 -0
- package/build/users-roles-settings-page.9d5895d6.chunk.js +1 -0
- package/build/users-roles-settings-page.fafcbe29.chunk.js +1 -0
- package/build/webhook-edit-page.634e50da.chunk.js +1 -0
- package/build/webhook-edit-page.f4f6935d.chunk.js +1 -0
- package/build/webhook-list-page.aae66737.chunk.js +1 -0
- package/build/webhook-list-page.fc554fbe.chunk.js +1 -0
- package/ee/admin/pages/AuthPage/components/Login/index.js +3 -3
- package/ee/admin/pages/AuthPage/components/Providers/SSOProviders.js +2 -2
- package/ee/admin/pages/AuthPage/components/Providers/index.js +12 -6
- package/ee/admin/pages/SettingsPage/SingleSignOn/index.js +119 -115
- package/ee/admin/pages/SettingsPage/pages/Roles/CreatePage/index.js +5 -5
- package/ee/admin/pages/SettingsPage/pages/Roles/ListPage/index.js +7 -7
- package/ee/server/controllers/authentication/middlewares.js +1 -1
- package/package.json +10 -9
- package/scripts/build.js +13 -1
- package/scripts/create-dev-plugins-file.js +69 -0
- package/scripts/create-plugins-file.js +92 -0
- package/server/controllers/admin.js +8 -2
- package/server/services/content-type.js +4 -4
- package/server/services/permission/permissions-manager/sanitize.js +9 -2
- package/server/services/user.js +14 -0
- package/server/validation/authentication/register.js +2 -2
- package/server/validation/common-validators.js +1 -1
- package/server/validation/user.js +3 -3
- package/admin/src/content-manager/components/Inputs/ComingSoonInput.js +0 -72
- package/admin/src/content-manager/pages/EditSettingsView/components/FieldButton.js +0 -118
|
@@ -59,7 +59,7 @@ const forms = {
|
|
|
59
59
|
fieldsToOmit: ['userInfo.confirmPassword', 'userInfo.news', 'userInfo.email'],
|
|
60
60
|
schema: yup.object().shape({
|
|
61
61
|
firstname: yup.string().required(translatedErrors.required),
|
|
62
|
-
lastname: yup.string()
|
|
62
|
+
lastname: yup.string(),
|
|
63
63
|
password: yup
|
|
64
64
|
.string()
|
|
65
65
|
.min(8, translatedErrors.minLength)
|
|
@@ -83,7 +83,7 @@ const forms = {
|
|
|
83
83
|
fieldsToOmit: ['confirmPassword', 'news'],
|
|
84
84
|
schema: yup.object().shape({
|
|
85
85
|
firstname: yup.string().required(translatedErrors.required),
|
|
86
|
-
lastname: yup.string()
|
|
86
|
+
lastname: yup.string(),
|
|
87
87
|
password: yup
|
|
88
88
|
.string()
|
|
89
89
|
.min(8, translatedErrors.minLength)
|
|
@@ -2,14 +2,14 @@ import React from 'react';
|
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { useIntl } from 'react-intl';
|
|
5
|
-
import {
|
|
5
|
+
import { Typography } from '@strapi/design-system/Typography';
|
|
6
6
|
import { Link } from '@strapi/design-system/Link';
|
|
7
7
|
import { Stack } from '@strapi/design-system/Stack';
|
|
8
8
|
import { Box } from '@strapi/design-system/Box';
|
|
9
9
|
import { Button } from '@strapi/design-system/Button';
|
|
10
10
|
import ArrowRight from '@strapi/icons/ArrowRight';
|
|
11
11
|
|
|
12
|
-
const WordWrap = styled(
|
|
12
|
+
const WordWrap = styled(Typography)`
|
|
13
13
|
word-break: break-word;
|
|
14
14
|
`;
|
|
15
15
|
|
|
@@ -24,7 +24,7 @@ const HomeHeader = ({ hasCreatedContentType, onCreateCT }) => {
|
|
|
24
24
|
<div>
|
|
25
25
|
<Box paddingLeft={6} paddingBottom={10}>
|
|
26
26
|
<StackCustom size={5}>
|
|
27
|
-
<
|
|
27
|
+
<Typography as="h1" variant="alpha">
|
|
28
28
|
{hasCreatedContentType
|
|
29
29
|
? formatMessage({
|
|
30
30
|
id: 'app.components.HomePage.welcome.again',
|
|
@@ -34,8 +34,8 @@ const HomeHeader = ({ hasCreatedContentType, onCreateCT }) => {
|
|
|
34
34
|
id: 'app.components.HomePage.welcome',
|
|
35
35
|
defaultMessage: 'Welcome on board!',
|
|
36
36
|
})}
|
|
37
|
-
</
|
|
38
|
-
<WordWrap textColor="neutral600">
|
|
37
|
+
</Typography>
|
|
38
|
+
<WordWrap textColor="neutral600" variant="epsilon">
|
|
39
39
|
{hasCreatedContentType
|
|
40
40
|
? formatMessage({
|
|
41
41
|
id: 'app.components.HomePage.welcomeBlock.content.again',
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import styled from 'styled-components';
|
|
8
8
|
import { useIntl } from 'react-intl';
|
|
9
|
-
import {
|
|
9
|
+
import { Typography } from '@strapi/design-system/Typography';
|
|
10
10
|
import { Box } from '@strapi/design-system/Box';
|
|
11
11
|
import { Stack } from '@strapi/design-system/Stack';
|
|
12
12
|
import { Grid, GridItem } from '@strapi/design-system/Grid';
|
|
@@ -138,10 +138,6 @@ const GridGap = styled(Grid)`
|
|
|
138
138
|
column-gap: ${({ theme }) => theme.spaces[4]};
|
|
139
139
|
`;
|
|
140
140
|
|
|
141
|
-
const WordWrap = styled(Text)`
|
|
142
|
-
word-break: break-word;
|
|
143
|
-
`;
|
|
144
|
-
|
|
145
141
|
const SocialLinks = () => {
|
|
146
142
|
const { formatMessage } = useIntl();
|
|
147
143
|
|
|
@@ -160,19 +156,19 @@ const SocialLinks = () => {
|
|
|
160
156
|
<Box paddingBottom={7}>
|
|
161
157
|
<Stack size={5}>
|
|
162
158
|
<Stack size={3}>
|
|
163
|
-
<
|
|
159
|
+
<Typography variant="delta" as="h2" id="join-the-community">
|
|
164
160
|
{formatMessage({
|
|
165
161
|
id: 'app.components.HomePage.community',
|
|
166
162
|
defaultMessage: 'Join the community',
|
|
167
163
|
})}
|
|
168
|
-
</
|
|
169
|
-
<
|
|
164
|
+
</Typography>
|
|
165
|
+
<Typography textColor="neutral600">
|
|
170
166
|
{formatMessage({
|
|
171
167
|
id: 'app.components.HomePage.community.content',
|
|
172
168
|
defaultMessage:
|
|
173
169
|
'Discuss with team members, contributors and developers on different channels',
|
|
174
170
|
})}
|
|
175
|
-
</
|
|
171
|
+
</Typography>
|
|
176
172
|
</Stack>
|
|
177
173
|
<Link
|
|
178
174
|
href="https://portal.productboard.com/strapi/1-roadmap/tabs/2-under-consideration"
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useQuery } from 'react-query';
|
|
3
|
+
import { useIntl } from 'react-intl';
|
|
4
|
+
import { LoadingIndicatorPage, useNotification, useFocusWhenNavigate } from '@strapi/helper-plugin';
|
|
5
|
+
import { Layout, HeaderLayout, ContentLayout } from '@strapi/design-system/Layout';
|
|
6
|
+
import { Main } from '@strapi/design-system/Main';
|
|
7
|
+
import { useNotifyAT } from '@strapi/design-system/LiveRegions';
|
|
8
|
+
import { Typography } from '@strapi/design-system/Typography';
|
|
9
|
+
import { Table, Thead, Tbody, Tr, Td, Th } from '@strapi/design-system/Table';
|
|
10
|
+
import { fetchPlugins } from './utils/api';
|
|
11
|
+
|
|
12
|
+
const Plugins = () => {
|
|
13
|
+
const { formatMessage } = useIntl();
|
|
14
|
+
useFocusWhenNavigate();
|
|
15
|
+
const { notifyStatus } = useNotifyAT();
|
|
16
|
+
const toggleNotification = useNotification();
|
|
17
|
+
|
|
18
|
+
const title = formatMessage({
|
|
19
|
+
id: 'app.components.ListPluginsPage.title',
|
|
20
|
+
defaultMessage: 'Plugins',
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const notifyLoad = () => {
|
|
24
|
+
notifyStatus(
|
|
25
|
+
formatMessage(
|
|
26
|
+
{
|
|
27
|
+
id: 'app.utils.notify.data-loaded',
|
|
28
|
+
defaultMessage: 'The {target} has loaded',
|
|
29
|
+
},
|
|
30
|
+
{ target: title }
|
|
31
|
+
)
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const { status, data } = useQuery('list-plugins', () => fetchPlugins(notifyLoad), {
|
|
36
|
+
onError: () => {
|
|
37
|
+
toggleNotification({
|
|
38
|
+
type: 'warning',
|
|
39
|
+
message: { id: 'notification.error', defaultMessage: 'An error occured' },
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
const isLoading = status !== 'success' && status !== 'error';
|
|
45
|
+
|
|
46
|
+
if (isLoading) {
|
|
47
|
+
return (
|
|
48
|
+
<Layout>
|
|
49
|
+
<Main aria-busy>
|
|
50
|
+
<LoadingIndicatorPage />
|
|
51
|
+
</Main>
|
|
52
|
+
</Layout>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<Layout>
|
|
58
|
+
<Main>
|
|
59
|
+
<HeaderLayout
|
|
60
|
+
title={title}
|
|
61
|
+
subtitle={formatMessage({
|
|
62
|
+
id: 'app.components.ListPluginsPage.description',
|
|
63
|
+
defaultMessage: 'List of the installed plugins in the project.',
|
|
64
|
+
})}
|
|
65
|
+
/>
|
|
66
|
+
<ContentLayout>
|
|
67
|
+
<Table colCount={2} rowCount={data?.plugins.length + 1}>
|
|
68
|
+
<Thead>
|
|
69
|
+
<Tr>
|
|
70
|
+
<Th>
|
|
71
|
+
<Typography variant="sigma" textColor="neutral600">
|
|
72
|
+
{formatMessage({
|
|
73
|
+
id: 'Settings.roles.list.header.name',
|
|
74
|
+
defaultMessage: 'Name',
|
|
75
|
+
})}
|
|
76
|
+
</Typography>
|
|
77
|
+
</Th>
|
|
78
|
+
<Th>
|
|
79
|
+
<Typography variant="sigma" textColor="neutral600">
|
|
80
|
+
{formatMessage({
|
|
81
|
+
id: 'Settings.roles.list.header.description',
|
|
82
|
+
defaultMessage: 'description',
|
|
83
|
+
})}
|
|
84
|
+
</Typography>
|
|
85
|
+
</Th>
|
|
86
|
+
</Tr>
|
|
87
|
+
</Thead>
|
|
88
|
+
<Tbody>
|
|
89
|
+
{data.plugins.map(({ name, displayName, description }) => {
|
|
90
|
+
return (
|
|
91
|
+
<Tr key={name}>
|
|
92
|
+
<Td>
|
|
93
|
+
<Typography textColor="neutral800" variant="omega" fontWeight="bold">
|
|
94
|
+
{displayName}
|
|
95
|
+
</Typography>
|
|
96
|
+
</Td>
|
|
97
|
+
<Td>
|
|
98
|
+
<Typography textColor="neutral800">{description}</Typography>
|
|
99
|
+
</Td>
|
|
100
|
+
</Tr>
|
|
101
|
+
);
|
|
102
|
+
})}
|
|
103
|
+
</Tbody>
|
|
104
|
+
</Table>
|
|
105
|
+
</ContentLayout>
|
|
106
|
+
</Main>
|
|
107
|
+
</Layout>
|
|
108
|
+
);
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export default Plugins;
|
|
@@ -1,34 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { CheckPagePermissions
|
|
3
|
-
|
|
4
|
-
import { Layout, HeaderLayout, ContentLayout } from '@strapi/design-system/Layout';
|
|
5
|
-
import { Main } from '@strapi/design-system/Main';
|
|
2
|
+
import { CheckPagePermissions } from '@strapi/helper-plugin';
|
|
3
|
+
|
|
6
4
|
import adminPermissions from '../../permissions';
|
|
5
|
+
import Plugins from './Plugins';
|
|
7
6
|
|
|
8
7
|
const InstalledPluginsPage = () => {
|
|
9
|
-
const { formatMessage } = useIntl();
|
|
10
|
-
|
|
11
8
|
return (
|
|
12
9
|
<CheckPagePermissions permissions={adminPermissions.marketplace.main}>
|
|
13
|
-
<
|
|
14
|
-
<Main>
|
|
15
|
-
<HeaderLayout
|
|
16
|
-
title={formatMessage({
|
|
17
|
-
id: 'app.components.ListPluginsPage.helmet.title',
|
|
18
|
-
defaultMessage: 'List plugins',
|
|
19
|
-
})}
|
|
20
|
-
/>
|
|
21
|
-
<ContentLayout>
|
|
22
|
-
<NoContent
|
|
23
|
-
content={{
|
|
24
|
-
id: 'coming.soon',
|
|
25
|
-
defaultMessage:
|
|
26
|
-
'This content is currently under construction and will be back in a few weeks!',
|
|
27
|
-
}}
|
|
28
|
-
/>
|
|
29
|
-
</ContentLayout>
|
|
30
|
-
</Main>
|
|
31
|
-
</Layout>
|
|
10
|
+
<Plugins />
|
|
32
11
|
</CheckPagePermissions>
|
|
33
12
|
);
|
|
34
13
|
};
|
|
@@ -17,7 +17,7 @@ import pick from 'lodash/pick';
|
|
|
17
17
|
import omit from 'lodash/omit';
|
|
18
18
|
import { Helmet } from 'react-helmet';
|
|
19
19
|
import { Main } from '@strapi/design-system/Main';
|
|
20
|
-
import {
|
|
20
|
+
import { Typography } from '@strapi/design-system/Typography';
|
|
21
21
|
import { Box } from '@strapi/design-system/Box';
|
|
22
22
|
import { ContentLayout, HeaderLayout } from '@strapi/design-system/Layout';
|
|
23
23
|
import { Button } from '@strapi/design-system/Button';
|
|
@@ -33,6 +33,7 @@ import Check from '@strapi/icons/Check';
|
|
|
33
33
|
import useLocalesProvider from '../../components/LocalesProvider/useLocalesProvider';
|
|
34
34
|
import { fetchUser, putUser } from './utils/api';
|
|
35
35
|
import schema from './utils/schema';
|
|
36
|
+
import { getFullName } from '../../utils';
|
|
36
37
|
|
|
37
38
|
const PasswordInput = styled(TextInput)`
|
|
38
39
|
::-ms-reveal {
|
|
@@ -87,7 +88,7 @@ const ProfilePage = () => {
|
|
|
87
88
|
await queryClient.invalidateQueries('user');
|
|
88
89
|
|
|
89
90
|
auth.setUserInfo(data);
|
|
90
|
-
const userDisplayName = data.username ||
|
|
91
|
+
const userDisplayName = data.username || getFullName(data.firstname, data.lastname);
|
|
91
92
|
setUserDisplayName(userDisplayName);
|
|
92
93
|
changeLocale(data.preferedLanguage);
|
|
93
94
|
|
|
@@ -172,7 +173,7 @@ const ProfilePage = () => {
|
|
|
172
173
|
return (
|
|
173
174
|
<Form>
|
|
174
175
|
<HeaderLayout
|
|
175
|
-
title={data.username ||
|
|
176
|
+
title={data.username || getFullName(data.firstname, data.lastname)}
|
|
176
177
|
primaryAction={
|
|
177
178
|
<Button startIcon={<Check />} loading={isSubmitting} type="submit">
|
|
178
179
|
{formatMessage({ id: 'form.button.save', defaultMessage: 'Save' })}
|
|
@@ -192,12 +193,12 @@ const ProfilePage = () => {
|
|
|
192
193
|
paddingRight={7}
|
|
193
194
|
>
|
|
194
195
|
<Stack size={4}>
|
|
195
|
-
<
|
|
196
|
+
<Typography variant="delta" as="h2">
|
|
196
197
|
{formatMessage({
|
|
197
198
|
id: 'Settings.profile.form.section.profile.title',
|
|
198
199
|
defaultMessage: 'Profile',
|
|
199
200
|
})}
|
|
200
|
-
</
|
|
201
|
+
</Typography>
|
|
201
202
|
<Grid gap={5}>
|
|
202
203
|
<GridItem s={12} col={6}>
|
|
203
204
|
<GenericInput
|
|
@@ -261,12 +262,12 @@ const ProfilePage = () => {
|
|
|
261
262
|
paddingRight={7}
|
|
262
263
|
>
|
|
263
264
|
<Stack size={4}>
|
|
264
|
-
<
|
|
265
|
+
<Typography variant="delta" as="h2">
|
|
265
266
|
{formatMessage({
|
|
266
267
|
id: 'Settings.profile.form.section.password.title',
|
|
267
268
|
defaultMessage: 'Change password',
|
|
268
269
|
})}
|
|
269
|
-
</
|
|
270
|
+
</Typography>
|
|
270
271
|
|
|
271
272
|
<Grid gap={5}>
|
|
272
273
|
<GridItem s={12} col={6}>
|
|
@@ -408,12 +409,12 @@ const ProfilePage = () => {
|
|
|
408
409
|
paddingRight={7}
|
|
409
410
|
>
|
|
410
411
|
<Stack size={4}>
|
|
411
|
-
<
|
|
412
|
+
<Typography variant="delta" as="h2">
|
|
412
413
|
{formatMessage({
|
|
413
414
|
id: 'Settings.profile.form.section.experience.title',
|
|
414
415
|
defaultMessage: 'Experience',
|
|
415
416
|
})}
|
|
416
|
-
</
|
|
417
|
+
</Typography>
|
|
417
418
|
<Grid gap={5}>
|
|
418
419
|
<GridItem s={12} col={6}>
|
|
419
420
|
<Select
|
package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/ContentBox/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useRef } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
|
-
import { ContentBox, useNotification } from '@strapi/helper-plugin';
|
|
3
|
+
import { ContentBox, useNotification, useTracking } from '@strapi/helper-plugin';
|
|
4
4
|
import { IconButton } from '@strapi/design-system/IconButton';
|
|
5
5
|
import Duplicate from '@strapi/icons/Duplicate';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
@@ -10,6 +10,8 @@ import Key from '@strapi/icons/Key';
|
|
|
10
10
|
const HeaderContentBox = ({ apiToken }) => {
|
|
11
11
|
const { formatMessage } = useIntl();
|
|
12
12
|
const toggleNotification = useNotification();
|
|
13
|
+
const { trackUsage } = useTracking();
|
|
14
|
+
const trackUsageRef = useRef(trackUsage);
|
|
13
15
|
|
|
14
16
|
return (
|
|
15
17
|
<ContentBox
|
|
@@ -18,6 +20,7 @@ const HeaderContentBox = ({ apiToken }) => {
|
|
|
18
20
|
<span style={{ alignSelf: 'start' }}>
|
|
19
21
|
<CopyToClipboard
|
|
20
22
|
onCopy={() => {
|
|
23
|
+
trackUsageRef('didCopyTokenKey');
|
|
21
24
|
toggleNotification({
|
|
22
25
|
type: 'success',
|
|
23
26
|
message: { id: 'Settings.apiTokens.notification.copied' },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
3
|
import {
|
|
4
4
|
SettingsPageTitle,
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
Form,
|
|
7
7
|
useOverlayBlocker,
|
|
8
8
|
useNotification,
|
|
9
|
+
useTracking,
|
|
9
10
|
} from '@strapi/helper-plugin';
|
|
10
11
|
import { HeaderLayout, ContentLayout } from '@strapi/design-system/Layout';
|
|
11
12
|
import { Main } from '@strapi/design-system/Main';
|
|
@@ -37,6 +38,8 @@ const ApiTokenCreateView = () => {
|
|
|
37
38
|
const { lockApp, unlockApp } = useOverlayBlocker();
|
|
38
39
|
const toggleNotification = useNotification();
|
|
39
40
|
const history = useHistory();
|
|
41
|
+
const { trackUsage } = useTracking();
|
|
42
|
+
const trackUsageRef = useRef(trackUsage);
|
|
40
43
|
|
|
41
44
|
const {
|
|
42
45
|
params: { id },
|
|
@@ -44,6 +47,10 @@ const ApiTokenCreateView = () => {
|
|
|
44
47
|
|
|
45
48
|
const isCreating = id === 'create';
|
|
46
49
|
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
trackUsageRef.current(isCreating ? 'didAddTokenFromList' : 'didEditTokenFromList');
|
|
52
|
+
}, [isCreating]);
|
|
53
|
+
|
|
47
54
|
if (history.location.state?.apiToken.accessKey) {
|
|
48
55
|
apiToken = history.location.state.apiToken;
|
|
49
56
|
}
|
|
@@ -73,6 +80,7 @@ const ApiTokenCreateView = () => {
|
|
|
73
80
|
}
|
|
74
81
|
|
|
75
82
|
const handleSubmit = async (body, actions) => {
|
|
83
|
+
trackUsageRef.current(isCreating ? 'willCreateToken' : 'willEditToken');
|
|
76
84
|
lockApp();
|
|
77
85
|
|
|
78
86
|
try {
|
|
@@ -89,6 +97,10 @@ const ApiTokenCreateView = () => {
|
|
|
89
97
|
message: formatMessage({ id: 'notification.success.saved', defaultMessage: 'Saved' }),
|
|
90
98
|
});
|
|
91
99
|
|
|
100
|
+
trackUsageRef.current(isCreating ? 'didCreateToken' : 'didEditToken', {
|
|
101
|
+
type: apiToken.type,
|
|
102
|
+
});
|
|
103
|
+
|
|
92
104
|
if (isCreating) {
|
|
93
105
|
history.replace(`/settings/api-tokens/${response.id}`, { apiToken: response });
|
|
94
106
|
}
|
package/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/DynamicTable/DeleteButton/index.js
CHANGED
|
@@ -2,17 +2,21 @@ import React from 'react';
|
|
|
2
2
|
import Trash from '@strapi/icons/Trash';
|
|
3
3
|
import { IconButton } from '@strapi/design-system/IconButton';
|
|
4
4
|
import { Box } from '@strapi/design-system/Box';
|
|
5
|
-
import { stopPropagation } from '@strapi/helper-plugin';
|
|
5
|
+
import { stopPropagation, useTracking } from '@strapi/helper-plugin';
|
|
6
6
|
import { useIntl } from 'react-intl';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
|
|
9
9
|
const DeleteButton = ({ tokenName, onClickDelete }) => {
|
|
10
10
|
const { formatMessage } = useIntl();
|
|
11
|
+
const { trackUsage } = useTracking();
|
|
11
12
|
|
|
12
13
|
return (
|
|
13
14
|
<Box paddingLeft={1} {...stopPropagation}>
|
|
14
15
|
<IconButton
|
|
15
|
-
onClick={
|
|
16
|
+
onClick={() => {
|
|
17
|
+
trackUsage('willDeleteToken');
|
|
18
|
+
onClickDelete();
|
|
19
|
+
}}
|
|
16
20
|
label={formatMessage(
|
|
17
21
|
{
|
|
18
22
|
id: 'app.component.table.delete',
|
|
@@ -2,7 +2,13 @@ import React from 'react';
|
|
|
2
2
|
import { Typography } from '@strapi/design-system/Typography';
|
|
3
3
|
import { Tbody, Tr, Td } from '@strapi/design-system/Table';
|
|
4
4
|
import { Flex } from '@strapi/design-system/Flex';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
RelativeTime,
|
|
7
|
+
useQueryParams,
|
|
8
|
+
onRowClick,
|
|
9
|
+
pxToRem,
|
|
10
|
+
useTracking,
|
|
11
|
+
} from '@strapi/helper-plugin';
|
|
6
12
|
import { useIntl } from 'react-intl';
|
|
7
13
|
import PropTypes from 'prop-types';
|
|
8
14
|
import { useHistory } from 'react-router-dom';
|
|
@@ -17,6 +23,7 @@ const TableRows = ({ canDelete, canUpdate, onClickDelete, withBulkActions, rows
|
|
|
17
23
|
push,
|
|
18
24
|
location: { pathname },
|
|
19
25
|
} = useHistory();
|
|
26
|
+
const { trackUsage } = useTracking();
|
|
20
27
|
|
|
21
28
|
const apiTokens = rows.sort((a, b) => {
|
|
22
29
|
const comparaison = a.name.localeCompare(b.name);
|
|
@@ -31,7 +38,10 @@ const TableRows = ({ canDelete, canUpdate, onClickDelete, withBulkActions, rows
|
|
|
31
38
|
<Tr
|
|
32
39
|
key={apiToken.id}
|
|
33
40
|
{...onRowClick({
|
|
34
|
-
fn: () =>
|
|
41
|
+
fn: () => {
|
|
42
|
+
trackUsage('willEditTokenFromList');
|
|
43
|
+
push(`${pathname}/${apiToken.id}`);
|
|
44
|
+
},
|
|
35
45
|
condition: canUpdate,
|
|
36
46
|
})}
|
|
37
47
|
>
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
useRBAC,
|
|
9
9
|
NoContent,
|
|
10
10
|
DynamicTable,
|
|
11
|
+
useTracking,
|
|
11
12
|
} from '@strapi/helper-plugin';
|
|
12
13
|
import { HeaderLayout, ContentLayout } from '@strapi/design-system/Layout';
|
|
13
14
|
import { Main } from '@strapi/design-system/Main';
|
|
@@ -31,6 +32,7 @@ const ApiTokenListView = () => {
|
|
|
31
32
|
allowedActions: { canCreate, canDelete, canUpdate, canRead },
|
|
32
33
|
} = useRBAC(adminPermissions.settings['api-tokens']);
|
|
33
34
|
const { push } = useHistory();
|
|
35
|
+
const { trackUsage } = useTracking();
|
|
34
36
|
|
|
35
37
|
useEffect(() => {
|
|
36
38
|
push({ search: qs.stringify({ sort: 'name:ASC' }, { encode: false }) });
|
|
@@ -39,10 +41,13 @@ const ApiTokenListView = () => {
|
|
|
39
41
|
const { data: apiTokens, status, isFetching } = useQuery(
|
|
40
42
|
['api-tokens'],
|
|
41
43
|
async () => {
|
|
44
|
+
trackUsage('willAccessTokenList');
|
|
42
45
|
const {
|
|
43
46
|
data: { data },
|
|
44
47
|
} = await axiosInstance.get(`/admin/api-tokens`);
|
|
45
48
|
|
|
49
|
+
trackUsage('didAccessTokenList', { number: data.length });
|
|
50
|
+
|
|
46
51
|
return data;
|
|
47
52
|
},
|
|
48
53
|
{
|
|
@@ -67,6 +72,7 @@ const ApiTokenListView = () => {
|
|
|
67
72
|
{
|
|
68
73
|
onSuccess: async () => {
|
|
69
74
|
await queryClient.invalidateQueries(['api-tokens']);
|
|
75
|
+
trackUsage('didDeleteToken');
|
|
70
76
|
},
|
|
71
77
|
onError: err => {
|
|
72
78
|
if (err?.response?.data?.data) {
|
|
@@ -100,6 +106,7 @@ const ApiTokenListView = () => {
|
|
|
100
106
|
data-testid="create-api-token-button"
|
|
101
107
|
startIcon={<Plus />}
|
|
102
108
|
size="L"
|
|
109
|
+
onClick={() => trackUsage('willAddTokenFromList')}
|
|
103
110
|
to="/settings/api-tokens/create"
|
|
104
111
|
>
|
|
105
112
|
{formatMessage({
|
|
@@ -20,7 +20,7 @@ import { useIntl } from 'react-intl';
|
|
|
20
20
|
import { useHistory } from 'react-router-dom';
|
|
21
21
|
import RoleRow from './components/RoleRow';
|
|
22
22
|
import EmptyRole from './components/EmptyRole';
|
|
23
|
-
import UpgradePlanModal from '../../../../../components/UpgradePlanModal
|
|
23
|
+
import UpgradePlanModal from '../../../../../components/UpgradePlanModal';
|
|
24
24
|
import { useRolesList } from '../../../../../hooks';
|
|
25
25
|
|
|
26
26
|
const useSortedRoles = () => {
|
|
@@ -29,7 +29,7 @@ import { Stack } from '@strapi/design-system/Stack';
|
|
|
29
29
|
import ArrowLeft from '@strapi/icons/ArrowLeft';
|
|
30
30
|
import Check from '@strapi/icons/Check';
|
|
31
31
|
import MagicLink from 'ee_else_ce/pages/SettingsPage/pages/Users/components/MagicLink';
|
|
32
|
-
import { formatAPIErrors } from '../../../../../utils';
|
|
32
|
+
import { formatAPIErrors, getFullName } from '../../../../../utils';
|
|
33
33
|
import { fetchUser, putUser } from './utils/api';
|
|
34
34
|
import layout from './utils/layout';
|
|
35
35
|
import { editValidation } from '../utils/validations/users';
|
|
@@ -89,7 +89,7 @@ const EditPage = ({ canUpdate }) => {
|
|
|
89
89
|
if (id.toString() === userInfos.id.toString()) {
|
|
90
90
|
auth.setUserInfo(data);
|
|
91
91
|
|
|
92
|
-
const userDisplayName = get(body, 'username') ||
|
|
92
|
+
const userDisplayName = get(body, 'username') || getFullName(body.firstname, body.lastname);
|
|
93
93
|
|
|
94
94
|
setUserDisplayName(userDisplayName);
|
|
95
95
|
}
|
|
@@ -131,7 +131,7 @@ const EditPage = ({ canUpdate }) => {
|
|
|
131
131
|
}, {});
|
|
132
132
|
|
|
133
133
|
const headerLabelName =
|
|
134
|
-
initialData.username ||
|
|
134
|
+
initialData.username || getFullName(initialData.firstname, initialData.lastname);
|
|
135
135
|
|
|
136
136
|
const title = formatMessage(headerLabel, { name: headerLabelName });
|
|
137
137
|
|
|
@@ -11,6 +11,7 @@ import Trash from '@strapi/icons/Trash';
|
|
|
11
11
|
import { useHistory } from 'react-router-dom';
|
|
12
12
|
import { useIntl } from 'react-intl';
|
|
13
13
|
import { stopPropagation, onRowClick } from '@strapi/helper-plugin';
|
|
14
|
+
import { getFullName } from '../../../../../../../utils';
|
|
14
15
|
|
|
15
16
|
const TableRows = ({
|
|
16
17
|
canDelete,
|
|
@@ -49,7 +50,7 @@ const TableRows = ({
|
|
|
49
50
|
id: 'app.component.table.select.one-entry',
|
|
50
51
|
defaultMessage: `Select {target}`,
|
|
51
52
|
},
|
|
52
|
-
{ target:
|
|
53
|
+
{ target: getFullName(data.firstname, data.lastname) }
|
|
53
54
|
)}
|
|
54
55
|
checked={isChecked}
|
|
55
56
|
onChange={() => {
|
|
@@ -77,7 +78,7 @@ const TableRows = ({
|
|
|
77
78
|
onClick={() => push(`${pathname}/${data.id}`)}
|
|
78
79
|
label={formatMessage(
|
|
79
80
|
{ id: 'app.component.table.edit', defaultMessage: 'Edit {target}' },
|
|
80
|
-
{ target:
|
|
81
|
+
{ target: getFullName(data.firstname, data.lastname) }
|
|
81
82
|
)}
|
|
82
83
|
noBorder
|
|
83
84
|
icon={<Pencil />}
|
|
@@ -89,7 +90,7 @@ const TableRows = ({
|
|
|
89
90
|
onClick={() => onClickDelete(data.id)}
|
|
90
91
|
label={formatMessage(
|
|
91
92
|
{ id: 'app.component.table.delete', defaultMessage: 'Delete {target}' },
|
|
92
|
-
{ target:
|
|
93
|
+
{ target: getFullName(data.firstname, data.lastname) }
|
|
93
94
|
)}
|
|
94
95
|
noBorder
|
|
95
96
|
icon={<Trash />}
|
|
@@ -3,7 +3,7 @@ import { translatedErrors } from '@strapi/helper-plugin';
|
|
|
3
3
|
|
|
4
4
|
const schema = yup.object().shape({
|
|
5
5
|
firstname: yup.string().required(translatedErrors.required),
|
|
6
|
-
lastname: yup.string()
|
|
6
|
+
lastname: yup.string(),
|
|
7
7
|
email: yup
|
|
8
8
|
.string()
|
|
9
9
|
.email(translatedErrors.email)
|
|
@@ -6,7 +6,7 @@ import { PaginationURLQuery, PageSizeURLQuery } from '@strapi/helper-plugin';
|
|
|
6
6
|
|
|
7
7
|
const PaginationFooter = ({ pagination }) => {
|
|
8
8
|
return (
|
|
9
|
-
<Box paddingTop={
|
|
9
|
+
<Box paddingTop={4}>
|
|
10
10
|
<Flex alignItems="flex-end" justifyContent="space-between">
|
|
11
11
|
<PageSizeURLQuery />
|
|
12
12
|
<PaginationURLQuery pagination={pagination} />
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
|
-
import
|
|
2
|
+
import { commonUserSchema } from './profile';
|
|
3
3
|
import rolesValidation from './roles';
|
|
4
4
|
|
|
5
5
|
const schema = yup.object().shape({
|
|
6
|
-
...
|
|
6
|
+
...commonUserSchema,
|
|
7
7
|
isActive: yup.bool(),
|
|
8
8
|
...rolesValidation,
|
|
9
9
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
2
|
import { translatedErrors } from '@strapi/helper-plugin';
|
|
3
3
|
|
|
4
|
-
const
|
|
4
|
+
export const commonUserSchema = {
|
|
5
5
|
firstname: yup.mixed().required(translatedErrors.required),
|
|
6
|
-
lastname: yup.mixed()
|
|
6
|
+
lastname: yup.mixed(),
|
|
7
7
|
email: yup
|
|
8
8
|
.string()
|
|
9
9
|
.email(translatedErrors.email)
|
|
@@ -23,6 +23,10 @@ const schema = {
|
|
|
23
23
|
.when('password', (password, passSchema) => {
|
|
24
24
|
return password ? passSchema.required(translatedErrors.required) : passSchema;
|
|
25
25
|
}),
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const schema = {
|
|
29
|
+
...commonUserSchema,
|
|
26
30
|
currentPassword: yup
|
|
27
31
|
.string()
|
|
28
32
|
.when(['password', 'confirmPassword'], (password, confirmPassword, passSchema) => {
|