@strapi/admin 4.0.0-beta.14 → 4.0.0-beta.15
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/{UpgradePlanModal → UpgradePlanModal}/index.js +0 -0
- package/admin/src/content-manager/components/DynamicTable/TableRows/index.js +2 -1
- package/admin/src/content-manager/components/EditViewDataManagerProvider/index.js +3 -1
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/schema.js +1 -1
- package/admin/src/content-manager/components/SelectMany/index.js +11 -2
- package/admin/src/content-manager/components/SelectOne/index.js +34 -21
- package/admin/src/content-manager/components/SelectWrapper/index.js +4 -7
- package/admin/src/content-manager/components/Wysiwyg/Editor.js +3 -2
- package/admin/src/content-manager/components/Wysiwyg/EditorStylesContainer.js +5 -2
- package/admin/src/content-manager/components/Wysiwyg/WysiwygNav.js +1 -1
- package/admin/src/content-manager/pages/EditView/Informations/index.js +3 -2
- package/admin/src/content-manager/pages/EditView/index.js +3 -6
- package/admin/src/pages/AuthPage/components/Register/index.js +0 -9
- package/admin/src/pages/AuthPage/utils/forms.js +2 -2
- package/admin/src/pages/ProfilePage/index.js +3 -2
- 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/utils/schema.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/utils/getFullName.js +9 -0
- package/admin/src/utils/index.js +1 -1
- package/build/3226.0dc582b2.chunk.js +2 -0
- package/build/3226.0dc582b2.chunk.js.LICENSE.txt +15 -0
- package/build/4362.fd69112c.chunk.js +1 -0
- package/build/4715.35096dd7.chunk.js +1 -0
- package/build/6250.11ba8b50.chunk.js +1 -0
- package/build/Admin-authenticatedApp.62e5ca51.chunk.js +1 -0
- package/build/Admin_profilePage.3aa61921.chunk.js +1 -0
- package/build/Admin_settingsPage.363ad01d.chunk.js +1 -0
- package/build/admin-edit-users.bcdd2e4d.chunk.js +1 -0
- package/build/admin-users.a2d08780.chunk.js +1 -0
- package/build/api-tokens-create-page.ac4285ba.chunk.js +1 -0
- package/build/api-tokens-edit-page.b8900ddd.chunk.js +1 -0
- package/build/api-tokens-list-page.d451255e.chunk.js +1 -0
- package/build/content-manager.d09d2a3a.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/runtime~main.cc96a027.js +1 -0
- package/ee/server/controllers/authentication/middlewares.js +1 -1
- package/package.json +7 -7
- 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
|
@@ -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)
|
|
@@ -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) => {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get fullname from firstname+lastname joined with a space
|
|
3
|
+
* Handle missing lastname
|
|
4
|
+
* @param {string} firstname
|
|
5
|
+
* @param {string} lastname
|
|
6
|
+
*/
|
|
7
|
+
export default (firstname, lastname = '') => {
|
|
8
|
+
return [firstname, lastname].filter(str => str).join(' ');
|
|
9
|
+
};
|
package/admin/src/utils/index.js
CHANGED
|
@@ -5,5 +5,5 @@ export { default as getAttributesToDisplay } from './getAttributesToDisplay';
|
|
|
5
5
|
export { default as makeUniqueRoutes } from './makeUniqueRoutes';
|
|
6
6
|
export { default as sortLinks } from './sortLinks';
|
|
7
7
|
export { default as getExistingActions } from './getExistingActions';
|
|
8
|
-
|
|
9
8
|
export { default as getRequestUrl } from './getRequestUrl';
|
|
9
|
+
export { default as getFullName } from './getFullName';
|