@strapi/plugin-users-permissions 5.0.0-beta.5 → 5.0.0-beta.7
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/BoundRoute/index.jsx +2 -2
- package/admin/src/components/FormModal/Input/index.jsx +32 -31
- package/admin/src/components/FormModal/index.jsx +1 -1
- package/admin/src/components/Permissions/PermissionRow/CheckboxWrapper.jsx +1 -1
- package/admin/src/components/Permissions/PermissionRow/SubCategory.jsx +2 -2
- package/admin/src/components/Policies/index.jsx +2 -2
- package/admin/src/components/UsersPermissions/index.jsx +2 -2
- package/admin/src/pages/AdvancedSettings/index.jsx +6 -16
- package/admin/src/pages/EmailTemplates/components/EmailForm.jsx +2 -1
- package/admin/src/pages/EmailTemplates/components/EmailTable.jsx +13 -18
- package/admin/src/pages/EmailTemplates/index.jsx +5 -4
- package/admin/src/pages/Providers/index.jsx +6 -9
- package/admin/src/pages/Roles/pages/CreatePage.jsx +29 -24
- package/admin/src/pages/Roles/pages/EditPage.jsx +33 -24
- package/admin/src/pages/Roles/pages/ListPage/components/TableBody.jsx +5 -5
- package/admin/src/pages/Roles/pages/ListPage/index.jsx +9 -12
- package/dist/_chunks/{index-3MYZ88xc-BF_n1AVy.mjs → index--VHJr8__-Cx-PmaTb.mjs} +4228 -3961
- package/dist/_chunks/index--VHJr8__-Cx-PmaTb.mjs.map +1 -0
- package/dist/_chunks/{index-3MYZ88xc-_tlNeVkL.js → index--VHJr8__-a6vFdIyj.js} +4263 -3996
- package/dist/_chunks/index--VHJr8__-a6vFdIyj.js.map +1 -0
- package/dist/_chunks/{index-DsumUSPh.mjs → index-B-kWBHFg.mjs} +76 -66
- package/dist/_chunks/index-B-kWBHFg.mjs.map +1 -0
- package/dist/_chunks/{index-CiXGPtL-.js → index-B0IECp2U.js} +5 -5
- package/dist/_chunks/index-B0IECp2U.js.map +1 -0
- package/dist/_chunks/{index-BTq-ZJe4.mjs → index-BEhglMSg.mjs} +12 -12
- package/dist/_chunks/{index-BTq-ZJe4.mjs.map → index-BEhglMSg.mjs.map} +1 -1
- package/dist/_chunks/{index-DsMCh6W5.mjs → index-BRZCpa1U.mjs} +13 -14
- package/dist/_chunks/index-BRZCpa1U.mjs.map +1 -0
- package/dist/_chunks/{index-DnKoxcjm.mjs → index-CYVy1i0_.mjs} +7 -7
- package/dist/_chunks/index-CYVy1i0_.mjs.map +1 -0
- package/dist/_chunks/{index-CKKnf-Tb.js → index-CvBfU3H9.js} +44 -44
- package/dist/_chunks/index-CvBfU3H9.js.map +1 -0
- package/dist/_chunks/{index-cSq8h4Av.js → index-D6s_GV1d.js} +14 -15
- package/dist/_chunks/index-D6s_GV1d.js.map +1 -0
- package/dist/_chunks/{index-BnYxQhNf.mjs → index-Du8DLJcX.mjs} +44 -44
- package/dist/_chunks/index-Du8DLJcX.mjs.map +1 -0
- package/dist/_chunks/{index-BqRcQLbX.js → index-QrGtUO_1.js} +12 -12
- package/dist/_chunks/{index-BqRcQLbX.js.map → index-QrGtUO_1.js.map} +1 -1
- package/dist/_chunks/{index-BcVrVSWh.js → index-lnrC9bmZ.js} +80 -71
- package/dist/_chunks/index-lnrC9bmZ.js.map +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/package.json +8 -8
- package/server/utils/sanitize/visitors/remove-user-relation-from-role-entities.js +2 -2
- package/dist/_chunks/index-3MYZ88xc-BF_n1AVy.mjs.map +0 -1
- package/dist/_chunks/index-3MYZ88xc-_tlNeVkL.js.map +0 -1
- package/dist/_chunks/index-BcVrVSWh.js.map +0 -1
- package/dist/_chunks/index-BnYxQhNf.mjs.map +0 -1
- package/dist/_chunks/index-CKKnf-Tb.js.map +0 -1
- package/dist/_chunks/index-CiXGPtL-.js.map +0 -1
- package/dist/_chunks/index-DnKoxcjm.mjs.map +0 -1
- package/dist/_chunks/index-DsMCh6W5.mjs.map +0 -1
- package/dist/_chunks/index-DsumUSPh.mjs.map +0 -1
- package/dist/_chunks/index-cSq8h4Av.js.map +0 -1
|
@@ -5,7 +5,7 @@ import map from 'lodash/map';
|
|
|
5
5
|
import tail from 'lodash/tail';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import { useIntl } from 'react-intl';
|
|
8
|
-
import styled from 'styled-components';
|
|
8
|
+
import { styled } from 'styled-components';
|
|
9
9
|
|
|
10
10
|
import getMethodColor from './getMethodColor';
|
|
11
11
|
|
|
@@ -24,7 +24,7 @@ function BoundRoute({ route }) {
|
|
|
24
24
|
|
|
25
25
|
return (
|
|
26
26
|
<Flex direction="column" alignItems="stretch" gap={2}>
|
|
27
|
-
<Typography variant="delta"
|
|
27
|
+
<Typography variant="delta" tag="h3">
|
|
28
28
|
{formatMessage({
|
|
29
29
|
id: 'users-permissions.BoundRoute.title',
|
|
30
30
|
defaultMessage: 'Bound route to',
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
|
|
9
|
-
import { TextInput,
|
|
9
|
+
import { TextInput, Toggle, Field } from '@strapi/design-system';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import { useIntl } from 'react-intl';
|
|
12
12
|
|
|
@@ -41,25 +41,26 @@ const Input = ({
|
|
|
41
41
|
|
|
42
42
|
if (type === 'bool') {
|
|
43
43
|
return (
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
44
|
+
<Field.Root hint={hint} name={name}>
|
|
45
|
+
<Field.Label>{label}</Field.Label>
|
|
46
|
+
<Toggle
|
|
47
|
+
aria-label={name}
|
|
48
|
+
checked={value}
|
|
49
|
+
disabled={disabled}
|
|
50
|
+
offLabel={formatMessage({
|
|
51
|
+
id: 'app.components.ToggleCheckbox.off-label',
|
|
52
|
+
defaultMessage: 'Off',
|
|
53
|
+
})}
|
|
54
|
+
onLabel={formatMessage({
|
|
55
|
+
id: 'app.components.ToggleCheckbox.on-label',
|
|
56
|
+
defaultMessage: 'On',
|
|
57
|
+
})}
|
|
58
|
+
onChange={(e) => {
|
|
59
|
+
onChange({ target: { name, value: e.target.checked } });
|
|
60
|
+
}}
|
|
61
|
+
/>
|
|
62
|
+
<Field.Hint />
|
|
63
|
+
</Field.Root>
|
|
63
64
|
);
|
|
64
65
|
}
|
|
65
66
|
|
|
@@ -73,17 +74,17 @@ const Input = ({
|
|
|
73
74
|
const errorMessage = error ? formatMessage({ id: error, defaultMessage: error }) : '';
|
|
74
75
|
|
|
75
76
|
return (
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
77
|
+
<Field.Root error={errorMessage} name={name}>
|
|
78
|
+
<Field.Label>{label}</Field.Label>
|
|
79
|
+
<TextInput
|
|
80
|
+
disabled={disabled}
|
|
81
|
+
onChange={onChange}
|
|
82
|
+
placeholder={formattedPlaceholder}
|
|
83
|
+
type={type}
|
|
84
|
+
value={inputValue}
|
|
85
|
+
/>
|
|
86
|
+
<Field.Error />
|
|
87
|
+
</Field.Root>
|
|
87
88
|
);
|
|
88
89
|
};
|
|
89
90
|
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
ModalHeader,
|
|
17
17
|
ModalLayout,
|
|
18
18
|
} from '@strapi/design-system';
|
|
19
|
-
import { Breadcrumbs, Crumb } from '@strapi/design-system
|
|
19
|
+
import { Breadcrumbs, Crumb } from '@strapi/design-system';
|
|
20
20
|
import { Form, Formik } from 'formik';
|
|
21
21
|
import PropTypes from 'prop-types';
|
|
22
22
|
import { useIntl } from 'react-intl';
|
|
@@ -13,7 +13,7 @@ import { Cog as CogIcon } from '@strapi/icons';
|
|
|
13
13
|
import get from 'lodash/get';
|
|
14
14
|
import PropTypes from 'prop-types';
|
|
15
15
|
import { useIntl } from 'react-intl';
|
|
16
|
-
import styled from 'styled-components';
|
|
16
|
+
import { styled } from 'styled-components';
|
|
17
17
|
|
|
18
18
|
import { useUsersPermissions } from '../../../contexts/UsersPermissionsContext';
|
|
19
19
|
|
|
@@ -101,7 +101,7 @@ const SubCategory = ({ subCategory }) => {
|
|
|
101
101
|
onClick={() => onSelectedAction(action.name)}
|
|
102
102
|
style={{ display: 'inline-flex', alignItems: 'center' }}
|
|
103
103
|
>
|
|
104
|
-
<VisuallyHidden
|
|
104
|
+
<VisuallyHidden tag="span">
|
|
105
105
|
{formatMessage(
|
|
106
106
|
{
|
|
107
107
|
id: 'app.utils.show-bound-route',
|
|
@@ -40,13 +40,13 @@ const Policies = () => {
|
|
|
40
40
|
</Flex>
|
|
41
41
|
) : (
|
|
42
42
|
<Flex direction="column" alignItems="stretch" gap={2}>
|
|
43
|
-
<Typography variant="delta"
|
|
43
|
+
<Typography variant="delta" tag="h3">
|
|
44
44
|
{formatMessage({
|
|
45
45
|
id: 'users-permissions.Policies.header.title',
|
|
46
46
|
defaultMessage: 'Advanced settings',
|
|
47
47
|
})}
|
|
48
48
|
</Typography>
|
|
49
|
-
<Typography
|
|
49
|
+
<Typography tag="p" textColor="neutral600">
|
|
50
50
|
{formatMessage({
|
|
51
51
|
id: 'users-permissions.Policies.header.hint',
|
|
52
52
|
defaultMessage:
|
|
@@ -65,13 +65,13 @@ const UsersPermissions = forwardRef(({ permissions, routes }, ref) => {
|
|
|
65
65
|
<GridItem col={7} paddingTop={6} paddingBottom={6} paddingLeft={7} paddingRight={7}>
|
|
66
66
|
<Flex direction="column" alignItems="stretch" gap={6}>
|
|
67
67
|
<Flex direction="column" alignItems="stretch" gap={2}>
|
|
68
|
-
<Typography variant="delta"
|
|
68
|
+
<Typography variant="delta" tag="h2">
|
|
69
69
|
{formatMessage({
|
|
70
70
|
id: getTrad('Plugins.header.title'),
|
|
71
71
|
defaultMessage: 'Permissions',
|
|
72
72
|
})}
|
|
73
73
|
</Typography>
|
|
74
|
-
<Typography
|
|
74
|
+
<Typography tag="p" textColor="neutral600">
|
|
75
75
|
{formatMessage({
|
|
76
76
|
id: getTrad('Plugins.header.description'),
|
|
77
77
|
defaultMessage: 'Only actions bound by a route are listed below.',
|
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
Box,
|
|
5
|
-
Button,
|
|
6
|
-
ContentLayout,
|
|
7
|
-
Flex,
|
|
8
|
-
Grid,
|
|
9
|
-
GridItem,
|
|
10
|
-
HeaderLayout,
|
|
11
|
-
Typography,
|
|
12
|
-
useNotifyAT,
|
|
13
|
-
} from '@strapi/design-system';
|
|
3
|
+
import { Box, Button, Flex, Grid, GridItem, Typography, useNotifyAT } from '@strapi/design-system';
|
|
14
4
|
import { Check } from '@strapi/icons';
|
|
15
5
|
import {
|
|
16
6
|
useAPIErrorHandler,
|
|
@@ -20,8 +10,8 @@ import {
|
|
|
20
10
|
useNotification,
|
|
21
11
|
useFetchClient,
|
|
22
12
|
useRBAC,
|
|
13
|
+
Layouts,
|
|
23
14
|
} from '@strapi/strapi/admin';
|
|
24
|
-
|
|
25
15
|
import { useIntl } from 'react-intl';
|
|
26
16
|
import { useMutation, useQuery, useQueryClient } from 'react-query';
|
|
27
17
|
|
|
@@ -133,7 +123,7 @@ const AdvancedSettingsPage = () => {
|
|
|
133
123
|
{({ values, isSubmitting, modified }) => {
|
|
134
124
|
return (
|
|
135
125
|
<>
|
|
136
|
-
<
|
|
126
|
+
<Layouts.Header
|
|
137
127
|
title={formatMessage({
|
|
138
128
|
id: getTrad('HeaderNav.link.advancedSettings'),
|
|
139
129
|
defaultMessage: 'Advanced Settings',
|
|
@@ -150,7 +140,7 @@ const AdvancedSettingsPage = () => {
|
|
|
150
140
|
</Button>
|
|
151
141
|
}
|
|
152
142
|
/>
|
|
153
|
-
<
|
|
143
|
+
<Layouts.Content>
|
|
154
144
|
<Box
|
|
155
145
|
background="neutral0"
|
|
156
146
|
hasRadius
|
|
@@ -161,7 +151,7 @@ const AdvancedSettingsPage = () => {
|
|
|
161
151
|
paddingRight={7}
|
|
162
152
|
>
|
|
163
153
|
<Flex direction="column" alignItems="stretch" gap={4}>
|
|
164
|
-
<Typography variant="delta"
|
|
154
|
+
<Typography variant="delta" tag="h2">
|
|
165
155
|
{formatMessage({
|
|
166
156
|
id: 'global.settings',
|
|
167
157
|
defaultMessage: 'Settings',
|
|
@@ -207,7 +197,7 @@ const AdvancedSettingsPage = () => {
|
|
|
207
197
|
</Grid>
|
|
208
198
|
</Flex>
|
|
209
199
|
</Box>
|
|
210
|
-
</
|
|
200
|
+
</Layouts.Content>
|
|
211
201
|
</>
|
|
212
202
|
);
|
|
213
203
|
}}
|
|
@@ -8,8 +8,9 @@ import {
|
|
|
8
8
|
ModalFooter,
|
|
9
9
|
ModalHeader,
|
|
10
10
|
ModalLayout,
|
|
11
|
+
Breadcrumbs,
|
|
12
|
+
Crumb,
|
|
11
13
|
} from '@strapi/design-system';
|
|
12
|
-
import { Breadcrumbs, Crumb } from '@strapi/design-system/v2';
|
|
13
14
|
import { Form, InputRenderer } from '@strapi/strapi/admin';
|
|
14
15
|
import PropTypes from 'prop-types';
|
|
15
16
|
import { useIntl } from 'react-intl';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
|
-
Icon,
|
|
5
4
|
IconButton,
|
|
6
5
|
Table,
|
|
7
6
|
Tbody,
|
|
@@ -12,7 +11,7 @@ import {
|
|
|
12
11
|
Typography,
|
|
13
12
|
VisuallyHidden,
|
|
14
13
|
} from '@strapi/design-system';
|
|
15
|
-
import { Check, Pencil, Refresh } from '@strapi/icons';
|
|
14
|
+
import { Check, Pencil, ArrowClockwise as Refresh } from '@strapi/icons';
|
|
16
15
|
import PropTypes from 'prop-types';
|
|
17
16
|
import { useIntl } from 'react-intl';
|
|
18
17
|
|
|
@@ -54,14 +53,12 @@ const EmailTable = ({ canUpdate, onEditClick }) => {
|
|
|
54
53
|
<Tbody>
|
|
55
54
|
<Tr onClick={() => onEditClick('reset_password')}>
|
|
56
55
|
<Td>
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
/>
|
|
64
|
-
</Icon>
|
|
56
|
+
<Refresh
|
|
57
|
+
aria-label={formatMessage({
|
|
58
|
+
id: 'global.reset-password',
|
|
59
|
+
defaultMessage: 'Reset password',
|
|
60
|
+
})}
|
|
61
|
+
/>
|
|
65
62
|
</Td>
|
|
66
63
|
<Td>
|
|
67
64
|
<Typography>
|
|
@@ -85,14 +82,12 @@ const EmailTable = ({ canUpdate, onEditClick }) => {
|
|
|
85
82
|
</Tr>
|
|
86
83
|
<Tr onClick={() => onEditClick('email_confirmation')}>
|
|
87
84
|
<Td>
|
|
88
|
-
<
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
/>
|
|
95
|
-
</Icon>
|
|
85
|
+
<Check
|
|
86
|
+
aria-label={formatMessage({
|
|
87
|
+
id: getTrad('Email.template.email_confirmation'),
|
|
88
|
+
defaultMessage: 'Email address confirmation',
|
|
89
|
+
})}
|
|
90
|
+
/>
|
|
96
91
|
</Td>
|
|
97
92
|
<Td>
|
|
98
93
|
<Typography>
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
3
|
import { useTracking } from '@strapi/admin/strapi-admin';
|
|
4
|
-
import {
|
|
4
|
+
import { useNotifyAT } from '@strapi/design-system';
|
|
5
5
|
import {
|
|
6
6
|
Page,
|
|
7
7
|
useAPIErrorHandler,
|
|
8
8
|
useNotification,
|
|
9
9
|
useFetchClient,
|
|
10
10
|
useRBAC,
|
|
11
|
+
Layouts,
|
|
11
12
|
} from '@strapi/strapi/admin';
|
|
12
13
|
import { useIntl } from 'react-intl';
|
|
13
14
|
import { useMutation, useQuery, useQueryClient } from 'react-query';
|
|
@@ -125,13 +126,13 @@ const EmailTemplatesPage = () => {
|
|
|
125
126
|
}
|
|
126
127
|
)}
|
|
127
128
|
</Page.Title>
|
|
128
|
-
<
|
|
129
|
+
<Layouts.Header
|
|
129
130
|
title={formatMessage({
|
|
130
131
|
id: getTrad('HeaderNav.link.emailTemplates'),
|
|
131
132
|
defaultMessage: 'Email templates',
|
|
132
133
|
})}
|
|
133
134
|
/>
|
|
134
|
-
<
|
|
135
|
+
<Layouts.Content>
|
|
135
136
|
<EmailTable onEditClick={handleEditClick} canUpdate={canUpdate} />
|
|
136
137
|
{isModalOpen && (
|
|
137
138
|
<EmailForm
|
|
@@ -140,7 +141,7 @@ const EmailTemplatesPage = () => {
|
|
|
140
141
|
onSubmit={handleSubmit}
|
|
141
142
|
/>
|
|
142
143
|
)}
|
|
143
|
-
</
|
|
144
|
+
</Layouts.Content>
|
|
144
145
|
</Page.Main>
|
|
145
146
|
);
|
|
146
147
|
};
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
-
import { useTracking } from '@strapi/admin/strapi-admin';
|
|
3
|
+
import { useTracking, Layouts } from '@strapi/admin/strapi-admin';
|
|
4
4
|
import {
|
|
5
|
-
ContentLayout,
|
|
6
|
-
HeaderLayout,
|
|
7
5
|
IconButton,
|
|
8
|
-
Layout,
|
|
9
6
|
Table,
|
|
10
7
|
Tbody,
|
|
11
8
|
Td,
|
|
@@ -147,7 +144,7 @@ export const ProvidersPage = () => {
|
|
|
147
144
|
}
|
|
148
145
|
|
|
149
146
|
return (
|
|
150
|
-
<
|
|
147
|
+
<Layouts.Root>
|
|
151
148
|
<Page.Title>
|
|
152
149
|
{formatMessage(
|
|
153
150
|
{ id: 'Settings.PageTitle', defaultMessage: 'Settings - {name}' },
|
|
@@ -160,13 +157,13 @@ export const ProvidersPage = () => {
|
|
|
160
157
|
)}
|
|
161
158
|
</Page.Title>
|
|
162
159
|
<Page.Main>
|
|
163
|
-
<
|
|
160
|
+
<Layouts.Header
|
|
164
161
|
title={formatMessage({
|
|
165
162
|
id: getTrad('HeaderNav.link.providers'),
|
|
166
163
|
defaultMessage: 'Providers',
|
|
167
164
|
})}
|
|
168
165
|
/>
|
|
169
|
-
<
|
|
166
|
+
<Layouts.Content>
|
|
170
167
|
<Table colCount={3} rowCount={providers.length + 1}>
|
|
171
168
|
<Thead>
|
|
172
169
|
<Tr>
|
|
@@ -233,7 +230,7 @@ export const ProvidersPage = () => {
|
|
|
233
230
|
))}
|
|
234
231
|
</Tbody>
|
|
235
232
|
</Table>
|
|
236
|
-
</
|
|
233
|
+
</Layouts.Content>
|
|
237
234
|
</Page.Main>
|
|
238
235
|
<FormModal
|
|
239
236
|
initialData={data[providerToEditName]}
|
|
@@ -251,7 +248,7 @@ export const ProvidersPage = () => {
|
|
|
251
248
|
onSubmit={handleSubmit}
|
|
252
249
|
providerToEditName={providerToEditName}
|
|
253
250
|
/>
|
|
254
|
-
</
|
|
251
|
+
</Layouts.Root>
|
|
255
252
|
);
|
|
256
253
|
};
|
|
257
254
|
|
|
@@ -2,18 +2,17 @@ import * as React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
Button,
|
|
5
|
-
ContentLayout,
|
|
6
5
|
Flex,
|
|
7
6
|
Grid,
|
|
8
7
|
GridItem,
|
|
9
|
-
HeaderLayout,
|
|
10
8
|
Main,
|
|
11
9
|
Textarea,
|
|
12
10
|
TextInput,
|
|
13
11
|
Typography,
|
|
12
|
+
Field,
|
|
14
13
|
} from '@strapi/design-system';
|
|
15
14
|
import { Check } from '@strapi/icons';
|
|
16
|
-
import { Page, useTracking, useNotification, useFetchClient } from '@strapi/strapi/admin';
|
|
15
|
+
import { Page, useTracking, useNotification, useFetchClient, Layouts } from '@strapi/strapi/admin';
|
|
17
16
|
import { Formik, Form } from 'formik';
|
|
18
17
|
import { useIntl } from 'react-intl';
|
|
19
18
|
import { useMutation } from 'react-query';
|
|
@@ -85,7 +84,7 @@ export const CreatePage = () => {
|
|
|
85
84
|
>
|
|
86
85
|
{({ handleSubmit, values, handleChange, errors }) => (
|
|
87
86
|
<Form noValidate onSubmit={handleSubmit}>
|
|
88
|
-
<
|
|
87
|
+
<Layouts.Header
|
|
89
88
|
primaryAction={
|
|
90
89
|
!isLoadingPlugins && (
|
|
91
90
|
<Button type="submit" loading={mutation.isLoading} startIcon={<Check />}>
|
|
@@ -105,7 +104,7 @@ export const CreatePage = () => {
|
|
|
105
104
|
defaultMessage: 'Define the rights given to the role',
|
|
106
105
|
})}
|
|
107
106
|
/>
|
|
108
|
-
<
|
|
107
|
+
<Layouts.Content>
|
|
109
108
|
<Flex
|
|
110
109
|
background="neutral0"
|
|
111
110
|
direction="column"
|
|
@@ -119,7 +118,7 @@ export const CreatePage = () => {
|
|
|
119
118
|
shadow="filterShadow"
|
|
120
119
|
>
|
|
121
120
|
<Flex direction="column" alignItems="stretch">
|
|
122
|
-
<Typography variant="delta"
|
|
121
|
+
<Typography variant="delta" tag="h2">
|
|
123
122
|
{formatMessage({
|
|
124
123
|
id: getTrad('EditPage.form.roles'),
|
|
125
124
|
defaultMessage: 'Role details',
|
|
@@ -128,31 +127,28 @@ export const CreatePage = () => {
|
|
|
128
127
|
|
|
129
128
|
<Grid gap={4}>
|
|
130
129
|
<GridItem col={6}>
|
|
131
|
-
<
|
|
130
|
+
<Field.Root
|
|
132
131
|
name="name"
|
|
133
|
-
value={values.name || ''}
|
|
134
|
-
onChange={handleChange}
|
|
135
|
-
label={formatMessage({
|
|
136
|
-
id: 'global.name',
|
|
137
|
-
defaultMessage: 'Name',
|
|
138
|
-
})}
|
|
139
132
|
error={
|
|
140
133
|
errors?.name
|
|
141
134
|
? formatMessage({ id: errors.name, defaultMessage: 'Name is required' })
|
|
142
135
|
: false
|
|
143
136
|
}
|
|
144
137
|
required
|
|
145
|
-
|
|
138
|
+
>
|
|
139
|
+
<Field.Label>
|
|
140
|
+
{formatMessage({
|
|
141
|
+
id: 'global.name',
|
|
142
|
+
defaultMessage: 'Name',
|
|
143
|
+
})}
|
|
144
|
+
</Field.Label>
|
|
145
|
+
<TextInput value={values.name || ''} onChange={handleChange} />
|
|
146
|
+
<Field.Error />
|
|
147
|
+
</Field.Root>
|
|
146
148
|
</GridItem>
|
|
147
149
|
<GridItem col={6}>
|
|
148
|
-
<
|
|
149
|
-
|
|
150
|
-
value={values.description || ''}
|
|
151
|
-
onChange={handleChange}
|
|
152
|
-
label={formatMessage({
|
|
153
|
-
id: 'global.description',
|
|
154
|
-
defaultMessage: 'Description',
|
|
155
|
-
})}
|
|
150
|
+
<Field.Root
|
|
151
|
+
name="description"
|
|
156
152
|
error={
|
|
157
153
|
errors?.description
|
|
158
154
|
? formatMessage({
|
|
@@ -162,7 +158,16 @@ export const CreatePage = () => {
|
|
|
162
158
|
: false
|
|
163
159
|
}
|
|
164
160
|
required
|
|
165
|
-
|
|
161
|
+
>
|
|
162
|
+
<Field.Label>
|
|
163
|
+
{formatMessage({
|
|
164
|
+
id: 'global.description',
|
|
165
|
+
defaultMessage: 'Description',
|
|
166
|
+
})}
|
|
167
|
+
</Field.Label>
|
|
168
|
+
<Textarea value={values.description || ''} onChange={handleChange} />
|
|
169
|
+
<Field.Error />
|
|
170
|
+
</Field.Root>
|
|
166
171
|
</GridItem>
|
|
167
172
|
</Grid>
|
|
168
173
|
</Flex>
|
|
@@ -175,7 +180,7 @@ export const CreatePage = () => {
|
|
|
175
180
|
/>
|
|
176
181
|
)}
|
|
177
182
|
</Flex>
|
|
178
|
-
</
|
|
183
|
+
</Layouts.Content>
|
|
179
184
|
</Form>
|
|
180
185
|
)}
|
|
181
186
|
</Formik>
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
|
-
ContentLayout,
|
|
5
|
-
HeaderLayout,
|
|
6
4
|
Main,
|
|
7
5
|
Button,
|
|
8
6
|
Flex,
|
|
@@ -11,6 +9,7 @@ import {
|
|
|
11
9
|
Typography,
|
|
12
10
|
GridItem,
|
|
13
11
|
Grid,
|
|
12
|
+
Field,
|
|
14
13
|
} from '@strapi/design-system';
|
|
15
14
|
import { Check } from '@strapi/icons';
|
|
16
15
|
import {
|
|
@@ -19,6 +18,7 @@ import {
|
|
|
19
18
|
useAPIErrorHandler,
|
|
20
19
|
useNotification,
|
|
21
20
|
useFetchClient,
|
|
21
|
+
Layouts,
|
|
22
22
|
} from '@strapi/strapi/admin';
|
|
23
23
|
import { Formik, Form } from 'formik';
|
|
24
24
|
import { useIntl } from 'react-intl';
|
|
@@ -102,7 +102,7 @@ export const EditPage = () => {
|
|
|
102
102
|
>
|
|
103
103
|
{({ handleSubmit, values, handleChange, errors }) => (
|
|
104
104
|
<Form noValidate onSubmit={handleSubmit}>
|
|
105
|
-
<
|
|
105
|
+
<Layouts.Header
|
|
106
106
|
primaryAction={
|
|
107
107
|
!isLoadingPlugins ? (
|
|
108
108
|
<Button
|
|
@@ -122,7 +122,7 @@ export const EditPage = () => {
|
|
|
122
122
|
subtitle={role.description}
|
|
123
123
|
navigationAction={<BackButton />}
|
|
124
124
|
/>
|
|
125
|
-
<
|
|
125
|
+
<Layouts.Content>
|
|
126
126
|
<Flex
|
|
127
127
|
background="neutral0"
|
|
128
128
|
direction="column"
|
|
@@ -136,7 +136,7 @@ export const EditPage = () => {
|
|
|
136
136
|
shadow="filterShadow"
|
|
137
137
|
>
|
|
138
138
|
<Flex direction="column" alignItems="stretch" gap={4}>
|
|
139
|
-
<Typography variant="delta"
|
|
139
|
+
<Typography variant="delta" tag="h2">
|
|
140
140
|
{formatMessage({
|
|
141
141
|
id: getTrad('EditPage.form.roles'),
|
|
142
142
|
defaultMessage: 'Role details',
|
|
@@ -145,31 +145,31 @@ export const EditPage = () => {
|
|
|
145
145
|
|
|
146
146
|
<Grid gap={4}>
|
|
147
147
|
<GridItem col={6}>
|
|
148
|
-
<
|
|
148
|
+
<Field.Root
|
|
149
149
|
name="name"
|
|
150
|
-
value={values.name || ''}
|
|
151
|
-
onChange={handleChange}
|
|
152
|
-
label={formatMessage({
|
|
153
|
-
id: 'global.name',
|
|
154
|
-
defaultMessage: 'Name',
|
|
155
|
-
})}
|
|
156
150
|
error={
|
|
157
151
|
errors?.name
|
|
158
|
-
? formatMessage({
|
|
152
|
+
? formatMessage({
|
|
153
|
+
id: errors.name,
|
|
154
|
+
defaultMessage: 'Name is required',
|
|
155
|
+
})
|
|
159
156
|
: false
|
|
160
157
|
}
|
|
161
158
|
required
|
|
162
|
-
|
|
159
|
+
>
|
|
160
|
+
<Field.Label>
|
|
161
|
+
{formatMessage({
|
|
162
|
+
id: 'global.name',
|
|
163
|
+
defaultMessage: 'Name',
|
|
164
|
+
})}
|
|
165
|
+
</Field.Label>
|
|
166
|
+
<TextInput value={values.name || ''} onChange={handleChange} />
|
|
167
|
+
<Field.Error />
|
|
168
|
+
</Field.Root>
|
|
163
169
|
</GridItem>
|
|
164
170
|
<GridItem col={6}>
|
|
165
|
-
<
|
|
166
|
-
|
|
167
|
-
value={values.description || ''}
|
|
168
|
-
onChange={handleChange}
|
|
169
|
-
label={formatMessage({
|
|
170
|
-
id: 'global.description',
|
|
171
|
-
defaultMessage: 'Description',
|
|
172
|
-
})}
|
|
171
|
+
<Field.Root
|
|
172
|
+
name="description"
|
|
173
173
|
error={
|
|
174
174
|
errors?.description
|
|
175
175
|
? formatMessage({
|
|
@@ -179,7 +179,16 @@ export const EditPage = () => {
|
|
|
179
179
|
: false
|
|
180
180
|
}
|
|
181
181
|
required
|
|
182
|
-
|
|
182
|
+
>
|
|
183
|
+
<Field.Label>
|
|
184
|
+
{formatMessage({
|
|
185
|
+
id: 'global.description',
|
|
186
|
+
defaultMessage: 'Description',
|
|
187
|
+
})}
|
|
188
|
+
</Field.Label>
|
|
189
|
+
<Textarea value={values.description || ''} onChange={handleChange} />
|
|
190
|
+
<Field.Error />
|
|
191
|
+
</Field.Root>
|
|
183
192
|
</GridItem>
|
|
184
193
|
</Grid>
|
|
185
194
|
</Flex>
|
|
@@ -192,7 +201,7 @@ export const EditPage = () => {
|
|
|
192
201
|
/>
|
|
193
202
|
)}
|
|
194
203
|
</Flex>
|
|
195
|
-
</
|
|
204
|
+
</Layouts.Content>
|
|
196
205
|
</Form>
|
|
197
206
|
)}
|
|
198
207
|
</Formik>
|
|
@@ -5,19 +5,19 @@ import { Pencil, Trash } from '@strapi/icons';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { useIntl } from 'react-intl';
|
|
7
7
|
import { useNavigate } from 'react-router-dom';
|
|
8
|
-
import styled from 'styled-components';
|
|
8
|
+
import { styled } from 'styled-components';
|
|
9
9
|
|
|
10
10
|
const EditLink = styled(Link)`
|
|
11
11
|
align-items: center;
|
|
12
|
-
height:
|
|
12
|
+
height: 3.2rem;
|
|
13
13
|
display: flex;
|
|
14
14
|
justify-content: center;
|
|
15
15
|
padding: ${({ theme }) => `${theme.spaces[2]}}`};
|
|
16
|
-
width:
|
|
16
|
+
width: 3.2rem;
|
|
17
17
|
|
|
18
18
|
svg {
|
|
19
|
-
height:
|
|
20
|
-
width:
|
|
19
|
+
height: 1.2rem;
|
|
20
|
+
width: 1.2rem;
|
|
21
21
|
|
|
22
22
|
path {
|
|
23
23
|
fill: ${({ theme }) => theme.colors.neutral500};
|