@strapi/plugin-users-permissions 0.0.0-next.de5394e73076ccf7aca1e28dc68894e3c43f8b91 → 0.0.0-next.e037a7b2d1f48b7bd8bcd0d9400ca0f9ded8a982

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 (41) hide show
  1. package/admin/src/components/Permissions/index.js +2 -4
  2. package/admin/src/{permissions.js → constants.js} +1 -3
  3. package/admin/src/index.js +12 -13
  4. package/admin/src/pages/AdvancedSettings/index.js +48 -35
  5. package/admin/src/pages/EmailTemplates/index.js +66 -55
  6. package/admin/src/pages/Providers/index.js +66 -64
  7. package/admin/src/{hooks → pages/Roles/hooks}/usePlugins.js +15 -8
  8. package/admin/src/pages/Roles/index.js +12 -9
  9. package/admin/src/pages/Roles/pages/CreatePage.js +190 -0
  10. package/admin/src/pages/Roles/pages/EditPage.js +211 -0
  11. package/admin/src/pages/Roles/{ListPage → pages/ListPage}/components/TableBody.js +44 -14
  12. package/admin/src/pages/Roles/{ListPage → pages/ListPage}/index.js +31 -32
  13. package/admin/src/pages/Roles/{ListPage → pages/ListPage}/utils/api.js +2 -4
  14. package/admin/src/translations/zh-Hans.json +80 -80
  15. package/admin/src/utils/index.js +0 -1
  16. package/documentation/content-api.yaml +1 -1
  17. package/jest.config.front.js +1 -1
  18. package/package.json +10 -10
  19. package/server/bootstrap/index.js +35 -0
  20. package/server/controllers/auth.js +46 -13
  21. package/server/controllers/user.js +12 -1
  22. package/server/middlewares/rateLimit.js +41 -21
  23. package/admin/src/hooks/index.js +0 -5
  24. package/admin/src/hooks/useFetchRole/index.js +0 -67
  25. package/admin/src/hooks/useFetchRole/reducer.js +0 -31
  26. package/admin/src/hooks/useForm/index.js +0 -70
  27. package/admin/src/hooks/useForm/reducer.js +0 -40
  28. package/admin/src/hooks/useRolesList/index.js +0 -65
  29. package/admin/src/hooks/useRolesList/init.js +0 -5
  30. package/admin/src/hooks/useRolesList/reducer.js +0 -31
  31. package/admin/src/pages/AdvancedSettings/utils/api.js +0 -18
  32. package/admin/src/pages/EmailTemplates/utils/api.js +0 -18
  33. package/admin/src/pages/Providers/reducer.js +0 -54
  34. package/admin/src/pages/Providers/utils/api.js +0 -26
  35. package/admin/src/pages/Providers/utils/createProvidersArray.js +0 -21
  36. package/admin/src/pages/Roles/CreatePage.js +0 -185
  37. package/admin/src/pages/Roles/EditPage.js +0 -197
  38. package/admin/src/pages/Roles/ProtectedCreatePage.js +0 -15
  39. package/admin/src/pages/Roles/ProtectedEditPage.js +0 -15
  40. package/admin/src/pages/Roles/ProtectedListPage.js +0 -17
  41. package/admin/src/utils/getRequestURL.js +0 -5
@@ -0,0 +1,211 @@
1
+ import * as React from 'react';
2
+
3
+ import {
4
+ ContentLayout,
5
+ HeaderLayout,
6
+ Main,
7
+ Button,
8
+ Flex,
9
+ TextInput,
10
+ Textarea,
11
+ Typography,
12
+ GridItem,
13
+ Grid,
14
+ } from '@strapi/design-system';
15
+ import {
16
+ CheckPagePermissions,
17
+ useOverlayBlocker,
18
+ SettingsPageTitle,
19
+ LoadingIndicatorPage,
20
+ Form,
21
+ useAPIErrorHandler,
22
+ useFetchClient,
23
+ useNotification,
24
+ Link,
25
+ } from '@strapi/helper-plugin';
26
+ import { ArrowLeft, Check } from '@strapi/icons';
27
+ import { Formik } from 'formik';
28
+ import { useIntl } from 'react-intl';
29
+ import { useQuery, useMutation } from 'react-query';
30
+ import { useRouteMatch } from 'react-router-dom';
31
+
32
+ import UsersPermissions from '../../../components/UsersPermissions';
33
+ import { PERMISSIONS } from '../../../constants';
34
+ import getTrad from '../../../utils/getTrad';
35
+ import { createRoleSchema } from '../constants';
36
+ import { usePlugins } from '../hooks/usePlugins';
37
+
38
+ export const EditPage = () => {
39
+ const { formatMessage } = useIntl();
40
+ const toggleNotification = useNotification();
41
+ const { lockApp, unlockApp } = useOverlayBlocker();
42
+ const {
43
+ params: { id },
44
+ } = useRouteMatch(`/settings/users-permissions/roles/:id`);
45
+ const { get } = useFetchClient();
46
+ const { isLoading: isLoadingPlugins, routes } = usePlugins();
47
+ const {
48
+ data: role,
49
+ isLoading: isLoadingRole,
50
+ refetch: refetchRole,
51
+ } = useQuery(['users-permissions', 'role', id], async () => {
52
+ // TODO: why doesn't this endpoint follow the admin API conventions?
53
+ const {
54
+ data: { role },
55
+ } = await get(`/users-permissions/roles/${id}`);
56
+
57
+ return role;
58
+ });
59
+
60
+ const permissionsRef = React.useRef();
61
+ const { put } = useFetchClient();
62
+ const { formatAPIError } = useAPIErrorHandler();
63
+ const mutation = useMutation((body) => put(`/users-permissions/roles/${id}`, body), {
64
+ onError(error) {
65
+ toggleNotification({
66
+ type: 'warning',
67
+ message: formatAPIError(error),
68
+ });
69
+ },
70
+
71
+ async onSuccess() {
72
+ toggleNotification({
73
+ type: 'success',
74
+ message: {
75
+ id: getTrad('Settings.roles.created'),
76
+ defaultMessage: 'Role edited',
77
+ },
78
+ });
79
+
80
+ await refetchRole();
81
+ },
82
+ });
83
+
84
+ const handleEditRoleSubmit = async (data) => {
85
+ // Set loading state
86
+ lockApp();
87
+
88
+ const permissions = permissionsRef.current.getPermissions();
89
+
90
+ await mutation.mutate({ ...data, ...permissions, users: [] });
91
+
92
+ unlockApp();
93
+ };
94
+
95
+ if (isLoadingRole) {
96
+ return <LoadingIndicatorPage />;
97
+ }
98
+
99
+ return (
100
+ <Main>
101
+ {/* TODO: this needs to be translated */}
102
+ <SettingsPageTitle name="Roles" />
103
+ <Formik
104
+ enableReinitialize
105
+ initialValues={{ name: role.name, description: role.description }}
106
+ onSubmit={handleEditRoleSubmit}
107
+ validationSchema={createRoleSchema}
108
+ >
109
+ {({ handleSubmit, values, handleChange, errors }) => (
110
+ <Form noValidate onSubmit={handleSubmit}>
111
+ <HeaderLayout
112
+ primaryAction={
113
+ !isLoadingPlugins && (
114
+ <Button
115
+ disabled={role.code === 'strapi-super-admin'}
116
+ type="submit"
117
+ loading={mutation.isLoading}
118
+ startIcon={<Check />}
119
+ >
120
+ {formatMessage({
121
+ id: 'global.save',
122
+ defaultMessage: 'Save',
123
+ })}
124
+ </Button>
125
+ )
126
+ }
127
+ title={role.name}
128
+ subtitle={role.description}
129
+ navigationAction={
130
+ <Link startIcon={<ArrowLeft />} to="/settings/users-permissions/roles">
131
+ {formatMessage({
132
+ id: 'global.back',
133
+ defaultMessage: 'Back',
134
+ })}
135
+ </Link>
136
+ }
137
+ />
138
+ <ContentLayout>
139
+ <Flex
140
+ background="neutral0"
141
+ direction="column"
142
+ alignItems="stretch"
143
+ gap={7}
144
+ hasRadius
145
+ paddingTop={6}
146
+ paddingBottom={6}
147
+ paddingLeft={7}
148
+ paddingRight={7}
149
+ shadow="filterShadow"
150
+ >
151
+ <Flex direction="column" alignItems="stretch" gap={4}>
152
+ <Typography variant="delta" as="h2">
153
+ {formatMessage({
154
+ id: getTrad('EditPage.form.roles'),
155
+ defaultMessage: 'Role details',
156
+ })}
157
+ </Typography>
158
+
159
+ <Grid gap={4}>
160
+ <GridItem col={6}>
161
+ <TextInput
162
+ name="name"
163
+ value={values.name || ''}
164
+ onChange={handleChange}
165
+ label={formatMessage({
166
+ id: 'global.name',
167
+ defaultMessage: 'Name',
168
+ })}
169
+ error={errors?.name ? formatMessage({ id: errors.name }) : false}
170
+ required
171
+ />
172
+ </GridItem>
173
+ <GridItem col={6}>
174
+ <Textarea
175
+ id="description"
176
+ value={values.description || ''}
177
+ onChange={handleChange}
178
+ label={formatMessage({
179
+ id: 'global.description',
180
+ defaultMessage: 'Description',
181
+ })}
182
+ error={
183
+ errors?.description ? formatMessage({ id: errors.description }) : false
184
+ }
185
+ required
186
+ />
187
+ </GridItem>
188
+ </Grid>
189
+ </Flex>
190
+
191
+ {!isLoadingPlugins && (
192
+ <UsersPermissions
193
+ ref={permissionsRef}
194
+ permissions={role.permissions}
195
+ routes={routes}
196
+ />
197
+ )}
198
+ </Flex>
199
+ </ContentLayout>
200
+ </Form>
201
+ )}
202
+ </Formik>
203
+ </Main>
204
+ );
205
+ };
206
+
207
+ export const ProtectedRolesEditPage = () => (
208
+ <CheckPagePermissions permissions={PERMISSIONS.updateRole}>
209
+ <EditPage />
210
+ </CheckPagePermissions>
211
+ );
@@ -1,13 +1,39 @@
1
1
  import React from 'react';
2
2
 
3
- import { Flex, IconButton, Tbody, Td, Tr, Typography } from '@strapi/design-system';
4
- import { CheckPermissions, onRowClick, stopPropagation } from '@strapi/helper-plugin';
3
+ import { Flex, IconButton, Link, Tbody, Td, Tr, Typography } from '@strapi/design-system';
4
+ import { CheckPermissions, onRowClick, pxToRem, stopPropagation } from '@strapi/helper-plugin';
5
5
  import { Pencil, Trash } from '@strapi/icons';
6
6
  import PropTypes from 'prop-types';
7
7
  import { useIntl } from 'react-intl';
8
8
  import { useHistory } from 'react-router-dom';
9
+ import styled from 'styled-components';
9
10
 
10
- import pluginId from '../../../../pluginId';
11
+ const EditLink = styled(Link)`
12
+ align-items: center;
13
+ height: ${pxToRem(32)};
14
+ display: flex;
15
+ justify-content: center;
16
+ padding: ${({ theme }) => `${theme.spaces[2]}}`};
17
+ width: ${pxToRem(32)};
18
+
19
+ svg {
20
+ height: ${pxToRem(12)};
21
+ width: ${pxToRem(12)};
22
+
23
+ path {
24
+ fill: ${({ theme }) => theme.colors.neutral500};
25
+ }
26
+ }
27
+
28
+ &:hover,
29
+ &:focus {
30
+ svg {
31
+ path {
32
+ fill: ${({ theme }) => theme.colors.neutral800};
33
+ }
34
+ }
35
+ }
36
+ `;
11
37
 
12
38
  const TableBody = ({ sortedRoles, canDelete, permissions, setRoleToDelete, onDelete }) => {
13
39
  const { formatMessage } = useIntl();
@@ -23,7 +49,7 @@ const TableBody = ({ sortedRoles, canDelete, permissions, setRoleToDelete, onDel
23
49
  };
24
50
 
25
51
  const handleClickEdit = (id) => {
26
- push(`/settings/${pluginId}/roles/${id}`);
52
+ push(`/settings/users-permissions/roles/${id}`);
27
53
  };
28
54
 
29
55
  return (
@@ -38,25 +64,29 @@ const TableBody = ({ sortedRoles, canDelete, permissions, setRoleToDelete, onDel
38
64
  </Td>
39
65
  <Td width="30%">
40
66
  <Typography>
41
- {`${role.nb_users} ${formatMessage({
42
- id: 'global.users',
43
- defaultMessage: 'users',
44
- }).toLowerCase()}`}
67
+ {formatMessage(
68
+ {
69
+ id: 'Roles.RoleRow.user-count',
70
+ defaultMessage: '{number, plural, =0 {# user} one {# user} other {# users}}',
71
+ },
72
+ { number: role.nb_users }
73
+ )}
45
74
  </Typography>
46
75
  </Td>
47
76
  <Td>
48
77
  <Flex justifyContent="end" {...stopPropagation}>
49
78
  <CheckPermissions permissions={permissions.updateRole}>
50
- <IconButton
51
- onClick={() => handleClickEdit(role.id)}
52
- noBorder
53
- icon={<Pencil />}
54
- label={formatMessage(
79
+ <EditLink
80
+ to={`/settings/users-permissions/roles/${role.id}`}
81
+ aria-label={formatMessage(
55
82
  { id: 'app.component.table.edit', defaultMessage: 'Edit {target}' },
56
83
  { target: `${role.name}` }
57
84
  )}
58
- />
85
+ >
86
+ <Pencil />
87
+ </EditLink>
59
88
  </CheckPermissions>
89
+
60
90
  {checkCanDeleteRole(role) && (
61
91
  <CheckPermissions permissions={permissions.deleteRole}>
62
92
  <IconButton
@@ -1,8 +1,7 @@
1
- import React, { useMemo, useState } from 'react';
1
+ import React, { useState } from 'react';
2
2
 
3
3
  import {
4
4
  ActionLayout,
5
- Button,
6
5
  ContentLayout,
7
6
  HeaderLayout,
8
7
  Layout,
@@ -16,9 +15,11 @@ import {
16
15
  VisuallyHidden,
17
16
  } from '@strapi/design-system';
18
17
  import {
18
+ CheckPagePermissions,
19
19
  CheckPermissions,
20
20
  ConfirmDialog,
21
21
  EmptyStateLayout,
22
+ LinkButton,
22
23
  LoadingIndicatorPage,
23
24
  NoPermissions,
24
25
  SearchURLQuery,
@@ -33,20 +34,17 @@ import {
33
34
  } from '@strapi/helper-plugin';
34
35
  import { Plus } from '@strapi/icons';
35
36
  import { useIntl } from 'react-intl';
36
- import { useMutation, useQuery, useQueryClient } from 'react-query';
37
- import { useHistory } from 'react-router-dom';
37
+ import { useMutation, useQuery } from 'react-query';
38
38
 
39
- import permissions from '../../../permissions';
40
- import pluginId from '../../../pluginId';
41
- import { getTrad } from '../../../utils';
39
+ import { PERMISSIONS } from '../../../../constants';
40
+ import { getTrad } from '../../../../utils';
42
41
 
43
42
  import TableBody from './components/TableBody';
44
43
  import { deleteData, fetchData } from './utils/api';
45
44
 
46
- const RoleListPage = () => {
45
+ export const RolesListPage = () => {
47
46
  const { trackUsage } = useTracking();
48
47
  const { formatMessage, locale } = useIntl();
49
- const { push } = useHistory();
50
48
  const toggleNotification = useNotification();
51
49
  const { notifyStatus } = useNotifyAT();
52
50
  const [{ query }] = useQueryParams();
@@ -56,26 +54,21 @@ const RoleListPage = () => {
56
54
  const [roleToDelete, setRoleToDelete] = useState();
57
55
  useFocusWhenNavigate();
58
56
 
59
- const queryClient = useQueryClient();
60
-
61
- const updatePermissions = useMemo(() => {
62
- return {
63
- create: permissions.createRole,
64
- read: permissions.readRoles,
65
- update: permissions.updateRole,
66
- delete: permissions.deleteRole,
67
- };
68
- }, []);
69
-
70
57
  const {
71
58
  isLoading: isLoadingForPermissions,
72
59
  allowedActions: { canRead, canDelete },
73
- } = useRBAC(updatePermissions);
60
+ } = useRBAC({
61
+ create: PERMISSIONS.createRole,
62
+ read: PERMISSIONS.readRoles,
63
+ update: PERMISSIONS.updateRole,
64
+ delete: PERMISSIONS.deleteRole,
65
+ });
74
66
 
75
67
  const {
76
68
  isLoading: isLoadingForData,
77
69
  data: { roles },
78
70
  isFetching,
71
+ refetch,
79
72
  } = useQuery('get-roles', () => fetchData(toggleNotification, notifyStatus), {
80
73
  initialData: {},
81
74
  enabled: canRead,
@@ -94,11 +87,6 @@ const RoleListPage = () => {
94
87
 
95
88
  const isLoading = isLoadingForData || isFetching;
96
89
 
97
- const handleNewRoleClick = () => {
98
- trackUsage('willCreateRole');
99
- push(`/settings/${pluginId}/roles/new`);
100
- };
101
-
102
90
  const handleShowConfirmDelete = () => {
103
91
  setShowConfirmDelete(!showConfirmDelete);
104
92
  };
@@ -121,7 +109,7 @@ const RoleListPage = () => {
121
109
 
122
110
  const deleteMutation = useMutation((id) => deleteData(id, toggleNotification), {
123
111
  async onSuccess() {
124
- await queryClient.invalidateQueries('get-roles');
112
+ await refetch();
125
113
  },
126
114
  });
127
115
 
@@ -157,13 +145,18 @@ const RoleListPage = () => {
157
145
  defaultMessage: 'List of roles',
158
146
  })}
159
147
  primaryAction={
160
- <CheckPermissions permissions={permissions.createRole}>
161
- <Button onClick={handleNewRoleClick} startIcon={<Plus />} size="S">
148
+ <CheckPermissions permissions={PERMISSIONS.createRole}>
149
+ <LinkButton
150
+ to="/settings/users-permissions/roles/new"
151
+ onClick={() => trackUsage('willCreateRole')}
152
+ startIcon={<Plus />}
153
+ size="S"
154
+ >
162
155
  {formatMessage({
163
156
  id: getTrad('List.button.roles'),
164
157
  defaultMessage: 'Add new role',
165
158
  })}
166
- </Button>
159
+ </LinkButton>
167
160
  </CheckPermissions>
168
161
  }
169
162
  />
@@ -220,7 +213,7 @@ const RoleListPage = () => {
220
213
  <TableBody
221
214
  sortedRoles={sortedRoles}
222
215
  canDelete={canDelete}
223
- permissions={permissions}
216
+ permissions={PERMISSIONS}
224
217
  setRoleToDelete={setRoleToDelete}
225
218
  onDelete={[showConfirmDelete, setShowConfirmDelete]}
226
219
  />
@@ -240,4 +233,10 @@ const RoleListPage = () => {
240
233
  );
241
234
  };
242
235
 
243
- export default RoleListPage;
236
+ export const ProtectedRolesListPage = () => {
237
+ return (
238
+ <CheckPagePermissions permissions={PERMISSIONS.accessRoles}>
239
+ <RolesListPage />
240
+ </CheckPagePermissions>
241
+ );
242
+ };
@@ -1,11 +1,9 @@
1
1
  import { getFetchClient } from '@strapi/helper-plugin';
2
2
 
3
- import { getRequestURL } from '../../../../utils';
4
-
5
3
  export const fetchData = async (toggleNotification, notifyStatus) => {
6
4
  try {
7
5
  const { get } = getFetchClient();
8
- const { data } = await get(getRequestURL('roles'));
6
+ const { data } = await get('/users-permissions/roles');
9
7
  notifyStatus('The roles have loaded successfully');
10
8
 
11
9
  return data;
@@ -22,7 +20,7 @@ export const fetchData = async (toggleNotification, notifyStatus) => {
22
20
  export const deleteData = async (id, toggleNotification) => {
23
21
  try {
24
22
  const { del } = getFetchClient();
25
- await del(`${getRequestURL('roles')}/${id}`);
23
+ await del(`/users-permissions/roles/${id}`);
26
24
  } catch (error) {
27
25
  toggleNotification({
28
26
  type: 'warning',
@@ -1,82 +1,82 @@
1
1
  {
2
- "BoundRoute.title": "绑定路由到",
3
- "EditForm.inputSelect.description.role": "新验证身份的用户将被赋予所选角色。",
4
- "EditForm.inputSelect.label.role": "认证用户的默认角色",
5
- "EditForm.inputToggle.description.email": "不允许用户使用不同的认证提供者(绑定的相同的电子邮件地址)来创建多个帐户。",
6
- "EditForm.inputToggle.description.email-confirmation": "启用(ON)后,新注册的用户会收到一封确认电子邮件。",
7
- "EditForm.inputToggle.description.email-confirmation-redirection": "确认您的电子邮件后,选择将您重定向到的位置。",
8
- "EditForm.inputToggle.description.email-reset-password": "应用程序的重置密码页面的 URL",
9
- "EditForm.inputToggle.description.sign-up": "当禁用(OFF)时,注册过程将被禁止。任何人无论使用任何的供应商都不可以订阅。",
10
- "EditForm.inputToggle.label.email": "每个电子邮件地址一个帐户",
11
- "EditForm.inputToggle.label.email-confirmation": "启用电子邮件确认",
12
- "EditForm.inputToggle.label.email-confirmation-redirection": "重定向 URL",
13
- "EditForm.inputToggle.label.email-reset-password": "重置密码页面 URL",
14
- "EditForm.inputToggle.label.sign-up": "启用注册",
15
- "EditForm.inputToggle.placeholder.email-confirmation-redirection": "例如: https://yourfrontend.com/reset-password",
16
- "EditForm.inputToggle.placeholder.email-reset-password": "例如: https://yourfrontend.com/reset-password",
17
- "EditPage.form.roles": "角色详情",
18
- "Email.template.data.loaded": "电子邮件模板已加载",
19
- "Email.template.email_confirmation": "邮箱地址确认",
20
- "Email.template.form.edit.label": "编辑模板",
21
- "Email.template.table.action.label": "操作",
22
- "Email.template.table.icon.label": "图标",
23
- "Email.template.table.name.label": "名称",
24
- "Form.advancedSettings.data.loaded": "高级设置数据已加载",
25
- "HeaderNav.link.advancedSettings": "高级设置",
26
- "HeaderNav.link.emailTemplates": "电子邮件模板",
27
- "HeaderNav.link.providers": "提供者",
28
- "Plugin.permissions.plugins.description": "定义 {name} 插件所有允许的操作。",
29
- "Plugins.header.description": "下面只列出路由绑定的操作。",
30
- "Plugins.header.title": "权限",
31
- "Policies.header.hint": "选择应用程序或插件的操作,然后点击 COG 图标显示绑定的路由",
32
- "Policies.header.title": "高级设置",
33
- "PopUpForm.Email.email_templates.inputDescription": "如果你不确定如何使用变量, {link}",
34
- "PopUpForm.Email.link.documentation": "查看我们的文档",
35
- "PopUpForm.Email.options.from.email.label": "发件人地址",
36
- "PopUpForm.Email.options.from.email.placeholder": "kai@doe.com",
37
- "PopUpForm.Email.options.from.name.label": "发件人名称",
38
- "PopUpForm.Email.options.from.name.placeholder": "Kai Doe",
39
- "PopUpForm.Email.options.message.label": "消息",
40
- "PopUpForm.Email.options.object.label": "主题",
41
- "PopUpForm.Email.options.object.placeholder": "请为%APP_NAME%确认邮箱地址",
42
- "PopUpForm.Email.options.response_email.label": "回复邮件",
43
- "PopUpForm.Email.options.response_email.placeholder": "kai@doe.com",
44
- "PopUpForm.Providers.enabled.description": "如果禁用,用户将无法使用此供应商。",
45
- "PopUpForm.Providers.enabled.label": "启用",
46
- "PopUpForm.Providers.key.label": "客户端 ID",
47
- "PopUpForm.Providers.key.placeholder": "文本",
48
- "PopUpForm.Providers.redirectURL.front-end.label": "重定向 URL",
49
- "PopUpForm.Providers.redirectURL.label": "添加到{provider}应用配置的跳转URL",
50
- "PopUpForm.Providers.secret.label": "客户端秘钥",
51
- "PopUpForm.Providers.secret.placeholder": "文本",
52
- "PopUpForm.Providers.subdomain.label": "主机URI(子域名)",
53
- "PopUpForm.Providers.subdomain.placeholder": "my.subdomain.com",
54
- "PopUpForm.header.edit.email-templates": "编辑电子邮件模版",
55
- "PopUpForm.header.edit.providers": "编辑提供商",
56
- "Providers.data.loaded": "提供商已加载",
57
- "Providers.status": "状态",
58
- "Roles.empty": "您还没有任何角色。",
59
- "Roles.empty.search": "没有与搜索相匹配的角色。",
60
- "Settings.roles.deleted": "角色已被删除",
61
- "Settings.roles.edited": "角色编辑完成",
62
- "Settings.section-label": "用户及权限插件",
63
- "components.Input.error.validation.email": "这是一个无效的电子邮件",
64
- "components.Input.error.validation.json": "这不符合JSON格式",
65
- "components.Input.error.validation.max": "值过高。",
66
- "components.Input.error.validation.maxLength": "值过长。",
67
- "components.Input.error.validation.min": "值太低。",
68
- "components.Input.error.validation.minLength": "值太短。",
69
- "components.Input.error.validation.minSupMax": "不能超过上限",
70
- "components.Input.error.validation.regex": "该值不符合正则表达式。",
71
- "components.Input.error.validation.required": "该值为必填项。",
72
- "components.Input.error.validation.unique": "该值已被使用。",
73
- "notification.success.submit": "设置已被更新",
74
- "page.title": "设置 - 角色",
75
- "plugin.description.long": "使用基于 JWT 的完整身份验证过程来保护 API。这个插件还有一个 ACL 策略,允许你管理用户组之间的权限。",
76
- "plugin.description.short": "使用基于 JWT 的完整身份验证过程保护 API",
77
- "plugin.name": "角色及权限",
78
- "popUpWarning.button.cancel": "取消",
79
- "popUpWarning.button.confirm": "确认",
80
- "popUpWarning.title": "请确认",
81
- "popUpWarning.warning.cancel": "你确定你要取消你的修改?"
2
+ "BoundRoute.title": "绑定路由到",
3
+ "EditForm.inputSelect.description.role": "新验证身份的用户将被赋予所选角色。",
4
+ "EditForm.inputSelect.label.role": "认证用户的默认角色",
5
+ "EditForm.inputToggle.description.email": "不允许用户使用不同的认证提供商但相同的电子邮件地址来创建多个账户。",
6
+ "EditForm.inputToggle.description.email-confirmation": "启用(开)后,新注册的用户会收到一封确认电子邮件。",
7
+ "EditForm.inputToggle.description.email-confirmation-redirection": "确认您的电子邮件后,选择将您重定向到的位置。",
8
+ "EditForm.inputToggle.description.email-reset-password": "应用程序的重置密码页面的网址",
9
+ "EditForm.inputToggle.description.sign-up": "当禁用(关)时,注册过程将被禁止。任何人无论使用任何的供应商都不可以订阅。",
10
+ "EditForm.inputToggle.label.email": "每个电子邮件地址对应一个账户",
11
+ "EditForm.inputToggle.label.email-confirmation": "启用电子邮件确认",
12
+ "EditForm.inputToggle.label.email-confirmation-redirection": "重定向网址",
13
+ "EditForm.inputToggle.label.email-reset-password": "重置密码页面网址",
14
+ "EditForm.inputToggle.label.sign-up": "启用注册",
15
+ "EditForm.inputToggle.placeholder.email-confirmation-redirection": "例如: https://yourfrontend.com/email-confirmation-redirection",
16
+ "EditForm.inputToggle.placeholder.email-reset-password": "例如: https://yourfrontend.com/reset-password",
17
+ "EditPage.form.roles": "角色详情",
18
+ "Email.template.data.loaded": "电子邮件模板已加载",
19
+ "Email.template.email_confirmation": "邮箱地址确认",
20
+ "Email.template.form.edit.label": "编辑模板",
21
+ "Email.template.table.action.label": "操作",
22
+ "Email.template.table.icon.label": "图标",
23
+ "Email.template.table.name.label": "名称",
24
+ "Form.advancedSettings.data.loaded": "高级设置数据已加载",
25
+ "HeaderNav.link.advancedSettings": "高级设置",
26
+ "HeaderNav.link.emailTemplates": "电子邮件模板",
27
+ "HeaderNav.link.providers": "提供商",
28
+ "Plugin.permissions.plugins.description": "定义 {name} 插件所有允许的操作。",
29
+ "Plugins.header.description": "下面只列出路由绑定的操作。",
30
+ "Plugins.header.title": "权限",
31
+ "Policies.header.hint": "选择应用程序或插件对应的操作,然后点击齿轮图标显示绑定的路由",
32
+ "Policies.header.title": "高级设置",
33
+ "PopUpForm.Email.email_templates.inputDescription": "如果你不确定如何使用变量, {link}",
34
+ "PopUpForm.Email.link.documentation": "查看我们的文档",
35
+ "PopUpForm.Email.options.from.email.label": "发件人地址",
36
+ "PopUpForm.Email.options.from.email.placeholder": "kai@doe.com",
37
+ "PopUpForm.Email.options.from.name.label": "发件人名称",
38
+ "PopUpForm.Email.options.from.name.placeholder": "Kai Doe",
39
+ "PopUpForm.Email.options.message.label": "消息",
40
+ "PopUpForm.Email.options.object.label": "主题",
41
+ "PopUpForm.Email.options.object.placeholder": "请为%APP_NAME%确认邮箱地址",
42
+ "PopUpForm.Email.options.response_email.label": "回复邮件",
43
+ "PopUpForm.Email.options.response_email.placeholder": "kai@doe.com",
44
+ "PopUpForm.Providers.enabled.description": "如果禁用,用户将无法使用此供应商。",
45
+ "PopUpForm.Providers.enabled.label": "启用",
46
+ "PopUpForm.Providers.key.label": "客户端 ID",
47
+ "PopUpForm.Providers.key.placeholder": "文本",
48
+ "PopUpForm.Providers.redirectURL.front-end.label": "重定向网址",
49
+ "PopUpForm.Providers.redirectURL.label": "添加到{provider}应用配置的跳转网址",
50
+ "PopUpForm.Providers.secret.label": "客户端秘钥",
51
+ "PopUpForm.Providers.secret.placeholder": "文本",
52
+ "PopUpForm.Providers.subdomain.label": "主机URI(子域名)",
53
+ "PopUpForm.Providers.subdomain.placeholder": "my.subdomain.com",
54
+ "PopUpForm.header.edit.email-templates": "编辑电子邮件模版",
55
+ "PopUpForm.header.edit.providers": "编辑提供商",
56
+ "Providers.data.loaded": "提供商已加载",
57
+ "Providers.status": "状态",
58
+ "Roles.empty": "您还没有任何角色。",
59
+ "Roles.empty.search": "没有与搜索相匹配的角色。",
60
+ "Settings.roles.deleted": "角色已被删除",
61
+ "Settings.roles.edited": "角色编辑完成",
62
+ "Settings.section-label": "用户及权限插件",
63
+ "components.Input.error.validation.email": "这是一个无效的电子邮件",
64
+ "components.Input.error.validation.json": "这不符合JSON格式",
65
+ "components.Input.error.validation.max": "值过高。",
66
+ "components.Input.error.validation.maxLength": "值过长。",
67
+ "components.Input.error.validation.min": "值太低。",
68
+ "components.Input.error.validation.minLength": "值太短。",
69
+ "components.Input.error.validation.minSupMax": "不能超过上限",
70
+ "components.Input.error.validation.regex": "该值不符合正则表达式。",
71
+ "components.Input.error.validation.required": "该值为必填项。",
72
+ "components.Input.error.validation.unique": "该值已被使用。",
73
+ "notification.success.submit": "设置已被更新",
74
+ "page.title": "设置 - 角色",
75
+ "plugin.description.long": "使用基于 JWT 的完整身份验证过程来保护 API。这个插件还有一个 ACL 策略,允许你管理用户组之间的权限。",
76
+ "plugin.description.short": "使用基于 JWT 的完整身份验证过程保护 API",
77
+ "plugin.name": "用户及权限插件",
78
+ "popUpWarning.button.cancel": "取消",
79
+ "popUpWarning.button.confirm": "确认",
80
+ "popUpWarning.title": "请确认",
81
+ "popUpWarning.warning.cancel": "你确定你要取消你的修改?"
82
82
  }
@@ -1,4 +1,3 @@
1
1
  export { default as cleanPermissions } from './cleanPermissions';
2
2
  export { default as formatPolicies } from './formatPolicies';
3
- export { default as getRequestURL } from './getRequestURL';
4
3
  export { default as getTrad } from './getTrad';
@@ -93,7 +93,7 @@ paths:
93
93
  required: true
94
94
  responses:
95
95
  200:
96
- description: Successfull registration
96
+ description: Successful registration
97
97
  content:
98
98
  application/json:
99
99
  schema:
@@ -3,5 +3,5 @@
3
3
  module.exports = {
4
4
  preset: '../../../jest-preset.front.js',
5
5
  displayName: 'Users & Permissions plugin',
6
- setupFilesAfterEnv: ['./tests/setup.js'],
6
+ setupFilesAfterEnv: ['./admin/src/tests/setup.js'],
7
7
  };