@strapi/admin 4.11.4 → 4.12.0-beta.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.
- package/admin/src/constants.js +83 -83
- 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/content-manager/utils/mergeMetasWithSchema.js +5 -1
- package/admin/src/hooks/index.js +0 -1
- package/admin/src/hooks/useAdminUsers/useAdminUsers.js +3 -3
- package/admin/src/hooks/useEnterprise/useEnterprise.js +4 -4
- package/admin/src/pages/App/index.js +28 -23
- package/admin/src/pages/AuthPage/components/Register/index.js +5 -1
- package/admin/src/pages/ProfilePage/index.js +6 -1
- package/admin/src/pages/SettingsPage/components/Tokens/TokenBox/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Users/EditPage/index.js +1 -1
- package/admin/src/translations/zh-Hans.json +1 -1
- package/build/0cd5f8915b265d5b1856.png +0 -0
- package/build/2799.cf9b491f.chunk.js +1 -0
- package/build/4485.d3c6dd1d.chunk.js +6 -0
- package/build/539.865446c0.chunk.js +1 -0
- package/build/{5563.86f9aa9c.chunk.js → 5563.a146acac.chunk.js} +2 -2
- package/build/7018.f3dad3c1.chunk.js +1 -0
- package/build/7259.0e25ab5d.chunk.js +1 -0
- package/build/9465.d8fc1377.chunk.js +112 -0
- package/build/9944.29289a16.chunk.js +26 -0
- package/build/{Admin-authenticatedApp.cb649fc1.chunk.js → Admin-authenticatedApp.9d3afb79.chunk.js} +2 -2
- package/build/{Admin_settingsPage.4069bb8a.chunk.js → Admin_settingsPage.074655f6.chunk.js} +13 -13
- package/build/admin-app.3ede71ad.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.08541eeb.chunk.js +1094 -0
- package/build/content-type-builder-translation-en-json.38e20391.chunk.js +1 -0
- package/build/content-type-builder.de22f7c9.chunk.js +166 -0
- package/build/index.html +1 -1
- package/build/main.a8ede50d.js +2927 -0
- package/build/review-workflows-settings-create-view.56f61e18.chunk.js +1 -0
- package/build/review-workflows-settings-edit-view.912bc9c0.chunk.js +1 -0
- package/build/review-workflows-settings-list-view.cf6a08d3.chunk.js +56 -0
- package/build/runtime~main.5e9bf4b3.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/constants.js +14 -14
- package/ee/admin/content-manager/pages/EditView/InformationBox/InformationBoxEE.js +84 -30
- 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/constants.js +25 -1
- 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/actions/index.js +19 -4
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/Layout/Layout.js +65 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/Layout/index.js +1 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/LimitsModal/LimitsModal.js +111 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/LimitsModal/assets/balloon.png +0 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/LimitsModal/index.js +3 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/ProtectedPage/ProtectedPage.js +21 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/ProtectedPage/index.js +1 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/Stages/Stage/Stage.js +4 -4
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/WorkflowAttributes/WorkflowAttributes.js +110 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/WorkflowAttributes/index.js +1 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/constants.js +3 -1
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/hooks/useReviewWorkflows.js +13 -19
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/pages/CreateView/CreateView.js +246 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/pages/CreateView/index.js +13 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/pages/EditView/EditView.js +269 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/pages/EditView/index.js +13 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/pages/ListView/ListView.js +382 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/pages/ListView/index.js +13 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/reducer/index.js +53 -23
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/utils/getWorkflowValidationSchema.js +43 -28
- package/ee/admin/pages/SettingsPage/pages/Users/ListPage/CreateAction/index.js +9 -2
- package/ee/server/config/admin-actions.js +24 -0
- package/ee/server/constants/default-stages.json +8 -4
- package/ee/server/constants/default-workflow.json +3 -1
- package/ee/server/constants/workflows.js +10 -1
- package/ee/server/content-types/workflow/index.js +10 -0
- package/ee/server/content-types/workflow-stage/index.js +3 -1
- package/ee/server/controllers/admin.js +1 -0
- package/ee/server/controllers/workflows/index.js +135 -8
- package/ee/server/controllers/workflows/stages/index.js +38 -38
- package/ee/server/migrations/review-workflows-content-types.js +29 -0
- package/ee/server/migrations/review-workflows-deleted-ct-in-workflows.js +39 -0
- package/ee/server/migrations/review-workflows-stage-attribute.js +49 -0
- package/ee/server/migrations/review-workflows-stages-color.js +2 -2
- package/ee/server/migrations/review-workflows-workflow-name.js +21 -0
- package/ee/server/register.js +12 -2
- package/ee/server/routes/review-workflows.js +44 -10
- package/ee/server/services/index.js +1 -0
- package/ee/server/services/review-workflows/entity-service-decorator.js +8 -13
- package/ee/server/services/review-workflows/review-workflows.js +45 -53
- package/ee/server/services/review-workflows/stages.js +84 -46
- package/ee/server/services/review-workflows/validation.js +60 -0
- package/ee/server/services/review-workflows/workflows/content-types.js +80 -0
- package/ee/server/services/review-workflows/workflows/index.js +207 -0
- package/ee/server/utils/review-workflows.js +30 -25
- package/ee/server/validation/review-workflows.js +49 -10
- package/package.json +10 -11
- 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/hooks/useLicenseLimits/index.js +0 -3
- 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/7018.98feed67.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-translation-en-json.f592325b.chunk.js +0 -1
- package/build/content-type-builder.bd1bbff1.chunk.js +0 -166
- package/build/main.ee36abd9.js +0 -2927
- package/build/review-workflows-settings.93808ae0.chunk.js +0 -110
- 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
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/ProtectedPage.js +0 -20
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/ReviewWorkflows.js +0 -204
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/index.js +0 -3
- package/ee/server/services/review-workflows/workflows.js +0 -25
|
@@ -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,3 +1,4 @@
|
|
|
1
|
+
import merge from 'lodash/merge';
|
|
1
2
|
import set from 'lodash/set';
|
|
2
3
|
|
|
3
4
|
const mergeMetasWithSchema = (data, schemas, mainSchemaKey) => {
|
|
@@ -6,7 +7,10 @@ const mergeMetasWithSchema = (data, schemas, mainSchemaKey) => {
|
|
|
6
7
|
const mainUID = data[mainSchemaKey].uid;
|
|
7
8
|
const mainSchema = findSchema(mainUID);
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
// TODO
|
|
11
|
+
// In order to merge all the layers of the schema objects, we used the Lodash function "merge".
|
|
12
|
+
// If the destructuration is used, it will only merge the first layer of properties and overwrite the nested objects.
|
|
13
|
+
set(merged, [mainSchemaKey], merge({}, mainSchema, data[mainSchemaKey]));
|
|
10
14
|
|
|
11
15
|
Object.keys(data.components).forEach((compoUID) => {
|
|
12
16
|
const compoSchema = findSchema(compoUID);
|
package/admin/src/hooks/index.js
CHANGED
|
@@ -3,7 +3,6 @@ export { useContentTypes } from './useContentTypes';
|
|
|
3
3
|
export { default as useFetchPermissionsLayout } from './useFetchPermissionsLayout';
|
|
4
4
|
export { default as useFetchRole } from './useFetchRole';
|
|
5
5
|
export { default as useLicenseLimitNotification } from './useLicenseLimitNotification';
|
|
6
|
-
export { default as useLicenseLimit } from './useLicenseLimits';
|
|
7
6
|
export { default as useMenu } from './useMenu';
|
|
8
7
|
export { default as usePermissionsDataManager } from './usePermissionsDataManager';
|
|
9
8
|
export { default as useRegenerate } from './useRegenerate';
|
|
@@ -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
|
}
|
|
@@ -31,21 +31,24 @@ 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')
|
|
38
37
|
);
|
|
39
38
|
|
|
40
39
|
function App() {
|
|
41
|
-
const adminPermissions = useEnterprise(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
40
|
+
const adminPermissions = useEnterprise(
|
|
41
|
+
ADMIN_PERMISSIONS_CE,
|
|
42
|
+
async () => (await import('../../../../ee/admin/constants')).ADMIN_PERMISSIONS_EE,
|
|
43
|
+
{
|
|
44
|
+
combine(cePermissions, eePermissions) {
|
|
45
|
+
// the `settings` NS e.g. are deep nested objects, that need a deep merge
|
|
46
|
+
return merge({}, cePermissions, eePermissions);
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
defaultValue: ADMIN_PERMISSIONS_CE,
|
|
50
|
+
}
|
|
51
|
+
);
|
|
49
52
|
const routes = useEnterprise(
|
|
50
53
|
ROUTES_CE,
|
|
51
54
|
async () => (await import('../../../../ee/admin/pages/App/constants')).ROUTES_EE,
|
|
@@ -113,8 +116,6 @@ function App() {
|
|
|
113
116
|
authLogo: prefixFileUrlWithBackendUrl(authLogo),
|
|
114
117
|
});
|
|
115
118
|
|
|
116
|
-
const deviceId = await getUID();
|
|
117
|
-
|
|
118
119
|
if (uuid) {
|
|
119
120
|
const {
|
|
120
121
|
data: { data: properties },
|
|
@@ -127,19 +128,23 @@ function App() {
|
|
|
127
128
|
|
|
128
129
|
try {
|
|
129
130
|
const event = 'didInitializeAdministration';
|
|
130
|
-
await post(
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
131
|
+
await post(
|
|
132
|
+
'https://analytics.strapi.io/api/v2/track',
|
|
133
|
+
{
|
|
134
|
+
// This event is anonymous
|
|
135
|
+
event,
|
|
136
|
+
userId: '',
|
|
137
|
+
deviceId,
|
|
138
|
+
eventPropeties: {},
|
|
139
|
+
userProperties: { environment: appInfo.currentEnvironment },
|
|
140
|
+
groupProperties: { ...properties, projectId: uuid },
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
headers: {
|
|
144
|
+
'X-Strapi-Event': event,
|
|
145
|
+
},
|
|
141
146
|
}
|
|
142
|
-
|
|
147
|
+
);
|
|
143
148
|
} catch (e) {
|
|
144
149
|
// Silent.
|
|
145
150
|
}
|
|
@@ -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);
|
|
@@ -203,7 +203,12 @@ const ProfilePage = () => {
|
|
|
203
203
|
<HeaderLayout
|
|
204
204
|
title={data.username || getFullName(data.firstname, data.lastname)}
|
|
205
205
|
primaryAction={
|
|
206
|
-
<Button
|
|
206
|
+
<Button
|
|
207
|
+
startIcon={<Check />}
|
|
208
|
+
loading={isSubmitting}
|
|
209
|
+
type="submit"
|
|
210
|
+
disabled={!dirty}
|
|
211
|
+
>
|
|
207
212
|
{formatMessage({ id: 'global.save', defaultMessage: 'Save' })}
|
|
208
213
|
</Button>
|
|
209
214
|
}
|
|
@@ -189,7 +189,7 @@ const EditPage = ({ canUpdate }) => {
|
|
|
189
189
|
<HeaderLayout
|
|
190
190
|
primaryAction={
|
|
191
191
|
<Button
|
|
192
|
-
disabled={
|
|
192
|
+
disabled={isSubmitting || !canUpdate ? true : !dirty}
|
|
193
193
|
startIcon={<Check />}
|
|
194
194
|
loading={isSubmitting}
|
|
195
195
|
type="submit"
|
|
@@ -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": "删除",
|
|
Binary file
|
|
@@ -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,6 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[4485],{55433:function(N,T,t){t.d(T,{r:function(){return L}});var i=t(32735),m=t(72850),h=t(60216),A=t.n(h),M=t(74506);function D(p,y,g){if(!p||!y)return{display:"none"};const{x:O,y:P}=g;return{transform:`translate(${O}px, ${P}px)`}}function L({renderItem:p}){const{itemType:y,isDragging:g,item:O,initialOffset:P,currentOffset:F,mouseOffset:K}=(0,M.useDragLayer)(R=>({item:R.getItem(),itemType:R.getItemType(),initialOffset:R.getInitialSourceClientOffset(),currentOffset:R.getSourceClientOffset(),isDragging:R.isDragging(),mouseOffset:R.getClientOffset()}));return g?i.createElement(m.x,{height:"100%",left:0,position:"fixed",pointerEvents:"none",top:0,zIndex:100,width:"100%"},i.createElement(m.x,{style:D(P,F,K)},p({type:y,item:O}))):null}L.propTypes={renderItem:A().func.isRequired}},73386:function(N,T,t){var i=t(32735);const m=(0,i.createContext)();var h=null},56327:function(N,T,t){t.d(T,{PL:function(){return M},Y9:function(){return D.Y},zE:function(){return se},Ky:function(){return le},fi:function(){return H},zH:function(){return de},r5:function(){return me}});var i=t(32735),m=t(15062),h=t(70031),M=()=>{const e=(0,m.v9)(h.Z),n=(0,i.useCallback)(r=>e?.components?.[r]??{},[e]);return{...e,getComponentLayout:n}},D=t(90553),L=t(19565),p=t(84306),y=t(42882),g=t(97889);const O={error:null,isLoading:!0,layout:{},layouts:{}};var F=(e,n)=>(0,g.ZP)(e,r=>{switch(n.type){case"GET_DATA":{r.isLoading=!0,r.error=null,r.layout={};break}case"GET_DATA_SUCCEEDED":{const s=n.data.contentType.uid;r.layout=n.data,r.layouts[s]=n.data,r.isLoading=!1;break}case"GET_DATA_ERROR":{r.isLoading=!1,r.error=n.error;break}case"SET_LAYOUT_FROM_STATE":{r.error=null,r.layout=e.layouts[n.uid];break}case"UPDATE_LAYOUT":{const s=e.layout;r.layout={...s,contentType:{uid:s.contentType.uid,...n.newLayout.contentType}},r.layouts[s.contentType.uid]={...s,contentType:{uid:s.contentType.uid,...n.newLayout.contentType}};break}default:return r}}),K=t(99381),R=t.n(K),V=t(33795),W=t.n(V),Y=t(3040),U=t.n(Y),_=t(51375);const $=(e,n)=>n.find(r=>r.uid===e),j=(e,n)=>{const r=S(e,n),s=b(r.contentType,n),a=z(r.contentType,r.components);return U()(r,["contentType","layouts","edit"],s),U()(r,["contentType","layouts","list"],a),Object.keys(r.components).forEach(l=>{const c=b(r.components[l],n);U()(r,["components",l,"layouts","edit"],c)}),r},S=(e,n)=>{const r=(0,_.w8)(R()(e),n,"contentType"),{components:s,contentType:a}=r,l=c=>Object.keys(c.metadatas).reduce((f,C)=>{const I=W()(c,["attributes",C],{});let k=c.metadatas[C];if(I.type==="relation"){const x=$(I.targetModel,n),B=k.edit.mainField,J={name:B,schema:W()(x,["attributes",B])};k={list:{...k.list,mainField:J},edit:{...k.edit,mainField:J}}}return f[C]=k,f},{});return U()(r,["contentType","metadatas"],l(a)),Object.keys(s).forEach(c=>{const f=s[c],C=l(f);U()(r,["components",c,"metadatas"],C)}),r},b=(e,n)=>e.layouts.edit.reduce((r,s)=>{const a=s.map(l=>{const c=W()(e,["attributes",l.name],{}),f={...l,fieldSchema:c,metadatas:W()(e,["metadatas",l.name,"edit"],{})};if(c.type==="relation"){const I=$(c.targetModel,n).pluginOptions||{};U()(f,"targetModelPluginOptions",I),U()(f,"queryInfos",{shouldDisplayRelationLink:w(e,l.name,n)})}return f});return r.push(a),r},[]),z=(e,n)=>e.layouts.list.reduce((s,a)=>{const l=W()(e,["attributes",a],{}),c=W()(e,["metadatas",a,"list"],{}),f=l.type;if(f==="relation")return s.push({key:`__${a}_key__`,name:a,fieldSchema:l,metadatas:c}),s;if(f==="component"){const C=n[l.component],I=C.settings.mainField,k=C.attributes[I];return s.push({key:`__${a}_key__`,name:a,fieldSchema:l,metadatas:{...c,mainField:{...k,name:I}}}),s}return s.push({key:`__${a}_key__`,name:a,fieldSchema:l,metadatas:c}),s},[]),w=(e,n,r)=>{const s=W()(e,["attributes",n,"targetModel"],"");return Z(r).includes(s)},Z=e=>e.filter(n=>n.isDisplayed).map(({uid:n})=>n);var X=j,se=e=>{const[{error:n,isLoading:r,layout:s,layouts:a},l]=(0,i.useReducer)(F,O),c=(0,i.useMemo)(y.Vo,[]),{schemas:f}=(0,m.v9)(B=>c(B),m.wU),C=(0,i.useRef)(!0),{get:I}=(0,L.kY)(),k=(0,i.useCallback)(async(B,J)=>{if(a[B]){l({type:"SET_LAYOUT_FROM_STATE",uid:B});return}l({type:"GET_DATA"});try{const{data:{data:re}}=await I(`/content-manager/content-types/${B}/configuration`,{cancelToken:J.token});l({type:"GET_DATA_SUCCEEDED",data:X(re,f)})}catch(re){if(p.default.isCancel(re))return;C.current&&console.error(re),C.current&&l({type:"GET_DATA_ERROR",error:re})}},[a,f,I]);(0,i.useEffect)(()=>()=>{C.current=!1},[]),(0,i.useEffect)(()=>{const J=p.default.CancelToken.source();return k(e,J),()=>{J.cancel("Operation canceled by the user.")}},[e,k]);const x=(0,i.useCallback)(B=>{l({type:"UPDATE_LAYOUT",newLayout:X(B,f)})},[f]);return{error:n,isLoading:r,layout:s,updateLayout:x}},oe=e=>e["content-manager_app"].collectionTypeLinks,ae=t(85973),ie=t.n(ae),Q=t(33348);const ue=(e,n)=>Object.keys(e).reduce((r,s)=>{const a=e[s],l=W()(n,[s],a);return ie()(a)?{...r,[s]:ue(a,l)}:(r[s]=l,r)},{});var E=(e,n,r)=>{const s=e.find(({to:k})=>k.includes(n));if(!s)return"/";const{to:a,search:l}=s,c=(0,Q.parse)(l),f=(0,Q.parse)(r.substring(1)),C=ue(c,f);return`${a}?${(0,Q.stringify)(C,{encode:!1})}`},le=e=>{const[{rawQuery:n}]=(0,L.Kx)(),r=(0,m.v9)(oe);return E(r,e,n)},ye=t(18777),ce=t(53038),H=()=>{const{search:e}=(0,ce.TH)(),n=e?(0,Q.parse)(e.substring(1)):{};return n.plugins?(0,Q.stringify)({plugins:n.plugins},{encode:!1}):""};const de=e=>{const n=(0,i.useRef)();return(0,i.useEffect)(()=>{n.current=e},[e]),n.current};var G=t(89334);const v=(e,n,r)=>({type:G.m,permissions:e,__meta__:{plugins:n,containerName:r}}),te=()=>({type:G.Q}),fe=e=>e["content-manager_rbacManager"].permissions,ne=e=>e.rbacProvider.collectionTypesRelatedPermissions;var me=(e,n,r="listView")=>{const s=(0,m.v9)(ne),a=(0,m.v9)(fe),l=(0,m.I0)(),c=s[n];return(0,i.useEffect)(()=>c?(l(v(c,e?e.plugins:null,r)),()=>{l(te())}):()=>{},[c,l,e,r]),a},o=t(73386);const d=()=>useContext(WysiwygContext);var u=null},90553:function(N,T,t){t.d(T,{Y:function(){return M}});var i=t(32735),m=t(74506),h=t.n(m),A=t(18777);const M=(D,{type:L="STRAPI_DND",index:p,item:y={},onStart:g,onEnd:O,onGrabItem:P,onDropItem:F,onCancel:K,onMoveItem:R,dropSensitivity:V="regular"})=>{const W=(0,i.useRef)(null),[{handlerId:Y},U]=(0,m.useDrop)({accept:L,collect(b){return{handlerId:b.getHandlerId()}},hover(b,z){if(!W.current)return;const w=b.index,Z=p;if(w!==Z){if(V==="regular"){const X=W.current.getBoundingClientRect(),q=(X.bottom-X.top)/2,ee=z.getClientOffset().y-X.top;if(w<Z&&ee<q||w>Z&&ee>q)return}R(Z,w),b.index=Z}}}),[{isDragging:_},$,j]=(0,m.useDrag)({type:L,item(){g&&g();const{width:b}=W.current?.getBoundingClientRect()??{};return{index:p,width:b,...y}},end(){O&&O()},canDrag:D,isDragging:y.id?b=>y.id===b.getItem().id:void 0,collect:b=>({isDragging:b.isDragging()})}),S=(0,A.A)(D,p,{onGrabItem:P,onDropItem:F,onCancel:K,onMoveItem:R});return[{handlerId:Y,isDragging:_,handleKeyDown:S},W,U,$,j]}},18777:function(N,T,t){t.d(T,{A:function(){return m}});var i=t(32735);const m=(h,A,{onCancel:M,onDropItem:D,onGrabItem:L,onMoveItem:p})=>{const[y,g]=(0,i.useState)(!1),O=R=>{y&&(R==="UP"?p(A-1,A):R==="DOWN"&&p(A+1,A))},P=()=>{y?(D&&D(A),g(!1)):(L&&L(A),g(!0))},F=()=>{y&&(g(!1),M&&M(A))};return R=>{if(h&&!(R.key==="Tab"&&!y))switch(R.preventDefault(),R.key){case" ":case"Enter":P();break;case"Escape":F();break;case"ArrowDown":case"ArrowRight":O("DOWN");break;case"ArrowUp":case"ArrowLeft":O("UP");break;default:}}}},42882:function(N,T,t){t.d(T,{Jg:function(){return p},KQ:function(){return D},Vo:function(){return L},Yg:function(){return h}});var i=t(98178),m=t(34947);const h=()=>g=>g["content-manager_app"]||m.E,A=()=>createSelector(h(),g=>g),M=()=>createSelector(h(),g=>g.models),D=()=>(0,i.P1)(h(),g=>({collectionTypeLinks:g.collectionTypeLinks,singleTypeLinks:g.singleTypeLinks})),L=()=>(0,i.P1)(h(),({components:g,models:O})=>({schemas:[...g,...O]})),p=(0,i.P1)(h(),g=>g.fieldSizes);var y=null},70031:function(N,T){const t=i=>i["content-manager_editViewLayoutManager"].currentLayout;T.Z=t},25708:function(N,T){T.Z={COMPONENT:"component",EDIT_FIELD:"editField",FIELD:"field",DYNAMIC_ZONE:"dynamicZone",RELATION:"relation"}},47510:function(N,T){const t=i=>`content-manager.${i}`;T.Z=t},51375:function(N,T,t){t.d(T,{_Q:function(){return ee.Z},W3:function(){return A},ko:function(){return p},FE:function(){return g},Di:function(){return K},Ex:function(){return me},du:function(){return Y},TA:function(){return $},Ts:function(){return z},Uo:function(){return Z},IF:function(){return q},OB:function(){return se.Z},w8:function(){return ge},kc:function(){return le}});var i=t(99381),m=t.n(i),A=(o,d,u)=>{if(Array.isArray(o)&&d>=0&&u>=0&&d<=o.length-1&&u<=o.length-1){const e=m()(o),n=e.splice(d,1);return e.splice(u,0,n[0]),e}return o},M=t(59578),D=t.n(M),p=o=>{const d=o.type;return d==="relation"?!D()(o.relationType).includes("morph"):!["json","dynamiczone","richtext","password"].includes(d)&&!!d};const y=(o,d)=>{typeof o=="function"?o(d):o!=null&&(o.current=d)},g=(...o)=>d=>o.forEach(u=>y(u,d));var O=t(33795),P=t.n(O);const F=(o,d)=>Object.keys(o).reduce((u,e)=>{const n=P()(o,[e],{}),{default:r,component:s,type:a,required:l,min:c,repeatable:f}=n;if(r!==void 0&&(u[e]=r),a==="component"){const C=d?.[s]?.attributes??{},I=F(C,d);if(l===!0&&(u[e]=f===!0?[]:I),c&&f===!0&&l){u[e]=[];for(let k=0;k<c;k+=1)u[e].push(I)}}return a==="dynamiczone"&&l===!0&&(u[e]=[]),u},{});var K=F,R=t(9086),V=t.n(R),Y=({layouts:o,metadatas:d,...u})=>{const e=o.list.map(s=>s.name?s.name:s),n=Object.keys(d).reduce((s,a)=>{const l=P()(d,[a],{});let c=l.edit;return c.mainField&&(c={...c,mainField:l.edit.mainField.name}),{...s,[a]:{edit:c,list:V()(l.list,["mainField"])}}},{}),r=o.edit.map(s=>s.map(({name:a,size:l})=>({name:a,size:l})));return{...u,layouts:{edit:r,list:e},metadatas:n}};const U=(o,d)=>o.map(u=>({...u,subject:d}));var $=o=>{const d={create:[{action:"plugin::content-manager.explorer.create",subject:null}],delete:[{action:"plugin::content-manager.explorer.delete",subject:null}],publish:[{action:"plugin::content-manager.explorer.publish",subject:null}],read:[{action:"plugin::content-manager.explorer.read",subject:null}],update:[{action:"plugin::content-manager.explorer.update",subject:null}]};return Object.keys(d).reduce((u,e)=>(u[e]=U(d[e],o),u),{})},j=t(95919),S=t.n(j),z=o=>o.split(".").filter(d=>S()(parseInt(d,10))),Z=o=>{if(o.length===0)return-1;const d=Math.max.apply(Math,o.map(u=>u.__temp_key__??0));return Number.isNaN(d)?-1:d},q=o=>`/content-manager/${o}`,se=t(47510),ee=t(25708),oe=t(86349),ae=t.n(oe),ie=t(3040),Q=t.n(ie),ge=(o,d,u)=>{const e=a=>d.find(l=>l.uid===a),n=Object.assign({},o),r=o[u].uid,s=e(r);return Q()(n,[u],ae()({},s,o[u])),Object.keys(o.components).forEach(a=>{const l=e(a);Q()(n,["components",a],{...o.components[a],...l})}),n},E=t(19565),le=(o,d,u)=>{const e=(n,r)=>Object.keys(n).reduce((s,a)=>{const l=(0,E.UN)(r,a),c=P()(n,a),f=(0,E.k2)(r,[a,"component"]),C=(0,E.k2)(r,[a,"repeatable"]);return l==="dynamiczone"?(s[a]=c.map(I=>e(I,u[I.__component])),s):l==="component"?(C?s[a]=c&&c.map(I=>e(I,u[f])):s[a]=c&&e(c,u[f]),s):(l!=="password"&&(s[a]=c),s)},{});return e(o,d)},ye=t(51355),ce=t.n(ye),pe=t(86834),H=t.n(pe),de=t(78746),G=t.n(de),v=t(24346),te=t(82293);v.kM(v.nK,"defined",function(){return this.test("defined",E.I0.required,o=>o!==void 0)}),v.kM(v.IX,"notEmptyMin",function(o){return this.test("notEmptyMin",E.I0.min,d=>H()(d)?!0:d.length>=o)}),v.kM(v.Z_,"isInferior",function(o,d){return this.test("isInferior",o,function(u){return!u||Number.isNaN(G()(u))?!0:G()(d)>=G()(u)})}),v.kM(v.Z_,"isSuperior",function(o,d){return this.test("isSuperior",o,function(u){return!u||Number.isNaN(G()(u))?!0:G()(u)>=G()(d)})});const fe=o=>P()(o,["attributes"],{}),ne=(o,{components:d},u={isCreatingEntry:!0,isDraft:!0,isFromComponent:!1})=>{const e=fe(o);return v.Ry().shape(Object.keys(e).reduce((n,r)=>{const s=e[r];if(s.type!=="relation"&&s.type!=="component"&&s.type!=="dynamiczone"){const a=Ee(s.type,s,u);n[r]=a}if(s.type==="relation"&&(n[r]=["oneWay","oneToOne","manyToOne","oneToManyMorph","oneToOneMorph"].includes(s.relationType)?v.Ry().nullable():v.IX().nullable()),s.type==="component"){const a=ne(d[s.component],{components:d},{...u,isFromComponent:!0});if(s.repeatable===!0){const{min:c,max:f,required:C}=s;let I=v.Vo(k=>{let x=v.IX().of(a);return c?C?x=x.min(c,E.I0.min):C!==!0&&H()(k)?x=x.nullable():x=x.min(c,E.I0.min):C&&!u.isDraft&&(x=x.min(1,E.I0.required)),f&&(x=x.max(f,E.I0.max)),x});return n[r]=I,n}const l=v.Vo(c=>c!==void 0?s.required===!0&&!u.isDraft?a.defined():a.nullable():s.required===!0?v.Ry().defined():v.Ry().nullable());return n[r]=l,n}if(s.type==="dynamiczone"){let a=v.IX().of(v.Vo(({__component:f})=>ne(d[f],{components:d},{...u,isFromComponent:!0})));const{max:l,min:c}=s;c?s.required?a=a.test("min",E.I0.min,f=>u.isCreatingEntry?f&&f.length>=c:f===void 0?!0:f!==null&&f.length>=c).test("required",E.I0.required,f=>u.isCreatingEntry?f!==null||f!==void 0:f===void 0?!0:f!==null):a=a.notEmptyMin(c):s.required&&!u.isDraft&&(a=a.test("required",E.I0.required,f=>u.isCreatingEntry?f!==null||f!==void 0:f===void 0?!0:f!==null)),l&&(a=a.max(l,E.I0.max)),n[r]=a}return n},{}))},Ee=(o,d,u)=>{let e=v.nK();return["string","uid","text","richtext","email","password","enumeration"].includes(o)&&(e=v.Z_()),o==="json"&&(e=v.nK(E.I0.json).test("isJSON",E.I0.json,n=>{if(!n||!n.length)return!0;try{return JSON.parse(n),!0}catch{return!1}}).nullable().test("required",E.I0.required,n=>!(d.required&&(!n||!n.length)))),o==="email"&&(e=e.email(E.I0.email)),["number","integer","float","decimal"].includes(o)&&(e=v.Rx().transform(n=>S()(n)?void 0:n).typeError()),o==="biginteger"&&(e=v.Z_().matches(/^-?\d*$/)),["date","datetime"].includes(o)&&(e=v.hT()),Object.keys(d).forEach(n=>{const r=d[n];if(r||!ce()(r)&&Number.isInteger(Math.floor(r))||r===0)switch(n){case"required":{u.isDraft||(o==="password"&&u.isCreatingEntry&&(e=e.required(E.I0.required)),o!=="password"&&(u.isCreatingEntry?e=e.required(E.I0.required):e=e.test("required",E.I0.required,s=>s===void 0&&!u.isFromComponent?!0:(0,te.Z)(o)?s===0?!0:!!s:o==="boolean"?s!=null:o==="date"||o==="datetime"?typeof s=="string"?!H()(s):!H()(s?.toString()):!H()(s))));break}case"max":{o==="biginteger"?e=e.isInferior(E.I0.max,r):e=e.max(r,E.I0.max);break}case"maxLength":e=e.max(r,E.I0.maxLength);break;case"min":{o==="biginteger"?e=e.isSuperior(E.I0.min,r):e=e.min(r,E.I0.min);break}case"minLength":{u.isDraft||(e=e.min(r,E.I0.minLength));break}case"regex":e=e.matches(new RegExp(r),{message:E.I0.regex,excludeEmptyString:!d.required});break;case"lowercase":["text","textarea","email","string"].includes(o)&&(e=e.strict().lowercase());break;case"uppercase":["text","textarea","email","string"].includes(o)&&(e=e.strict().uppercase());break;case"positive":(0,te.Z)(o)&&(e=e.positive());break;case"negative":(0,te.Z)(o)&&(e=e.negative());break;default:e=e.nullable()}}),e};var me=ne},82293:function(N,T,t){t.d(T,{Z:function(){return i}});function i(m){return["integer","biginteger","decimal","float","number"].includes(m)}},39731:function(N,T,t){t.d(T,{uT:function(){return U},fC:function(){return j},Dx:function(){return Y}});var i=t(32735),m=t(49372),h=t(87933),A=t(85025),M=t(31600),D=t(72850),L=t(50563),p=t(95489),y=t(35331),g=t(60216),O=t.n(g),P=t(67879),F=t(8471),K=t.p+"0cd5f8915b265d5b1856.png";const R="limits-title",V="https://strapi.io/pricing-cloud",W="https://strapi.io/contact-sales";function Y({children:S}){return i.createElement(m.Z,{variant:"alpha",id:R},S)}Y.propTypes={children:O().node.isRequired};function U({children:S}){return i.createElement(m.Z,{variant:"omega"},S)}U.propTypes={children:O().node.isRequired};function _(){const{formatMessage:S}=(0,P.Z)();return i.createElement(h.k,{gap:2,paddingTop:4},i.createElement(p.Q,{variant:"default",isExternal:!0,href:V},S({id:"Settings.review-workflows.limit.cta.learn",defaultMessage:"Learn more"})),i.createElement(p.Q,{variant:"tertiary",isExternal:!0,href:W},S({id:"Settings.review-workflows.limit.cta.sales",defaultMessage:"Contact Sales"})))}const $=F.ZP.img`
|
|
2
|
+
// Margin top|right reverse the padding of ModalBody
|
|
3
|
+
margin-right: ${({theme:S})=>`-${S.spaces[7]}`};
|
|
4
|
+
margin-top: ${({theme:S})=>`-${S.spaces[7]}`};
|
|
5
|
+
width: 360px;
|
|
6
|
+
`;function j({children:S,isOpen:b,onClose:z}){const{formatMessage:w}=(0,P.Z)();return b?i.createElement(A.P,{labelledBy:R},i.createElement(M.f,null,i.createElement(h.k,{gap:2,paddingLeft:7,position:"relative"},i.createElement(h.k,{alignItems:"start",direction:"column",gap:2,width:"60%"},S,i.createElement(_,null)),i.createElement(h.k,{justifyContent:"end",height:"100%",width:"40%"},i.createElement($,{src:K,"aria-hidden":!0,alt:"",loading:"lazy"}),i.createElement(D.x,{display:"flex",position:"absolute",right:0,top:0},i.createElement(L.h,{icon:i.createElement(y.Z,null),"aria-label":w({id:"global.close",defaultMessage:"Close"}),onClick:z})))))):null}j.defaultProps={isOpen:!1},j.propTypes={children:O().node.isRequired,isOpen:O().bool,onClose:O().func.isRequired}},61937:function(N,T,t){t.d(T,{$k:function(){return p},FT:function(){return O},Nj:function(){return L},Ot:function(){return D},VS:function(){return y},gu:function(){return h},lv:function(){return g},qZ:function(){return A},sN:function(){return m},uL:function(){return P},x4:function(){return M}});var i=t(12301);const m="settings_review-workflows",h="Settings/Review_Workflows/RESET_WORKFLOW",A="Settings/Review_Workflows/SET_WORKFLOW",M="Settings/Review_Workflows/WORKFLOW_DELETE_STAGE",D="Settings/Review_Workflows/WORKFLOW_ADD_STAGE",L="Settings/Review_Workflows/WORKFLOW_UPDATE_STAGE",p="Settings/Review_Workflows/WORKFLOW_UPDATE_STAGE_POSITION",y="Settings/Review_Workflows/WORKFLOW_UPDATE",g={primary600:"Blue",primary200:"Lilac",alternative600:"Violet",alternative200:"Lavender",success600:"Green",success200:"Pale Green",danger500:"Cherry",danger200:"Pink",warning600:"Orange",warning200:"Yellow",secondary600:"Teal",secondary200:"Baby Blue",neutral400:"Gray",neutral0:"White"},O=i.W.colors.primary600,P={STAGE:"stage"}},67350:function(N,T,t){t.d(T,{n:function(){return h}});var i=t(19565),m=t(20108);function h(A={}){const{get:M}=(0,i.kY)(),{id:D="",...L}=A,p={populate:"stages"},{data:y,isLoading:g,status:O,refetch:P}=(0,m.useQuery)(["review-workflows","workflows",D],async()=>(await M(`/admin/review-workflows/workflows/${D}`,{params:{...p,...L}})).data);let F=[];return D&&y?.data?F=[y.data]:Array.isArray(y?.data)&&(F=y.data),{meta:y?.meta??{},workflows:F,isLoading:g,status:O,refetch:P}}},54504:function(N,T,t){t.d(T,{k:function(){return h},s:function(){return A}});var i=t(12301),m=t(61937);function h(M){if(!M)return null;const L=Object.entries(i.W.colors).filter(([,p])=>p.toUpperCase()===M.toUpperCase()).reduce((p,[y])=>(m.lv?.[y]&&(p=y),p),null);return L?{themeColorName:L,name:m.lv[L]}:null}function A(){return Object.entries(m.lv).map(([M,D])=>({hex:i.W.colors[M].toUpperCase(),name:D}))}}}]);
|
|
@@ -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}}}]);
|