@strapi/admin 4.11.4 → 4.11.5
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.
- package/admin/src/content-manager/components/CollectionTypeFormWrapper/index.js +8 -5
- package/admin/src/content-manager/components/Inputs/index.js +3 -47
- package/admin/src/content-manager/components/SingleTypeFormWrapper/index.js +34 -37
- package/admin/src/content-manager/pages/EditSettingsView/components/ModalForm.js +0 -27
- package/admin/src/content-manager/pages/ListView/components/TableRows/index.js +93 -14
- package/admin/src/content-manager/pages/ListView/index.js +65 -59
- package/admin/src/content-manager/pages/ListView/utils/buildValidGetParams.js +30 -0
- package/admin/src/content-manager/pages/ListView/utils/index.js +1 -1
- package/admin/src/hooks/useAdminUsers/useAdminUsers.js +3 -3
- package/admin/src/hooks/useEnterprise/useEnterprise.js +4 -4
- package/admin/src/hooks/useSettingsMenu/index.js +35 -21
- package/admin/src/pages/App/index.js +0 -3
- package/admin/src/pages/AuthPage/components/Register/index.js +5 -1
- package/admin/src/pages/ProfilePage/index.js +12 -12
- package/admin/src/pages/SettingsPage/components/SettingsNav/index.js +13 -11
- package/admin/src/pages/SettingsPage/components/Tokens/TokenBox/index.js +1 -1
- package/admin/src/translations/zh-Hans.json +1 -1
- package/build/2799.cf9b491f.chunk.js +1 -0
- package/build/539.865446c0.chunk.js +1 -0
- package/build/{5563.86f9aa9c.chunk.js → 5563.27e2de0c.chunk.js} +3 -3
- package/build/5932.f8be7e31.chunk.js +1 -0
- package/build/7259.0e25ab5d.chunk.js +1 -0
- package/build/{9932.7e2b71de.chunk.js → 9932.9f3790a5.chunk.js} +81 -81
- package/build/9944.29289a16.chunk.js +26 -0
- package/build/{Admin-authenticatedApp.cb649fc1.chunk.js → Admin-authenticatedApp.7f04c595.chunk.js} +2 -2
- package/build/{Admin_profilePage.2131eb68.chunk.js → Admin_profilePage.0adb571e.chunk.js} +2 -2
- package/build/{Admin_settingsPage.4069bb8a.chunk.js → Admin_settingsPage.36152558.chunk.js} +9 -9
- package/build/admin-app.3ea6009c.chunk.js +61 -0
- package/build/admin-edit-users.78552758.chunk.js +10 -0
- package/build/admin-users.c23322fc.chunk.js +11 -0
- package/build/audit-logs-settings-page.37fe915c.chunk.js +1 -0
- package/build/content-manager.552c7418.chunk.js +1094 -0
- package/build/{content-type-builder-list-view.a200a358.chunk.js → content-type-builder-list-view.82cfadc0.chunk.js} +7 -7
- package/build/content-type-builder.238687f9.chunk.js +166 -0
- package/build/index.html +1 -1
- package/build/main.3d752c03.js +2927 -0
- package/build/runtime~main.87232977.js +2 -0
- package/build/{users-roles-settings-page.1f505119.chunk.js → users-roles-settings-page.d286426a.chunk.js} +1 -1
- package/build/{zh-Hans-json.4cfef87d.chunk.js → zh-Hans-json.fada6f40.chunk.js} +1 -1
- package/ee/admin/content-manager/{components/DynamicTable/CellContent/ReviewWorkflowsStage → pages/ListView/ReviewWorkflowsColumn}/ReviewWorkflowsStageEE.js +7 -2
- package/ee/admin/content-manager/pages/ListView/ReviewWorkflowsColumn/constants.js +24 -0
- package/ee/admin/content-manager/pages/ListView/ReviewWorkflowsColumn/index.js +1 -0
- package/ee/admin/hooks/useLicenseLimitNotification/index.js +17 -6
- package/ee/admin/hooks/useLicenseLimits/index.js +1 -32
- package/ee/admin/hooks/useLicenseLimits/useLicenseLimits.js +44 -0
- package/ee/admin/pages/SettingsPage/pages/ApplicationInfosPage/components/AdminSeatInfo/index.js +6 -4
- package/ee/admin/pages/SettingsPage/pages/AuditLogs/ListView/hooks/useAuditLogsData.js +6 -4
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/hooks/useReviewWorkflows.js +3 -5
- package/ee/admin/pages/SettingsPage/pages/Users/ListPage/CreateAction/index.js +9 -2
- package/package.json +11 -12
- package/admin/src/content-manager/components/DynamicTable/CellContent/ReviewWorkflowsStage/getTableColumn.js +0 -2
- package/admin/src/content-manager/pages/ListView/utils/buildQueryString.js +0 -36
- package/admin/src/content-manager/pages/ListView/utils/createPluginsFilter.js +0 -4
- package/admin/src/pages/App/utils/index.js +0 -3
- package/admin/src/pages/App/utils/unique-identifier.js +0 -12
- package/build/1799.44d2e264.chunk.js +0 -33
- package/build/5932.6a23b88c.chunk.js +0 -1
- package/build/7259.fb69d4bf.chunk.js +0 -1
- package/build/admin-app.fea867af.chunk.js +0 -61
- package/build/admin-edit-users.200551e3.chunk.js +0 -10
- package/build/admin-users.3b12dca2.chunk.js +0 -11
- package/build/audit-logs-settings-page.f538490f.chunk.js +0 -1
- package/build/content-manager.c40f5ff9.chunk.js +0 -1088
- package/build/content-type-builder.bd1bbff1.chunk.js +0 -166
- package/build/main.ee36abd9.js +0 -2927
- package/build/runtime~main.efd966f6.js +0 -2
- package/ee/admin/content-manager/components/DynamicTable/CellContent/ReviewWorkflowsStage/getTableColumn.js +0 -58
- package/ee/admin/content-manager/components/DynamicTable/CellContent/ReviewWorkflowsStage/index.js +0 -3
|
@@ -10,8 +10,6 @@ import {
|
|
|
10
10
|
HeaderLayout,
|
|
11
11
|
useNotifyAT,
|
|
12
12
|
Flex,
|
|
13
|
-
Typography,
|
|
14
|
-
Status,
|
|
15
13
|
} from '@strapi/design-system';
|
|
16
14
|
import {
|
|
17
15
|
NoPermissions,
|
|
@@ -33,7 +31,6 @@ import {
|
|
|
33
31
|
} from '@strapi/helper-plugin';
|
|
34
32
|
import { ArrowLeft, Cog, Plus } from '@strapi/icons';
|
|
35
33
|
import axios from 'axios';
|
|
36
|
-
import getReviewWorkflowsColumn from 'ee_else_ce/content-manager/components/DynamicTable/CellContent/ReviewWorkflowsStage/getTableColumn';
|
|
37
34
|
import isEqual from 'lodash/isEqual';
|
|
38
35
|
import PropTypes from 'prop-types';
|
|
39
36
|
import { stringify } from 'qs';
|
|
@@ -45,6 +42,7 @@ import { bindActionCreators, compose } from 'redux';
|
|
|
45
42
|
import styled from 'styled-components';
|
|
46
43
|
|
|
47
44
|
import { INJECT_COLUMN_IN_TABLE } from '../../../exposedHooks';
|
|
45
|
+
import { useEnterprise } from '../../../hooks/useEnterprise';
|
|
48
46
|
import { selectAdminPermissions } from '../../../pages/App/selectors';
|
|
49
47
|
import { InjectionZone } from '../../../shared/components';
|
|
50
48
|
import AttributeFilter from '../../components/AttributeFilter';
|
|
@@ -57,7 +55,7 @@ import { ConfirmDialogDeleteAll } from './components/ConfirmDialogDeleteAll';
|
|
|
57
55
|
import { FieldPicker } from './components/FieldPicker';
|
|
58
56
|
import { TableRows } from './components/TableRows';
|
|
59
57
|
import makeSelectListView, { selectDisplayedHeaders } from './selectors';
|
|
60
|
-
import {
|
|
58
|
+
import { buildValidGetParams } from './utils';
|
|
61
59
|
|
|
62
60
|
const ConfigureLayoutBox = styled(Box)`
|
|
63
61
|
svg {
|
|
@@ -67,6 +65,8 @@ const ConfigureLayoutBox = styled(Box)`
|
|
|
67
65
|
}
|
|
68
66
|
`;
|
|
69
67
|
|
|
68
|
+
const REVIEW_WORKFLOW_COLUMNS_CE = null;
|
|
69
|
+
|
|
70
70
|
function ListView({
|
|
71
71
|
canCreate,
|
|
72
72
|
canDelete,
|
|
@@ -101,14 +101,30 @@ function ListView({
|
|
|
101
101
|
useFocusWhenNavigate();
|
|
102
102
|
|
|
103
103
|
const [{ query }] = useQueryParams();
|
|
104
|
-
const params =
|
|
104
|
+
const params = React.useMemo(() => buildValidGetParams(query), [query]);
|
|
105
105
|
const pluginsQueryParams = stringify({ plugins: query.plugins }, { encode: false });
|
|
106
106
|
|
|
107
107
|
const { pathname } = useLocation();
|
|
108
108
|
const { push } = useHistory();
|
|
109
109
|
const { formatMessage } = useIntl();
|
|
110
|
-
const hasDraftAndPublish = options?.draftAndPublish || false;
|
|
111
110
|
const fetchClient = useFetchClient();
|
|
111
|
+
|
|
112
|
+
const hasDraftAndPublish = options?.draftAndPublish ?? false;
|
|
113
|
+
const hasReviewWorkflows = options?.reviewWorkflows ?? false;
|
|
114
|
+
|
|
115
|
+
const reviewWorkflowColumns = useEnterprise(
|
|
116
|
+
REVIEW_WORKFLOW_COLUMNS_CE,
|
|
117
|
+
async () =>
|
|
118
|
+
(
|
|
119
|
+
await import(
|
|
120
|
+
'../../../../../ee/admin/content-manager/pages/ListView/ReviewWorkflowsColumn/constants'
|
|
121
|
+
)
|
|
122
|
+
).REVIEW_WORKFLOW_COLUMNS_EE,
|
|
123
|
+
{
|
|
124
|
+
enabled: !!options?.reviewWorkflows,
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
|
|
112
128
|
const { post, del } = fetchClient;
|
|
113
129
|
|
|
114
130
|
const bulkPublishMutation = useMutation(
|
|
@@ -121,7 +137,7 @@ function ListView({
|
|
|
121
137
|
message: { id: 'content-manager.success.record.publish', defaultMessage: 'Published' },
|
|
122
138
|
});
|
|
123
139
|
|
|
124
|
-
fetchData(`/content-manager/collection-types/${slug}
|
|
140
|
+
fetchData(`/content-manager/collection-types/${slug}`, { params });
|
|
125
141
|
},
|
|
126
142
|
onError(error) {
|
|
127
143
|
toggleNotification({
|
|
@@ -144,7 +160,7 @@ function ListView({
|
|
|
144
160
|
},
|
|
145
161
|
});
|
|
146
162
|
|
|
147
|
-
fetchData(`/content-manager/collection-types/${slug}
|
|
163
|
+
fetchData(`/content-manager/collection-types/${slug}`, { params });
|
|
148
164
|
},
|
|
149
165
|
onError(error) {
|
|
150
166
|
toggleNotification({
|
|
@@ -159,19 +175,17 @@ function ListView({
|
|
|
159
175
|
// Using a ref to avoid requests being fired multiple times on slug on change
|
|
160
176
|
// We need it because the hook as mulitple dependencies so it may run before the permissions have checked
|
|
161
177
|
const requestUrlRef = React.useRef('');
|
|
162
|
-
|
|
163
178
|
/**
|
|
164
179
|
* TODO: re-write all of this, it's a mess.
|
|
165
180
|
*/
|
|
166
181
|
const fetchData = React.useCallback(
|
|
167
|
-
async (endPoint,
|
|
182
|
+
async (endPoint, options) => {
|
|
168
183
|
getData();
|
|
169
184
|
|
|
170
185
|
try {
|
|
171
|
-
const opts = source ? { cancelToken: source.token } : null;
|
|
172
186
|
const {
|
|
173
187
|
data: { results, pagination: paginationResult },
|
|
174
|
-
} = await fetchClient.get(endPoint,
|
|
188
|
+
} = await fetchClient.get(endPoint, options);
|
|
175
189
|
|
|
176
190
|
notifyStatus(
|
|
177
191
|
formatMessage(
|
|
@@ -218,12 +232,12 @@ function ListView({
|
|
|
218
232
|
const handleConfirmDeleteAllData = React.useCallback(
|
|
219
233
|
async (ids) => {
|
|
220
234
|
try {
|
|
221
|
-
await post(
|
|
235
|
+
await post(`/content-manager/collection-types/${slug}/actions/bulkDelete`, {
|
|
222
236
|
ids,
|
|
223
237
|
});
|
|
224
238
|
|
|
225
|
-
|
|
226
|
-
|
|
239
|
+
fetchData(`/content-manager/collection-types/${slug}`, { params });
|
|
240
|
+
|
|
227
241
|
trackUsageRef.current('didBulkDeleteEntries');
|
|
228
242
|
} catch (err) {
|
|
229
243
|
toggleNotification({
|
|
@@ -232,16 +246,16 @@ function ListView({
|
|
|
232
246
|
});
|
|
233
247
|
}
|
|
234
248
|
},
|
|
235
|
-
[
|
|
249
|
+
[slug, toggleNotification, formatAPIError, post, fetchData, params]
|
|
236
250
|
);
|
|
237
251
|
|
|
238
252
|
const handleConfirmDeleteData = React.useCallback(
|
|
239
253
|
async (idToDelete) => {
|
|
240
254
|
try {
|
|
241
|
-
await del(
|
|
255
|
+
await del(`/content-manager/collection-types/${slug}/${idToDelete}`);
|
|
242
256
|
|
|
243
|
-
const requestUrl = getRequestUrl(`collection-types/${slug}
|
|
244
|
-
fetchData(requestUrl);
|
|
257
|
+
const requestUrl = getRequestUrl(`collection-types/${slug}`);
|
|
258
|
+
fetchData(requestUrl, { params });
|
|
245
259
|
|
|
246
260
|
toggleNotification({
|
|
247
261
|
type: 'success',
|
|
@@ -254,7 +268,7 @@ function ListView({
|
|
|
254
268
|
});
|
|
255
269
|
}
|
|
256
270
|
},
|
|
257
|
-
[slug,
|
|
271
|
+
[slug, toggleNotification, formatAPIError, del, fetchData, params]
|
|
258
272
|
);
|
|
259
273
|
|
|
260
274
|
/**
|
|
@@ -326,10 +340,10 @@ function ListView({
|
|
|
326
340
|
const source = CancelToken.source();
|
|
327
341
|
|
|
328
342
|
const shouldSendRequest = canRead;
|
|
329
|
-
const requestUrl = getRequestUrl(`collection-types/${slug}
|
|
343
|
+
const requestUrl = getRequestUrl(`collection-types/${slug}`);
|
|
330
344
|
|
|
331
345
|
if (shouldSendRequest && requestUrl.includes(requestUrlRef.current)) {
|
|
332
|
-
fetchData(requestUrl, source);
|
|
346
|
+
fetchData(requestUrl, { cancelToken: source.token, params });
|
|
333
347
|
}
|
|
334
348
|
|
|
335
349
|
return () => {
|
|
@@ -388,24 +402,8 @@ function ListView({
|
|
|
388
402
|
};
|
|
389
403
|
});
|
|
390
404
|
|
|
391
|
-
if (
|
|
392
|
-
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
// this should not exist. Ideally we would use registerHook() similar to what has been done
|
|
396
|
-
// in the i18n plugin. In order to do that review-workflows should have been a plugin. In
|
|
397
|
-
// a future iteration we need to find a better pattern.
|
|
398
|
-
|
|
399
|
-
// In CE this will return null - in EE a column definition including the custom formatting component.
|
|
400
|
-
const reviewWorkflowColumn = getReviewWorkflowsColumn(layout);
|
|
401
|
-
|
|
402
|
-
if (reviewWorkflowColumn) {
|
|
403
|
-
formattedHeaders.push(reviewWorkflowColumn);
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
return [
|
|
407
|
-
...formattedHeaders,
|
|
408
|
-
{
|
|
405
|
+
if (hasDraftAndPublish) {
|
|
406
|
+
formattedHeaders.push({
|
|
409
407
|
key: '__published_at_temp_key__',
|
|
410
408
|
name: 'publishedAt',
|
|
411
409
|
fieldSchema: {
|
|
@@ -419,25 +417,29 @@ function ListView({
|
|
|
419
417
|
searchable: false,
|
|
420
418
|
sortable: true,
|
|
421
419
|
},
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
if (reviewWorkflowColumns) {
|
|
424
|
+
// Make sure the column header label is translated
|
|
425
|
+
if (typeof reviewWorkflowColumns.metadatas.label !== 'string') {
|
|
426
|
+
reviewWorkflowColumns.metadatas.label = formatMessage(
|
|
427
|
+
reviewWorkflowColumns.metadatas.label
|
|
428
|
+
);
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
formattedHeaders.push(reviewWorkflowColumns);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
return formattedHeaders;
|
|
435
|
+
}, [
|
|
436
|
+
runHookWaterfall,
|
|
437
|
+
displayedHeaders,
|
|
438
|
+
layout,
|
|
439
|
+
reviewWorkflowColumns,
|
|
440
|
+
hasDraftAndPublish,
|
|
441
|
+
formatMessage,
|
|
442
|
+
]);
|
|
441
443
|
|
|
442
444
|
const subtitle = canRead
|
|
443
445
|
? formatMessage(
|
|
@@ -580,6 +582,10 @@ function ListView({
|
|
|
580
582
|
canCreate={canCreate}
|
|
581
583
|
canDelete={canDelete}
|
|
582
584
|
contentType={contentType}
|
|
585
|
+
features={{
|
|
586
|
+
hasDraftAndPublish,
|
|
587
|
+
hasReviewWorkflows,
|
|
588
|
+
}}
|
|
583
589
|
headers={tableHeaders}
|
|
584
590
|
rows={data}
|
|
585
591
|
withBulkActions
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const createPluginsFilter = (obj = {}) =>
|
|
2
|
+
Object.values(obj).reduce((acc, current) => Object.assign(acc, current), {});
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @description
|
|
6
|
+
* Creates a valid query params object for get requests
|
|
7
|
+
* ie. plugins[18n][locale]=en becomes locale=en
|
|
8
|
+
* @param {object} [query={}] - The query params
|
|
9
|
+
* @returns {object} - The modified query params
|
|
10
|
+
*/
|
|
11
|
+
const buildValidGetParams = (query = {}) => {
|
|
12
|
+
// Extract pluginOptions from the query, they shouldn't be part of the URL
|
|
13
|
+
const {
|
|
14
|
+
plugins: _,
|
|
15
|
+
_q: searchQuery,
|
|
16
|
+
...validQueryParams
|
|
17
|
+
} = {
|
|
18
|
+
...query,
|
|
19
|
+
...createPluginsFilter(query.plugins),
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
if (searchQuery) {
|
|
23
|
+
// Encode the search query here since the paramsSerializer will not
|
|
24
|
+
validQueryParams._q = encodeURIComponent(searchQuery);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return validQueryParams;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default buildValidGetParams;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as
|
|
1
|
+
export { default as buildValidGetParams } from './buildValidGetParams';
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { useFetchClient } from '@strapi/helper-plugin';
|
|
2
|
-
import { stringify } from 'qs';
|
|
3
2
|
import { useQuery } from 'react-query';
|
|
4
3
|
|
|
5
4
|
export function useAdminUsers(params = {}, queryOptions = {}) {
|
|
6
5
|
const { id = '', ...queryParams } = params;
|
|
7
|
-
const queryString = stringify(queryParams, { encode: false });
|
|
8
6
|
|
|
9
7
|
const { get } = useFetchClient();
|
|
10
8
|
|
|
@@ -13,7 +11,9 @@ export function useAdminUsers(params = {}, queryOptions = {}) {
|
|
|
13
11
|
async () => {
|
|
14
12
|
const {
|
|
15
13
|
data: { data },
|
|
16
|
-
} = await get(`/admin/users/${id}
|
|
14
|
+
} = await get(`/admin/users/${id}`, {
|
|
15
|
+
params: queryParams,
|
|
16
|
+
});
|
|
17
17
|
|
|
18
18
|
return data;
|
|
19
19
|
},
|
|
@@ -9,7 +9,7 @@ function isEnterprise() {
|
|
|
9
9
|
export function useEnterprise(
|
|
10
10
|
ceData,
|
|
11
11
|
eeCallback,
|
|
12
|
-
{ defaultValue = null, combine = (ceData, eeData) => eeData } = {}
|
|
12
|
+
{ defaultValue = null, combine = (ceData, eeData) => eeData, enabled = true } = {}
|
|
13
13
|
) {
|
|
14
14
|
const eeCallbackRef = useCallbackRef(eeCallback);
|
|
15
15
|
const combineCallbackRef = useCallbackRef(combine);
|
|
@@ -17,7 +17,7 @@ export function useEnterprise(
|
|
|
17
17
|
// We have to use a nested object here, because functions (e.g. Components)
|
|
18
18
|
// can not be stored as value directly
|
|
19
19
|
const [{ data }, setData] = React.useState({
|
|
20
|
-
data: isEnterprise() ? defaultValue : ceData,
|
|
20
|
+
data: isEnterprise() && enabled ? defaultValue : ceData,
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
React.useEffect(() => {
|
|
@@ -27,10 +27,10 @@ export function useEnterprise(
|
|
|
27
27
|
setData({ data: combineCallbackRef(ceData, eeData) });
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
if (isEnterprise()) {
|
|
30
|
+
if (isEnterprise() && enabled) {
|
|
31
31
|
importEE();
|
|
32
32
|
}
|
|
33
|
-
}, [ceData, eeCallbackRef, combineCallbackRef]);
|
|
33
|
+
}, [ceData, eeCallbackRef, combineCallbackRef, enabled]);
|
|
34
34
|
|
|
35
35
|
return data;
|
|
36
36
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useState, useEffect } from 'react';
|
|
1
|
+
import { useState, useEffect, useCallback } from 'react';
|
|
2
2
|
|
|
3
3
|
import { hasPermissions, useRBACProvider, useStrapiApp, useAppInfo } from '@strapi/helper-plugin';
|
|
4
4
|
import { useSelector } from 'react-redux';
|
|
@@ -19,25 +19,15 @@ const useSettingsMenu = () => {
|
|
|
19
19
|
const { shouldUpdateStrapi } = useAppInfo();
|
|
20
20
|
const { settings } = useStrapiApp();
|
|
21
21
|
const permissions = useSelector(selectAdminPermissions);
|
|
22
|
+
|
|
22
23
|
const { global: globalLinks, admin: adminLinks } = useEnterprise(
|
|
23
24
|
LINKS_CE,
|
|
24
25
|
async () => (await import('../../../../ee/admin/hooks/useSettingsMenu/constants')).LINKS_EE,
|
|
25
26
|
{
|
|
26
27
|
combine(ceLinks, eeLinks) {
|
|
27
|
-
function addPermissions(link) {
|
|
28
|
-
if (!link.id) {
|
|
29
|
-
throw new Error('The settings menu item must have an id attribute.');
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return {
|
|
33
|
-
...link,
|
|
34
|
-
permissions: permissions.settings?.[link.id]?.main,
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
28
|
return {
|
|
39
|
-
admin: [...eeLinks.admin, ...ceLinks.admin]
|
|
40
|
-
global: [...ceLinks.global, ...eeLinks.global]
|
|
29
|
+
admin: [...eeLinks.admin, ...ceLinks.admin],
|
|
30
|
+
global: [...ceLinks.global, ...eeLinks.global],
|
|
41
31
|
};
|
|
42
32
|
},
|
|
43
33
|
defaultValue: {
|
|
@@ -47,6 +37,20 @@ const useSettingsMenu = () => {
|
|
|
47
37
|
}
|
|
48
38
|
);
|
|
49
39
|
|
|
40
|
+
const addPermissions = useCallback(
|
|
41
|
+
(link) => {
|
|
42
|
+
if (!link.id) {
|
|
43
|
+
throw new Error('The settings menu item must have an id attribute.');
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return {
|
|
47
|
+
...link,
|
|
48
|
+
permissions: permissions.settings?.[link.id]?.main,
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
[permissions.settings]
|
|
52
|
+
);
|
|
53
|
+
|
|
50
54
|
useEffect(() => {
|
|
51
55
|
const getData = async () => {
|
|
52
56
|
const buildMenuPermissions = (sections) =>
|
|
@@ -86,26 +90,36 @@ const useSettingsMenu = () => {
|
|
|
86
90
|
};
|
|
87
91
|
|
|
88
92
|
const { global, ...otherSections } = settings;
|
|
93
|
+
|
|
89
94
|
const sections = formatLinks([
|
|
90
95
|
{
|
|
91
96
|
...settings.global,
|
|
92
|
-
links: sortLinks([...settings.global.links, ...globalLinks]).map(
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
97
|
+
links: sortLinks([...settings.global.links, ...globalLinks.map(addPermissions)]).map(
|
|
98
|
+
(link) => ({
|
|
99
|
+
...link,
|
|
100
|
+
hasNotification: link.id === '000-application-infos' && shouldUpdateStrapi,
|
|
101
|
+
})
|
|
102
|
+
),
|
|
96
103
|
},
|
|
97
104
|
{
|
|
98
105
|
id: 'permissions',
|
|
99
106
|
intlLabel: { id: 'Settings.permissions', defaultMessage: 'Administration Panel' },
|
|
100
|
-
links: adminLinks,
|
|
107
|
+
links: adminLinks.map(addPermissions),
|
|
101
108
|
},
|
|
102
109
|
...Object.values(otherSections),
|
|
103
110
|
]);
|
|
104
111
|
|
|
105
112
|
getData();
|
|
106
|
-
}, [adminLinks, globalLinks, userPermissions, settings, shouldUpdateStrapi]);
|
|
113
|
+
}, [adminLinks, globalLinks, userPermissions, settings, shouldUpdateStrapi, addPermissions]);
|
|
114
|
+
|
|
115
|
+
const filterMenu = (menuItem) => {
|
|
116
|
+
return {
|
|
117
|
+
...menuItem,
|
|
118
|
+
links: menuItem.links.filter((link) => link.isDisplayed),
|
|
119
|
+
};
|
|
120
|
+
};
|
|
107
121
|
|
|
108
|
-
return { isLoading, menu };
|
|
122
|
+
return { isLoading, menu: menu.map(filterMenu) };
|
|
109
123
|
};
|
|
110
124
|
|
|
111
125
|
export default useSettingsMenu;
|
|
@@ -31,7 +31,6 @@ import NotFoundPage from '../NotFoundPage';
|
|
|
31
31
|
import UseCasePage from '../UseCasePage';
|
|
32
32
|
|
|
33
33
|
import { ROUTES_CE, SET_ADMIN_PERMISSIONS } from './constants';
|
|
34
|
-
import { getUID } from './utils';
|
|
35
34
|
|
|
36
35
|
const AuthenticatedApp = lazy(() =>
|
|
37
36
|
import(/* webpackChunkName: "Admin-authenticatedApp" */ '../../components/AuthenticatedApp')
|
|
@@ -113,8 +112,6 @@ function App() {
|
|
|
113
112
|
authLogo: prefixFileUrlWithBackendUrl(authLogo),
|
|
114
113
|
});
|
|
115
114
|
|
|
116
|
-
const deviceId = await getUID();
|
|
117
|
-
|
|
118
115
|
if (uuid) {
|
|
119
116
|
const {
|
|
120
117
|
data: { data: properties },
|
|
@@ -64,7 +64,11 @@ const Register = ({ authType, fieldsToDisable, noSignin, onSubmit, schema }) =>
|
|
|
64
64
|
try {
|
|
65
65
|
const {
|
|
66
66
|
data: { data },
|
|
67
|
-
} = await get(`/admin/registration-info
|
|
67
|
+
} = await get(`/admin/registration-info`, {
|
|
68
|
+
params: {
|
|
69
|
+
registrationToken,
|
|
70
|
+
},
|
|
71
|
+
});
|
|
68
72
|
|
|
69
73
|
if (data) {
|
|
70
74
|
setUserInfo(data);
|
|
@@ -77,19 +77,14 @@ const ProfilePage = () => {
|
|
|
77
77
|
const { isLoading: isLoadingSSO, data: dataSSO } = useQuery(
|
|
78
78
|
['providers', 'isSSOLocked'],
|
|
79
79
|
async () => {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
} = await get('/admin/providers/isSSOLocked');
|
|
80
|
+
const {
|
|
81
|
+
data: { data },
|
|
82
|
+
} = await get('/admin/providers/isSSOLocked');
|
|
84
83
|
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
return {
|
|
89
|
-
isSSOLocked: false,
|
|
90
|
-
};
|
|
84
|
+
return data;
|
|
91
85
|
},
|
|
92
86
|
{
|
|
87
|
+
enabled: window.strapi.isEE && window.strapi.features.isEnabled('sso'),
|
|
93
88
|
onError() {
|
|
94
89
|
toggleNotification({
|
|
95
90
|
type: 'warning',
|
|
@@ -178,7 +173,7 @@ const ProfilePage = () => {
|
|
|
178
173
|
);
|
|
179
174
|
}
|
|
180
175
|
|
|
181
|
-
const hasLockedRole = dataSSO?.isSSOLocked;
|
|
176
|
+
const hasLockedRole = dataSSO?.isSSOLocked ?? false;
|
|
182
177
|
const { email, firstname, lastname, username, preferedLanguage } = data;
|
|
183
178
|
const initialData = { email, firstname, lastname, username, preferedLanguage, currentTheme };
|
|
184
179
|
|
|
@@ -203,7 +198,12 @@ const ProfilePage = () => {
|
|
|
203
198
|
<HeaderLayout
|
|
204
199
|
title={data.username || getFullName(data.firstname, data.lastname)}
|
|
205
200
|
primaryAction={
|
|
206
|
-
<Button
|
|
201
|
+
<Button
|
|
202
|
+
startIcon={<Check />}
|
|
203
|
+
loading={isSubmitting}
|
|
204
|
+
type="submit"
|
|
205
|
+
disabled={!dirty}
|
|
206
|
+
>
|
|
207
207
|
{formatMessage({ id: 'global.save', defaultMessage: 'Save' })}
|
|
208
208
|
</Button>
|
|
209
209
|
}
|
|
@@ -50,17 +50,19 @@ const SettingsNav = ({ menu }) => {
|
|
|
50
50
|
<SubNavSections>
|
|
51
51
|
{sections.map((section) => (
|
|
52
52
|
<SubNavSection key={section.id} label={formatMessage(section.intlLabel)}>
|
|
53
|
-
{section.links.map((link) =>
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
53
|
+
{section.links.map((link) => {
|
|
54
|
+
return (
|
|
55
|
+
<SubNavLink
|
|
56
|
+
as={NavLink}
|
|
57
|
+
withBullet={link.hasNotification}
|
|
58
|
+
to={link.to}
|
|
59
|
+
onClick={() => handleClickOnLink(link.to)}
|
|
60
|
+
key={link.id}
|
|
61
|
+
>
|
|
62
|
+
{formatMessage(link.intlLabel)}
|
|
63
|
+
</SubNavLink>
|
|
64
|
+
);
|
|
65
|
+
})}
|
|
64
66
|
</SubNavSection>
|
|
65
67
|
))}
|
|
66
68
|
</SubNavSections>
|
|
@@ -799,7 +799,7 @@
|
|
|
799
799
|
"content-manager.popUpWarning.warning.unpublish-question": "您确定不要发布它吗?",
|
|
800
800
|
"content-manager.popUpWarning.warning.updateAllSettings": "这将修改所有设置",
|
|
801
801
|
"content-manager.popUpwarning.warning.has-draft-relations.button-confirm": "是, 发布",
|
|
802
|
-
"content-manager.popUpwarning.warning.has-draft-relations.message": "<b>{count, plural,
|
|
802
|
+
"content-manager.popUpwarning.warning.has-draft-relations.message": "<b>{count, plural, one { 个关联的内容} other { 个关联的内容}}</b> 尚未发布,这可能会导致不可预期的行为。",
|
|
803
803
|
"content-manager.popover.display-relations.label": "显示关联",
|
|
804
804
|
"content-manager.relation.add": "添加关联",
|
|
805
805
|
"content-manager.relation.disconnect": "删除",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[2799],{42799:function(n,a,e){e.r(a),e.d(a,{REVIEW_WORKFLOW_COLUMNS_EE:function(){return t}});var s=e(47510);const t={key:"__strapi_reviewWorkflows_stage_temp_key__",name:"strapi_reviewWorkflows_stage",fieldSchema:{type:"relation"},metadatas:{label:{id:(0,s.Z)("containers.ListPage.table-headers.reviewWorkflows.stage"),defaultMessage:"Review stage"},searchable:!1,sortable:!0,mainField:{name:"name",schema:{type:"string"}}}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[539],{60539:function(v,a,t){t.r(a),t.d(a,{ReviewWorkflowsStageEE:function(){return r}});var n=t(32735),e=t(87933),l=t(72850),i=t(49372),u=t(19565),d=t(60216),o=t.n(d),h=t(61937),g=t(54504);function r({color:s,name:m}){const{themeColorName:p}=(0,g.k)(s);return n.createElement(e.k,{alignItems:"center",gap:2,maxWidth:(0,u.Q1)(300)},n.createElement(l.x,{height:2,background:s,borderColor:p==="neutral0"?"neutral150":"transparent",hasRadius:!0,shrink:0,width:2}),n.createElement(i.Z,{fontWeight:"regular",textColor:"neutral700",ellipsis:!0},m))}r.defaultProps={color:h.FT},r.propTypes={color:o().string,name:o().string.isRequired}}}]);
|