@strapi/plugin-users-permissions 4.0.0-beta.4 → 4.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.
@@ -1,7 +1,7 @@
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 { Stack } from '@strapi/design-system/Stack';
3
+ import { Box } from '@strapi/design-system/Box';
4
+ import { H3, Text } from '@strapi/design-system/Text';
5
5
  import map from 'lodash/map';
6
6
  import tail from 'lodash/tail';
7
7
  import { useIntl } from 'react-intl';
@@ -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 { TableLabel } from '@strapi/design-system/Text';
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,7 +59,7 @@ 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
64
  <TableLabel textColor="neutral600">{subCategory.label}</TableLabel>
65
65
  </Box>
@@ -75,8 +75,8 @@ const SubCategory = ({ subCategory }) => {
75
75
  {formatMessage({ id: 'app.utils.select-all', defaultMessage: 'Select all' })}
76
76
  </Checkbox>
77
77
  </Box>
78
- </Row>
79
- <Row paddingTop={6} paddingBottom={6}>
78
+ </Flex>
79
+ <Flex paddingTop={6} paddingBottom={6}>
80
80
  <Grid gap={2} style={{ flex: 1 }}>
81
81
  {subCategory.actions.map(action => {
82
82
  const name = `${action.name}.enabled`;
@@ -104,7 +104,7 @@ const SubCategory = ({ subCategory }) => {
104
104
  );
105
105
  })}
106
106
  </Grid>
107
- </Row>
107
+ </Flex>
108
108
  </Box>
109
109
  );
110
110
  };
@@ -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,7 @@
1
1
  import React, { memo, useCallback, useReducer } from 'react';
2
- import { Accordion, AccordionToggle, AccordionContent } from '@strapi/parts/Accordion';
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';
4
5
  import { useUsersPermissions } from '../../contexts/UsersPermissionsContext';
5
6
  import formatPluginName from '../../utils/formatPluginName';
6
7
  import PermissionRow from './PermissionRow';
@@ -41,7 +42,9 @@ const Permissions = () => {
41
42
  variant={index % 2 ? 'primary' : 'secondary'}
42
43
  />
43
44
  <AccordionContent>
44
- <PermissionRow permissions={modifiedData[collapse.name]} name={collapse.name} />
45
+ <Box background="neutral0">
46
+ <PermissionRow permissions={modifiedData[collapse.name]} name={collapse.name} />
47
+ </Box>
45
48
  </AccordionContent>
46
49
  </Accordion>
47
50
  ))}
@@ -1,8 +1,8 @@
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';
3
+ import { H3, Text } from '@strapi/design-system/Text';
4
+ import { Stack } from '@strapi/design-system/Stack';
5
+ import { GridItem } from '@strapi/design-system/Grid';
6
6
  import { get, isEmpty, takeRight, toLower, without } from 'lodash';
7
7
  import { useUsersPermissions } from '../../contexts/UsersPermissionsContext';
8
8
  import BoundRoute from '../BoundRoute';
@@ -1,8 +1,8 @@
1
1
  import React, { memo, useReducer, useCallback, 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 { H3, Text } from '@strapi/design-system/Text';
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';
@@ -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 { H3 } from '@strapi/design-system/Text';
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' })}
@@ -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 { Text, TableLabel } from '@strapi/design-system/Text';
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 }) => {
@@ -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',
@@ -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';
@@ -15,14 +15,14 @@ import {
15
15
  import has from 'lodash/has';
16
16
  import upperFirst from 'lodash/upperFirst';
17
17
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
18
- import { HeaderLayout, Layout, ContentLayout } from '@strapi/parts/Layout';
19
- import { Main } from '@strapi/parts/Main';
20
- import { useNotifyAT } from '@strapi/parts/LiveRegions';
21
- import { Table, Thead, Tr, Th, Tbody, Td } from '@strapi/parts/Table';
22
- import { Text, TableLabel } from '@strapi/parts/Text';
23
- import { VisuallyHidden } from '@strapi/parts/VisuallyHidden';
24
- import { IconButton } from '@strapi/parts/IconButton';
25
- import EditIcon from '@strapi/icons/EditIcon';
18
+ import { HeaderLayout, Layout, ContentLayout } from '@strapi/design-system/Layout';
19
+ import { Main } from '@strapi/design-system/Main';
20
+ import { useNotifyAT } from '@strapi/design-system/LiveRegions';
21
+ import { Table, Thead, Tr, Th, Tbody, Td } from '@strapi/design-system/Table';
22
+ import { Text, TableLabel } from '@strapi/design-system/Text';
23
+ import { VisuallyHidden } from '@strapi/design-system/VisuallyHidden';
24
+ import { IconButton } from '@strapi/design-system/IconButton';
25
+ import Pencil from '@strapi/icons/Pencil';
26
26
  import { useQuery, useMutation, useQueryClient } from 'react-query';
27
27
  import forms from './utils/forms';
28
28
  import { fetchData, putProvider } from './utils/api';
@@ -233,7 +233,7 @@ export const ProvidersPage = () => {
233
233
  <IconButton
234
234
  onClick={() => handleClickEdit(provider)}
235
235
  noBorder
236
- icon={<EditIcon />}
236
+ icon={<Pencil />}
237
237
  label="Edit"
238
238
  />
239
239
  )}
@@ -18,4 +18,4 @@ export const fetchData = async toggleNotification => {
18
18
 
19
19
  export const putProvider = body => {
20
20
  return axiosInstance.put(getRequestURL('providers'), body);
21
- }
21
+ };
@@ -1,15 +1,15 @@
1
1
  import React, { useState, useRef } from 'react';
2
2
  import { useHistory } from 'react-router-dom';
3
- import { ContentLayout, HeaderLayout } from '@strapi/parts/Layout';
4
- import { Main } from '@strapi/parts/Main';
5
- import { Button } from '@strapi/parts/Button';
6
- import { Stack } from '@strapi/parts/Stack';
7
- import { Box } from '@strapi/parts/Box';
8
- import { TextInput } from '@strapi/parts/TextInput';
9
- import { Textarea } from '@strapi/parts/Textarea';
10
- import { H3 } from '@strapi/parts/Text';
11
- import CheckIcon from '@strapi/icons/CheckIcon';
12
- import { GridItem, Grid } from '@strapi/parts/Grid';
3
+ import { ContentLayout, HeaderLayout } from '@strapi/design-system/Layout';
4
+ import { Main } from '@strapi/design-system/Main';
5
+ import { Button } from '@strapi/design-system/Button';
6
+ import { Stack } from '@strapi/design-system/Stack';
7
+ import { Box } from '@strapi/design-system/Box';
8
+ import { TextInput } from '@strapi/design-system/TextInput';
9
+ import { Textarea } from '@strapi/design-system/Textarea';
10
+ import { H3 } from '@strapi/design-system/Text';
11
+ import Check from '@strapi/icons/Check';
12
+ import { GridItem, Grid } from '@strapi/design-system/Grid';
13
13
  import { Formik } from 'formik';
14
14
  import { useIntl } from 'react-intl';
15
15
  import {
@@ -84,7 +84,7 @@ const EditPage = () => {
84
84
  <HeaderLayout
85
85
  primaryAction={
86
86
  !isLoadingPlugins && (
87
- <Button type="submit" loading={isSubmitting} startIcon={<CheckIcon />}>
87
+ <Button type="submit" loading={isSubmitting} startIcon={<Check />}>
88
88
  {formatMessage({
89
89
  id: 'app.components.Button.save',
90
90
  defaultMessage: 'Save',
@@ -1,14 +1,16 @@
1
1
  import React, { useState, useRef } from 'react';
2
- import { ContentLayout, HeaderLayout } from '@strapi/parts/Layout';
3
- import { Main } from '@strapi/parts/Main';
4
- import { Button } from '@strapi/parts/Button';
5
- import { Stack } from '@strapi/parts/Stack';
6
- import { Box } from '@strapi/parts/Box';
7
- import { TextInput } from '@strapi/parts/TextInput';
8
- import { Textarea } from '@strapi/parts/Textarea';
9
- import { H3 } from '@strapi/parts/Text';
10
- import CheckIcon from '@strapi/icons/CheckIcon';
11
- import { GridItem, Grid } from '@strapi/parts/Grid';
2
+ import { ContentLayout, HeaderLayout } from '@strapi/design-system/Layout';
3
+ import { Main } from '@strapi/design-system/Main';
4
+ import { Button } from '@strapi/design-system/Button';
5
+ import { Stack } from '@strapi/design-system/Stack';
6
+ import { Box } from '@strapi/design-system/Box';
7
+ import { TextInput } from '@strapi/design-system/TextInput';
8
+ import { Textarea } from '@strapi/design-system/Textarea';
9
+ import { H3 } from '@strapi/design-system/Text';
10
+ import ArrowLeft from '@strapi/icons/ArrowLeft';
11
+ import Check from '@strapi/icons/Check';
12
+ import { Link } from '@strapi/design-system/Link';
13
+ import { GridItem, Grid } from '@strapi/design-system/Grid';
12
14
  import { Formik } from 'formik';
13
15
  import { useIntl } from 'react-intl';
14
16
  import { useRouteMatch } from 'react-router-dom';
@@ -92,7 +94,7 @@ const EditPage = () => {
92
94
  disabled={role.code === 'strapi-super-admin'}
93
95
  type="submit"
94
96
  loading={isSubmitting}
95
- startIcon={<CheckIcon />}
97
+ startIcon={<Check />}
96
98
  >
97
99
  {formatMessage({
98
100
  id: 'app.components.Button.save',
@@ -103,6 +105,14 @@ const EditPage = () => {
103
105
  }
104
106
  title={role.name}
105
107
  subtitle={role.description}
108
+ navigationAction={
109
+ <Link startIcon={<ArrowLeft />} to="/settings/users-permissions/roles">
110
+ {formatMessage({
111
+ id: 'app.components.go-back',
112
+ defaultMessage: 'Go back',
113
+ })}
114
+ </Link>
115
+ }
106
116
  />
107
117
  <ContentLayout>
108
118
  <Stack size={7}>
@@ -1,7 +1,11 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { IconButton, Tbody, Text, Tr, Td, Row } from '@strapi/parts';
4
- import { EditIcon, DeleteIcon } from '@strapi/icons';
3
+ import { IconButton } from '@strapi/design-system/IconButton';
4
+ import { Text } from '@strapi/design-system/Text';
5
+ import { Flex } from '@strapi/design-system/Flex';
6
+ import { Tbody, Tr, Td } from '@strapi/design-system/Table';
7
+ import Pencil from '@strapi/icons/Pencil';
8
+ import Trash from '@strapi/icons/Trash';
5
9
  import { CheckPermissions, onRowClick, stopPropagation } from '@strapi/helper-plugin';
6
10
  import { useIntl } from 'react-intl';
7
11
  import { useHistory } from 'react-router-dom';
@@ -44,12 +48,12 @@ const TableBody = ({ sortedRoles, canDelete, permissions, setRoleToDelete, onDel
44
48
  </Text>
45
49
  </Td>
46
50
  <Td>
47
- <Row justifyContent="end" {...stopPropagation}>
51
+ <Flex justifyContent="end" {...stopPropagation}>
48
52
  <CheckPermissions permissions={permissions.updateRole}>
49
53
  <IconButton
50
54
  onClick={() => handleClickEdit(role.id)}
51
55
  noBorder
52
- icon={<EditIcon />}
56
+ icon={<Pencil />}
53
57
  label={formatMessage(
54
58
  { id: 'app.component.table.edit', defaultMessage: 'Edit {target}' },
55
59
  { target: `${role.name}` }
@@ -61,7 +65,7 @@ const TableBody = ({ sortedRoles, canDelete, permissions, setRoleToDelete, onDel
61
65
  <IconButton
62
66
  onClick={() => handleClickDelete(role.id)}
63
67
  noBorder
64
- icon={<DeleteIcon />}
68
+ icon={<Trash />}
65
69
  label={formatMessage(
66
70
  { id: 'app.component.table.delete', defaultMessage: 'Delete {target}' },
67
71
  { target: `${role.name}` }
@@ -69,7 +73,7 @@ const TableBody = ({ sortedRoles, canDelete, permissions, setRoleToDelete, onDel
69
73
  />
70
74
  </CheckPermissions>
71
75
  )}
72
- </Row>
76
+ </Flex>
73
77
  </Td>
74
78
  </Tr>
75
79
  ))}
@@ -13,8 +13,8 @@ import {
13
13
  ContentLayout,
14
14
  ActionLayout,
15
15
  VisuallyHidden,
16
- } from '@strapi/parts';
17
- import AddIcon from '@strapi/icons/AddIcon';
16
+ } from '@strapi/design-system';
17
+ import Plus from '@strapi/icons/Plus';
18
18
  import {
19
19
  useTracking,
20
20
  SettingsPageTitle,
@@ -137,7 +137,7 @@ const RoleListPage = () => {
137
137
  })}
138
138
  primaryAction={
139
139
  <CheckPermissions permissions={permissions.createRole}>
140
- <Button onClick={handleNewRoleClick} startIcon={<AddIcon />}>
140
+ <Button onClick={handleNewRoleClick} startIcon={<Plus />}>
141
141
  {formatMessage({
142
142
  id: getTrad('List.button.roles'),
143
143
  defaultMessage: 'Add new role',
package/package.json CHANGED
@@ -1,11 +1,10 @@
1
1
  {
2
2
  "name": "@strapi/plugin-users-permissions",
3
- "version": "4.0.0-beta.4",
3
+ "version": "4.0.0-beta.8",
4
4
  "description": "Protect your API with a full-authentication process based on JWT",
5
5
  "strapi": {
6
6
  "displayName": "Roles & Permissions",
7
7
  "name": "users-permissions",
8
- "icon": "users",
9
8
  "description": "users-permissions.plugin.description",
10
9
  "required": true,
11
10
  "kind": "plugin"
@@ -15,9 +14,9 @@
15
14
  },
16
15
  "dependencies": {
17
16
  "@purest/providers": "^1.0.2",
18
- "@strapi/helper-plugin": "4.0.0-beta.4",
19
- "@strapi/utils": "4.0.0-beta.4",
20
- "bcryptjs": "^2.4.3",
17
+ "@strapi/helper-plugin": "4.0.0-beta.8",
18
+ "@strapi/utils": "4.0.0-beta.8",
19
+ "bcryptjs": "2.4.3",
21
20
  "grant-koa": "5.4.8",
22
21
  "jsonwebtoken": "^8.1.0",
23
22
  "koa2-ratelimit": "^0.9.0",
@@ -58,5 +57,5 @@
58
57
  "npm": ">=6.0.0"
59
58
  },
60
59
  "license": "SEE LICENSE IN LICENSE",
61
- "gitHead": "b4a32bc84e2e23043dbc33b2bded0ea9ddcd13e7"
60
+ "gitHead": "61b7748dad3e3d3c88e4a0a318e2d526e372ead0"
62
61
  }
@@ -37,9 +37,12 @@ module.exports = async ({ strapi }) => {
37
37
  };
38
38
 
39
39
  const initGrant = async pluginStore => {
40
+ const apiPrefix = strapi.config.get('api.rest.prefix');
41
+ const baseURL = `${strapi.config.server.url}/${apiPrefix}/auth`;
42
+
40
43
  const grantConfig = {
41
44
  defaults: {
42
- prefix: '/api/connect',
45
+ prefix: `${apiPrefix}/connect`,
43
46
  },
44
47
  email: {
45
48
  enabled: true,
@@ -50,7 +53,7 @@ const initGrant = async pluginStore => {
50
53
  icon: 'discord',
51
54
  key: '',
52
55
  secret: '',
53
- callback: `${strapi.config.server.url}/api/auth/discord/callback`,
56
+ callback: `${baseURL}/discord/callback`,
54
57
  scope: ['identify', 'email'],
55
58
  },
56
59
  facebook: {
@@ -58,7 +61,7 @@ const initGrant = async pluginStore => {
58
61
  icon: 'facebook-square',
59
62
  key: '',
60
63
  secret: '',
61
- callback: `${strapi.config.server.url}/api/auth/facebook/callback`,
64
+ callback: `${baseURL}/facebook/callback`,
62
65
  scope: ['email'],
63
66
  },
64
67
  google: {
@@ -66,7 +69,7 @@ const initGrant = async pluginStore => {
66
69
  icon: 'google',
67
70
  key: '',
68
71
  secret: '',
69
- callback: `${strapi.config.server.url}/api/auth/google/callback`,
72
+ callback: `${baseURL}/google/callback`,
70
73
  scope: ['email'],
71
74
  },
72
75
  github: {
@@ -74,7 +77,7 @@ const initGrant = async pluginStore => {
74
77
  icon: 'github',
75
78
  key: '',
76
79
  secret: '',
77
- callback: `${strapi.config.server.url}/api/auth/github/callback`,
80
+ callback: `${baseURL}/github/callback`,
78
81
  scope: ['user', 'user:email'],
79
82
  },
80
83
  microsoft: {
@@ -82,7 +85,7 @@ const initGrant = async pluginStore => {
82
85
  icon: 'windows',
83
86
  key: '',
84
87
  secret: '',
85
- callback: `${strapi.config.server.url}/api/auth/microsoft/callback`,
88
+ callback: `${baseURL}/microsoft/callback`,
86
89
  scope: ['user.read'],
87
90
  },
88
91
  twitter: {
@@ -90,14 +93,14 @@ const initGrant = async pluginStore => {
90
93
  icon: 'twitter',
91
94
  key: '',
92
95
  secret: '',
93
- callback: `${strapi.config.server.url}/api/auth/twitter/callback`,
96
+ callback: `${baseURL}/twitter/callback`,
94
97
  },
95
98
  instagram: {
96
99
  enabled: false,
97
100
  icon: 'instagram',
98
101
  key: '',
99
102
  secret: '',
100
- callback: `${strapi.config.server.url}/api/auth/instagram/callback`,
103
+ callback: `${baseURL}/instagram/callback`,
101
104
  scope: ['user_profile'],
102
105
  },
103
106
  vk: {
@@ -105,7 +108,7 @@ const initGrant = async pluginStore => {
105
108
  icon: 'vk',
106
109
  key: '',
107
110
  secret: '',
108
- callback: `${strapi.config.server.url}/api/auth/vk/callback`,
111
+ callback: `${baseURL}/vk/callback`,
109
112
  scope: ['email'],
110
113
  },
111
114
  twitch: {
@@ -113,7 +116,7 @@ const initGrant = async pluginStore => {
113
116
  icon: 'twitch',
114
117
  key: '',
115
118
  secret: '',
116
- callback: `${strapi.config.server.url}/api/auth/twitch/callback`,
119
+ callback: `${baseURL}/twitch/callback`,
117
120
  scope: ['user:read:email'],
118
121
  },
119
122
  linkedin: {
@@ -121,7 +124,7 @@ const initGrant = async pluginStore => {
121
124
  icon: 'linkedin',
122
125
  key: '',
123
126
  secret: '',
124
- callback: `${strapi.config.server.url}/api/auth/linkedin/callback`,
127
+ callback: `${baseURL}/linkedin/callback`,
125
128
  scope: ['r_liteprofile', 'r_emailaddress'],
126
129
  },
127
130
  cognito: {
@@ -130,7 +133,7 @@ const initGrant = async pluginStore => {
130
133
  key: '',
131
134
  secret: '',
132
135
  subdomain: 'my.subdomain.com',
133
- callback: `${strapi.config.server.url}/api/auth/cognito/callback`,
136
+ callback: `${baseURL}/cognito/callback`,
134
137
  scope: ['email', 'openid', 'profile'],
135
138
  },
136
139
  reddit: {
@@ -139,7 +142,7 @@ const initGrant = async pluginStore => {
139
142
  key: '',
140
143
  secret: '',
141
144
  state: true,
142
- callback: `${strapi.config.server.url}/api/auth/reddit/callback`,
145
+ callback: `${baseURL}/reddit/callback`,
143
146
  scope: ['identity'],
144
147
  },
145
148
  auth0: {
@@ -148,7 +151,7 @@ const initGrant = async pluginStore => {
148
151
  key: '',
149
152
  secret: '',
150
153
  subdomain: 'my-tenant.eu',
151
- callback: `${strapi.config.server.url}/api/auth/auth0/callback`,
154
+ callback: `${baseURL}/auth0/callback`,
152
155
  scope: ['openid', 'email', 'profile'],
153
156
  },
154
157
  cas: {
@@ -156,7 +159,7 @@ const initGrant = async pluginStore => {
156
159
  icon: 'book',
157
160
  key: '',
158
161
  secret: '',
159
- callback: `${strapi.config.server.url}/api/auth/cas/callback`,
162
+ callback: `${baseURL}/cas/callback`,
160
163
  scope: ['openid email'], // scopes should be space delimited
161
164
  subdomain: 'my.subdomain.com/cas',
162
165
  },
@@ -586,8 +586,10 @@ module.exports = ({ strapi }) => {
586
586
  });
587
587
  };
588
588
 
589
- const buildRedirectUri = (provider = '') =>
590
- `${getAbsoluteServerUrl(strapi.config)}/api/connect/${provider}/callback`;
589
+ const buildRedirectUri = (provider = '') => {
590
+ const apiPrefix = strapi.config.get('api.rest.prefix');
591
+ return `${getAbsoluteServerUrl(strapi.config)}/${apiPrefix}/connect/${provider}/callback`;
592
+ };
591
593
 
592
594
  return {
593
595
  connect,
@@ -1 +0,0 @@
1
- <svg width="24" height="24" xmlns="http://www.w3.org/2000/svg"><text transform="translate(-24 -6)" fill="#4B515A" fill-rule="evenodd" font-size="24" font-family="AppleColorEmoji, Apple Color Emoji"><tspan x="24" y="28">🔐</tspan></text></svg>