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

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 (55) hide show
  1. package/LICENSE +18 -3
  2. package/admin/src/components/FormModal/index.jsx +50 -66
  3. package/admin/src/components/Permissions/PermissionRow/CheckboxWrapper.jsx +3 -2
  4. package/admin/src/components/Permissions/PermissionRow/SubCategory.jsx +11 -20
  5. package/admin/src/components/Permissions/index.jsx +1 -0
  6. package/admin/src/components/Policies/index.jsx +3 -3
  7. package/admin/src/components/UsersPermissions/index.jsx +5 -5
  8. package/admin/src/pages/AdvancedSettings/index.jsx +5 -5
  9. package/admin/src/pages/EmailTemplates/components/EmailForm.jsx +113 -112
  10. package/admin/src/pages/EmailTemplates/components/EmailTable.jsx +17 -12
  11. package/admin/src/pages/EmailTemplates/index.jsx +6 -7
  12. package/admin/src/pages/Providers/index.jsx +1 -1
  13. package/admin/src/pages/Roles/pages/CreatePage.jsx +6 -7
  14. package/admin/src/pages/Roles/pages/EditPage.jsx +6 -7
  15. package/admin/src/pages/Roles/pages/ListPage/components/TableBody.jsx +6 -5
  16. package/admin/src/pages/Roles/pages/ListPage/index.jsx +5 -6
  17. package/dist/_chunks/{index-69WUS0qJ-DzUzGVgd.mjs → index-8-k5RCnK-BHUgmsKx.mjs} +1231 -320
  18. package/dist/_chunks/index-8-k5RCnK-BHUgmsKx.mjs.map +1 -0
  19. package/dist/_chunks/{index-69WUS0qJ-621Sl9hj.js → index-8-k5RCnK-qR3QHvSP.js} +1228 -317
  20. package/dist/_chunks/index-8-k5RCnK-qR3QHvSP.js.map +1 -0
  21. package/dist/_chunks/{index-B_rNTZBF.mjs → index-B9OX-a4A.mjs} +29 -34
  22. package/dist/_chunks/index-B9OX-a4A.mjs.map +1 -0
  23. package/dist/_chunks/{index-B6AAcVOR.mjs → index-Cf2sMpyd.mjs} +10 -10
  24. package/dist/_chunks/{index-B6AAcVOR.mjs.map → index-Cf2sMpyd.mjs.map} +1 -1
  25. package/dist/_chunks/{index-00_Lq0-y.mjs → index-DCFIfSfa.mjs} +17 -23
  26. package/dist/_chunks/index-DCFIfSfa.mjs.map +1 -0
  27. package/dist/_chunks/{index-DGyiWVHr.js → index-DRoVF6Y7.js} +20 -26
  28. package/dist/_chunks/index-DRoVF6Y7.js.map +1 -0
  29. package/dist/_chunks/{index-BSqwdKVh.js → index-DVEZVDjs.js} +28 -33
  30. package/dist/_chunks/index-DVEZVDjs.js.map +1 -0
  31. package/dist/_chunks/{index-DTK4DMrt.js → index-iMO1GC3n.js} +94 -96
  32. package/dist/_chunks/index-iMO1GC3n.js.map +1 -0
  33. package/dist/_chunks/{index-CIJz4WB2.js → index-iSLj9xJT.js} +4 -4
  34. package/dist/_chunks/index-iSLj9xJT.js.map +1 -0
  35. package/dist/_chunks/{index-BGu68xEV.js → index-iaebB1BT.js} +10 -10
  36. package/dist/_chunks/{index-BGu68xEV.js.map → index-iaebB1BT.js.map} +1 -1
  37. package/dist/_chunks/{index-DaCuO0x_.mjs → index-qhy_K2pJ.mjs} +5 -5
  38. package/dist/_chunks/index-qhy_K2pJ.mjs.map +1 -0
  39. package/dist/_chunks/{index-fnfzDsYv.mjs → index-zmcUQlrv.mjs} +95 -97
  40. package/dist/_chunks/index-zmcUQlrv.mjs.map +1 -0
  41. package/dist/admin/index.js +1 -1
  42. package/dist/admin/index.mjs +1 -1
  43. package/package.json +6 -6
  44. package/server/config.js +29 -0
  45. package/server/controllers/auth.js +22 -4
  46. package/dist/_chunks/index-00_Lq0-y.mjs.map +0 -1
  47. package/dist/_chunks/index-69WUS0qJ-621Sl9hj.js.map +0 -1
  48. package/dist/_chunks/index-69WUS0qJ-DzUzGVgd.mjs.map +0 -1
  49. package/dist/_chunks/index-BSqwdKVh.js.map +0 -1
  50. package/dist/_chunks/index-B_rNTZBF.mjs.map +0 -1
  51. package/dist/_chunks/index-CIJz4WB2.js.map +0 -1
  52. package/dist/_chunks/index-DGyiWVHr.js.map +0 -1
  53. package/dist/_chunks/index-DTK4DMrt.js.map +0 -1
  54. package/dist/_chunks/index-DaCuO0x_.mjs.map +0 -1
  55. package/dist/_chunks/index-fnfzDsYv.mjs.map +0 -1
@@ -10,6 +10,7 @@ import {
10
10
  Tr,
11
11
  Typography,
12
12
  VisuallyHidden,
13
+ Box,
13
14
  } from '@strapi/design-system';
14
15
  import { Check, Pencil, ArrowClockwise as Refresh } from '@strapi/icons';
15
16
  import PropTypes from 'prop-types';
@@ -53,12 +54,14 @@ const EmailTable = ({ canUpdate, onEditClick }) => {
53
54
  <Tbody>
54
55
  <Tr onClick={() => onEditClick('reset_password')}>
55
56
  <Td>
56
- <Refresh
57
- aria-label={formatMessage({
58
- id: 'global.reset-password',
59
- defaultMessage: 'Reset password',
60
- })}
61
- />
57
+ <Box width="3.2rem" height="3.2rem" padding="0.8rem">
58
+ <Refresh
59
+ aria-label={formatMessage({
60
+ id: 'global.reset-password',
61
+ defaultMessage: 'Reset password',
62
+ })}
63
+ />
64
+ </Box>
62
65
  </Td>
63
66
  <Td>
64
67
  <Typography>
@@ -84,12 +87,14 @@ const EmailTable = ({ canUpdate, onEditClick }) => {
84
87
  </Tr>
85
88
  <Tr onClick={() => onEditClick('email_confirmation')}>
86
89
  <Td>
87
- <Check
88
- aria-label={formatMessage({
89
- id: getTrad('Email.template.email_confirmation'),
90
- defaultMessage: 'Email address confirmation',
91
- })}
92
- />
90
+ <Box width="3.2rem" height="3.2rem" padding="0.8rem">
91
+ <Check
92
+ aria-label={formatMessage({
93
+ id: getTrad('Email.template.email_confirmation'),
94
+ defaultMessage: 'Email address confirmation',
95
+ })}
96
+ />
97
+ </Box>
93
98
  </Td>
94
99
  <Td>
95
100
  <Typography>
@@ -134,13 +134,12 @@ const EmailTemplatesPage = () => {
134
134
  />
135
135
  <Layouts.Content>
136
136
  <EmailTable onEditClick={handleEditClick} canUpdate={canUpdate} />
137
- {isModalOpen && (
138
- <EmailForm
139
- template={data[templateToEdit]}
140
- onToggle={handleToggle}
141
- onSubmit={handleSubmit}
142
- />
143
- )}
137
+ <EmailForm
138
+ template={data[templateToEdit]}
139
+ onToggle={handleToggle}
140
+ open={isModalOpen}
141
+ onSubmit={handleSubmit}
142
+ />
144
143
  </Layouts.Content>
145
144
  </Page.Main>
146
145
  );
@@ -63,7 +63,7 @@ export const ProvidersPage = () => {
63
63
 
64
64
  const submitMutation = useMutation((body) => put('/users-permissions/providers', body), {
65
65
  async onSuccess() {
66
- await queryClient.invalidateQueries(['users-permissions', 'providers']);
66
+ await queryClient.invalidateQueries(['users-permissions', 'get-providers']);
67
67
 
68
68
  toggleNotification({
69
69
  type: 'success',
@@ -4,7 +4,6 @@ import {
4
4
  Button,
5
5
  Flex,
6
6
  Grid,
7
- GridItem,
8
7
  Main,
9
8
  Textarea,
10
9
  TextInput,
@@ -125,8 +124,8 @@ export const CreatePage = () => {
125
124
  })}
126
125
  </Typography>
127
126
 
128
- <Grid gap={4}>
129
- <GridItem col={6}>
127
+ <Grid.Root gap={4}>
128
+ <Grid.Item col={6}>
130
129
  <Field.Root
131
130
  name="name"
132
131
  error={
@@ -145,8 +144,8 @@ export const CreatePage = () => {
145
144
  <TextInput value={values.name || ''} onChange={handleChange} />
146
145
  <Field.Error />
147
146
  </Field.Root>
148
- </GridItem>
149
- <GridItem col={6}>
147
+ </Grid.Item>
148
+ <Grid.Item col={6}>
150
149
  <Field.Root
151
150
  name="description"
152
151
  error={
@@ -168,8 +167,8 @@ export const CreatePage = () => {
168
167
  <Textarea value={values.description || ''} onChange={handleChange} />
169
168
  <Field.Error />
170
169
  </Field.Root>
171
- </GridItem>
172
- </Grid>
170
+ </Grid.Item>
171
+ </Grid.Root>
173
172
  </Flex>
174
173
 
175
174
  {!isLoadingPlugins && (
@@ -7,7 +7,6 @@ import {
7
7
  TextInput,
8
8
  Textarea,
9
9
  Typography,
10
- GridItem,
11
10
  Grid,
12
11
  Field,
13
12
  } from '@strapi/design-system';
@@ -143,8 +142,8 @@ export const EditPage = () => {
143
142
  })}
144
143
  </Typography>
145
144
 
146
- <Grid gap={4}>
147
- <GridItem col={6}>
145
+ <Grid.Root gap={4}>
146
+ <Grid.Item col={6}>
148
147
  <Field.Root
149
148
  name="name"
150
149
  error={
@@ -166,8 +165,8 @@ export const EditPage = () => {
166
165
  <TextInput value={values.name || ''} onChange={handleChange} />
167
166
  <Field.Error />
168
167
  </Field.Root>
169
- </GridItem>
170
- <GridItem col={6}>
168
+ </Grid.Item>
169
+ <Grid.Item col={6}>
171
170
  <Field.Root
172
171
  name="description"
173
172
  error={
@@ -189,8 +188,8 @@ export const EditPage = () => {
189
188
  <Textarea value={values.description || ''} onChange={handleChange} />
190
189
  <Field.Error />
191
190
  </Field.Root>
192
- </GridItem>
193
- </Grid>
191
+ </Grid.Item>
192
+ </Grid.Root>
194
193
  </Flex>
195
194
 
196
195
  {!isLoadingPlugins && (
@@ -4,20 +4,20 @@ import { Flex, IconButton, Link, Tbody, Td, Tr, Typography } from '@strapi/desig
4
4
  import { Pencil, Trash } from '@strapi/icons';
5
5
  import PropTypes from 'prop-types';
6
6
  import { useIntl } from 'react-intl';
7
- import { useNavigate } from 'react-router-dom';
7
+ import { useNavigate, NavLink } from 'react-router-dom';
8
8
  import { styled } from 'styled-components';
9
9
 
10
10
  const EditLink = styled(Link)`
11
11
  align-items: center;
12
12
  height: 3.2rem;
13
+ width: 3.2rem;
13
14
  display: flex;
14
15
  justify-content: center;
15
- padding: ${({ theme }) => `${theme.spaces[2]}}`};
16
- width: 3.2rem;
16
+ padding: ${({ theme }) => `${theme.spaces[2]}`};
17
17
 
18
18
  svg {
19
- height: 1.2rem;
20
- width: 1.2rem;
19
+ height: 1.6rem;
20
+ width: 1.6rem;
21
21
 
22
22
  path {
23
23
  fill: ${({ theme }) => theme.colors.neutral500};
@@ -72,6 +72,7 @@ const TableBody = ({ sortedRoles, canDelete, canUpdate, setRoleToDelete, onDelet
72
72
  <Flex justifyContent="end" onClick={(e) => e.stopPropagation()}>
73
73
  {canUpdate ? (
74
74
  <EditLink
75
+ tag={NavLink}
75
76
  to={role.id.toString()}
76
77
  aria-label={formatMessage(
77
78
  { id: 'app.component.table.edit', defaultMessage: 'Edit {target}' },
@@ -11,8 +11,9 @@ import {
11
11
  EmptyStateLayout,
12
12
  useCollator,
13
13
  useFilter,
14
+ LinkButton,
15
+ Dialog,
14
16
  } from '@strapi/design-system';
15
- import { LinkButton } from '@strapi/design-system';
16
17
  import { Plus } from '@strapi/icons';
17
18
  import {
18
19
  ConfirmDialog,
@@ -250,11 +251,9 @@ export const RolesListPage = () => {
250
251
  <EmptyStateLayout content={formatMessage(emptyLayout[emptyContent])} />
251
252
  )}
252
253
  </Layouts.Content>
253
- <ConfirmDialog
254
- onConfirm={handleConfirmDelete}
255
- onClose={handleShowConfirmDelete}
256
- isOpen={showConfirmDelete}
257
- />
254
+ <Dialog.Root open={showConfirmDelete} onOpenChange={handleShowConfirmDelete}>
255
+ <ConfirmDialog onConfirm={handleConfirmDelete} />
256
+ </Dialog.Root>
258
257
  </Page.Main>
259
258
  </Layouts.Root>
260
259
  );