@strapi/plugin-users-permissions 5.0.0-beta.6 → 5.0.0-beta.8

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.
Files changed (146) hide show
  1. package/admin/src/components/BoundRoute/index.jsx +2 -2
  2. package/admin/src/components/FormModal/Input/index.jsx +32 -31
  3. package/admin/src/components/Permissions/PermissionRow/CheckboxWrapper.jsx +1 -1
  4. package/admin/src/components/Permissions/PermissionRow/SubCategory.jsx +2 -2
  5. package/admin/src/components/Permissions/index.jsx +26 -35
  6. package/admin/src/components/Policies/index.jsx +2 -2
  7. package/admin/src/components/UsersPermissions/index.jsx +2 -2
  8. package/admin/src/pages/AdvancedSettings/index.jsx +6 -16
  9. package/admin/src/pages/EmailTemplates/components/EmailForm.jsx +2 -1
  10. package/admin/src/pages/EmailTemplates/components/EmailTable.jsx +10 -6
  11. package/admin/src/pages/EmailTemplates/index.jsx +5 -4
  12. package/admin/src/pages/Providers/index.jsx +10 -12
  13. package/admin/src/pages/Roles/pages/CreatePage.jsx +29 -24
  14. package/admin/src/pages/Roles/pages/EditPage.jsx +33 -24
  15. package/admin/src/pages/Roles/pages/ListPage/components/TableBody.jsx +5 -5
  16. package/admin/src/pages/Roles/pages/ListPage/index.jsx +8 -11
  17. package/dist/_chunks/ar-BguGUqwK.js +44 -0
  18. package/dist/_chunks/ar-BguGUqwK.js.map +1 -0
  19. package/dist/_chunks/ar-CK8BRRXB.mjs +44 -0
  20. package/dist/_chunks/ar-CK8BRRXB.mjs.map +1 -0
  21. package/dist/_chunks/cs-BVigMk0l.mjs +50 -0
  22. package/dist/_chunks/cs-BVigMk0l.mjs.map +1 -0
  23. package/dist/_chunks/cs-BW8-K_GY.js +50 -0
  24. package/dist/_chunks/cs-BW8-K_GY.js.map +1 -0
  25. package/dist/_chunks/de-BKUdRFI4.mjs +62 -0
  26. package/dist/_chunks/de-BKUdRFI4.mjs.map +1 -0
  27. package/dist/_chunks/de-owXpVluI.js +62 -0
  28. package/dist/_chunks/de-owXpVluI.js.map +1 -0
  29. package/dist/_chunks/dk-BQiTK50l.mjs +86 -0
  30. package/dist/_chunks/dk-BQiTK50l.mjs.map +1 -0
  31. package/dist/_chunks/dk-LXAnbuBk.js +86 -0
  32. package/dist/_chunks/dk-LXAnbuBk.js.map +1 -0
  33. package/dist/_chunks/en-DOHtPf-2.mjs +86 -0
  34. package/dist/_chunks/en-DOHtPf-2.mjs.map +1 -0
  35. package/dist/_chunks/en-MHo5mcsU.js +86 -0
  36. package/dist/_chunks/en-MHo5mcsU.js.map +1 -0
  37. package/dist/_chunks/es-BwLCLXAQ.js +86 -0
  38. package/dist/_chunks/es-BwLCLXAQ.js.map +1 -0
  39. package/dist/_chunks/es-DNgOVMjD.mjs +86 -0
  40. package/dist/_chunks/es-DNgOVMjD.mjs.map +1 -0
  41. package/dist/_chunks/fr-DkgRugiU.mjs +50 -0
  42. package/dist/_chunks/fr-DkgRugiU.mjs.map +1 -0
  43. package/dist/_chunks/fr-DkhpSjjm.js +50 -0
  44. package/dist/_chunks/fr-DkhpSjjm.js.map +1 -0
  45. package/dist/_chunks/id-BTemOeTZ.js +62 -0
  46. package/dist/_chunks/id-BTemOeTZ.js.map +1 -0
  47. package/dist/_chunks/id-BdEsvnaF.mjs +62 -0
  48. package/dist/_chunks/id-BdEsvnaF.mjs.map +1 -0
  49. package/dist/_chunks/index-00_Lq0-y.mjs +611 -0
  50. package/dist/_chunks/index-00_Lq0-y.mjs.map +1 -0
  51. package/dist/_chunks/index-69WUS0qJ-621Sl9hj.js +10602 -0
  52. package/dist/_chunks/index-69WUS0qJ-621Sl9hj.js.map +1 -0
  53. package/dist/_chunks/index-69WUS0qJ-DzUzGVgd.mjs +10578 -0
  54. package/dist/_chunks/index-69WUS0qJ-DzUzGVgd.mjs.map +1 -0
  55. package/dist/_chunks/index-B6AAcVOR.mjs +249 -0
  56. package/dist/_chunks/index-B6AAcVOR.mjs.map +1 -0
  57. package/dist/_chunks/index-BGu68xEV.js +248 -0
  58. package/dist/_chunks/index-BGu68xEV.js.map +1 -0
  59. package/dist/_chunks/index-BSqwdKVh.js +1164 -0
  60. package/dist/_chunks/index-BSqwdKVh.js.map +1 -0
  61. package/dist/_chunks/index-B_rNTZBF.mjs +1134 -0
  62. package/dist/_chunks/index-B_rNTZBF.mjs.map +1 -0
  63. package/dist/_chunks/index-CIJz4WB2.js +272 -0
  64. package/dist/_chunks/index-CIJz4WB2.js.map +1 -0
  65. package/dist/_chunks/index-DGyiWVHr.js +634 -0
  66. package/dist/_chunks/index-DGyiWVHr.js.map +1 -0
  67. package/dist/_chunks/index-DTK4DMrt.js +359 -0
  68. package/dist/_chunks/index-DTK4DMrt.js.map +1 -0
  69. package/dist/_chunks/index-DaCuO0x_.mjs +253 -0
  70. package/dist/_chunks/index-DaCuO0x_.mjs.map +1 -0
  71. package/dist/_chunks/index-fnfzDsYv.mjs +337 -0
  72. package/dist/_chunks/index-fnfzDsYv.mjs.map +1 -0
  73. package/dist/_chunks/it-B-rv0E24.mjs +62 -0
  74. package/dist/_chunks/it-B-rv0E24.mjs.map +1 -0
  75. package/dist/_chunks/it-D1rH6V6_.js +62 -0
  76. package/dist/_chunks/it-D1rH6V6_.js.map +1 -0
  77. package/dist/_chunks/ja-C8K-VBPD.mjs +48 -0
  78. package/dist/_chunks/ja-C8K-VBPD.mjs.map +1 -0
  79. package/dist/_chunks/ja-DqShgTMf.js +48 -0
  80. package/dist/_chunks/ja-DqShgTMf.js.map +1 -0
  81. package/dist/_chunks/ko-B9DGEPWH.js +86 -0
  82. package/dist/_chunks/ko-B9DGEPWH.js.map +1 -0
  83. package/dist/_chunks/ko-Busb0wIY.mjs +86 -0
  84. package/dist/_chunks/ko-Busb0wIY.mjs.map +1 -0
  85. package/dist/_chunks/ms-ByvsQjRt.mjs +49 -0
  86. package/dist/_chunks/ms-ByvsQjRt.mjs.map +1 -0
  87. package/dist/_chunks/ms-CPBU3LWf.js +49 -0
  88. package/dist/_chunks/ms-CPBU3LWf.js.map +1 -0
  89. package/dist/_chunks/nl-5qO8Rpcy.mjs +48 -0
  90. package/dist/_chunks/nl-5qO8Rpcy.mjs.map +1 -0
  91. package/dist/_chunks/nl-CwNB6YoO.js +48 -0
  92. package/dist/_chunks/nl-CwNB6YoO.js.map +1 -0
  93. package/dist/_chunks/pl-BdIzifBE.mjs +86 -0
  94. package/dist/_chunks/pl-BdIzifBE.mjs.map +1 -0
  95. package/dist/_chunks/pl-Do9UD69f.js +86 -0
  96. package/dist/_chunks/pl-Do9UD69f.js.map +1 -0
  97. package/dist/_chunks/pt-BIO24ioG.mjs +48 -0
  98. package/dist/_chunks/pt-BIO24ioG.mjs.map +1 -0
  99. package/dist/_chunks/pt-BR-D7dZhxuP.js +44 -0
  100. package/dist/_chunks/pt-BR-D7dZhxuP.js.map +1 -0
  101. package/dist/_chunks/pt-BR-f0p23AQZ.mjs +44 -0
  102. package/dist/_chunks/pt-BR-f0p23AQZ.mjs.map +1 -0
  103. package/dist/_chunks/pt-fdvyOnUp.js +48 -0
  104. package/dist/_chunks/pt-fdvyOnUp.js.map +1 -0
  105. package/dist/_chunks/ru-C94rjPGA.js +86 -0
  106. package/dist/_chunks/ru-C94rjPGA.js.map +1 -0
  107. package/dist/_chunks/ru-VWy-IB7K.mjs +86 -0
  108. package/dist/_chunks/ru-VWy-IB7K.mjs.map +1 -0
  109. package/dist/_chunks/sk-BABEhykl.js +50 -0
  110. package/dist/_chunks/sk-BABEhykl.js.map +1 -0
  111. package/dist/_chunks/sk-B_LIcepm.mjs +50 -0
  112. package/dist/_chunks/sk-B_LIcepm.mjs.map +1 -0
  113. package/dist/_chunks/sv-ABLKOokl.mjs +86 -0
  114. package/dist/_chunks/sv-ABLKOokl.mjs.map +1 -0
  115. package/dist/_chunks/sv-Be43LhA9.js +86 -0
  116. package/dist/_chunks/sv-Be43LhA9.js.map +1 -0
  117. package/dist/_chunks/th-DKyP7ueR.mjs +60 -0
  118. package/dist/_chunks/th-DKyP7ueR.mjs.map +1 -0
  119. package/dist/_chunks/th-DgVhVLhL.js +60 -0
  120. package/dist/_chunks/th-DgVhVLhL.js.map +1 -0
  121. package/dist/_chunks/tr-B_idhkEs.js +85 -0
  122. package/dist/_chunks/tr-B_idhkEs.js.map +1 -0
  123. package/dist/_chunks/tr-qa1Q5UjC.mjs +85 -0
  124. package/dist/_chunks/tr-qa1Q5UjC.mjs.map +1 -0
  125. package/dist/_chunks/uk-BmRqbeQc.mjs +49 -0
  126. package/dist/_chunks/uk-BmRqbeQc.mjs.map +1 -0
  127. package/dist/_chunks/uk-LHOivnhP.js +49 -0
  128. package/dist/_chunks/uk-LHOivnhP.js.map +1 -0
  129. package/dist/_chunks/vi-CdVRdKDw.js +50 -0
  130. package/dist/_chunks/vi-CdVRdKDw.js.map +1 -0
  131. package/dist/_chunks/vi-HW-EdMea.mjs +50 -0
  132. package/dist/_chunks/vi-HW-EdMea.mjs.map +1 -0
  133. package/dist/_chunks/zh-5hKkVPA4.mjs +86 -0
  134. package/dist/_chunks/zh-5hKkVPA4.mjs.map +1 -0
  135. package/dist/_chunks/zh-Cuq8gMnF.js +86 -0
  136. package/dist/_chunks/zh-Cuq8gMnF.js.map +1 -0
  137. package/dist/_chunks/zh-Hans-BHilK-yc.mjs +86 -0
  138. package/dist/_chunks/zh-Hans-BHilK-yc.mjs.map +1 -0
  139. package/dist/_chunks/zh-Hans-GQDMKtY4.js +86 -0
  140. package/dist/_chunks/zh-Hans-GQDMKtY4.js.map +1 -0
  141. package/dist/admin/index.js +4 -0
  142. package/dist/admin/index.js.map +1 -0
  143. package/dist/admin/index.mjs +5 -0
  144. package/dist/admin/index.mjs.map +1 -0
  145. package/package.json +13 -13
  146. package/server/utils/sanitize/visitors/remove-user-relation-from-role-entities.js +2 -2
@@ -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" as="h3">
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, ToggleInput } from '@strapi/design-system';
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
- <ToggleInput
45
- aria-label={name}
46
- checked={value}
47
- disabled={disabled}
48
- hint={hint}
49
- label={label}
50
- name={name}
51
- offLabel={formatMessage({
52
- id: 'app.components.ToggleCheckbox.off-label',
53
- defaultMessage: 'Off',
54
- })}
55
- onLabel={formatMessage({
56
- id: 'app.components.ToggleCheckbox.on-label',
57
- defaultMessage: 'On',
58
- })}
59
- onChange={(e) => {
60
- onChange({ target: { name, value: e.target.checked } });
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
- <TextInput
77
- aria-label={name}
78
- disabled={disabled}
79
- error={errorMessage}
80
- label={label}
81
- name={name}
82
- onChange={onChange}
83
- placeholder={formattedPlaceholder}
84
- type={type}
85
- value={inputValue}
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
 
@@ -1,5 +1,5 @@
1
1
  import { Box } from '@strapi/design-system';
2
- import styled, { css } from 'styled-components';
2
+ import { styled, css } from 'styled-components';
3
3
 
4
4
  const activeCheckboxWrapperStyles = css`
5
5
  background: ${(props) => props.theme.colors.primary100};
@@ -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 as="span">
104
+ <VisuallyHidden tag="span">
105
105
  {formatMessage(
106
106
  {
107
107
  id: 'app.utils.show-bound-route',
@@ -1,6 +1,6 @@
1
1
  import React, { useReducer } from 'react';
2
2
 
3
- import { Accordion, AccordionContent, AccordionToggle, Flex } from '@strapi/design-system';
3
+ import { Accordion, Flex } from '@strapi/design-system';
4
4
  import { useIntl } from 'react-intl';
5
5
 
6
6
  import { useUsersPermissions } from '../../contexts/UsersPermissionsContext';
@@ -13,42 +13,33 @@ import { initialState, reducer } from './reducer';
13
13
  const Permissions = () => {
14
14
  const { modifiedData } = useUsersPermissions();
15
15
  const { formatMessage } = useIntl();
16
- const [{ collapses }, dispatch] = useReducer(reducer, initialState, (state) =>
17
- init(state, modifiedData)
18
- );
19
-
20
- const handleToggle = (index) =>
21
- dispatch({
22
- type: 'TOGGLE_COLLAPSE',
23
- index,
24
- });
16
+ const [{ collapses }] = useReducer(reducer, initialState, (state) => init(state, modifiedData));
25
17
 
26
18
  return (
27
- <Flex direction="column" alignItems="stretch" gap={1}>
28
- {collapses.map((collapse, index) => (
29
- <Accordion
30
- expanded={collapse.isOpen}
31
- onToggle={() => handleToggle(index)}
32
- key={collapse.name}
33
- variant={index % 2 === 0 ? 'secondary' : undefined}
34
- >
35
- <AccordionToggle
36
- title={formatPluginName(collapse.name)}
37
- description={formatMessage(
38
- {
39
- id: 'users-permissions.Plugin.permissions.plugins.description',
40
- defaultMessage: 'Define all allowed actions for the {name} plugin.',
41
- },
42
- { name: collapse.name }
43
- )}
44
- variant={index % 2 ? 'primary' : 'secondary'}
45
- />
46
- <AccordionContent>
47
- <PermissionRow permissions={modifiedData[collapse.name]} name={collapse.name} />
48
- </AccordionContent>
49
- </Accordion>
50
- ))}
51
- </Flex>
19
+ <Accordion.Root size="M">
20
+ <Flex direction="column" alignItems="stretch" gap={1}>
21
+ {collapses.map((collapse, index) => (
22
+ <Accordion.Item key={collapse.name} value={collapse.name}>
23
+ <Accordion.Header variant={index % 2 === 0 ? 'secondary' : undefined}>
24
+ <Accordion.Trigger
25
+ description={formatMessage(
26
+ {
27
+ id: 'users-permissions.Plugin.permissions.plugins.description',
28
+ defaultMessage: 'Define all allowed actions for the {name} plugin.',
29
+ },
30
+ { name: collapse.name }
31
+ )}
32
+ >
33
+ {formatPluginName(collapse.name)}
34
+ </Accordion.Trigger>
35
+ </Accordion.Header>
36
+ <Accordion.Content>
37
+ <PermissionRow permissions={modifiedData[collapse.name]} name={collapse.name} />
38
+ </Accordion.Content>
39
+ </Accordion.Item>
40
+ ))}
41
+ </Flex>
42
+ </Accordion.Root>
52
43
  );
53
44
  };
54
45
 
@@ -40,13 +40,13 @@ const Policies = () => {
40
40
  </Flex>
41
41
  ) : (
42
42
  <Flex direction="column" alignItems="stretch" gap={2}>
43
- <Typography variant="delta" as="h3">
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 as="p" textColor="neutral600">
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" as="h2">
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 as="p" textColor="neutral600">
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
- <HeaderLayout
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
- <ContentLayout>
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" as="h2">
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
- </ContentLayout>
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';
13
14
  import { Form, InputRenderer } from '@strapi/strapi/admin';
14
15
  import PropTypes from 'prop-types';
15
16
  import { useIntl } from 'react-intl';
@@ -75,9 +75,11 @@ const EmailTable = ({ canUpdate, onEditClick }) => {
75
75
  id: getTrad('Email.template.form.edit.label'),
76
76
  defaultMessage: 'Edit a template',
77
77
  })}
78
- noBorder
79
- icon={canUpdate && <Pencil />}
80
- />
78
+ borderWidth={0}
79
+ disabled={!canUpdate}
80
+ >
81
+ <Pencil />
82
+ </IconButton>
81
83
  </Td>
82
84
  </Tr>
83
85
  <Tr onClick={() => onEditClick('email_confirmation')}>
@@ -104,9 +106,11 @@ const EmailTable = ({ canUpdate, onEditClick }) => {
104
106
  id: getTrad('Email.template.form.edit.label'),
105
107
  defaultMessage: 'Edit a template',
106
108
  })}
107
- noBorder
108
- icon={canUpdate && <Pencil />}
109
- />
109
+ borderWidth={0}
110
+ disabled={!canUpdate}
111
+ >
112
+ <Pencil />
113
+ </IconButton>
110
114
  </Td>
111
115
  </Tr>
112
116
  </Tbody>
@@ -1,13 +1,14 @@
1
1
  import * as React from 'react';
2
2
 
3
3
  import { useTracking } from '@strapi/admin/strapi-admin';
4
- import { ContentLayout, HeaderLayout, useNotifyAT } from '@strapi/design-system';
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
- <HeaderLayout
129
+ <Layouts.Header
129
130
  title={formatMessage({
130
131
  id: getTrad('HeaderNav.link.emailTemplates'),
131
132
  defaultMessage: 'Email templates',
132
133
  })}
133
134
  />
134
- <ContentLayout>
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
- </ContentLayout>
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
- <Layout>
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
- <HeaderLayout
160
+ <Layouts.Header
164
161
  title={formatMessage({
165
162
  id: getTrad('HeaderNav.link.providers'),
166
163
  defaultMessage: 'Providers',
167
164
  })}
168
165
  />
169
- <ContentLayout>
166
+ <Layouts.Content>
170
167
  <Table colCount={3} rowCount={providers.length + 1}>
171
168
  <Thead>
172
169
  <Tr>
@@ -223,17 +220,18 @@ export const ProvidersPage = () => {
223
220
  {canUpdate && (
224
221
  <IconButton
225
222
  onClick={() => handleClickEdit(provider)}
226
- noBorder
227
- icon={<Pencil />}
223
+ borderWidth={0}
228
224
  label="Edit"
229
- />
225
+ >
226
+ <Pencil />
227
+ </IconButton>
230
228
  )}
231
229
  </Td>
232
230
  </Tr>
233
231
  ))}
234
232
  </Tbody>
235
233
  </Table>
236
- </ContentLayout>
234
+ </Layouts.Content>
237
235
  </Page.Main>
238
236
  <FormModal
239
237
  initialData={data[providerToEditName]}
@@ -251,7 +249,7 @@ export const ProvidersPage = () => {
251
249
  onSubmit={handleSubmit}
252
250
  providerToEditName={providerToEditName}
253
251
  />
254
- </Layout>
252
+ </Layouts.Root>
255
253
  );
256
254
  };
257
255
 
@@ -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
- <HeaderLayout
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
- <ContentLayout>
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" as="h2">
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
- <TextInput
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
- <Textarea
149
- id="description"
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
- </ContentLayout>
183
+ </Layouts.Content>
179
184
  </Form>
180
185
  )}
181
186
  </Formik>