@strapi/plugin-users-permissions 5.0.0-alpha.0 → 5.0.0-alpha.1

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 (76) hide show
  1. package/admin/src/index.js +1 -2
  2. package/admin/src/pages/AdvancedSettings/index.jsx +4 -6
  3. package/admin/src/pages/EmailTemplates/components/EmailTable.jsx +4 -5
  4. package/admin/src/pages/EmailTemplates/index.jsx +5 -7
  5. package/admin/src/pages/Providers/index.jsx +6 -18
  6. package/admin/src/pages/Roles/hooks/usePlugins.js +1 -2
  7. package/admin/src/pages/Roles/pages/CreatePage.jsx +1 -2
  8. package/admin/src/pages/Roles/pages/EditPage.jsx +7 -2
  9. package/admin/src/pages/Roles/pages/ListPage/components/TableBody.jsx +2 -3
  10. package/admin/src/pages/Roles/pages/ListPage/index.jsx +33 -6
  11. package/admin/src/utils/prefixPluginTranslations.js +13 -0
  12. package/dist/_chunks/{EditViewPage-xYzUSAwS-wpHlxdkC.js → EditViewPage-kgrZ8rEg-6k5dfk_x.js} +181 -167
  13. package/dist/_chunks/{EditViewPage-xYzUSAwS-wpHlxdkC.js.map → EditViewPage-kgrZ8rEg-6k5dfk_x.js.map} +1 -1
  14. package/dist/_chunks/{EditViewPage-xYzUSAwS-5mOQ_-nB.mjs → EditViewPage-kgrZ8rEg-GlayP0Uq.mjs} +44 -32
  15. package/dist/_chunks/EditViewPage-kgrZ8rEg-GlayP0Uq.mjs.map +1 -0
  16. package/dist/_chunks/{ListViewPage-xOVa04T_-elahT0e9.js → ListViewPage-BNB0ptO7-TUQO_9Hj.js} +104 -105
  17. package/dist/_chunks/ListViewPage-BNB0ptO7-TUQO_9Hj.js.map +1 -0
  18. package/dist/_chunks/{ListViewPage-xOVa04T_-lbfb219V.mjs → ListViewPage-BNB0ptO7-t1ra9JlI.mjs} +9 -10
  19. package/dist/_chunks/ListViewPage-BNB0ptO7-t1ra9JlI.mjs.map +1 -0
  20. package/dist/_chunks/{ReviewWorkflowsColumn-FDxVKdto-m8hslkeI.js → ReviewWorkflowsColumn-56Z6l-FH-3Dq1lGu9.js} +5 -5
  21. package/dist/_chunks/{ReviewWorkflowsColumn-FDxVKdto-m8hslkeI.js.map → ReviewWorkflowsColumn-56Z6l-FH-3Dq1lGu9.js.map} +1 -1
  22. package/dist/_chunks/{ReviewWorkflowsColumn-FDxVKdto-IWfB3WVH.mjs → ReviewWorkflowsColumn-56Z6l-FH-mpkuW-HV.mjs} +2 -2
  23. package/dist/_chunks/{ReviewWorkflowsColumn-FDxVKdto-IWfB3WVH.mjs.map → ReviewWorkflowsColumn-56Z6l-FH-mpkuW-HV.mjs.map} +1 -1
  24. package/dist/_chunks/{constants-WjN6I3sL-7e3gpx4b.mjs → constants-evLWZCaJ-0QLv9QPI.mjs} +2 -2
  25. package/dist/_chunks/{constants-WjN6I3sL-7e3gpx4b.mjs.map → constants-evLWZCaJ-0QLv9QPI.mjs.map} +1 -1
  26. package/dist/_chunks/{constants-WjN6I3sL-cDZPE6ED.js → constants-evLWZCaJ-dGs71EWl.js} +18 -18
  27. package/dist/_chunks/{constants-WjN6I3sL-cDZPE6ED.js.map → constants-evLWZCaJ-dGs71EWl.js.map} +1 -1
  28. package/dist/_chunks/{index-MEUac_4V.js → index-6E51D69B.js} +35 -37
  29. package/dist/_chunks/index-6E51D69B.js.map +1 -0
  30. package/dist/_chunks/{index-N-GcFWtg.mjs → index-BGIcvvEB.mjs} +6 -7
  31. package/dist/_chunks/index-BGIcvvEB.mjs.map +1 -0
  32. package/dist/_chunks/{index-VgvlwVA7.js → index-Bg2Rf_5y.js} +10 -11
  33. package/dist/_chunks/index-Bg2Rf_5y.js.map +1 -0
  34. package/dist/_chunks/{index-mzJ2Vb5u.js → index-LpFmy25n.js} +4 -5
  35. package/dist/_chunks/index-LpFmy25n.js.map +1 -0
  36. package/dist/_chunks/{index-vXywiVeM.mjs → index-R05CeNXG.mjs} +11 -12
  37. package/dist/_chunks/index-R05CeNXG.mjs.map +1 -0
  38. package/dist/_chunks/{index-5ZvCaCyY-JgYo3Jws.js → index-YFPS5vYF-ZGkR3L1g.js} +2791 -2679
  39. package/dist/_chunks/index-YFPS5vYF-ZGkR3L1g.js.map +1 -0
  40. package/dist/_chunks/{index-5ZvCaCyY-06DLg5eU.mjs → index-YFPS5vYF-cugkJcLS.mjs} +2822 -2710
  41. package/dist/_chunks/index-YFPS5vYF-cugkJcLS.mjs.map +1 -0
  42. package/dist/_chunks/{index-ee_14Ldw.mjs → index-aEKi1Qb9.mjs} +9 -13
  43. package/dist/_chunks/index-aEKi1Qb9.mjs.map +1 -0
  44. package/dist/_chunks/{index-A3oJlPcE.mjs → index-hG66XSuA.mjs} +31 -33
  45. package/dist/_chunks/index-hG66XSuA.mjs.map +1 -0
  46. package/dist/_chunks/{index-53jX2hhF.mjs → index-xt3l4qU9.mjs} +19 -11
  47. package/dist/_chunks/index-xt3l4qU9.mjs.map +1 -0
  48. package/dist/_chunks/{index-TJUxOCtJ.js → index-yKMi8hKt.js} +20 -12
  49. package/dist/_chunks/index-yKMi8hKt.js.map +1 -0
  50. package/dist/_chunks/{index-bRuKnVcH.js → index-ylhaoJtw.js} +8 -12
  51. package/dist/_chunks/index-ylhaoJtw.js.map +1 -0
  52. package/dist/_chunks/{useSyncRbac-Kt8Li0Yf-h8HqtZ6y.js → useSyncRbac-83vFRiaG-YY4KQcAU.js} +7 -7
  53. package/dist/_chunks/{useSyncRbac-Kt8Li0Yf-h8HqtZ6y.js.map → useSyncRbac-83vFRiaG-YY4KQcAU.js.map} +1 -1
  54. package/dist/_chunks/{useSyncRbac-Kt8Li0Yf-Z54sMEPM.mjs → useSyncRbac-83vFRiaG-ov11t-T1.mjs} +2 -2
  55. package/dist/_chunks/{useSyncRbac-Kt8Li0Yf-Z54sMEPM.mjs.map → useSyncRbac-83vFRiaG-ov11t-T1.mjs.map} +1 -1
  56. package/dist/admin/index.js +1 -2
  57. package/dist/admin/index.js.map +1 -1
  58. package/dist/admin/index.mjs +1 -2
  59. package/dist/admin/index.mjs.map +1 -1
  60. package/package.json +6 -6
  61. package/admin/src/pages/Roles/pages/ListPage/utils/api.js +0 -30
  62. package/dist/_chunks/EditViewPage-xYzUSAwS-5mOQ_-nB.mjs.map +0 -1
  63. package/dist/_chunks/ListViewPage-xOVa04T_-elahT0e9.js.map +0 -1
  64. package/dist/_chunks/ListViewPage-xOVa04T_-lbfb219V.mjs.map +0 -1
  65. package/dist/_chunks/index-53jX2hhF.mjs.map +0 -1
  66. package/dist/_chunks/index-5ZvCaCyY-06DLg5eU.mjs.map +0 -1
  67. package/dist/_chunks/index-5ZvCaCyY-JgYo3Jws.js.map +0 -1
  68. package/dist/_chunks/index-A3oJlPcE.mjs.map +0 -1
  69. package/dist/_chunks/index-MEUac_4V.js.map +0 -1
  70. package/dist/_chunks/index-N-GcFWtg.mjs.map +0 -1
  71. package/dist/_chunks/index-TJUxOCtJ.js.map +0 -1
  72. package/dist/_chunks/index-VgvlwVA7.js.map +0 -1
  73. package/dist/_chunks/index-bRuKnVcH.js.map +0 -1
  74. package/dist/_chunks/index-ee_14Ldw.mjs.map +0 -1
  75. package/dist/_chunks/index-mzJ2Vb5u.js.map +0 -1
  76. package/dist/_chunks/index-vXywiVeM.mjs.map +0 -1
@@ -1,9 +1,8 @@
1
- import { prefixPluginTranslations } from '@strapi/helper-plugin';
2
-
3
1
  import pluginPkg from '../../package.json';
4
2
 
5
3
  import { PERMISSIONS } from './constants';
6
4
  import getTrad from './utils/getTrad';
5
+ import { prefixPluginTranslations } from './utils/prefixPluginTranslations';
7
6
 
8
7
  const name = pluginPkg.strapi.name;
9
8
 
@@ -8,11 +8,10 @@ import {
8
8
  Grid,
9
9
  GridItem,
10
10
  HeaderLayout,
11
- Main,
12
11
  Typography,
13
12
  useNotifyAT,
14
13
  } from '@strapi/design-system';
15
- import { useFetchClient, useFocusWhenNavigate, useRBAC } from '@strapi/helper-plugin';
14
+ import { useRBAC } from '@strapi/helper-plugin';
16
15
  import { Check } from '@strapi/icons';
17
16
  import {
18
17
  useAPIErrorHandler,
@@ -20,6 +19,7 @@ import {
20
19
  Form,
21
20
  InputRenderer,
22
21
  useNotification,
22
+ useFetchClient,
23
23
  } from '@strapi/strapi/admin';
24
24
  import { Helmet } from 'react-helmet';
25
25
  import { useIntl } from 'react-intl';
@@ -45,8 +45,6 @@ const AdvancedSettingsPage = () => {
45
45
  const { get, put } = useFetchClient();
46
46
  const { formatAPIError } = useAPIErrorHandler();
47
47
 
48
- useFocusWhenNavigate();
49
-
50
48
  const {
51
49
  isLoading: isLoadingForPermissions,
52
50
  allowedActions: { canUpdate },
@@ -119,7 +117,7 @@ const AdvancedSettingsPage = () => {
119
117
  }
120
118
 
121
119
  return (
122
- <Main aria-busy={isSubmittingForm}>
120
+ <Page.Main aria-busy={isSubmittingForm}>
123
121
  <Helmet
124
122
  title={formatMessage(
125
123
  { id: 'Settings.PageTitle', defaultMessage: 'Settings - {name}' },
@@ -214,7 +212,7 @@ const AdvancedSettingsPage = () => {
214
212
  );
215
213
  }}
216
214
  </Form>
217
- </Main>
215
+ </Page.Main>
218
216
  );
219
217
  };
220
218
 
@@ -12,7 +12,6 @@ import {
12
12
  Typography,
13
13
  VisuallyHidden,
14
14
  } from '@strapi/design-system';
15
- import { onRowClick, stopPropagation } from '@strapi/helper-plugin';
16
15
  import { Check, Pencil, Refresh } from '@strapi/icons';
17
16
  import PropTypes from 'prop-types';
18
17
  import { useIntl } from 'react-intl';
@@ -53,7 +52,7 @@ const EmailTable = ({ canUpdate, onEditClick }) => {
53
52
  </Tr>
54
53
  </Thead>
55
54
  <Tbody>
56
- <Tr {...onRowClick({ fn: () => onEditClick('reset_password') })}>
55
+ <Tr onClick={() => onEditClick('reset_password')}>
57
56
  <Td>
58
57
  <Icon>
59
58
  <Refresh
@@ -72,7 +71,7 @@ const EmailTable = ({ canUpdate, onEditClick }) => {
72
71
  })}
73
72
  </Typography>
74
73
  </Td>
75
- <Td {...stopPropagation}>
74
+ <Td onClick={(e) => e.stopPropagation()}>
76
75
  <IconButton
77
76
  onClick={() => onEditClick('reset_password')}
78
77
  label={formatMessage({
@@ -84,7 +83,7 @@ const EmailTable = ({ canUpdate, onEditClick }) => {
84
83
  />
85
84
  </Td>
86
85
  </Tr>
87
- <Tr {...onRowClick({ fn: () => onEditClick('email_confirmation') })}>
86
+ <Tr onClick={() => onEditClick('email_confirmation')}>
88
87
  <Td>
89
88
  <Icon>
90
89
  <Check
@@ -103,7 +102,7 @@ const EmailTable = ({ canUpdate, onEditClick }) => {
103
102
  })}
104
103
  </Typography>
105
104
  </Td>
106
- <Td {...stopPropagation}>
105
+ <Td onClick={(e) => e.stopPropagation()}>
107
106
  <IconButton
108
107
  onClick={() => onEditClick('email_confirmation')}
109
108
  label={formatMessage({
@@ -1,9 +1,9 @@
1
1
  import * as React from 'react';
2
2
 
3
3
  import { useTracking } from '@strapi/admin/strapi-admin';
4
- import { ContentLayout, HeaderLayout, Main, useNotifyAT } from '@strapi/design-system';
5
- import { useFetchClient, useFocusWhenNavigate, useRBAC } from '@strapi/helper-plugin';
6
- import { Page, useAPIErrorHandler, useNotification } from '@strapi/strapi/admin';
4
+ import { ContentLayout, HeaderLayout, useNotifyAT } from '@strapi/design-system';
5
+ import { useRBAC } from '@strapi/helper-plugin';
6
+ import { Page, useAPIErrorHandler, useNotification, useFetchClient } from '@strapi/strapi/admin';
7
7
  import { Helmet } from 'react-helmet';
8
8
  import { useIntl } from 'react-intl';
9
9
  import { useMutation, useQuery, useQueryClient } from 'react-query';
@@ -28,8 +28,6 @@ const EmailTemplatesPage = () => {
28
28
  const { get, put } = useFetchClient();
29
29
  const { formatAPIError } = useAPIErrorHandler();
30
30
 
31
- useFocusWhenNavigate();
32
-
33
31
  const [isModalOpen, setIsModalOpen] = React.useState(false);
34
32
  const [templateToEdit, setTemplateToEdit] = React.useState(null);
35
33
 
@@ -111,7 +109,7 @@ const EmailTemplatesPage = () => {
111
109
  }
112
110
 
113
111
  return (
114
- <Main aria-busy={submitMutation.isLoading}>
112
+ <Page.Main aria-busy={submitMutation.isLoading}>
115
113
  <Helmet
116
114
  title={formatMessage(
117
115
  { id: 'Settings.PageTitle', defaultMessage: 'Settings - {name}' },
@@ -139,7 +137,7 @@ const EmailTemplatesPage = () => {
139
137
  />
140
138
  )}
141
139
  </ContentLayout>
142
- </Main>
140
+ </Page.Main>
143
141
  );
144
142
  };
145
143
 
@@ -6,7 +6,6 @@ import {
6
6
  HeaderLayout,
7
7
  IconButton,
8
8
  Layout,
9
- Main,
10
9
  Table,
11
10
  Tbody,
12
11
  Td,
@@ -17,15 +16,9 @@ import {
17
16
  VisuallyHidden,
18
17
  useCollator,
19
18
  } from '@strapi/design-system';
20
- import {
21
- onRowClick,
22
- stopPropagation,
23
- useFetchClient,
24
- useFocusWhenNavigate,
25
- useRBAC,
26
- } from '@strapi/helper-plugin';
19
+ import { useRBAC } from '@strapi/helper-plugin';
27
20
  import { Pencil } from '@strapi/icons';
28
- import { Page, useAPIErrorHandler, useNotification } from '@strapi/strapi/admin';
21
+ import { Page, useAPIErrorHandler, useNotification, useFetchClient } from '@strapi/strapi/admin';
29
22
  import upperFirst from 'lodash/upperFirst';
30
23
  import { Helmet } from 'react-helmet';
31
24
  import { useIntl } from 'react-intl';
@@ -50,8 +43,6 @@ export const ProvidersPage = () => {
50
43
  sensitivity: 'base',
51
44
  });
52
45
 
53
- useFocusWhenNavigate();
54
-
55
46
  const {
56
47
  isLoading: isLoadingPermissions,
57
48
  allowedActions: { canUpdate },
@@ -164,7 +155,7 @@ export const ProvidersPage = () => {
164
155
  }
165
156
  )}
166
157
  />
167
- <Main>
158
+ <Page.Main>
168
159
  <HeaderLayout
169
160
  title={formatMessage({
170
161
  id: getTrad('HeaderNav.link.providers'),
@@ -201,10 +192,7 @@ export const ProvidersPage = () => {
201
192
  {providers.map((provider) => (
202
193
  <Tr
203
194
  key={provider.name}
204
- {...onRowClick({
205
- fn: () => handleClickEdit(provider),
206
- condition: canUpdate,
207
- })}
195
+ onClick={() => (canUpdate ? handleClickEdit(provider) : undefined)}
208
196
  >
209
197
  <Td width="45%">
210
198
  <Typography fontWeight="semiBold" textColor="neutral800">
@@ -227,7 +215,7 @@ export const ProvidersPage = () => {
227
215
  })}
228
216
  </Typography>
229
217
  </Td>
230
- <Td {...stopPropagation}>
218
+ <Td onClick={(e) => e.stopPropagation()}>
231
219
  {canUpdate && (
232
220
  <IconButton
233
221
  onClick={() => handleClickEdit(provider)}
@@ -242,7 +230,7 @@ export const ProvidersPage = () => {
242
230
  </Tbody>
243
231
  </Table>
244
232
  </ContentLayout>
245
- </Main>
233
+ </Page.Main>
246
234
  <FormModal
247
235
  initialData={data[providerToEditName]}
248
236
  isOpen={isOpen}
@@ -1,7 +1,6 @@
1
1
  import { useEffect } from 'react';
2
2
 
3
- import { useFetchClient } from '@strapi/helper-plugin';
4
- import { useAPIErrorHandler, useNotification } from '@strapi/strapi/admin';
3
+ import { useAPIErrorHandler, useNotification, useFetchClient } from '@strapi/strapi/admin';
5
4
  import { useQueries } from 'react-query';
6
5
 
7
6
  import { cleanPermissions, getTrad } from '../../../utils';
@@ -12,9 +12,8 @@ import {
12
12
  TextInput,
13
13
  Typography,
14
14
  } from '@strapi/design-system';
15
- import { useFetchClient } from '@strapi/helper-plugin';
16
15
  import { Check } from '@strapi/icons';
17
- import { Page, useTracking, useNotification } from '@strapi/strapi/admin';
16
+ import { Page, useTracking, useNotification, useFetchClient } from '@strapi/strapi/admin';
18
17
  import { Formik, Form } from 'formik';
19
18
  import { Helmet } from 'react-helmet';
20
19
  import { useIntl } from 'react-intl';
@@ -12,9 +12,14 @@ import {
12
12
  GridItem,
13
13
  Grid,
14
14
  } from '@strapi/design-system';
15
- import { useFetchClient } from '@strapi/helper-plugin';
16
15
  import { Check } from '@strapi/icons';
17
- import { Page, BackButton, useAPIErrorHandler, useNotification } from '@strapi/strapi/admin';
16
+ import {
17
+ Page,
18
+ BackButton,
19
+ useAPIErrorHandler,
20
+ useNotification,
21
+ useFetchClient,
22
+ } from '@strapi/strapi/admin';
18
23
  import { Formik, Form } from 'formik';
19
24
  import { Helmet } from 'react-helmet';
20
25
  import { useIntl } from 'react-intl';
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
3
  import { Flex, IconButton, Link, Tbody, Td, Tr, Typography } from '@strapi/design-system';
4
- import { onRowClick, stopPropagation } from '@strapi/helper-plugin';
5
4
  import { Pencil, Trash } from '@strapi/icons';
6
5
  import PropTypes from 'prop-types';
7
6
  import { useIntl } from 'react-intl';
@@ -51,7 +50,7 @@ const TableBody = ({ sortedRoles, canDelete, canUpdate, setRoleToDelete, onDelet
51
50
  return (
52
51
  <Tbody>
53
52
  {sortedRoles?.map((role) => (
54
- <Tr key={role.name} {...onRowClick({ fn: () => navigate(role.id.toString()) })}>
53
+ <Tr key={role.name} onClick={() => navigate(role.id.toString())}>
55
54
  <Td width="20%">
56
55
  <Typography>{role.name}</Typography>
57
56
  </Td>
@@ -70,7 +69,7 @@ const TableBody = ({ sortedRoles, canDelete, canUpdate, setRoleToDelete, onDelet
70
69
  </Typography>
71
70
  </Td>
72
71
  <Td>
73
- <Flex justifyContent="end" {...stopPropagation}>
72
+ <Flex justifyContent="end" onClick={(e) => e.stopPropagation()}>
74
73
  {canUpdate ? (
75
74
  <EditLink
76
75
  to={role.id.toString()}
@@ -5,7 +5,6 @@ import {
5
5
  ContentLayout,
6
6
  HeaderLayout,
7
7
  Layout,
8
- Main,
9
8
  Table,
10
9
  Th,
11
10
  Thead,
@@ -18,7 +17,7 @@ import {
18
17
  useFilter,
19
18
  } from '@strapi/design-system';
20
19
  import { LinkButton } from '@strapi/design-system/v2';
21
- import { useFocusWhenNavigate, useQueryParams, useRBAC } from '@strapi/helper-plugin';
20
+ import { useRBAC } from '@strapi/helper-plugin';
22
21
  import { Plus } from '@strapi/icons';
23
22
  import {
24
23
  ConfirmDialog,
@@ -27,6 +26,8 @@ import {
27
26
  SearchInput,
28
27
  BackButton,
29
28
  useNotification,
29
+ useQueryParams,
30
+ useFetchClient,
30
31
  } from '@strapi/strapi/admin';
31
32
  import { Helmet } from 'react-helmet';
32
33
  import { useIntl } from 'react-intl';
@@ -37,7 +38,6 @@ import { PERMISSIONS } from '../../../../constants';
37
38
  import { getTrad } from '../../../../utils';
38
39
 
39
40
  import TableBody from './components/TableBody';
40
- import { deleteData, fetchData } from './utils/api';
41
41
 
42
42
  export const RolesListPage = () => {
43
43
  const { trackUsage } = useTracking();
@@ -48,7 +48,7 @@ export const RolesListPage = () => {
48
48
  const _q = query?._q || '';
49
49
  const [showConfirmDelete, setShowConfirmDelete] = useState(false);
50
50
  const [roleToDelete, setRoleToDelete] = useState();
51
- useFocusWhenNavigate();
51
+ const { del, get } = useFetchClient();
52
52
 
53
53
  const {
54
54
  isLoading: isLoadingForPermissions,
@@ -87,6 +87,33 @@ export const RolesListPage = () => {
87
87
  setShowConfirmDelete(!showConfirmDelete);
88
88
  };
89
89
 
90
+ const deleteData = async (id, formatMessage, toggleNotification) => {
91
+ try {
92
+ await del(`/users-permissions/roles/${id}`);
93
+ } catch (error) {
94
+ toggleNotification({
95
+ type: 'danger',
96
+ message: formatMessage({ id: 'notification.error', defaultMessage: 'An error occured' }),
97
+ });
98
+ }
99
+ };
100
+
101
+ const fetchData = async (toggleNotification, formatMessage, notifyStatus) => {
102
+ try {
103
+ const { data } = await get('/users-permissions/roles');
104
+ notifyStatus('The roles have loaded successfully');
105
+
106
+ return data;
107
+ } catch (err) {
108
+ toggleNotification({
109
+ type: 'danger',
110
+ message: formatMessage({ id: 'notification.error' }),
111
+ });
112
+
113
+ throw new Error(err);
114
+ }
115
+ };
116
+
90
117
  const emptyLayout = {
91
118
  roles: {
92
119
  id: getTrad('Roles.empty'),
@@ -137,7 +164,7 @@ export const RolesListPage = () => {
137
164
  { name: pageTitle }
138
165
  )}
139
166
  />
140
- <Main aria-busy={isLoading}>
167
+ <Page.Main>
141
168
  <HeaderLayout
142
169
  title={formatMessage({
143
170
  id: 'global.roles',
@@ -232,7 +259,7 @@ export const RolesListPage = () => {
232
259
  onClose={handleShowConfirmDelete}
233
260
  isOpen={showConfirmDelete}
234
261
  />
235
- </Main>
262
+ </Page.Main>
236
263
  </Layout>
237
264
  );
238
265
  };
@@ -0,0 +1,13 @@
1
+ const prefixPluginTranslations = (trad, pluginId) => {
2
+ if (!pluginId) {
3
+ throw new TypeError("pluginId can't be empty");
4
+ }
5
+
6
+ return Object.keys(trad).reduce((acc, current) => {
7
+ acc[`${pluginId}.${current}`] = trad[current];
8
+
9
+ return acc;
10
+ }, {});
11
+ };
12
+
13
+ export { prefixPluginTranslations };