@strapi/admin 4.10.5 → 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.
Files changed (82) hide show
  1. package/admin/src/components/AuthenticatedApp/utils/api.js +5 -4
  2. package/admin/src/content-manager/components/CollectionTypeFormWrapper/index.js +1 -2
  3. package/admin/src/content-manager/components/DynamicZone/index.js +1 -1
  4. package/admin/src/content-manager/components/FieldComponent/index.js +1 -1
  5. package/admin/src/content-manager/components/Inputs/index.js +1 -1
  6. package/admin/src/content-manager/components/Wysiwyg/WysiwygNav.js +67 -71
  7. package/admin/src/content-manager/hooks/useFetchContentTypeLayout/index.js +3 -5
  8. package/admin/src/content-manager/pages/App/useContentManagerInitData.js +2 -3
  9. package/admin/src/content-manager/pages/ComponentSetttingsView/index.js +2 -5
  10. package/admin/src/content-manager/pages/EditView/DeleteLink/index.js +1 -1
  11. package/admin/src/content-manager/pages/EditView/Header/index.js +1 -1
  12. package/admin/src/content-manager/pages/EditViewLayoutManager/Permissions.js +1 -1
  13. package/admin/src/content-manager/pages/ListView/index.js +1 -2
  14. package/admin/src/hooks/marketplace/constants.js +1 -0
  15. package/admin/src/hooks/{useFetchMarketplacePlugins → marketplace/useFetchMarketplacePlugins}/index.js +21 -1
  16. package/admin/src/hooks/{useFetchMarketplaceProviders → marketplace/useFetchMarketplaceProviders}/index.js +21 -1
  17. package/admin/src/hooks/useReleaseNotification/utils/api.js +6 -5
  18. package/admin/src/pages/Admin/Onboarding/index.js +89 -91
  19. package/admin/src/pages/App/index.js +1 -5
  20. package/admin/src/pages/AuthPage/components/Register/index.js +3 -4
  21. package/admin/src/pages/AuthPage/index.js +11 -26
  22. package/admin/src/pages/MarketplacePage/components/NpmPackagesFilters/FiltersPopover.js +39 -41
  23. package/admin/src/pages/MarketplacePage/utils/useMarketplaceData.js +2 -2
  24. package/admin/src/pages/SettingsPage/components/Tokens/TokenDescription/index.js +1 -1
  25. package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/utils/urlToFile.js +3 -2
  26. package/admin/src/pages/SettingsPage/pages/Roles/CreatePage/index.js +1 -1
  27. package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/RoleForm/index.js +1 -1
  28. package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/EventInput/index.js +12 -1
  29. package/admin/src/pages/SettingsPage/pages/Webhooks/ListView/index.js +120 -205
  30. package/admin/src/pages/UseCasePage/index.js +13 -15
  31. package/admin/src/translations/en.json +11 -9
  32. package/build/1387.a86ac314.chunk.js +1 -0
  33. package/build/{1657.85034334.chunk.js → 1657.ca8562dd.chunk.js} +46 -46
  34. package/build/{3816.1a828046.chunk.js → 3816.60f858cf.chunk.js} +12 -12
  35. package/build/{5563.44e0ef15.chunk.js → 5563.2c8334ef.chunk.js} +1 -1
  36. package/build/{617.2c8c7183.chunk.js → 617.87b2fe96.chunk.js} +1 -1
  37. package/build/{6970.e8422af3.chunk.js → 6970.36d3ffff.chunk.js} +1 -1
  38. package/build/7259.116a9960.chunk.js +1 -0
  39. package/build/Admin-authenticatedApp.0318dfb3.chunk.js +79 -0
  40. package/build/{Admin_marketplace.87f51b29.chunk.js → Admin_marketplace.f446ba2b.chunk.js} +10 -10
  41. package/build/Admin_settingsPage.f8c46a9a.chunk.js +79 -0
  42. package/build/admin-app.6d48536c.chunk.js +63 -0
  43. package/build/{admin-edit-roles-page.6fe9de49.chunk.js → admin-edit-roles-page.02c3b136.chunk.js} +3 -3
  44. package/build/{admin-users.16bb6e77.chunk.js → admin-users.69f4900a.chunk.js} +11 -11
  45. package/build/{audit-logs-settings-page.7ec976e1.chunk.js → audit-logs-settings-page.482909d7.chunk.js} +1 -1
  46. package/build/{content-manager.a97db8a1.chunk.js → content-manager.cd71cb6e.chunk.js} +95 -95
  47. package/build/content-type-builder-translation-en-json.af293c9e.chunk.js +1 -0
  48. package/build/content-type-builder.b10576e7.chunk.js +126 -0
  49. package/build/en-json.d965e364.chunk.js +1 -0
  50. package/build/{i18n-settings-page.e34ec940.chunk.js → i18n-settings-page.55628f74.chunk.js} +1 -1
  51. package/build/index.html +1 -1
  52. package/build/main.adab8b96.js +2630 -0
  53. package/build/{runtime~main.df78e1c7.js → runtime~main.0201a49b.js} +2 -2
  54. package/build/{upload.bf183c0c.chunk.js → upload.c50d8c7a.chunk.js} +1 -1
  55. package/build/{users-email-settings-page.756aa7ab.chunk.js → users-email-settings-page.d2429d0a.chunk.js} +1 -1
  56. package/build/{users-providers-settings-page.ff9e4c0a.chunk.js → users-providers-settings-page.50c5ba27.chunk.js} +1 -1
  57. package/build/{users-roles-settings-page.eeb3a339.chunk.js → users-roles-settings-page.2549794b.chunk.js} +2 -2
  58. package/build/webhook-edit-page.cb2cf1a5.chunk.js +128 -0
  59. package/build/webhook-list-page.e2fca9f8.chunk.js +71 -0
  60. package/ee/LICENSE +1 -21
  61. package/ee/admin/pages/AuthPage/components/Login/index.js +1 -1
  62. package/ee/admin/pages/AuthPage/components/Providers/SSOProviders.js +1 -1
  63. package/ee/admin/pages/AuthPage/components/Providers/index.js +1 -1
  64. package/ee/admin/pages/SettingsPage/pages/Users/ListPage/ModalForm/utils/formDataModel.js +1 -1
  65. package/ee/admin/pages/SettingsPage/pages/Users/ListPage/ModalForm/utils/roleSettingsForm.js +1 -1
  66. package/package.json +13 -15
  67. package/webpack.alias.js +0 -1
  68. package/admin/src/hooks/useFetchMarketplacePlugins/utils/api.js +0 -18
  69. package/admin/src/hooks/useFetchMarketplaceProviders/utils/api.js +0 -18
  70. package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/EventInput/utils/formatValue.js +0 -13
  71. package/admin/src/pages/SettingsPage/pages/Webhooks/ListView/reducer.js +0 -72
  72. package/build/1387.437eb420.chunk.js +0 -1
  73. package/build/7259.3ed2b60e.chunk.js +0 -1
  74. package/build/Admin-authenticatedApp.6b74c5fd.chunk.js +0 -79
  75. package/build/Admin_settingsPage.20884a40.chunk.js +0 -79
  76. package/build/admin-app.d4fd9379.chunk.js +0 -63
  77. package/build/content-type-builder-translation-en-json.5e5f8607.chunk.js +0 -1
  78. package/build/content-type-builder.51c64fe5.chunk.js +0 -126
  79. package/build/en-json.1f6af924.chunk.js +0 -1
  80. package/build/main.57970a57.js +0 -2674
  81. package/build/webhook-edit-page.550be445.chunk.js +0 -128
  82. 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 axios.get(
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 axios({
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 axios({
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 axios({
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 axios({
216
- method: 'POST',
217
- url: `${strapi.backendURL}${requestURL}`,
218
- data: { ...body, resetPasswordToken: query.get('code') },
219
- cancelToken: source.token,
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, FocusTrap } from '@strapi/design-system';
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} onBlur={() => {}}>
22
- <FocusTrap onEscape={onToggle}>
23
- <FiltersFlex direction="column" alignItems="stretch" gap={1}>
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.collections',
27
- defaultMessage: 'Collections',
49
+ id: 'admin.pages.MarketPlacePage.filters.categories',
50
+ defaultMessage: 'Categories',
28
51
  })}
29
- value={query?.collections || []}
30
- onChange={(newCollections) => {
31
- const update = { collections: newCollections };
52
+ value={query?.categories || []}
53
+ onChange={(newCategories) => {
54
+ const update = { categories: newCategories };
32
55
  handleSelectChange(update);
33
56
  }}
34
- onClear={() => handleSelectClear('collections')}
35
- possibleFilters={possibleCollections}
57
+ onClear={() => handleSelectClear('categories')}
58
+ possibleFilters={possibleCategories}
36
59
  customizeContent={(values) =>
37
60
  formatMessage(
38
61
  {
39
- id: 'admin.pages.MarketPlacePage.filters.collectionsSelected',
62
+ id: 'admin.pages.MarketPlacePage.filters.categoriesSelected',
40
63
  defaultMessage:
41
- '{count, plural, =0 {No collections} one {# collection} other {# collections}} selected',
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
- {npmPackageType === 'plugin' && (
48
- <FilterSelect
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();
@@ -12,7 +12,7 @@ const TokenDescription = ({ errors, values, onChange, canEditInputs }) => {
12
12
  id: 'Settings.tokens.form.description',
13
13
  defaultMessage: 'Description',
14
14
  })}
15
- name="description"
15
+ id="description"
16
16
  error={
17
17
  errors.description
18
18
  ? formatMessage(
@@ -1,8 +1,9 @@
1
- import axios from 'axios';
1
+ import { getFetchClient } from '@strapi/helper-plugin';
2
2
 
3
3
  const urlToFile = async (url) => {
4
4
  try {
5
- const res = await axios.get(url, { responseType: 'blob', timeout: 8000 });
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
- name="description"
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
- name="description"
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
- import formatValue from './utils/formatValue';
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 {