@strapi/plugin-users-permissions 4.0.0-beta.2 → 4.0.0-beta.20

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 (46) hide show
  1. package/admin/src/components/BoundRoute/index.js +23 -27
  2. package/admin/src/components/FormModal/Input/index.js +2 -2
  3. package/admin/src/components/FormModal/index.js +10 -5
  4. package/admin/src/components/Permissions/PermissionRow/CheckboxWrapper.js +1 -1
  5. package/admin/src/components/Permissions/PermissionRow/SubCategory.js +12 -10
  6. package/admin/src/components/Permissions/PermissionRow/index.js +1 -1
  7. package/admin/src/components/Permissions/index.js +12 -8
  8. package/admin/src/components/Policies/index.js +12 -9
  9. package/admin/src/components/UsersPermissions/index.js +12 -15
  10. package/admin/src/index.js +0 -8
  11. package/admin/src/pages/AdvancedSettings/index.js +13 -13
  12. package/admin/src/pages/EmailTemplates/components/EmailForm.js +10 -5
  13. package/admin/src/pages/EmailTemplates/components/EmailTable.js +16 -16
  14. package/admin/src/pages/EmailTemplates/index.js +3 -3
  15. package/admin/src/pages/Providers/index.js +21 -21
  16. package/admin/src/pages/Providers/utils/api.js +1 -1
  17. package/admin/src/pages/Roles/CreatePage/index.js +13 -13
  18. package/admin/src/pages/Roles/EditPage/index.js +23 -13
  19. package/admin/src/pages/Roles/ListPage/components/TableBody.js +14 -10
  20. package/admin/src/pages/Roles/ListPage/index.js +19 -25
  21. package/documentation/1.0.0/overrides/users-permissions-User.json +7 -7
  22. package/package.json +29 -30
  23. package/server/bootstrap/index.js +17 -17
  24. package/server/config.js +2 -2
  25. package/server/content-types/permission/index.js +3 -0
  26. package/server/content-types/role/index.js +3 -0
  27. package/server/controllers/auth.js +73 -215
  28. package/server/controllers/{user/admin.js → content-manager-user.js} +44 -75
  29. package/server/controllers/index.js +2 -0
  30. package/server/controllers/role.js +7 -7
  31. package/server/controllers/settings.js +5 -4
  32. package/server/controllers/user.js +118 -28
  33. package/server/controllers/validation/auth.js +29 -0
  34. package/server/controllers/validation/user.js +38 -0
  35. package/server/middlewares/rateLimit.js +1 -1
  36. package/server/routes/admin/role.js +5 -5
  37. package/server/routes/admin/settings.js +6 -6
  38. package/server/routes/content-api/auth.js +5 -7
  39. package/server/services/jwt.js +9 -17
  40. package/server/services/providers.js +13 -10
  41. package/server/services/role.js +5 -10
  42. package/server/services/user.js +8 -6
  43. package/server/services/users-permissions.js +56 -45
  44. package/server/strategies/users-permissions.js +23 -22
  45. package/admin/src/assets/images/logo.svg +0 -1
  46. package/server/controllers/user/api.js +0 -158
@@ -1,13 +1,19 @@
1
1
  import React from 'react';
2
- import { Stack } from '@strapi/parts/Stack';
3
- import { Box } from '@strapi/parts/Box';
4
- import { H3, Text } from '@strapi/parts/Text';
2
+ import styled from 'styled-components';
3
+ import { Stack } from '@strapi/design-system/Stack';
4
+ import { Box } from '@strapi/design-system/Box';
5
+ import { Typography } from '@strapi/design-system/Typography';
5
6
  import map from 'lodash/map';
6
7
  import tail from 'lodash/tail';
7
8
  import { useIntl } from 'react-intl';
8
9
  import PropTypes from 'prop-types';
9
10
  import getMethodColor from './getMethodColor';
10
11
 
12
+ const MethodBox = styled(Box)`
13
+ margin: -1px;
14
+ border-radius: ${({ theme }) => theme.spaces[1]} 0 0 ${({ theme }) => theme.spaces[1]};
15
+ `;
16
+
11
17
  function BoundRoute({ route }) {
12
18
  const { formatMessage } = useIntl();
13
19
 
@@ -18,41 +24,31 @@ function BoundRoute({ route }) {
18
24
 
19
25
  return (
20
26
  <Stack size={2}>
21
- <H3>
27
+ <Typography variant="delta" as="h3">
22
28
  {formatMessage({
23
29
  id: 'users-permissions.BoundRoute.title',
24
30
  defaultMessage: 'Bound route to',
25
31
  })}
26
32
  &nbsp;
27
33
  <span>{controller}</span>
28
- <Text style={{ fontSize: 'inherit', fontWeight: 'inherit' }} textColor="primary600">
34
+ <Typography variant="delta" textColor="primary600">
29
35
  .{action}
30
- </Text>
31
- </H3>
32
- <Box hasRadius background="neutral0" borderColor="neutral200">
33
- <Box
34
- color={colors.text}
35
- background={colors.background}
36
- borderColor={colors.border}
37
- padding={2}
38
- hasRadius
39
- style={{
40
- display: 'inline-block',
41
- margin: '-1px',
42
- borderTopRightRadius: 0,
43
- borderBottomRightRadius: 0,
44
- }}
45
- >
46
- <Text bold>{method}</Text>
47
- </Box>
48
- <Box style={{ display: 'inline-block' }} paddingLeft={2} paddingRight={2}>
36
+ </Typography>
37
+ </Typography>
38
+ <Stack horizontal hasRadius background="neutral0" borderColor="neutral200" size={0}>
39
+ <MethodBox background={colors.background} borderColor={colors.border} padding={2}>
40
+ <Typography fontWeight="bold" textColor={colors.text}>
41
+ {method}
42
+ </Typography>
43
+ </MethodBox>
44
+ <Box paddingLeft={2} paddingRight={2}>
49
45
  {map(formattedRoute, value => (
50
- <Text key={value} textColor={value.includes(':') ? 'neutral600' : 'neutral900'}>
46
+ <Typography key={value} textColor={value.includes(':') ? 'neutral600' : 'neutral900'}>
51
47
  /{value}
52
- </Text>
48
+ </Typography>
53
49
  ))}
54
50
  </Box>
55
- </Box>
51
+ </Stack>
56
52
  </Stack>
57
53
  );
58
54
  }
@@ -6,8 +6,8 @@
6
6
 
7
7
  import React from 'react';
8
8
  import { useIntl } from 'react-intl';
9
- import { ToggleInput } from '@strapi/parts/ToggleInput';
10
- import { TextInput } from '@strapi/parts/TextInput';
9
+ import { ToggleInput } from '@strapi/design-system/ToggleInput';
10
+ import { TextInput } from '@strapi/design-system/TextInput';
11
11
  import PropTypes from 'prop-types';
12
12
 
13
13
  const Input = ({
@@ -6,11 +6,16 @@
6
6
 
7
7
  import React from 'react';
8
8
  import { useIntl } from 'react-intl';
9
- import { Button } from '@strapi/parts/Button';
10
- import { Stack } from '@strapi/parts/Stack';
11
- import { Breadcrumbs, Crumb } from '@strapi/parts/Breadcrumbs';
12
- import { Grid, GridItem } from '@strapi/parts/Grid';
13
- import { ModalLayout, ModalHeader, ModalFooter, ModalBody } from '@strapi/parts/ModalLayout';
9
+ import { Button } from '@strapi/design-system/Button';
10
+ import { Stack } from '@strapi/design-system/Stack';
11
+ import { Breadcrumbs, Crumb } from '@strapi/design-system/Breadcrumbs';
12
+ import { Grid, GridItem } from '@strapi/design-system/Grid';
13
+ import {
14
+ ModalLayout,
15
+ ModalHeader,
16
+ ModalFooter,
17
+ ModalBody,
18
+ } from '@strapi/design-system/ModalLayout';
14
19
  import PropTypes from 'prop-types';
15
20
  import { Formik } from 'formik';
16
21
  import { Form } from '@strapi/helper-plugin';
@@ -1,5 +1,5 @@
1
1
  import styled, { css } from 'styled-components';
2
- import { Box } from '@strapi/parts/Box';
2
+ import { Box } from '@strapi/design-system/Box';
3
3
 
4
4
  const activeCheckboxWrapperStyles = css`
5
5
  background: ${props => props.theme.colors.primary100};
@@ -2,11 +2,11 @@ import React, { useCallback, useMemo } from 'react';
2
2
  import { get } from 'lodash';
3
3
  import styled from 'styled-components';
4
4
  import PropTypes from 'prop-types';
5
- import { Box } from '@strapi/parts/Box';
6
- import { Checkbox } from '@strapi/parts/Checkbox';
7
- import { Row } from '@strapi/parts/Row';
8
- import { TableLabel } from '@strapi/parts/Text';
9
- import { Grid, GridItem } from '@strapi/parts/Grid';
5
+ import { Box } from '@strapi/design-system/Box';
6
+ import { Checkbox } from '@strapi/design-system/Checkbox';
7
+ import { Flex } from '@strapi/design-system/Flex';
8
+ import { Typography } from '@strapi/design-system/Typography';
9
+ import { Grid, GridItem } from '@strapi/design-system/Grid';
10
10
  import CogIcon from '@strapi/icons/Cog';
11
11
  import { useIntl } from 'react-intl';
12
12
  import CheckboxWrapper from './CheckboxWrapper';
@@ -59,9 +59,11 @@ const SubCategory = ({ subCategory }) => {
59
59
 
60
60
  return (
61
61
  <Box>
62
- <Row justifyContent="space-between" alignItems="center">
62
+ <Flex justifyContent="space-between" alignItems="center">
63
63
  <Box paddingRight={4}>
64
- <TableLabel textColor="neutral600">{subCategory.label}</TableLabel>
64
+ <Typography variant="sigma" textColor="neutral600">
65
+ {subCategory.label}
66
+ </Typography>
65
67
  </Box>
66
68
  <Border />
67
69
  <Box paddingLeft={4}>
@@ -75,8 +77,8 @@ const SubCategory = ({ subCategory }) => {
75
77
  {formatMessage({ id: 'app.utils.select-all', defaultMessage: 'Select all' })}
76
78
  </Checkbox>
77
79
  </Box>
78
- </Row>
79
- <Row paddingTop={6} paddingBottom={6}>
80
+ </Flex>
81
+ <Flex paddingTop={6} paddingBottom={6}>
80
82
  <Grid gap={2} style={{ flex: 1 }}>
81
83
  {subCategory.actions.map(action => {
82
84
  const name = `${action.name}.enabled`;
@@ -104,7 +106,7 @@ const SubCategory = ({ subCategory }) => {
104
106
  );
105
107
  })}
106
108
  </Grid>
107
- </Row>
109
+ </Flex>
108
110
  </Box>
109
111
  );
110
112
  };
@@ -1,7 +1,7 @@
1
1
  import React, { useMemo } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import sortBy from 'lodash/sortBy';
4
- import { Box } from '@strapi/parts/Box';
4
+ import { Box } from '@strapi/design-system/Box';
5
5
  import SubCategory from './SubCategory';
6
6
 
7
7
  const PermissionRow = ({ name, permissions }) => {
@@ -1,6 +1,8 @@
1
- import React, { memo, useCallback, useReducer } from 'react';
2
- import { Accordion, AccordionToggle, AccordionContent } from '@strapi/parts/Accordion';
1
+ import React, { useReducer } from 'react';
2
+ import { Accordion, AccordionToggle, AccordionContent } from '@strapi/design-system/Accordion';
3
3
  import { useIntl } from 'react-intl';
4
+ import { Box } from '@strapi/design-system/Box';
5
+ import { Stack } from '@strapi/design-system/Stack';
4
6
  import { useUsersPermissions } from '../../contexts/UsersPermissionsContext';
5
7
  import formatPluginName from '../../utils/formatPluginName';
6
8
  import PermissionRow from './PermissionRow';
@@ -14,20 +16,20 @@ const Permissions = () => {
14
16
  init(state, modifiedData)
15
17
  );
16
18
 
17
- const handleToggle = useCallback(index => {
19
+ const handleToggle = index =>
18
20
  dispatch({
19
21
  type: 'TOGGLE_COLLAPSE',
20
22
  index,
21
23
  });
22
- }, []);
23
24
 
24
25
  return (
25
- <>
26
+ <Stack size={1}>
26
27
  {collapses.map((collapse, index) => (
27
28
  <Accordion
28
29
  expanded={collapse.isOpen}
29
30
  toggle={() => handleToggle(index)}
30
31
  key={collapse.name}
32
+ variant={index % 2 === 0 ? 'secondary' : undefined}
31
33
  >
32
34
  <AccordionToggle
33
35
  title={formatPluginName(collapse.name)}
@@ -41,12 +43,14 @@ const Permissions = () => {
41
43
  variant={index % 2 ? 'primary' : 'secondary'}
42
44
  />
43
45
  <AccordionContent>
44
- <PermissionRow permissions={modifiedData[collapse.name]} name={collapse.name} />
46
+ <Box>
47
+ <PermissionRow permissions={modifiedData[collapse.name]} name={collapse.name} />
48
+ </Box>
45
49
  </AccordionContent>
46
50
  </Accordion>
47
51
  ))}
48
- </>
52
+ </Stack>
49
53
  );
50
54
  };
51
55
 
52
- export default memo(Permissions);
56
+ export default Permissions;
@@ -1,20 +1,23 @@
1
1
  import React from 'react';
2
2
  import { useIntl } from 'react-intl';
3
- import { H3, Text } from '@strapi/parts/Text';
4
- import { Stack } from '@strapi/parts/Stack';
5
- import { GridItem } from '@strapi/parts/Grid';
6
- import { get, isEmpty, takeRight, toLower, without } from 'lodash';
3
+ import { Typography } from '@strapi/design-system/Typography';
4
+ import { Stack } from '@strapi/design-system/Stack';
5
+ import { GridItem } from '@strapi/design-system/Grid';
6
+ import { get, isEmpty, without } from 'lodash';
7
7
  import { useUsersPermissions } from '../../contexts/UsersPermissionsContext';
8
8
  import BoundRoute from '../BoundRoute';
9
9
 
10
10
  const Policies = () => {
11
11
  const { formatMessage } = useIntl();
12
12
  const { selectedAction, routes } = useUsersPermissions();
13
+
13
14
  const path = without(selectedAction.split('.'), 'controllers');
14
15
  const controllerRoutes = get(routes, path[0]);
16
+ const pathResolved = path.slice(1).join('.');
17
+
15
18
  const displayedRoutes = isEmpty(controllerRoutes)
16
19
  ? []
17
- : controllerRoutes.filter(o => toLower(o.handler) === toLower(takeRight(path, 2).join('.')));
20
+ : controllerRoutes.filter(o => o.handler.endsWith(pathResolved));
18
21
 
19
22
  return (
20
23
  <GridItem
@@ -35,19 +38,19 @@ const Policies = () => {
35
38
  </Stack>
36
39
  ) : (
37
40
  <Stack size={2}>
38
- <H3>
41
+ <Typography variant="delta" as="h3">
39
42
  {formatMessage({
40
43
  id: 'users-permissions.Policies.header.title',
41
44
  defaultMessage: 'Advanced settings',
42
45
  })}
43
- </H3>
44
- <Text as="p" textColor="neutral600">
46
+ </Typography>
47
+ <Typography as="p" textColor="neutral600">
45
48
  {formatMessage({
46
49
  id: 'users-permissions.Policies.header.hint',
47
50
  defaultMessage:
48
51
  "Select the application's actions or the plugin's actions and click on the cog icon to display the bound route",
49
52
  })}
50
- </Text>
53
+ </Typography>
51
54
  </Stack>
52
55
  )}
53
56
  </GridItem>
@@ -1,8 +1,8 @@
1
- import React, { memo, useReducer, useCallback, forwardRef, useImperativeHandle } from 'react';
1
+ import React, { memo, useReducer, forwardRef, useImperativeHandle } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { H3, Text } from '@strapi/parts/Text';
4
- import { Stack } from '@strapi/parts/Stack';
5
- import { Grid, GridItem } from '@strapi/parts/Grid';
3
+ import { Typography } from '@strapi/design-system/Typography';
4
+ import { Stack } from '@strapi/design-system/Stack';
5
+ import { Grid, GridItem } from '@strapi/design-system/Grid';
6
6
  import { useIntl } from 'react-intl';
7
7
  import getTrad from '../../utils/getTrad';
8
8
  import Policies from '../Policies';
@@ -31,28 +31,25 @@ const UsersPermissions = forwardRef(({ permissions, routes }, ref) => {
31
31
  },
32
32
  }));
33
33
 
34
- const handleChange = useCallback(({ target: { name, value } }) => {
34
+ const handleChange = ({ target: { name, value } }) =>
35
35
  dispatch({
36
36
  type: 'ON_CHANGE',
37
37
  keys: name.split('.'),
38
38
  value: value === 'empty__string_value' ? '' : value,
39
39
  });
40
- }, []);
41
40
 
42
- const handleChangeSelectAll = useCallback(({ target: { name, value } }) => {
41
+ const handleChangeSelectAll = ({ target: { name, value } }) =>
43
42
  dispatch({
44
43
  type: 'ON_CHANGE_SELECT_ALL',
45
44
  keys: name.split('.'),
46
45
  value,
47
46
  });
48
- }, []);
49
47
 
50
- const handleSelectedAction = useCallback(actionToSelect => {
48
+ const handleSelectedAction = actionToSelect =>
51
49
  dispatch({
52
50
  type: 'SELECT_ACTION',
53
51
  actionToSelect,
54
52
  });
55
- }, []);
56
53
 
57
54
  const providerValue = {
58
55
  ...state,
@@ -65,20 +62,20 @@ const UsersPermissions = forwardRef(({ permissions, routes }, ref) => {
65
62
  <UsersPermissionsProvider value={providerValue}>
66
63
  <Grid gap={0} shadow="filterShadow" hasRadius background="neutral0">
67
64
  <GridItem col={7} paddingTop={6} paddingBottom={6} paddingLeft={7} paddingRight={7}>
68
- <Stack size={4}>
65
+ <Stack size={6}>
69
66
  <Stack size={2}>
70
- <H3 as="h2">
67
+ <Typography variant="delta" as="h2">
71
68
  {formatMessage({
72
69
  id: getTrad('Plugins.header.title'),
73
70
  defaultMessage: 'Permissions',
74
71
  })}
75
- </H3>
76
- <Text as="p" textColor="neutral600">
72
+ </Typography>
73
+ <Typography as="p" textColor="neutral600">
77
74
  {formatMessage({
78
75
  id: getTrad('Plugins.header.description'),
79
76
  defaultMessage: 'Only actions bound by a route are listed below.',
80
77
  })}
81
- </Text>
78
+ </Typography>
82
79
  </Stack>
83
80
  <Permissions />
84
81
  </Stack>
@@ -6,13 +6,10 @@
6
6
  // IF THE DOC IS NOT UPDATED THE PULL REQUEST WILL NOT BE MERGED
7
7
  import { prefixPluginTranslations } from '@strapi/helper-plugin';
8
8
  import pluginPkg from '../../package.json';
9
- import pluginLogo from './assets/images/logo.svg';
10
9
  import pluginPermissions from './permissions';
11
10
  import pluginId from './pluginId';
12
11
  import getTrad from './utils/getTrad';
13
12
 
14
- const pluginDescription = pluginPkg.strapi.description || pluginPkg.description;
15
- const icon = pluginPkg.strapi.icon;
16
13
  const name = pluginPkg.strapi.name;
17
14
 
18
15
  export default {
@@ -95,13 +92,8 @@ export default {
95
92
  );
96
93
 
97
94
  app.registerPlugin({
98
- description: pluginDescription,
99
- icon,
100
95
  id: pluginId,
101
- isReady: true,
102
- isRequired: pluginPkg.strapi.required || false,
103
96
  name,
104
- pluginLogo,
105
97
  });
106
98
  },
107
99
  bootstrap() {},
@@ -13,16 +13,16 @@ import {
13
13
  useOverlayBlocker,
14
14
  useRBAC,
15
15
  } from '@strapi/helper-plugin';
16
- import { useNotifyAT } from '@strapi/parts/LiveRegions';
17
- import { Main } from '@strapi/parts/Main';
18
- import { HeaderLayout, ContentLayout } from '@strapi/parts/Layout';
19
- import { Button } from '@strapi/parts/Button';
20
- import { Box } from '@strapi/parts/Box';
21
- import { Stack } from '@strapi/parts/Stack';
22
- import { Select, Option } from '@strapi/parts/Select';
23
- import { H3 } from '@strapi/parts/Text';
24
- import { Grid, GridItem } from '@strapi/parts/Grid';
25
- import CheckIcon from '@strapi/icons/CheckIcon';
16
+ import { useNotifyAT } from '@strapi/design-system/LiveRegions';
17
+ import { Main } from '@strapi/design-system/Main';
18
+ import { HeaderLayout, ContentLayout } from '@strapi/design-system/Layout';
19
+ import { Button } from '@strapi/design-system/Button';
20
+ import { Box } from '@strapi/design-system/Box';
21
+ import { Stack } from '@strapi/design-system/Stack';
22
+ import { Select, Option } from '@strapi/design-system/Select';
23
+ import { Typography } from '@strapi/design-system/Typography';
24
+ import { Grid, GridItem } from '@strapi/design-system/Grid';
25
+ import Check from '@strapi/icons/Check';
26
26
  import pluginPermissions from '../../permissions';
27
27
  import { getTrad } from '../../utils';
28
28
  import layout from './utils/layout';
@@ -151,7 +151,7 @@ const AdvancedSettingsPage = () => {
151
151
  loading={isSubmitting}
152
152
  type="submit"
153
153
  disabled={!canUpdate}
154
- startIcon={<CheckIcon />}
154
+ startIcon={<Check />}
155
155
  size="L"
156
156
  >
157
157
  {formatMessage({ id: getTrad('Form.save'), defaultMessage: 'Save' })}
@@ -169,12 +169,12 @@ const AdvancedSettingsPage = () => {
169
169
  paddingRight={7}
170
170
  >
171
171
  <Stack size={4}>
172
- <H3>
172
+ <Typography variant="delta" as="h2">
173
173
  {formatMessage({
174
174
  id: getTrad('Form.title.advancedSettings'),
175
175
  defaultMessage: 'Settings',
176
176
  })}
177
- </H3>
177
+ </Typography>
178
178
  <Grid gap={6}>
179
179
  <GridItem col={6} s={12}>
180
180
  <Select
@@ -3,11 +3,16 @@ import PropTypes from 'prop-types';
3
3
  import { useIntl } from 'react-intl';
4
4
  import { Form, GenericInput } from '@strapi/helper-plugin';
5
5
  import { Formik } from 'formik';
6
- import { ModalLayout, ModalHeader, ModalFooter, ModalBody } from '@strapi/parts/ModalLayout';
7
- import { Grid, GridItem } from '@strapi/parts/Grid';
8
- import { Button } from '@strapi/parts/Button';
9
- import { Breadcrumbs, Crumb } from '@strapi/parts/Breadcrumbs';
10
- import { Textarea } from '@strapi/parts/Textarea';
6
+ import {
7
+ ModalLayout,
8
+ ModalHeader,
9
+ ModalFooter,
10
+ ModalBody,
11
+ } from '@strapi/design-system/ModalLayout';
12
+ import { Grid, GridItem } from '@strapi/design-system/Grid';
13
+ import { Button } from '@strapi/design-system/Button';
14
+ import { Breadcrumbs, Crumb } from '@strapi/design-system/Breadcrumbs';
15
+ import { Textarea } from '@strapi/design-system/Textarea';
11
16
  import { getTrad } from '../../../utils';
12
17
  import schema from '../utils/schema';
13
18
 
@@ -1,14 +1,14 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { useIntl } from 'react-intl';
4
- import { Table, Thead, Tbody, Tr, Td, Th } from '@strapi/parts/Table';
5
- import { VisuallyHidden } from '@strapi/parts/VisuallyHidden';
6
- import { Text, TableLabel } from '@strapi/parts/Text';
7
- import { IconButton } from '@strapi/parts/IconButton';
8
- import EditIcon from '@strapi/icons/EditIcon';
9
- import Reload from '@strapi/icons/Reload';
4
+ import { Table, Thead, Tbody, Tr, Td, Th } from '@strapi/design-system/Table';
5
+ import { VisuallyHidden } from '@strapi/design-system/VisuallyHidden';
6
+ import { Typography } from '@strapi/design-system/Typography';
7
+ import { IconButton } from '@strapi/design-system/IconButton';
8
+ import Pencil from '@strapi/icons/Pencil';
9
+ import Reload from '@strapi/icons/Refresh';
10
10
  import { onRowClick, stopPropagation } from '@strapi/helper-plugin';
11
- import CheckIcon from '@strapi/icons/CheckIcon';
11
+ import Check from '@strapi/icons/Check';
12
12
  import { getTrad } from '../../../utils';
13
13
 
14
14
  const EmailTable = ({ canUpdate, onEditClick }) => {
@@ -27,12 +27,12 @@ const EmailTable = ({ canUpdate, onEditClick }) => {
27
27
  </VisuallyHidden>
28
28
  </Th>
29
29
  <Th>
30
- <TableLabel textColor="neutral600">
30
+ <Typography variant="sigma" textColor="neutral600">
31
31
  {formatMessage({
32
32
  id: getTrad('Email.template.table.name.label'),
33
33
  defaultMessage: 'name',
34
34
  })}
35
- </TableLabel>
35
+ </Typography>
36
36
  </Th>
37
37
  <Th width="1%">
38
38
  <VisuallyHidden>
@@ -55,12 +55,12 @@ const EmailTable = ({ canUpdate, onEditClick }) => {
55
55
  />
56
56
  </Td>
57
57
  <Td>
58
- <Text>
58
+ <Typography>
59
59
  {formatMessage({
60
60
  id: getTrad('Email.template.reset_password'),
61
61
  defaultMessage: 'Reset password',
62
62
  })}
63
- </Text>
63
+ </Typography>
64
64
  </Td>
65
65
  <Td {...stopPropagation}>
66
66
  <IconButton
@@ -70,13 +70,13 @@ const EmailTable = ({ canUpdate, onEditClick }) => {
70
70
  defaultMessage: 'Edit a template',
71
71
  })}
72
72
  noBorder
73
- icon={canUpdate && <EditIcon />}
73
+ icon={canUpdate && <Pencil />}
74
74
  />
75
75
  </Td>
76
76
  </Tr>
77
77
  <Tr {...onRowClick({ fn: () => onEditClick('email_confirmation') })}>
78
78
  <Td>
79
- <CheckIcon
79
+ <Check
80
80
  aria-label={formatMessage({
81
81
  id: getTrad('Email.template.email_confirmation'),
82
82
  defaultMessage: 'Email address confirmation',
@@ -84,12 +84,12 @@ const EmailTable = ({ canUpdate, onEditClick }) => {
84
84
  />
85
85
  </Td>
86
86
  <Td>
87
- <Text>
87
+ <Typography>
88
88
  {formatMessage({
89
89
  id: getTrad('Email.template.email_confirmation'),
90
90
  defaultMessage: 'Email address confirmation',
91
91
  })}
92
- </Text>
92
+ </Typography>
93
93
  </Td>
94
94
  <Td {...stopPropagation}>
95
95
  <IconButton
@@ -99,7 +99,7 @@ const EmailTable = ({ canUpdate, onEditClick }) => {
99
99
  defaultMessage: 'Edit a template',
100
100
  })}
101
101
  noBorder
102
- icon={canUpdate && <EditIcon />}
102
+ icon={canUpdate && <Pencil />}
103
103
  />
104
104
  </Td>
105
105
  </Tr>
@@ -11,9 +11,9 @@ import {
11
11
  useFocusWhenNavigate,
12
12
  LoadingIndicatorPage,
13
13
  } from '@strapi/helper-plugin';
14
- import { useNotifyAT } from '@strapi/parts/LiveRegions';
15
- import { Main } from '@strapi/parts/Main';
16
- import { ContentLayout, HeaderLayout } from '@strapi/parts/Layout';
14
+ import { useNotifyAT } from '@strapi/design-system/LiveRegions';
15
+ import { Main } from '@strapi/design-system/Main';
16
+ import { ContentLayout, HeaderLayout } from '@strapi/design-system/Layout';
17
17
  import pluginPermissions from '../../permissions';
18
18
  import { getTrad } from '../../utils';
19
19
  import { fetchData, putEmailTemplate } from './utils/api';