@strapi/admin 4.11.0-exp.9xg4-3qfm-9w8f.1 → 4.11.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/components/Providers/index.js +32 -32
- package/admin/src/components/Theme/index.js +5 -3
- package/admin/src/content-manager/components/ComponentIcon/ComponentIcon.js +16 -26
- package/admin/src/content-manager/components/ComponentIcon/constants.js +133 -0
- package/admin/src/content-manager/components/DynamicTable/BulkActionsBar/index.js +307 -0
- package/admin/src/content-manager/components/DynamicTable/index.js +20 -4
- package/admin/src/content-manager/components/DynamicZone/components/AddComponentButton.js +32 -95
- package/admin/src/content-manager/components/DynamicZone/components/ComponentCard.js +10 -2
- package/admin/src/content-manager/components/DynamicZone/components/ComponentCategory.js +63 -15
- package/admin/src/content-manager/components/DynamicZone/components/ComponentPicker.js +50 -63
- package/admin/src/content-manager/components/DynamicZone/components/DynamicComponent.js +132 -58
- package/admin/src/content-manager/components/DynamicZone/components/DynamicZoneLabel.js +29 -37
- package/admin/src/content-manager/components/DynamicZone/index.js +131 -83
- package/admin/src/content-manager/components/EditViewDataManagerProvider/index.js +12 -4
- package/admin/src/content-manager/components/EditViewDataManagerProvider/reducer.js +18 -6
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/index.js +0 -1
- package/admin/src/content-manager/components/Inputs/index.js +18 -11
- package/admin/src/content-manager/components/Inputs/utils/index.js +0 -1
- package/admin/src/content-manager/pages/EditSettingsView/components/DynamicZoneList.js +7 -1
- package/admin/src/content-manager/pages/EditView/index.js +1 -1
- package/admin/src/content-manager/pages/ListView/index.js +118 -2
- package/admin/src/content-manager/utils/index.js +2 -0
- package/admin/src/content-manager/{components/EditViewDataManagerProvider/utils → utils}/schema.js +1 -1
- package/admin/src/injectionZones.js +6 -1
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/EventTable/EventTableCE.js +13 -0
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/EventTable/index.js +3 -0
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/Events/index.js +331 -0
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/HeadersInput/Combobox.js +54 -4
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/HeadersInput/index.js +12 -23
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/WebhookForm/index.js +129 -116
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/WebhookForm/utils/makeWebhookValidationSchema.js +62 -0
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/index.js +59 -64
- package/admin/src/translations/en.json +11 -1
- package/build/3562.e0b1a0b3.chunk.js +50 -0
- package/build/371.6e4e2c1f.chunk.js +71 -0
- package/build/5297.31c9ffdc.chunk.js +39 -0
- package/build/{5563.79950369.chunk.js → 5563.badbffde.chunk.js} +2 -2
- package/build/{3081.7e9329cb.chunk.js → 6691.f7a3b5ac.chunk.js} +2 -2
- package/build/6970.d456705f.chunk.js +1 -0
- package/build/{7259.5cc67413.chunk.js → 7259.5d0de931.chunk.js} +1 -1
- package/build/8976.0022f5a3.chunk.js +50 -0
- package/build/{1657.3f2b2c11.chunk.js → 9932.5ef475c5.chunk.js} +54 -54
- package/build/Admin-authenticatedApp.ab2b5910.chunk.js +79 -0
- package/build/{Admin_InternalErrorPage.96ceaae1.chunk.js → Admin_InternalErrorPage.f25f04f3.chunk.js} +1 -1
- package/build/{Admin_homePage.94dc81b1.chunk.js → Admin_homePage.05063e43.chunk.js} +16 -16
- package/build/{Admin_marketplace.1b0c3d3b.chunk.js → Admin_marketplace.005d2d5b.chunk.js} +11 -11
- package/build/{Admin_pluginsPage.a28b96d5.chunk.js → Admin_pluginsPage.5d9d4060.chunk.js} +1 -1
- package/build/{Admin_profilePage.a8fa3a56.chunk.js → Admin_profilePage.ab7b94d7.chunk.js} +2 -2
- package/build/{Admin_settingsPage.ee76d19e.chunk.js → Admin_settingsPage.07a6a5f0.chunk.js} +2 -2
- package/build/{Upload_ConfigureTheView.aa64ed9a.chunk.js → Upload_ConfigureTheView.121deffb.chunk.js} +1 -1
- package/build/{admin-app.bd209f08.chunk.js → admin-app.7cc667be.chunk.js} +10 -10
- package/build/{admin-edit-roles-page.0d12b741.chunk.js → admin-edit-roles-page.bfe3304d.chunk.js} +3 -3
- package/build/{admin-edit-users.f9ce7844.chunk.js → admin-edit-users.6efe0382.chunk.js} +2 -2
- package/build/{admin-roles-list.af53b372.chunk.js → admin-roles-list.b2577370.chunk.js} +1 -1
- package/build/{admin-users.0fc77b35.chunk.js → admin-users.4af49ccf.chunk.js} +2 -2
- package/build/{api-tokens-create-page.973d2816.chunk.js → api-tokens-create-page.65411a36.chunk.js} +1 -1
- package/build/{api-tokens-edit-page.29725c5e.chunk.js → api-tokens-edit-page.60312cb6.chunk.js} +1 -1
- package/build/{api-tokens-list-page.66c4fbdd.chunk.js → api-tokens-list-page.01a4d5cd.chunk.js} +2 -2
- package/build/audit-logs-settings-page.b165679b.chunk.js +16 -0
- package/build/content-manager.8cc6c3f9.chunk.js +1094 -0
- package/build/content-type-builder-list-view.58f9ed20.chunk.js +211 -0
- package/build/{content-type-builder-translation-en-json.af293c9e.chunk.js → content-type-builder-translation-en-json.f592325b.chunk.js} +1 -1
- package/build/content-type-builder.baeb0413.chunk.js +132 -0
- package/build/{email-settings-page.63f269ff.chunk.js → email-settings-page.8caad83f.chunk.js} +1 -1
- package/build/en-json.a8f34002.chunk.js +1 -0
- package/build/i18n-settings-page.579d5eab.chunk.js +9 -0
- package/build/i18n-translation-en-json.1ec7becf.chunk.js +1 -0
- package/build/index.html +1 -1
- package/build/main.1d678f7b.js +2926 -0
- package/build/{review-workflows-settings.56cab253.chunk.js → review-workflows-settings.3a7bae25.chunk.js} +2 -2
- package/build/{runtime~main.0dfc909e.js → runtime~main.9dbd4553.js} +2 -2
- package/build/{sso-settings-page.265e3d72.chunk.js → sso-settings-page.4bb073e0.chunk.js} +1 -1
- package/build/{transfer-tokens-create-page.170acee6.chunk.js → transfer-tokens-create-page.9ec277d7.chunk.js} +1 -1
- package/build/{transfer-tokens-edit-page.6cf23295.chunk.js → transfer-tokens-edit-page.fa5ade14.chunk.js} +1 -1
- package/build/{transfer-tokens-list-page.c3fec4c1.chunk.js → transfer-tokens-list-page.5d68d590.chunk.js} +2 -2
- package/build/{upload-settings.1d187578.chunk.js → upload-settings.2c1565d6.chunk.js} +1 -1
- package/build/{upload.bc340679.chunk.js → upload.257b2aef.chunk.js} +1 -1
- package/build/{users-advanced-settings-page.7b4bf63a.chunk.js → users-advanced-settings-page.ddd29040.chunk.js} +1 -1
- package/build/{users-email-settings-page.035a026c.chunk.js → users-email-settings-page.717e2a51.chunk.js} +1 -1
- package/build/{users-providers-settings-page.6873dce9.chunk.js → users-providers-settings-page.c7eae829.chunk.js} +1 -1
- package/build/{users-roles-settings-page.2549794b.chunk.js → users-roles-settings-page.63cf2838.chunk.js} +1 -1
- package/build/webhook-edit-page.8576742e.chunk.js +31 -0
- package/build/{webhook-list-page.0861d3e9.chunk.js → webhook-list-page.abf5747c.chunk.js} +1 -1
- package/ee/admin/pages/SettingsPage/pages/Webhooks/EditView/components/EventTable/EventTableEE.js +23 -0
- package/ee/admin/pages/SettingsPage/pages/Webhooks/EditView/components/EventTable/index.js +3 -0
- package/package.json +13 -13
- package/admin/src/content-manager/components/DynamicTable/ConfirmDialogDeleteAll/index.js +0 -73
- package/admin/src/content-manager/components/DynamicZone/utils/connect.js +0 -12
- package/admin/src/content-manager/components/DynamicZone/utils/select.js +0 -53
- package/admin/src/content-manager/components/Inputs/utils/getStep.js +0 -13
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/EventInput/EventRow.js +0 -70
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/EventInput/index.js +0 -174
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/HeadersInput/keys.js +0 -39
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/utils/fieldsRegex.js +0 -4
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/utils/schema.js +0 -35
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/reducer.js +0 -100
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/utils/formatData.js +0 -20
- package/build/462.6f8cbd19.chunk.js +0 -71
- package/build/617.0518c0ba.chunk.js +0 -155
- package/build/6858.85d76858.chunk.js +0 -50
- package/build/6970.6a329e15.chunk.js +0 -1
- package/build/9036.f7ce35cc.chunk.js +0 -211
- package/build/Admin-authenticatedApp.e7ca2959.chunk.js +0 -79
- package/build/audit-logs-settings-page.6bc76e7d.chunk.js +0 -121
- package/build/content-manager.8bfce7f0.chunk.js +0 -1123
- package/build/content-type-builder-list-view.26aab6f3.chunk.js +0 -215
- package/build/content-type-builder.b10576e7.chunk.js +0 -126
- package/build/en-json.ba3290b8.chunk.js +0 -1
- package/build/i18n-settings-page.2ac4ca58.chunk.js +0 -114
- package/build/i18n-translation-en-json.60af6722.chunk.js +0 -1
- package/build/main.aca47de6.js +0 -2633
- package/build/webhook-edit-page.0bc97587.chunk.js +0 -128
|
@@ -52,7 +52,13 @@ const reducer = (state, action) =>
|
|
|
52
52
|
}
|
|
53
53
|
case 'ADD_COMPONENT_TO_DYNAMIC_ZONE':
|
|
54
54
|
case 'ADD_REPEATABLE_COMPONENT_TO_FIELD': {
|
|
55
|
-
const {
|
|
55
|
+
const {
|
|
56
|
+
keys,
|
|
57
|
+
allComponents,
|
|
58
|
+
componentLayoutData,
|
|
59
|
+
shouldCheckErrors,
|
|
60
|
+
position = undefined,
|
|
61
|
+
} = action;
|
|
56
62
|
|
|
57
63
|
if (shouldCheckErrors) {
|
|
58
64
|
draftState.shouldCheckErrors = !state.shouldCheckErrors;
|
|
@@ -62,7 +68,15 @@ const reducer = (state, action) =>
|
|
|
62
68
|
draftState.modifiedDZName = keys[0];
|
|
63
69
|
}
|
|
64
70
|
|
|
65
|
-
const currentValue = get(state, ['modifiedData', ...keys], []);
|
|
71
|
+
const currentValue = [...get(state, ['modifiedData', ...keys], [])];
|
|
72
|
+
|
|
73
|
+
let actualPosition = position;
|
|
74
|
+
|
|
75
|
+
if (actualPosition === undefined) {
|
|
76
|
+
actualPosition = currentValue.length;
|
|
77
|
+
} else if (actualPosition < 0) {
|
|
78
|
+
actualPosition = 0;
|
|
79
|
+
}
|
|
66
80
|
|
|
67
81
|
const defaultDataStructure =
|
|
68
82
|
action.type === 'ADD_COMPONENT_TO_DYNAMIC_ZONE'
|
|
@@ -87,11 +101,9 @@ const reducer = (state, action) =>
|
|
|
87
101
|
componentLayoutData.attributes
|
|
88
102
|
);
|
|
89
103
|
|
|
90
|
-
|
|
91
|
-
? [...currentValue, componentDataStructure]
|
|
92
|
-
: [componentDataStructure];
|
|
104
|
+
currentValue.splice(actualPosition, 0, componentDataStructure);
|
|
93
105
|
|
|
94
|
-
set(draftState, ['modifiedData', ...keys],
|
|
106
|
+
set(draftState, ['modifiedData', ...keys], currentValue);
|
|
95
107
|
|
|
96
108
|
break;
|
|
97
109
|
}
|
|
@@ -12,14 +12,7 @@ import Wysiwyg from '../Wysiwyg';
|
|
|
12
12
|
import InputUID from '../InputUID';
|
|
13
13
|
import { RelationInputDataManager } from '../RelationInputDataManager';
|
|
14
14
|
|
|
15
|
-
import {
|
|
16
|
-
connect,
|
|
17
|
-
generateOptions,
|
|
18
|
-
getInputType,
|
|
19
|
-
getStep,
|
|
20
|
-
select,
|
|
21
|
-
VALIDATIONS_TO_OMIT,
|
|
22
|
-
} from './utils';
|
|
15
|
+
import { connect, generateOptions, getInputType, select, VALIDATIONS_TO_OMIT } from './utils';
|
|
23
16
|
|
|
24
17
|
function Inputs({
|
|
25
18
|
allowedFields,
|
|
@@ -93,9 +86,7 @@ function Inputs({
|
|
|
93
86
|
return value;
|
|
94
87
|
}, [type, value]);
|
|
95
88
|
|
|
96
|
-
const step =
|
|
97
|
-
return getStep(type);
|
|
98
|
-
}, [type]);
|
|
89
|
+
const step = getStep(type);
|
|
99
90
|
|
|
100
91
|
const isUserAllowedToEditField = useMemo(() => {
|
|
101
92
|
const joinedName = fieldName.join('.');
|
|
@@ -184,6 +175,9 @@ function Inputs({
|
|
|
184
175
|
|
|
185
176
|
let minutes;
|
|
186
177
|
|
|
178
|
+
/**
|
|
179
|
+
* Wtf is this?
|
|
180
|
+
*/
|
|
187
181
|
if (inputType === 'datetime') {
|
|
188
182
|
minutes = parseInt(inputValue.substr(14, 2), 10);
|
|
189
183
|
} else if (inputType === 'time') {
|
|
@@ -316,6 +310,19 @@ Inputs.propTypes = {
|
|
|
316
310
|
customFieldInputs: PropTypes.object,
|
|
317
311
|
};
|
|
318
312
|
|
|
313
|
+
const getStep = (type) => {
|
|
314
|
+
switch (type) {
|
|
315
|
+
case 'float':
|
|
316
|
+
case 'decimal':
|
|
317
|
+
return 0.01;
|
|
318
|
+
case 'time':
|
|
319
|
+
case 'datetime':
|
|
320
|
+
return 15;
|
|
321
|
+
default:
|
|
322
|
+
return 1;
|
|
323
|
+
}
|
|
324
|
+
};
|
|
325
|
+
|
|
319
326
|
const Memoized = memo(Inputs, isEqual);
|
|
320
327
|
|
|
321
328
|
export default connect(Memoized, select);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { default as connect } from './connect';
|
|
2
2
|
export { default as generateOptions } from './generateOptions';
|
|
3
3
|
export { default as getInputType } from './getInputType';
|
|
4
|
-
export { default as getStep } from './getStep';
|
|
5
4
|
export { default as select } from './select';
|
|
6
5
|
export { default as VALIDATIONS_TO_OMIT } from './VALIDATIONS_TO_OMIT';
|
|
@@ -25,6 +25,12 @@ const CustomLink = styled(Flex)`
|
|
|
25
25
|
> div:first-child {
|
|
26
26
|
background: ${({ theme }) => theme.colors.primary200};
|
|
27
27
|
color: ${({ theme }) => theme.colors.primary600};
|
|
28
|
+
|
|
29
|
+
svg {
|
|
30
|
+
path {
|
|
31
|
+
fill: ${({ theme }) => theme.colors.primary600};
|
|
32
|
+
}
|
|
33
|
+
}
|
|
28
34
|
}
|
|
29
35
|
}
|
|
30
36
|
`;
|
|
@@ -49,7 +55,7 @@ const DynamicZoneList = ({ components }) => {
|
|
|
49
55
|
as={Link}
|
|
50
56
|
to={`/content-manager/components/${componentUid}/configurations/edit`}
|
|
51
57
|
>
|
|
52
|
-
<ComponentIcon />
|
|
58
|
+
<ComponentIcon icon={componentLayouts?.[componentUid]?.info?.icon} />
|
|
53
59
|
|
|
54
60
|
<Box paddingTop={1}>
|
|
55
61
|
<Typography fontSize={1} textColor="neutral600" fontWeight="bold">
|
|
@@ -13,7 +13,7 @@ import { Pencil, Layer } from '@strapi/icons';
|
|
|
13
13
|
import InformationBox from 'ee_else_ce/content-manager/pages/EditView/InformationBox';
|
|
14
14
|
import { InjectionZone } from '../../../shared/components';
|
|
15
15
|
import permissions from '../../../permissions';
|
|
16
|
-
import DynamicZone from '../../components/DynamicZone';
|
|
16
|
+
import { DynamicZone } from '../../components/DynamicZone';
|
|
17
17
|
import CollectionTypeFormWrapper from '../../components/CollectionTypeFormWrapper';
|
|
18
18
|
import EditViewDataManagerProvider from '../../components/EditViewDataManagerProvider';
|
|
19
19
|
import SingleTypeFormWrapper from '../../components/SingleTypeFormWrapper';
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
useTracking,
|
|
22
22
|
Link,
|
|
23
23
|
useAPIErrorHandler,
|
|
24
|
+
getYupInnerErrors,
|
|
24
25
|
} from '@strapi/helper-plugin';
|
|
25
26
|
|
|
26
27
|
import {
|
|
@@ -35,6 +36,7 @@ import {
|
|
|
35
36
|
} from '@strapi/design-system';
|
|
36
37
|
|
|
37
38
|
import { ArrowLeft, Plus, Cog } from '@strapi/icons';
|
|
39
|
+
import { useMutation } from 'react-query';
|
|
38
40
|
|
|
39
41
|
import DynamicTable from '../../components/DynamicTable';
|
|
40
42
|
import AttributeFilter from '../../components/AttributeFilter';
|
|
@@ -42,7 +44,7 @@ import { InjectionZone } from '../../../shared/components';
|
|
|
42
44
|
|
|
43
45
|
import permissions from '../../../permissions';
|
|
44
46
|
|
|
45
|
-
import { getRequestUrl, getTrad } from '../../utils';
|
|
47
|
+
import { createYupSchema, getRequestUrl, getTrad } from '../../utils';
|
|
46
48
|
|
|
47
49
|
import FieldPicker from './FieldPicker';
|
|
48
50
|
import PaginationFooter from './PaginationFooter';
|
|
@@ -64,6 +66,7 @@ function ListView({
|
|
|
64
66
|
canCreate,
|
|
65
67
|
canDelete,
|
|
66
68
|
canRead,
|
|
69
|
+
canPublish,
|
|
67
70
|
data,
|
|
68
71
|
getData,
|
|
69
72
|
getDataSucceeded,
|
|
@@ -100,6 +103,50 @@ function ListView({
|
|
|
100
103
|
const fetchClient = useFetchClient();
|
|
101
104
|
const { post, del } = fetchClient;
|
|
102
105
|
|
|
106
|
+
const bulkPublishMutation = useMutation(
|
|
107
|
+
(data) =>
|
|
108
|
+
post(`/content-manager/collection-types/${contentType.uid}/actions/bulkPublish`, data),
|
|
109
|
+
{
|
|
110
|
+
onSuccess() {
|
|
111
|
+
toggleNotification({
|
|
112
|
+
type: 'success',
|
|
113
|
+
message: { id: 'content-manager.success.record.publish', defaultMessage: 'Published' },
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
fetchData(`/content-manager/collection-types/${slug}${params}`);
|
|
117
|
+
},
|
|
118
|
+
onError(error) {
|
|
119
|
+
toggleNotification({
|
|
120
|
+
type: 'warning',
|
|
121
|
+
message: formatAPIError(error),
|
|
122
|
+
});
|
|
123
|
+
},
|
|
124
|
+
}
|
|
125
|
+
);
|
|
126
|
+
const bulkUnpublishMutation = useMutation(
|
|
127
|
+
(data) =>
|
|
128
|
+
post(`/content-manager/collection-types/${contentType.uid}/actions/bulkUnpublish`, data),
|
|
129
|
+
{
|
|
130
|
+
onSuccess() {
|
|
131
|
+
toggleNotification({
|
|
132
|
+
type: 'success',
|
|
133
|
+
message: {
|
|
134
|
+
id: 'content-manager.success.record.unpublish',
|
|
135
|
+
defaultMessage: 'Unpublished',
|
|
136
|
+
},
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
fetchData(`/content-manager/collection-types/${slug}${params}`);
|
|
140
|
+
},
|
|
141
|
+
onError(error) {
|
|
142
|
+
toggleNotification({
|
|
143
|
+
type: 'warning',
|
|
144
|
+
message: formatAPIError(error),
|
|
145
|
+
});
|
|
146
|
+
},
|
|
147
|
+
}
|
|
148
|
+
);
|
|
149
|
+
|
|
103
150
|
// FIXME
|
|
104
151
|
// Using a ref to avoid requests being fired multiple times on slug on change
|
|
105
152
|
// We need it because the hook as mulitple dependencies so it may run before the permissions have checked
|
|
@@ -199,6 +246,70 @@ function ListView({
|
|
|
199
246
|
[slug, params, fetchData, toggleNotification, formatAPIError, del]
|
|
200
247
|
);
|
|
201
248
|
|
|
249
|
+
/**
|
|
250
|
+
* @param {number[]} selectedEntries - Array of ids to publish
|
|
251
|
+
* @returns {{validIds: number[], errors: Object.<number, string>}} - Returns an object with the valid ids and the errors
|
|
252
|
+
*/
|
|
253
|
+
const validateEntriesToPublish = async (selectedEntries) => {
|
|
254
|
+
const validations = { validIds: [], errors: {} };
|
|
255
|
+
// Create the validation schema based on the contentType
|
|
256
|
+
const schema = createYupSchema(
|
|
257
|
+
contentType,
|
|
258
|
+
{ components: layout.components },
|
|
259
|
+
{ isDraft: false }
|
|
260
|
+
);
|
|
261
|
+
// Get the selected entries
|
|
262
|
+
const entries = data.filter((entry) => {
|
|
263
|
+
return selectedEntries.includes(entry.id);
|
|
264
|
+
});
|
|
265
|
+
// Validate each entry and map the unresolved promises
|
|
266
|
+
const validationPromises = entries.map((entry) =>
|
|
267
|
+
schema.validate(entry, { abortEarly: false })
|
|
268
|
+
);
|
|
269
|
+
// Resolve all the promises in one go
|
|
270
|
+
const resolvedPromises = await Promise.allSettled(validationPromises);
|
|
271
|
+
// Set the validations
|
|
272
|
+
resolvedPromises.forEach((promise) => {
|
|
273
|
+
if (promise.status === 'rejected') {
|
|
274
|
+
const entityId = promise.reason.value.id;
|
|
275
|
+
validations.errors[entityId] = getYupInnerErrors(promise.reason);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
if (promise.status === 'fulfilled') {
|
|
279
|
+
validations.validIds.push(promise.value.id);
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
return validations;
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
const handleConfirmPublishAllData = async (selectedEntries) => {
|
|
287
|
+
const validations = await validateEntriesToPublish(selectedEntries);
|
|
288
|
+
|
|
289
|
+
if (Object.values(validations.errors).length) {
|
|
290
|
+
toggleNotification({
|
|
291
|
+
type: 'warning',
|
|
292
|
+
title: {
|
|
293
|
+
id: 'content-manager.listView.validation.errors.title',
|
|
294
|
+
defaultMessage: 'Action required',
|
|
295
|
+
},
|
|
296
|
+
message: {
|
|
297
|
+
id: 'content-manager.listView.validation.errors.message',
|
|
298
|
+
defaultMessage:
|
|
299
|
+
'Please make sure all fields are valid before publishing (required field, min/max character limit, etc.)',
|
|
300
|
+
},
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
throw new Error('Validation error');
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
return bulkPublishMutation.mutateAsync({ ids: selectedEntries });
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
const handleConfirmUnpublishAllData = (selectedEntries) => {
|
|
310
|
+
return bulkUnpublishMutation.mutateAsync({ ids: selectedEntries });
|
|
311
|
+
};
|
|
312
|
+
|
|
202
313
|
useEffect(() => {
|
|
203
314
|
const CancelToken = axios.CancelToken;
|
|
204
315
|
const source = CancelToken.source();
|
|
@@ -330,9 +441,12 @@ function ListView({
|
|
|
330
441
|
<DynamicTable
|
|
331
442
|
canCreate={canCreate}
|
|
332
443
|
canDelete={canDelete}
|
|
444
|
+
canPublish={canPublish}
|
|
333
445
|
contentTypeName={headerLayoutTitle}
|
|
334
|
-
onConfirmDeleteAll={handleConfirmDeleteAllData}
|
|
335
446
|
onConfirmDelete={handleConfirmDeleteData}
|
|
447
|
+
onConfirmDeleteAll={handleConfirmDeleteAllData}
|
|
448
|
+
onConfirmPublishAll={handleConfirmPublishAllData}
|
|
449
|
+
onConfirmUnpublishAll={handleConfirmUnpublishAllData}
|
|
336
450
|
isBulkable={isBulkable}
|
|
337
451
|
isLoading={isLoading}
|
|
338
452
|
// FIXME: remove the layout props drilling
|
|
@@ -354,10 +468,12 @@ ListView.propTypes = {
|
|
|
354
468
|
canCreate: PropTypes.bool.isRequired,
|
|
355
469
|
canDelete: PropTypes.bool.isRequired,
|
|
356
470
|
canRead: PropTypes.bool.isRequired,
|
|
471
|
+
canPublish: PropTypes.bool.isRequired,
|
|
357
472
|
data: PropTypes.array.isRequired,
|
|
358
473
|
layout: PropTypes.exact({
|
|
359
474
|
components: PropTypes.object.isRequired,
|
|
360
475
|
contentType: PropTypes.shape({
|
|
476
|
+
uid: PropTypes.string.isRequired,
|
|
361
477
|
attributes: PropTypes.object.isRequired,
|
|
362
478
|
metadatas: PropTypes.object.isRequired,
|
|
363
479
|
info: PropTypes.shape({ displayName: PropTypes.string.isRequired }).isRequired,
|
|
@@ -18,3 +18,5 @@ export { default as mergeMetasWithSchema } from './mergeMetasWithSchema';
|
|
|
18
18
|
|
|
19
19
|
export { default as removeKeyInObject } from './removeKeyInObject';
|
|
20
20
|
export { default as removePasswordFieldsFromData } from './removePasswordFieldsFromData';
|
|
21
|
+
|
|
22
|
+
export { default as createYupSchema } from './schema';
|
package/admin/src/content-manager/{components/EditViewDataManagerProvider/utils → utils}/schema.js
RENAMED
|
@@ -7,7 +7,7 @@ import toNumber from 'lodash/toNumber';
|
|
|
7
7
|
import * as yup from 'yup';
|
|
8
8
|
import { translatedErrors as errorsTrads } from '@strapi/helper-plugin';
|
|
9
9
|
|
|
10
|
-
import isFieldTypeNumber from '
|
|
10
|
+
import isFieldTypeNumber from './isFieldTypeNumber';
|
|
11
11
|
|
|
12
12
|
yup.addMethod(yup.mixed, 'defined', function () {
|
|
13
13
|
return this.test('defined', errorsTrads.required, (value) => value !== undefined);
|
|
@@ -13,7 +13,12 @@ const injectionZones = {
|
|
|
13
13
|
},
|
|
14
14
|
contentManager: {
|
|
15
15
|
editView: { informations: [], 'right-links': [] },
|
|
16
|
-
listView: {
|
|
16
|
+
listView: {
|
|
17
|
+
actions: [],
|
|
18
|
+
deleteModalAdditionalInfos: [],
|
|
19
|
+
publishModalAdditionalInfos: [],
|
|
20
|
+
unpublishModalAdditionalInfos: [],
|
|
21
|
+
},
|
|
17
22
|
},
|
|
18
23
|
};
|
|
19
24
|
|
package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/EventTable/EventTableCE.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import EventTable from '../Events';
|
|
4
|
+
|
|
5
|
+
// This component is overwritten by the EE counterpart
|
|
6
|
+
export function EventTableCE() {
|
|
7
|
+
return (
|
|
8
|
+
<EventTable.Root>
|
|
9
|
+
<EventTable.Headers />
|
|
10
|
+
<EventTable.Body />
|
|
11
|
+
</EventTable.Root>
|
|
12
|
+
);
|
|
13
|
+
}
|