@strapi/admin 4.10.4 → 4.10.6
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/AuthenticatedApp/utils/api.js +5 -4
- package/admin/src/content-manager/components/CollectionTypeFormWrapper/index.js +1 -2
- package/admin/src/content-manager/components/DynamicZone/index.js +1 -1
- package/admin/src/content-manager/components/FieldComponent/index.js +1 -1
- package/admin/src/content-manager/components/Inputs/index.js +1 -1
- package/admin/src/content-manager/components/Wysiwyg/WysiwygNav.js +67 -71
- package/admin/src/content-manager/hooks/useFetchContentTypeLayout/index.js +3 -5
- package/admin/src/content-manager/pages/App/useContentManagerInitData.js +2 -3
- package/admin/src/content-manager/pages/ComponentSetttingsView/index.js +2 -5
- package/admin/src/content-manager/pages/EditView/DeleteLink/index.js +1 -1
- package/admin/src/content-manager/pages/EditView/Header/index.js +1 -1
- package/admin/src/content-manager/pages/EditViewLayoutManager/Permissions.js +1 -1
- package/admin/src/content-manager/pages/ListView/index.js +1 -2
- package/admin/src/hooks/marketplace/constants.js +1 -0
- package/admin/src/hooks/{useFetchMarketplacePlugins → marketplace/useFetchMarketplacePlugins}/index.js +21 -1
- package/admin/src/hooks/{useFetchMarketplaceProviders → marketplace/useFetchMarketplaceProviders}/index.js +21 -1
- package/admin/src/hooks/useReleaseNotification/utils/api.js +6 -5
- package/admin/src/pages/Admin/Onboarding/index.js +89 -91
- package/admin/src/pages/App/index.js +1 -5
- package/admin/src/pages/AuthPage/components/Register/index.js +3 -4
- package/admin/src/pages/AuthPage/index.js +11 -26
- package/admin/src/pages/MarketplacePage/components/NpmPackagesFilters/FiltersPopover.js +39 -41
- package/admin/src/pages/MarketplacePage/utils/useMarketplaceData.js +2 -2
- package/admin/src/pages/SettingsPage/components/Tokens/TokenDescription/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/utils/urlToFile.js +3 -2
- package/admin/src/pages/SettingsPage/pages/Roles/CreatePage/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/RoleForm/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/EventInput/index.js +12 -1
- package/admin/src/pages/SettingsPage/pages/Webhooks/ListView/index.js +120 -205
- package/admin/src/pages/UseCasePage/index.js +13 -15
- package/admin/src/translations/en.json +11 -9
- package/build/1387.a86ac314.chunk.js +1 -0
- package/build/{1657.85034334.chunk.js → 1657.ca8562dd.chunk.js} +46 -46
- package/build/{3816.2b58bc1a.chunk.js → 3816.60f858cf.chunk.js} +19 -22
- package/build/{5542.5328b662.chunk.js → 5542.002522eb.chunk.js} +13 -13
- package/build/{5563.44e0ef15.chunk.js → 5563.2c8334ef.chunk.js} +1 -1
- package/build/617.87b2fe96.chunk.js +155 -0
- package/build/{6970.e8422af3.chunk.js → 6970.36d3ffff.chunk.js} +1 -1
- package/build/7259.116a9960.chunk.js +1 -0
- package/build/Admin-authenticatedApp.0318dfb3.chunk.js +79 -0
- package/build/{Admin_marketplace.87f51b29.chunk.js → Admin_marketplace.f446ba2b.chunk.js} +10 -10
- package/build/Admin_settingsPage.f8c46a9a.chunk.js +79 -0
- package/build/admin-app.6d48536c.chunk.js +63 -0
- package/build/{admin-edit-roles-page.6fe9de49.chunk.js → admin-edit-roles-page.02c3b136.chunk.js} +3 -3
- package/build/{admin-users.16bb6e77.chunk.js → admin-users.69f4900a.chunk.js} +11 -11
- package/build/audit-logs-settings-page.482909d7.chunk.js +129 -0
- package/build/{content-manager.a837bfcd.chunk.js → content-manager.cd71cb6e.chunk.js} +95 -95
- package/build/content-type-builder-translation-en-json.af293c9e.chunk.js +1 -0
- package/build/content-type-builder.b10576e7.chunk.js +126 -0
- package/build/{email-settings-page.5bc22e5a.chunk.js → email-settings-page.dba83275.chunk.js} +4 -4
- package/build/en-json.d965e364.chunk.js +1 -0
- package/build/i18n-settings-page.55628f74.chunk.js +114 -0
- package/build/index.html +1 -1
- package/build/main.adab8b96.js +2630 -0
- package/build/{runtime~main.a096f3d0.js → runtime~main.0201a49b.js} +2 -2
- package/build/upload-settings.63d99bf5.chunk.js +14 -0
- package/build/upload.c50d8c7a.chunk.js +34 -0
- package/build/{users-advanced-settings-page.dd2a4954.chunk.js → users-advanced-settings-page.4f49ca57.chunk.js} +3 -3
- package/build/users-email-settings-page.d2429d0a.chunk.js +24 -0
- package/build/users-providers-settings-page.50c5ba27.chunk.js +29 -0
- package/build/{users-roles-settings-page.eeb3a339.chunk.js → users-roles-settings-page.2549794b.chunk.js} +2 -2
- package/build/webhook-edit-page.cb2cf1a5.chunk.js +128 -0
- package/build/webhook-list-page.e2fca9f8.chunk.js +71 -0
- package/ee/LICENSE +1 -21
- package/ee/admin/content-manager/components/DynamicTable/CellContent/ReviewWorkflowsStage/getTableColumn.js +6 -1
- package/ee/admin/pages/AuthPage/components/Login/index.js +1 -1
- package/ee/admin/pages/AuthPage/components/Providers/SSOProviders.js +1 -1
- package/ee/admin/pages/AuthPage/components/Providers/index.js +1 -1
- package/ee/admin/pages/SettingsPage/pages/Users/ListPage/ModalForm/utils/formDataModel.js +1 -1
- package/ee/admin/pages/SettingsPage/pages/Users/ListPage/ModalForm/utils/roleSettingsForm.js +1 -1
- package/package.json +13 -15
- package/webpack.alias.js +0 -1
- package/admin/src/hooks/useFetchMarketplacePlugins/utils/api.js +0 -18
- package/admin/src/hooks/useFetchMarketplaceProviders/utils/api.js +0 -18
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/EventInput/utils/formatValue.js +0 -13
- package/admin/src/pages/SettingsPage/pages/Webhooks/ListView/reducer.js +0 -72
- package/build/1387.437eb420.chunk.js +0 -1
- package/build/617.ce23dea8.chunk.js +0 -155
- package/build/7259.3ed2b60e.chunk.js +0 -1
- package/build/Admin-authenticatedApp.dbb99d34.chunk.js +0 -79
- package/build/Admin_settingsPage.20884a40.chunk.js +0 -79
- package/build/admin-app.d4fd9379.chunk.js +0 -63
- package/build/audit-logs-settings-page.48b921f9.chunk.js +0 -129
- package/build/content-type-builder-translation-en-json.5e5f8607.chunk.js +0 -1
- package/build/content-type-builder.51c64fe5.chunk.js +0 -126
- package/build/en-json.1f6af924.chunk.js +0 -1
- package/build/i18n-settings-page.1581894e.chunk.js +0 -114
- package/build/main.31bdf27e.js +0 -2679
- package/build/upload-settings.4d962053.chunk.js +0 -14
- package/build/upload.4dcd513f.chunk.js +0 -34
- package/build/users-email-settings-page.510648ab.chunk.js +0 -24
- package/build/users-providers-settings-page.0ee7d54f.chunk.js +0 -29
- package/build/webhook-edit-page.36c9f20d.chunk.js +0 -128
- package/build/webhook-list-page.0983d83f.chunk.js +0 -71
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
import React, { useEffect, useState, useMemo, lazy, Suspense } from 'react';
|
|
8
8
|
import { Switch, Route } from 'react-router-dom';
|
|
9
|
-
import axios from 'axios';
|
|
10
9
|
import {
|
|
11
10
|
LoadingIndicatorPage,
|
|
12
11
|
auth,
|
|
@@ -100,10 +99,7 @@ function App() {
|
|
|
100
99
|
setTelemetryProperties(properties);
|
|
101
100
|
|
|
102
101
|
try {
|
|
103
|
-
|
|
104
|
-
* TODO: remove this call to `axios`
|
|
105
|
-
*/
|
|
106
|
-
await axios.post('https://analytics.strapi.io/api/v2/track', {
|
|
102
|
+
await post('https://analytics.strapi.io/api/v2/track', {
|
|
107
103
|
// This event is anonymous
|
|
108
104
|
event: 'didInitializeAdministration',
|
|
109
105
|
userId: '',
|
|
@@ -5,7 +5,6 @@ import omit from 'lodash/omit';
|
|
|
5
5
|
import { useHistory } from 'react-router-dom';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import { Formik } from 'formik';
|
|
8
|
-
import axios from 'axios';
|
|
9
8
|
import {
|
|
10
9
|
Form,
|
|
11
10
|
useQuery,
|
|
@@ -14,6 +13,7 @@ import {
|
|
|
14
13
|
getYupInnerErrors,
|
|
15
14
|
Link,
|
|
16
15
|
useAPIErrorHandler,
|
|
16
|
+
useFetchClient,
|
|
17
17
|
} from '@strapi/helper-plugin';
|
|
18
18
|
import {
|
|
19
19
|
Box,
|
|
@@ -52,6 +52,7 @@ const Register = ({ authType, fieldsToDisable, noSignin, onSubmit, schema }) =>
|
|
|
52
52
|
const { formatMessage } = useIntl();
|
|
53
53
|
const query = useQuery();
|
|
54
54
|
const { formatAPIError } = useAPIErrorHandler();
|
|
55
|
+
const { get } = useFetchClient();
|
|
55
56
|
|
|
56
57
|
const registrationToken = query.get('registrationToken');
|
|
57
58
|
|
|
@@ -61,9 +62,7 @@ const Register = ({ authType, fieldsToDisable, noSignin, onSubmit, schema }) =>
|
|
|
61
62
|
try {
|
|
62
63
|
const {
|
|
63
64
|
data: { data },
|
|
64
|
-
} = await
|
|
65
|
-
`${strapi.backendURL}/admin/registration-info?registrationToken=${registrationToken}`
|
|
66
|
-
);
|
|
65
|
+
} = await get(`/admin/registration-info?registrationToken=${registrationToken}`);
|
|
67
66
|
|
|
68
67
|
if (data) {
|
|
69
68
|
setUserInfo(data);
|
|
@@ -4,7 +4,7 @@ import camelCase from 'lodash/camelCase';
|
|
|
4
4
|
import get from 'lodash/get';
|
|
5
5
|
import omit from 'lodash/omit';
|
|
6
6
|
import { Redirect, useRouteMatch, useHistory } from 'react-router-dom';
|
|
7
|
-
import { auth, useQuery, useGuidedTour, useTracking } from '@strapi/helper-plugin';
|
|
7
|
+
import { auth, useQuery, useGuidedTour, useTracking, useFetchClient } from '@strapi/helper-plugin';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import forms from 'ee_else_ce/pages/AuthPage/utils/forms';
|
|
10
10
|
import persistStateToLocaleStorage from '../../components/GuidedTour/utils/persistStateToLocaleStorage';
|
|
@@ -46,6 +46,8 @@ const AuthPage = ({ hasAdmin, setHasAdmin }) => {
|
|
|
46
46
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
47
47
|
}, []);
|
|
48
48
|
|
|
49
|
+
const { post } = useFetchClient();
|
|
50
|
+
|
|
49
51
|
// Reset the state on navigation change
|
|
50
52
|
useEffect(() => {
|
|
51
53
|
dispatch({
|
|
@@ -85,12 +87,7 @@ const AuthPage = ({ hasAdmin, setHasAdmin }) => {
|
|
|
85
87
|
|
|
86
88
|
const forgotPasswordRequest = async (body, requestURL, { setSubmitting, setErrors }) => {
|
|
87
89
|
try {
|
|
88
|
-
await
|
|
89
|
-
method: 'POST',
|
|
90
|
-
url: `${strapi.backendURL}${requestURL}`,
|
|
91
|
-
data: body,
|
|
92
|
-
cancelToken: source.token,
|
|
93
|
-
});
|
|
90
|
+
await post(requestURL, body, { cancelToken: source.token });
|
|
94
91
|
|
|
95
92
|
push('/auth/forgot-password-success');
|
|
96
93
|
} catch (err) {
|
|
@@ -108,12 +105,7 @@ const AuthPage = ({ hasAdmin, setHasAdmin }) => {
|
|
|
108
105
|
data: {
|
|
109
106
|
data: { token, user },
|
|
110
107
|
},
|
|
111
|
-
} = await
|
|
112
|
-
method: 'POST',
|
|
113
|
-
url: `${strapi.backendURL}${requestURL}`,
|
|
114
|
-
data: omit(body, fieldsToOmit),
|
|
115
|
-
cancelToken: source.token,
|
|
116
|
-
});
|
|
108
|
+
} = await post(requestURL, omit(body, fieldsToOmit), { cancelToken: source.token });
|
|
117
109
|
|
|
118
110
|
if (user.preferedLanguage) {
|
|
119
111
|
changeLocale(user.preferedLanguage);
|
|
@@ -151,17 +143,11 @@ const AuthPage = ({ hasAdmin, setHasAdmin }) => {
|
|
|
151
143
|
const registerRequest = async (body, requestURL, { setSubmitting, setErrors }) => {
|
|
152
144
|
try {
|
|
153
145
|
trackUsage('willCreateFirstAdmin');
|
|
154
|
-
|
|
155
146
|
const {
|
|
156
147
|
data: {
|
|
157
148
|
data: { token, user },
|
|
158
149
|
},
|
|
159
|
-
} = await
|
|
160
|
-
method: 'POST',
|
|
161
|
-
url: `${strapi.backendURL}${requestURL}`,
|
|
162
|
-
data: omit(body, fieldsToOmit),
|
|
163
|
-
cancelToken: source.token,
|
|
164
|
-
});
|
|
150
|
+
} = await post(requestURL, omit(body, fieldsToOmit), { cancelToken: source.token });
|
|
165
151
|
|
|
166
152
|
auth.setToken(token, false);
|
|
167
153
|
auth.setUserInfo(user, false);
|
|
@@ -212,12 +198,11 @@ const AuthPage = ({ hasAdmin, setHasAdmin }) => {
|
|
|
212
198
|
data: {
|
|
213
199
|
data: { token, user },
|
|
214
200
|
},
|
|
215
|
-
} = await
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
});
|
|
201
|
+
} = await post(
|
|
202
|
+
requestURL,
|
|
203
|
+
{ ...body, resetPasswordToken: query.get('code') },
|
|
204
|
+
{ cancelToken: source.token }
|
|
205
|
+
);
|
|
221
206
|
|
|
222
207
|
auth.setToken(token, false);
|
|
223
208
|
auth.setUserInfo(user, false);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
|
-
import { Popover, Flex
|
|
4
|
+
import { Popover, Flex } from '@strapi/design-system';
|
|
5
5
|
import { useIntl } from 'react-intl';
|
|
6
6
|
import FilterSelect from './FilterSelect';
|
|
7
7
|
|
|
@@ -18,60 +18,58 @@ const FiltersPopover = ({
|
|
|
18
18
|
const { formatMessage } = useIntl();
|
|
19
19
|
|
|
20
20
|
return (
|
|
21
|
-
<Popover source={source} padding={3} spacing={4}
|
|
22
|
-
<
|
|
23
|
-
<
|
|
21
|
+
<Popover source={source} onDismiss={onToggle} padding={3} spacing={4}>
|
|
22
|
+
<FiltersFlex direction="column" alignItems="stretch" gap={1}>
|
|
23
|
+
<FilterSelect
|
|
24
|
+
message={formatMessage({
|
|
25
|
+
id: 'admin.pages.MarketPlacePage.filters.collections',
|
|
26
|
+
defaultMessage: 'Collections',
|
|
27
|
+
})}
|
|
28
|
+
value={query?.collections || []}
|
|
29
|
+
onChange={(newCollections) => {
|
|
30
|
+
const update = { collections: newCollections };
|
|
31
|
+
handleSelectChange(update);
|
|
32
|
+
}}
|
|
33
|
+
onClear={() => handleSelectClear('collections')}
|
|
34
|
+
possibleFilters={possibleCollections}
|
|
35
|
+
customizeContent={(values) =>
|
|
36
|
+
formatMessage(
|
|
37
|
+
{
|
|
38
|
+
id: 'admin.pages.MarketPlacePage.filters.collectionsSelected',
|
|
39
|
+
defaultMessage:
|
|
40
|
+
'{count, plural, =0 {No collections} one {# collection} other {# collections}} selected',
|
|
41
|
+
},
|
|
42
|
+
{ count: values.length }
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
/>
|
|
46
|
+
{npmPackageType === 'plugin' && (
|
|
24
47
|
<FilterSelect
|
|
25
48
|
message={formatMessage({
|
|
26
|
-
id: 'admin.pages.MarketPlacePage.filters.
|
|
27
|
-
defaultMessage: '
|
|
49
|
+
id: 'admin.pages.MarketPlacePage.filters.categories',
|
|
50
|
+
defaultMessage: 'Categories',
|
|
28
51
|
})}
|
|
29
|
-
value={query?.
|
|
30
|
-
onChange={(
|
|
31
|
-
const update = {
|
|
52
|
+
value={query?.categories || []}
|
|
53
|
+
onChange={(newCategories) => {
|
|
54
|
+
const update = { categories: newCategories };
|
|
32
55
|
handleSelectChange(update);
|
|
33
56
|
}}
|
|
34
|
-
onClear={() => handleSelectClear('
|
|
35
|
-
possibleFilters={
|
|
57
|
+
onClear={() => handleSelectClear('categories')}
|
|
58
|
+
possibleFilters={possibleCategories}
|
|
36
59
|
customizeContent={(values) =>
|
|
37
60
|
formatMessage(
|
|
38
61
|
{
|
|
39
|
-
id: 'admin.pages.MarketPlacePage.filters.
|
|
62
|
+
id: 'admin.pages.MarketPlacePage.filters.categoriesSelected',
|
|
40
63
|
defaultMessage:
|
|
41
|
-
'{count, plural, =0 {No
|
|
64
|
+
'{count, plural, =0 {No categories} one {# category} other {# categories}} selected',
|
|
42
65
|
},
|
|
43
66
|
{ count: values.length }
|
|
44
67
|
)
|
|
45
68
|
}
|
|
69
|
+
name="categories"
|
|
46
70
|
/>
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
message={formatMessage({
|
|
50
|
-
id: 'admin.pages.MarketPlacePage.filters.categories',
|
|
51
|
-
defaultMessage: 'Categories',
|
|
52
|
-
})}
|
|
53
|
-
value={query?.categories || []}
|
|
54
|
-
onChange={(newCategories) => {
|
|
55
|
-
const update = { categories: newCategories };
|
|
56
|
-
handleSelectChange(update);
|
|
57
|
-
}}
|
|
58
|
-
onClear={() => handleSelectClear('categories')}
|
|
59
|
-
possibleFilters={possibleCategories}
|
|
60
|
-
customizeContent={(values) =>
|
|
61
|
-
formatMessage(
|
|
62
|
-
{
|
|
63
|
-
id: 'admin.pages.MarketPlacePage.filters.categoriesSelected',
|
|
64
|
-
defaultMessage:
|
|
65
|
-
'{count, plural, =0 {No categories} one {# category} other {# categories}} selected',
|
|
66
|
-
},
|
|
67
|
-
{ count: values.length }
|
|
68
|
-
)
|
|
69
|
-
}
|
|
70
|
-
name="categories"
|
|
71
|
-
/>
|
|
72
|
-
)}
|
|
73
|
-
</FiltersFlex>
|
|
74
|
-
</FocusTrap>
|
|
71
|
+
)}
|
|
72
|
+
</FiltersFlex>
|
|
75
73
|
</Popover>
|
|
76
74
|
);
|
|
77
75
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useState, useEffect } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
3
|
import { useNotifyAT } from '@strapi/design-system';
|
|
4
|
-
import useFetchMarketplacePlugins from '../../../hooks/useFetchMarketplacePlugins';
|
|
5
|
-
import useFetchMarketplaceProviders from '../../../hooks/useFetchMarketplaceProviders';
|
|
4
|
+
import useFetchMarketplacePlugins from '../../../hooks/marketplace/useFetchMarketplacePlugins';
|
|
5
|
+
import useFetchMarketplaceProviders from '../../../hooks/marketplace/useFetchMarketplaceProviders';
|
|
6
6
|
|
|
7
7
|
function useMarketplaceData({ npmPackageType, debouncedSearch, query, tabQuery }) {
|
|
8
8
|
const { notifyStatus } = useNotifyAT();
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { getFetchClient } from '@strapi/helper-plugin';
|
|
2
2
|
|
|
3
3
|
const urlToFile = async (url) => {
|
|
4
4
|
try {
|
|
5
|
-
const
|
|
5
|
+
const { get } = getFetchClient();
|
|
6
|
+
const res = await get(url, { responseType: 'blob', timeout: 8000 });
|
|
6
7
|
const loadedFile = new File([res.data], res.config.url, {
|
|
7
8
|
type: res.headers['content-type'],
|
|
8
9
|
});
|
|
@@ -219,7 +219,7 @@ const CreatePage = () => {
|
|
|
219
219
|
id: 'global.description',
|
|
220
220
|
defaultMessage: 'Description',
|
|
221
221
|
})}
|
|
222
|
-
|
|
222
|
+
id="description"
|
|
223
223
|
error={errors.description && formatMessage({ id: errors.description })}
|
|
224
224
|
onChange={handleChange}
|
|
225
225
|
>
|
|
@@ -74,7 +74,7 @@ const RoleForm = ({ disabled, role, values, errors, onChange, onBlur }) => {
|
|
|
74
74
|
id: 'global.description',
|
|
75
75
|
defaultMessage: 'Description',
|
|
76
76
|
})}
|
|
77
|
-
|
|
77
|
+
id="description"
|
|
78
78
|
error={errors.name && formatMessage({ id: errors.name })}
|
|
79
79
|
onChange={onChange}
|
|
80
80
|
onBlur={onBlur}
|
|
@@ -5,7 +5,18 @@ import { useFormikContext } from 'formik';
|
|
|
5
5
|
import { useIntl } from 'react-intl';
|
|
6
6
|
import styled from 'styled-components';
|
|
7
7
|
import EventRow from './EventRow';
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
export const formatValue = (value) =>
|
|
10
|
+
value.reduce((acc, curr) => {
|
|
11
|
+
const key = curr.split('.')[0];
|
|
12
|
+
|
|
13
|
+
if (!acc[key]) {
|
|
14
|
+
acc[key] = [];
|
|
15
|
+
}
|
|
16
|
+
acc[key].push(curr);
|
|
17
|
+
|
|
18
|
+
return acc;
|
|
19
|
+
}, {});
|
|
9
20
|
|
|
10
21
|
const StyledTable = styled.table`
|
|
11
22
|
td {
|