@strapi/admin 4.2.0-beta.2 → 4.2.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/app.js +4 -7
- package/admin/src/assets/images/homepage-logo.png +0 -0
- package/admin/src/components/AutoReloadOverlayBlockerProvider/Blocker.js +2 -6
- package/admin/src/components/ConfigurationsProvider/index.js +51 -0
- package/admin/src/components/ConfigurationsProvider/reducer.js +28 -0
- package/admin/src/components/GuidedTour/Homepage/index.js +1 -2
- package/admin/src/components/GuidedTour/Modal/components/Stepper.js +1 -2
- package/admin/src/components/LeftMenu/index.js +19 -7
- package/admin/src/components/Notifications/Notification/index.js +2 -2
- package/admin/src/components/Providers/index.js +8 -4
- package/admin/src/components/UnauthenticatedLogo/index.js +4 -2
- package/admin/src/components/UpgradePlanModal/index.js +6 -2
- package/admin/src/content-manager/components/DynamicZone/components/ComponentPicker/Category/ComponentCard/index.js +1 -1
- package/admin/src/content-manager/components/SelectMany/ListItem.js +1 -2
- package/admin/src/content-manager/components/SelectWrapper/index.js +8 -7
- package/admin/src/content-manager/components/SelectWrapper/utils/getSelectStyles.js +1 -1
- package/admin/src/content-manager/components/SingleTypeFormWrapper/index.js +2 -2
- package/admin/src/content-manager/components/Wysiwyg/Editor.js +2 -0
- package/admin/src/content-manager/pages/App/LeftMenu/index.js +8 -7
- package/admin/src/content-manager/pages/EditSettingsView/components/ComponentFieldList.js +1 -1
- package/admin/src/content-manager/pages/EditSettingsView/components/LinkToCTB.js +1 -2
- package/admin/src/content-manager/pages/EditSettingsView/index.js +1 -2
- package/admin/src/content-manager/pages/EditView/Header/index.js +3 -3
- package/admin/src/content-manager/pages/EditView/index.js +1 -4
- package/admin/src/content-manager/pages/ListSettingsView/index.js +1 -2
- package/admin/src/content-manager/pages/ListView/index.js +1 -1
- package/admin/src/content-manager/pages/NoContentType/index.js +1 -2
- package/admin/src/hooks/useFetchMarketplaceProviders/index.js +23 -0
- package/admin/src/hooks/useFetchMarketplaceProviders/utils/api.js +11 -0
- package/admin/src/pages/Admin/index.js +5 -15
- package/admin/src/pages/App/index.js +9 -18
- package/admin/src/pages/AuthPage/components/ForgotPassword/index.js +1 -2
- package/admin/src/pages/AuthPage/components/ForgotPasswordSuccess/index.js +1 -1
- package/admin/src/pages/AuthPage/components/Login/BaseLogin.js +1 -2
- package/admin/src/pages/AuthPage/components/Oops/index.js +1 -2
- package/admin/src/pages/AuthPage/components/Register/index.js +12 -12
- package/admin/src/pages/AuthPage/components/ResetPassword/index.js +3 -4
- package/admin/src/pages/HomePage/ContentBlocks.js +15 -2
- package/admin/src/pages/HomePage/HomeHeader.js +2 -2
- package/admin/src/pages/HomePage/SocialLinks.js +4 -3
- package/admin/src/pages/InternalErrorPage/index.js +1 -2
- package/admin/src/pages/MarketplacePage/components/{EmptyPluginSearch/EmptyPluginGrid.js → EmptyNpmPackageSearch/EmptyNpmPackageGrid.js} +1 -1
- package/admin/src/pages/MarketplacePage/components/{EmptyPluginSearch → EmptyNpmPackageSearch}/index.js +6 -4
- package/admin/src/pages/MarketplacePage/components/{PluginCard → NpmPackageCard}/InstallPluginButton.js +0 -0
- package/admin/src/pages/MarketplacePage/components/{PluginCard → NpmPackageCard}/index.js +26 -13
- package/admin/src/pages/MarketplacePage/components/NpmPackagesGrid/index.js +42 -0
- package/admin/src/pages/MarketplacePage/components/PageHeader/index.js +14 -6
- package/admin/src/pages/MarketplacePage/index.js +99 -37
- package/admin/src/pages/NotFoundPage/index.js +1 -2
- package/admin/src/pages/SettingsPage/components/SettingsNav/index.js +5 -4
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/DynamicTable/UpdateButton/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/Form/index.js +85 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/Form/init.js +13 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/Form/reducer.js +43 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/LogoInput/index.js +118 -0
- package/admin/src/pages/{App → SettingsPage/pages/ApplicationInfosPage/components/LogoInput}/reducer.js +13 -7
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/LogoInput/stepper.js +25 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/LogoModalStepper/AddLogoDialog.js +67 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/LogoModalStepper/FromComputerForm.js +176 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/LogoModalStepper/FromUrlForm.js +82 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/LogoModalStepper/ImageCardAsset.js +51 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/LogoModalStepper/PendingLogoDialog.js +97 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/LogoModalStepper/index.js +85 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/LogoModalStepper/reducer.js +28 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/index.js +155 -87
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/utils/api.js +16 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/utils/constants.js +3 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/utils/getFormData.js +17 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/utils/parseFileMetadatas.js +76 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/utils/prefixAllUrls.js +17 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/utils/urlToFile.js +21 -0
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Users/EditPage/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/WebhookForm/index.js +1 -2
- package/admin/src/pages/SettingsPage/pages/Webhooks/ListView/index.js +1 -1
- package/admin/src/reducers.js +2 -4
- package/admin/src/translations/en.json +33 -3
- package/admin/src/translations/pl.json +264 -12
- package/admin/src/translations/vi.json +17 -17
- package/build/1856.6a94980b.chunk.js +172 -0
- package/build/2077.5456ccd1.chunk.js +194 -0
- package/build/2758.9475712b.chunk.js +162 -0
- package/build/2912.dd031292.chunk.js +253 -0
- package/build/4715.4588fdf5.chunk.js +385 -0
- package/build/4800.d3ebc81d.chunk.js +1 -0
- package/build/4982.c57c5675.chunk.js +308 -0
- package/build/7197.ed8d6752.chunk.js +113 -0
- package/build/7589.577cf729.chunk.js +194 -0
- package/build/{7393.8ae60738.chunk.js → 7757.f6eb5e92.chunk.js} +89 -87
- package/build/7841.9e9cf739.chunk.js +253 -0
- package/build/8681.aec05472.chunk.js +163 -0
- package/build/9066.2847fdff.chunk.js +101 -0
- package/build/9115.abdf4e3b.chunk.js +1 -0
- package/build/9158.e48d88af.chunk.js +503 -0
- package/build/{7191.3bde3cbf.chunk.js → 9298.cb3b6bc1.chunk.js} +112 -113
- package/build/9420.ba035f29.chunk.js +508 -0
- package/build/948.d64fb515.chunk.js +2 -0
- package/build/Admin-authenticatedApp.e7ed0550.chunk.js +80 -0
- package/build/Admin_homePage.8c00145e.chunk.js +71 -0
- package/build/Admin_marketplace.a88d5bda.chunk.js +11 -0
- package/build/Admin_pluginsPage.e895d79f.chunk.js +1 -0
- package/build/{Admin_profilePage.62c203ad.chunk.js → Admin_profilePage.33cfed9b.chunk.js} +2 -2
- package/build/Admin_settingsPage.fe33e0a2.chunk.js +180 -0
- package/build/admin-edit-roles-page.e77a2acc.chunk.js +1 -0
- package/build/admin-edit-users.4c49fe98.chunk.js +11 -0
- package/build/admin-users.b89adf82.chunk.js +12 -0
- package/build/api-tokens-create-page.618b3e40.chunk.js +1 -0
- package/build/api-tokens-edit-page.8d19dfe1.chunk.js +1 -0
- package/build/api-tokens-list-page.274e1c80.chunk.js +15 -0
- package/build/{codemirror-css.b467b1de.chunk.js → codemirror-css.98490df3.chunk.js} +2 -2
- package/build/{codemirror-javacript.41bdefda.chunk.js → codemirror-javacript.cafbda9c.chunk.js} +1 -1
- package/build/codemirror-theme.b3c64617.chunk.js +34 -0
- package/build/content-manager.04b93497.chunk.js +1204 -0
- package/build/content-type-builder.b3139cb1.chunk.js +141 -0
- package/build/{cropper-css.ecc0d670.chunk.js → cropper-css.0055cd53.chunk.js} +2 -2
- package/build/email-settings-page.4ae595f6.chunk.js +103 -0
- package/build/en-json.0a5ba154.chunk.js +1 -0
- package/build/fb376b132d18bf4522ca.png +0 -0
- package/build/{fontawesome-css-all.04f33619.chunk.js → fontawesome-css-all.b88d464e.chunk.js} +3 -3
- package/build/{fontawesome-css.477ba714.chunk.js → fontawesome-css.59dc4459.chunk.js} +2 -2
- package/build/highlight.js.9d8ef460.chunk.js +86 -0
- package/build/i18n-settings-page.bdac3c7b.chunk.js +101 -0
- package/build/index.html +1 -1
- package/build/main.3257934a.js +8404 -0
- package/build/pl-json.f65302c2.chunk.js +1 -0
- package/build/{runtime~main.a32b12c8.js → runtime~main.de49adfd.js} +1 -1
- package/build/sso-settings-page.0b4d2106.chunk.js +1 -0
- package/build/upload-settings.cadfd452.chunk.js +101 -0
- package/build/upload-translation-ca-json.79159984.chunk.js +1 -0
- package/build/upload.fbc65439.chunk.js +105 -0
- package/build/users-advanced-settings-page.646b6f29.chunk.js +101 -0
- package/build/users-email-settings-page.8b561ea3.chunk.js +1 -0
- package/build/users-providers-settings-page.82141ace.chunk.js +1 -0
- package/build/users-roles-settings-page.28bf6bdc.chunk.js +30 -0
- package/build/vi-json.bf3424be.chunk.js +1 -0
- package/build/webhook-edit-page.ca670f8d.chunk.js +23 -0
- package/build/webhook-list-page.7057f1e8.chunk.js +133 -0
- package/ee/admin/pages/AuthPage/components/Providers/index.js +1 -1
- package/ee/admin/pages/SettingsPage/pages/Roles/CreatePage/index.js +1 -1
- package/ee/server/controllers/user.js +4 -0
- package/index.js +239 -53
- package/package.json +8 -12
- package/scripts/build.js +3 -17
- package/server/config/admin-actions.js +14 -0
- package/server/controllers/admin.js +29 -12
- package/server/controllers/user.js +4 -0
- package/server/policies/index.js +0 -1
- package/server/routes/admin.js +28 -9
- package/server/routes/serve-admin-panel.js +1 -1
- package/server/services/index.js +1 -0
- package/server/services/permission/permissions-manager/sanitize.js +22 -0
- package/server/services/project-settings.js +173 -0
- package/server/services/user.js +1 -1
- package/server/utils/index.d.ts +2 -0
- package/server/validation/project-settings.js +39 -0
- package/webpack.config.js +5 -28
- package/admin/src/content-manager/components/DynamicComponentCard/index.js +0 -43
- package/admin/src/pages/App/constants.js +0 -1
- package/admin/src/tsconfig.json +0 -10
- package/build/1856.521a99fd.chunk.js +0 -172
- package/build/20.cf744c35.chunk.js +0 -308
- package/build/2077.51485bfb.chunk.js +0 -194
- package/build/2135.95ee6de1.chunk.js +0 -162
- package/build/2524.688d0355.chunk.js +0 -1
- package/build/2897.8e7d5853.chunk.js +0 -184
- package/build/2912.79c2b3c8.chunk.js +0 -253
- package/build/2a9e9ef5c4c775bb7c7b.png +0 -0
- package/build/4073.f3936352.chunk.js +0 -1
- package/build/4715.77e04177.chunk.js +0 -385
- package/build/5232.928fea74.chunk.js +0 -989
- package/build/6229.26d93336.chunk.js +0 -194
- package/build/6281.f10a7e3a.chunk.js +0 -1
- package/build/6404.80bf5858.chunk.js +0 -506
- package/build/7009.79fce86d.chunk.js +0 -164
- package/build/7841.f0e7d629.chunk.js +0 -253
- package/build/7863.c1938f3f.chunk.js +0 -112
- package/build/9066.118ecccd.chunk.js +0 -101
- package/build/Admin-authenticatedApp.1f76af8f.chunk.js +0 -80
- package/build/Admin_homePage.8b391120.chunk.js +0 -71
- package/build/Admin_marketplace.21730109.chunk.js +0 -11
- package/build/Admin_pluginsPage.788fb2f6.chunk.js +0 -1
- package/build/Admin_settingsPage.9ce20f16.chunk.js +0 -170
- package/build/admin-edit-roles-page.75380ed4.chunk.js +0 -1
- package/build/admin-edit-users.05f7f389.chunk.js +0 -10
- package/build/admin-users.e03db115.chunk.js +0 -11
- package/build/api-tokens-create-page.c44e0c62.chunk.js +0 -1
- package/build/api-tokens-edit-page.30d0924d.chunk.js +0 -1
- package/build/api-tokens-list-page.6049cd23.chunk.js +0 -15
- package/build/codemirror-theme.cf9f9eb6.chunk.js +0 -34
- package/build/content-manager.2f0f9b15.chunk.js +0 -1204
- package/build/content-type-builder.ce7b7f42.chunk.js +0 -141
- package/build/email-settings-page.f67d13b2.chunk.js +0 -103
- package/build/en-json.3e1a222e.chunk.js +0 -1
- package/build/highlight.js.3381ffc3.chunk.js +0 -86
- package/build/i18n-settings-page.6b67cb75.chunk.js +0 -101
- package/build/main.e6045245.js +0 -7909
- package/build/pl-json.94f05d2c.chunk.js +0 -1
- package/build/sso-settings-page.e9034e22.chunk.js +0 -1
- package/build/upload-settings.3db55de0.chunk.js +0 -101
- package/build/upload.070c189b.chunk.js +0 -105
- package/build/users-advanced-settings-page.a23cda17.chunk.js +0 -101
- package/build/users-email-settings-page.0a096388.chunk.js +0 -1
- package/build/users-providers-settings-page.bfe7755a.chunk.js +0 -1
- package/build/users-roles-settings-page.c01bec1d.chunk.js +0 -30
- package/build/vi-json.3d14e91e.chunk.js +0 -1
- package/build/webhook-edit-page.d457087d.chunk.js +0 -23
- package/build/webhook-list-page.a4217ff2.chunk.js +0 -133
- package/server/policies/isTelemetryEnabled.js +0 -16
- package/utils/create-cache-dir.js +0 -161
- package/utils/get-custom-app-config-file.js +0 -23
- package/utils/get-custom-webpack-config.js +0 -38
- package/utils/get-plugins-path.js +0 -26
- package/utils/index.js +0 -13
- package/utils/should-build-admin.js +0 -52
- package/utils/watch-admin-files.js +0 -59
package/admin/src/app.js
CHANGED
|
Binary file
|
|
@@ -6,7 +6,7 @@ import styled, { keyframes } from 'styled-components';
|
|
|
6
6
|
import { pxToRem } from '@strapi/helper-plugin';
|
|
7
7
|
import Clock from '@strapi/icons/Clock';
|
|
8
8
|
import Refresh from '@strapi/icons/Refresh';
|
|
9
|
-
import { Link } from '@strapi/design-system/Link';
|
|
9
|
+
import { Link } from '@strapi/design-system/v2/Link';
|
|
10
10
|
import { Box } from '@strapi/design-system/Box';
|
|
11
11
|
import { Stack } from '@strapi/design-system/Stack';
|
|
12
12
|
import { Flex } from '@strapi/design-system/Flex';
|
|
@@ -72,11 +72,7 @@ const Blocker = ({ displayedIcon, description, title, isOpen }) => {
|
|
|
72
72
|
</Flex>
|
|
73
73
|
<Flex justifyContent="center">
|
|
74
74
|
<Box paddingTop={2}>
|
|
75
|
-
<Link
|
|
76
|
-
href="https://docs.strapi.io"
|
|
77
|
-
target="_blank"
|
|
78
|
-
rel="noopener noreferrer nofollow"
|
|
79
|
-
>
|
|
75
|
+
<Link href="https://docs.strapi.io" isExternal>
|
|
80
76
|
{formatMessage({
|
|
81
77
|
id: 'global.documentation',
|
|
82
78
|
defaultMessage: 'Read the documentation',
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React, { useReducer, useRef } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { ConfigurationsContext } from '../../contexts';
|
|
4
|
+
import reducer, { initialState } from './reducer';
|
|
5
|
+
|
|
6
|
+
const ConfigurationsProvider = ({
|
|
7
|
+
children,
|
|
8
|
+
authLogo,
|
|
9
|
+
menuLogo: defaultMenuLogo,
|
|
10
|
+
showReleaseNotification,
|
|
11
|
+
showTutorials,
|
|
12
|
+
}) => {
|
|
13
|
+
const [{ menuLogo }, dispatch] = useReducer(reducer, initialState);
|
|
14
|
+
|
|
15
|
+
const updateProjectSettings = ({ menuLogo }) => {
|
|
16
|
+
return dispatch({
|
|
17
|
+
type: 'UPDATE_PROJECT_SETTINGS',
|
|
18
|
+
values: {
|
|
19
|
+
menuLogo: menuLogo || defaultMenuLogo,
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const updateProjectSettingsRef = useRef(updateProjectSettings);
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<ConfigurationsContext.Provider
|
|
28
|
+
value={{
|
|
29
|
+
logos: {
|
|
30
|
+
menu: { custom: menuLogo, default: defaultMenuLogo },
|
|
31
|
+
auth: { custom: null, default: authLogo },
|
|
32
|
+
},
|
|
33
|
+
updateProjectSettings: updateProjectSettingsRef.current,
|
|
34
|
+
showReleaseNotification,
|
|
35
|
+
showTutorials,
|
|
36
|
+
}}
|
|
37
|
+
>
|
|
38
|
+
{children}
|
|
39
|
+
</ConfigurationsContext.Provider>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
ConfigurationsProvider.propTypes = {
|
|
44
|
+
authLogo: PropTypes.string.isRequired,
|
|
45
|
+
children: PropTypes.element.isRequired,
|
|
46
|
+
menuLogo: PropTypes.string.isRequired,
|
|
47
|
+
showReleaseNotification: PropTypes.bool.isRequired,
|
|
48
|
+
showTutorials: PropTypes.bool.isRequired,
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export default ConfigurationsProvider;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/* eslint-disable consistent-return */
|
|
2
|
+
/*
|
|
3
|
+
*
|
|
4
|
+
* ConfigurationsProvider reducer
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import produce from 'immer';
|
|
9
|
+
|
|
10
|
+
const initialState = {
|
|
11
|
+
menuLogo: null,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const reducer = (state = initialState, action) =>
|
|
15
|
+
produce(state, draftState => {
|
|
16
|
+
switch (action.type) {
|
|
17
|
+
case 'UPDATE_PROJECT_SETTINGS': {
|
|
18
|
+
Object.assign(draftState, action.values);
|
|
19
|
+
break;
|
|
20
|
+
}
|
|
21
|
+
default: {
|
|
22
|
+
return draftState;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export default reducer;
|
|
28
|
+
export { initialState };
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { useGuidedTour, useTracking } from '@strapi/helper-plugin';
|
|
2
|
+
import { useGuidedTour, useTracking, LinkButton } from '@strapi/helper-plugin';
|
|
3
3
|
import { useIntl } from 'react-intl';
|
|
4
4
|
import { Stack } from '@strapi/design-system/Stack';
|
|
5
5
|
import { Flex } from '@strapi/design-system/Flex';
|
|
6
6
|
import { Box } from '@strapi/design-system/Box';
|
|
7
7
|
import { Typography } from '@strapi/design-system/Typography';
|
|
8
|
-
import { LinkButton } from '@strapi/design-system/LinkButton';
|
|
9
8
|
import { Button } from '@strapi/design-system/Button';
|
|
10
9
|
import ArrowRight from '@strapi/icons/ArrowRight';
|
|
11
10
|
import StepperHomepage from './components/Stepper';
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { useIntl } from 'react-intl';
|
|
4
|
-
import { pxToRem } from '@strapi/helper-plugin';
|
|
4
|
+
import { pxToRem, LinkButton } from '@strapi/helper-plugin';
|
|
5
5
|
import { Typography } from '@strapi/design-system/Typography';
|
|
6
6
|
import { Button } from '@strapi/design-system/Button';
|
|
7
|
-
import { LinkButton } from '@strapi/design-system/LinkButton';
|
|
8
7
|
import { Box } from '@strapi/design-system/Box';
|
|
9
8
|
import { Flex } from '@strapi/design-system/Flex';
|
|
10
9
|
import ArrowRight from '@strapi/icons/ArrowRight';
|
|
@@ -2,7 +2,7 @@ import React, { useRef, useState } from 'react';
|
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { useIntl } from 'react-intl';
|
|
5
|
-
import { NavLink as
|
|
5
|
+
import { NavLink as RouterNavLink } from 'react-router-dom';
|
|
6
6
|
import { Divider } from '@strapi/design-system/Divider';
|
|
7
7
|
import {
|
|
8
8
|
MainNav,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
NavSection,
|
|
13
13
|
NavUser,
|
|
14
14
|
NavCondense,
|
|
15
|
-
} from '@strapi/design-system/MainNav';
|
|
15
|
+
} from '@strapi/design-system/v2/MainNav';
|
|
16
16
|
import { FocusTrap } from '@strapi/design-system/FocusTrap';
|
|
17
17
|
import { Box } from '@strapi/design-system/Box';
|
|
18
18
|
import { Typography } from '@strapi/design-system/Typography';
|
|
@@ -29,7 +29,7 @@ const LinkUserWrapper = styled(Box)`
|
|
|
29
29
|
left: ${({ theme }) => theme.spaces[5]};
|
|
30
30
|
`;
|
|
31
31
|
|
|
32
|
-
const LinkUser = styled(
|
|
32
|
+
const LinkUser = styled(RouterNavLink)`
|
|
33
33
|
display: flex;
|
|
34
34
|
justify-content: space-between;
|
|
35
35
|
align-items: center;
|
|
@@ -53,7 +53,9 @@ const LinkUser = styled(Link)`
|
|
|
53
53
|
const LeftMenu = ({ generalSectionLinks, pluginsSectionLinks }) => {
|
|
54
54
|
const buttonRef = useRef();
|
|
55
55
|
const [userLinksVisible, setUserLinksVisible] = useState(false);
|
|
56
|
-
const {
|
|
56
|
+
const {
|
|
57
|
+
logos: { menu },
|
|
58
|
+
} = useConfigurations();
|
|
57
59
|
const [condensed, setCondensed] = usePersistentState('navbar-condensed', false);
|
|
58
60
|
const { userDisplayName } = useAppInfos();
|
|
59
61
|
const { formatMessage } = useIntl();
|
|
@@ -88,18 +90,27 @@ const LeftMenu = ({ generalSectionLinks, pluginsSectionLinks }) => {
|
|
|
88
90
|
return (
|
|
89
91
|
<MainNav condensed={condensed}>
|
|
90
92
|
<NavBrand
|
|
93
|
+
as={RouterNavLink}
|
|
91
94
|
workplace={formatMessage({
|
|
92
95
|
id: 'app.components.LeftMenu.navbrand.workplace',
|
|
93
96
|
defaultMessage: 'Workplace',
|
|
94
97
|
})}
|
|
95
98
|
title={menuTitle}
|
|
96
|
-
icon={
|
|
99
|
+
icon={
|
|
100
|
+
<img
|
|
101
|
+
src={menu.custom || menu.default}
|
|
102
|
+
alt={formatMessage({
|
|
103
|
+
id: 'app.components.LeftMenu.logo.alt',
|
|
104
|
+
defaultMessage: 'Application logo',
|
|
105
|
+
})}
|
|
106
|
+
/>
|
|
107
|
+
}
|
|
97
108
|
/>
|
|
98
109
|
|
|
99
110
|
<Divider />
|
|
100
111
|
|
|
101
112
|
<NavSections>
|
|
102
|
-
<NavLink to="/content-manager" icon={<Write />}>
|
|
113
|
+
<NavLink as={RouterNavLink} to="/content-manager" icon={<Write />}>
|
|
103
114
|
{formatMessage({ id: 'global.content-manager', defaultMessage: 'Content manager' })}
|
|
104
115
|
</NavLink>
|
|
105
116
|
|
|
@@ -109,7 +120,7 @@ const LeftMenu = ({ generalSectionLinks, pluginsSectionLinks }) => {
|
|
|
109
120
|
const Icon = link.icon;
|
|
110
121
|
|
|
111
122
|
return (
|
|
112
|
-
<NavLink to={link.to} key={link.to} icon={<Icon />}>
|
|
123
|
+
<NavLink as={RouterNavLink} to={link.to} key={link.to} icon={<Icon />}>
|
|
113
124
|
{formatMessage(link.intlLabel)}
|
|
114
125
|
</NavLink>
|
|
115
126
|
);
|
|
@@ -124,6 +135,7 @@ const LeftMenu = ({ generalSectionLinks, pluginsSectionLinks }) => {
|
|
|
124
135
|
|
|
125
136
|
return (
|
|
126
137
|
<NavLink
|
|
138
|
+
as={RouterNavLink}
|
|
127
139
|
badgeContent={
|
|
128
140
|
(link.notificationsCount > 0 && link.notificationsCount.toString()) || undefined
|
|
129
141
|
}
|
|
@@ -2,7 +2,7 @@ import React, { useEffect, useCallback } from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { useIntl } from 'react-intl';
|
|
4
4
|
import { Alert } from '@strapi/design-system/Alert';
|
|
5
|
-
import { Link } from '@strapi/design-system/Link';
|
|
5
|
+
import { Link } from '@strapi/design-system/v2/Link';
|
|
6
6
|
|
|
7
7
|
const Notification = ({ dispatch, notification }) => {
|
|
8
8
|
const { formatMessage } = useIntl();
|
|
@@ -60,7 +60,7 @@ const Notification = ({ dispatch, notification }) => {
|
|
|
60
60
|
<Alert
|
|
61
61
|
action={
|
|
62
62
|
link ? (
|
|
63
|
-
<Link href={link.url}
|
|
63
|
+
<Link href={link.url} isExternal>
|
|
64
64
|
{formatMessage({
|
|
65
65
|
id: link.label?.id || link.label,
|
|
66
66
|
defaultMessage: link.label?.defaultMessage || link.label?.id || link.label,
|
|
@@ -3,7 +3,8 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { QueryClientProvider, QueryClient } from 'react-query';
|
|
4
4
|
import { LibraryProvider, StrapiAppProvider } from '@strapi/helper-plugin';
|
|
5
5
|
import { Provider } from 'react-redux';
|
|
6
|
-
import { AdminContext
|
|
6
|
+
import { AdminContext } from '../../contexts';
|
|
7
|
+
import ConfigurationsProvider from '../ConfigurationsProvider';
|
|
7
8
|
import LanguageProvider from '../LanguageProvider';
|
|
8
9
|
import GuidedTour from '../GuidedTour';
|
|
9
10
|
import AutoReloadOverlayBlockerProvider from '../AutoReloadOverlayBlockerProvider';
|
|
@@ -47,8 +48,11 @@ const Providers = ({
|
|
|
47
48
|
<QueryClientProvider client={queryClient}>
|
|
48
49
|
<Provider store={store}>
|
|
49
50
|
<AdminContext.Provider value={{ getAdminInjectedComponents }}>
|
|
50
|
-
<
|
|
51
|
-
|
|
51
|
+
<ConfigurationsProvider
|
|
52
|
+
authLogo={authLogo}
|
|
53
|
+
menuLogo={menuLogo}
|
|
54
|
+
showReleaseNotification={showReleaseNotification}
|
|
55
|
+
showTutorials={showTutorials}
|
|
52
56
|
>
|
|
53
57
|
<StrapiAppProvider
|
|
54
58
|
getPlugin={getPlugin}
|
|
@@ -71,7 +75,7 @@ const Providers = ({
|
|
|
71
75
|
</LanguageProvider>
|
|
72
76
|
</LibraryProvider>
|
|
73
77
|
</StrapiAppProvider>
|
|
74
|
-
</
|
|
78
|
+
</ConfigurationsProvider>
|
|
75
79
|
</AdminContext.Provider>
|
|
76
80
|
</Provider>
|
|
77
81
|
</QueryClientProvider>
|
|
@@ -7,9 +7,11 @@ const Img = styled.img`
|
|
|
7
7
|
`;
|
|
8
8
|
|
|
9
9
|
const Logo = () => {
|
|
10
|
-
const {
|
|
10
|
+
const {
|
|
11
|
+
logos: { auth },
|
|
12
|
+
} = useConfigurations();
|
|
11
13
|
|
|
12
|
-
return <Img src={
|
|
14
|
+
return <Img src={auth.default} aria-hidden alt="" />;
|
|
13
15
|
};
|
|
14
16
|
|
|
15
17
|
export default Logo;
|
|
@@ -5,7 +5,7 @@ import { useIntl } from 'react-intl';
|
|
|
5
5
|
import { Portal } from '@strapi/design-system/Portal';
|
|
6
6
|
import { FocusTrap } from '@strapi/design-system/FocusTrap';
|
|
7
7
|
import { IconButton } from '@strapi/design-system/IconButton';
|
|
8
|
-
import { LinkButton } from '@strapi/design-system/LinkButton';
|
|
8
|
+
import { LinkButton } from '@strapi/design-system/v2/LinkButton';
|
|
9
9
|
import { Box } from '@strapi/design-system/Box';
|
|
10
10
|
import { Flex } from '@strapi/design-system/Flex';
|
|
11
11
|
import { Typography } from '@strapi/design-system/Typography';
|
|
@@ -104,7 +104,11 @@ const UpgradePlanModal = ({ onClose, isOpen }) => {
|
|
|
104
104
|
})}
|
|
105
105
|
</Typography>
|
|
106
106
|
</Stack>
|
|
107
|
-
<LinkButton
|
|
107
|
+
<LinkButton
|
|
108
|
+
href="https://strapi.io/pricing-self-hosted"
|
|
109
|
+
isExternal
|
|
110
|
+
endIcon={<ExternalLink />}
|
|
111
|
+
>
|
|
108
112
|
{formatMessage({
|
|
109
113
|
id: 'app.components.UpgradePlanModal.button',
|
|
110
114
|
defaultMessage: 'Learn more',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
|
-
import { pxToRem, RemoveRoundedButton } from '@strapi/helper-plugin';
|
|
4
|
+
import { pxToRem, RemoveRoundedButton, Link } from '@strapi/helper-plugin';
|
|
5
5
|
import { useIntl } from 'react-intl';
|
|
6
6
|
import { useLocation } from 'react-router-dom';
|
|
7
7
|
import has from 'lodash/has';
|
|
@@ -9,7 +9,6 @@ import isEmpty from 'lodash/isEmpty';
|
|
|
9
9
|
import { Box } from '@strapi/design-system/Box';
|
|
10
10
|
import { Flex } from '@strapi/design-system/Flex';
|
|
11
11
|
import { Typography } from '@strapi/design-system/Typography';
|
|
12
|
-
import { Link } from '@strapi/design-system/Link';
|
|
13
12
|
import { getTrad } from '../../utils';
|
|
14
13
|
|
|
15
14
|
const StyledBullet = styled.div`
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import React, { useCallback, useState, useEffect, useMemo, memo } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import {
|
|
4
|
-
// FormattedMessage,
|
|
5
|
-
useIntl,
|
|
6
|
-
} from 'react-intl';
|
|
3
|
+
import { useIntl } from 'react-intl';
|
|
7
4
|
import { useLocation } from 'react-router-dom';
|
|
8
|
-
import { Link } from '@strapi/design-system/Link';
|
|
9
|
-
import { Stack } from '@strapi/design-system/Stack';
|
|
10
5
|
import { useTheme } from 'styled-components';
|
|
11
6
|
import findIndex from 'lodash/findIndex';
|
|
12
7
|
import get from 'lodash/get';
|
|
13
8
|
import isArray from 'lodash/isArray';
|
|
14
9
|
import isEmpty from 'lodash/isEmpty';
|
|
15
10
|
import set from 'lodash/set';
|
|
16
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
NotAllowedInput,
|
|
13
|
+
useCMEditViewDataManager,
|
|
14
|
+
useQueryParams,
|
|
15
|
+
Link,
|
|
16
|
+
} from '@strapi/helper-plugin';
|
|
17
17
|
import { stringify } from 'qs';
|
|
18
18
|
import axios from 'axios';
|
|
19
|
+
import { Stack } from '@strapi/design-system/Stack';
|
|
19
20
|
import { axiosInstance } from '../../../core/utils';
|
|
20
21
|
import { getTrad } from '../../utils';
|
|
21
22
|
import Label from './Label';
|
|
@@ -43,7 +43,7 @@ const getSelectStyles = theme => {
|
|
|
43
43
|
};
|
|
44
44
|
},
|
|
45
45
|
indicatorContainer: base => ({ ...base, padding: 0, paddingRight: theme.spaces[3] }),
|
|
46
|
-
input: base => ({ ...base, margin: 0, padding: 0 }),
|
|
46
|
+
input: base => ({ ...base, margin: 0, padding: 0, color: theme.colors.neutral800 }),
|
|
47
47
|
menu: base => {
|
|
48
48
|
return {
|
|
49
49
|
...base,
|
|
@@ -143,8 +143,8 @@ const SingleTypeFormWrapper = ({ allLayoutData, children, slug }) => {
|
|
|
143
143
|
|
|
144
144
|
const displayErrors = useCallback(
|
|
145
145
|
err => {
|
|
146
|
-
const errorPayload = err.response.
|
|
147
|
-
let errorMessage = get(errorPayload, ['message'], 'Bad Request');
|
|
146
|
+
const errorPayload = err.response.data;
|
|
147
|
+
let errorMessage = get(errorPayload, ['error', 'message'], 'Bad Request');
|
|
148
148
|
|
|
149
149
|
// TODO handle errors correctly when back-end ready
|
|
150
150
|
if (Array.isArray(errorMessage)) {
|
|
@@ -5,18 +5,19 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import React, { useMemo, useState } from 'react';
|
|
8
|
+
import { useSelector, shallowEqual } from 'react-redux';
|
|
9
|
+
import { useIntl } from 'react-intl';
|
|
10
|
+
import matchSorter from 'match-sorter';
|
|
11
|
+
import sortBy from 'lodash/sortBy';
|
|
12
|
+
import toLower from 'lodash/toLower';
|
|
13
|
+
import { NavLink } from 'react-router-dom';
|
|
8
14
|
import {
|
|
9
15
|
SubNav,
|
|
10
16
|
SubNavHeader,
|
|
11
17
|
SubNavSection,
|
|
12
18
|
SubNavSections,
|
|
13
19
|
SubNavLink,
|
|
14
|
-
} from '@strapi/design-system/SubNav';
|
|
15
|
-
import { useSelector, shallowEqual } from 'react-redux';
|
|
16
|
-
import { useIntl } from 'react-intl';
|
|
17
|
-
import matchSorter from 'match-sorter';
|
|
18
|
-
import sortBy from 'lodash/sortBy';
|
|
19
|
-
import toLower from 'lodash/toLower';
|
|
20
|
+
} from '@strapi/design-system/v2/SubNav';
|
|
20
21
|
import getTrad from '../../../utils/getTrad';
|
|
21
22
|
import { makeSelectModelLinks } from '../selectors';
|
|
22
23
|
|
|
@@ -111,7 +112,7 @@ const LeftMenu = () => {
|
|
|
111
112
|
const search = link.search ? `?${link.search}` : '';
|
|
112
113
|
|
|
113
114
|
return (
|
|
114
|
-
<SubNavLink key={link.uid} to={`${link.to}${search}`}>
|
|
115
|
+
<SubNavLink as={NavLink} key={link.uid} to={`${link.to}${search}`}>
|
|
115
116
|
{link.title}
|
|
116
117
|
</SubNavLink>
|
|
117
118
|
);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { Link } from '@strapi/helper-plugin';
|
|
3
4
|
import { Box } from '@strapi/design-system/Box';
|
|
4
5
|
import { Flex } from '@strapi/design-system/Flex';
|
|
5
|
-
import { Link } from '@strapi/design-system/Link';
|
|
6
6
|
import { Typography } from '@strapi/design-system/Typography';
|
|
7
7
|
import Cog from '@strapi/icons/Cog';
|
|
8
8
|
import { useIntl } from 'react-intl';
|
|
@@ -5,10 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import React from 'react';
|
|
8
|
-
import { useTracking, CheckPermissions } from '@strapi/helper-plugin';
|
|
8
|
+
import { useTracking, CheckPermissions, LinkButton } from '@strapi/helper-plugin';
|
|
9
9
|
import { useIntl } from 'react-intl';
|
|
10
10
|
import get from 'lodash/get';
|
|
11
|
-
import { LinkButton } from '@strapi/design-system/LinkButton';
|
|
12
11
|
import Pencil from '@strapi/icons/Pencil';
|
|
13
12
|
import getTrad from '../../../utils/getTrad';
|
|
14
13
|
import useLayoutDnd from '../../../hooks/useLayoutDnd';
|
|
@@ -9,11 +9,10 @@ import flatMap from 'lodash/flatMap';
|
|
|
9
9
|
import isEqual from 'lodash/isEqual';
|
|
10
10
|
import get from 'lodash/get';
|
|
11
11
|
import set from 'lodash/set';
|
|
12
|
-
import { useNotification, useTracking, ConfirmDialog } from '@strapi/helper-plugin';
|
|
12
|
+
import { useNotification, useTracking, ConfirmDialog, Link } from '@strapi/helper-plugin';
|
|
13
13
|
import { useHistory } from 'react-router-dom';
|
|
14
14
|
import { Main } from '@strapi/design-system/Main';
|
|
15
15
|
import { HeaderLayout, ContentLayout } from '@strapi/design-system/Layout';
|
|
16
|
-
import { Link } from '@strapi/design-system/Link';
|
|
17
16
|
import { Button } from '@strapi/design-system/Button';
|
|
18
17
|
import { Box } from '@strapi/design-system/Box';
|
|
19
18
|
import { Typography } from '@strapi/design-system/Typography';
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import React, { memo, useRef, useState } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
3
|
import { useHistory } from 'react-router-dom';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import isEqualFastCompare from 'react-fast-compare';
|
|
4
6
|
import get from 'lodash/get';
|
|
5
7
|
import isEqual from 'lodash/isEqual';
|
|
6
8
|
import isEmpty from 'lodash/isEmpty';
|
|
7
9
|
import ArrowLeft from '@strapi/icons/ArrowLeft';
|
|
10
|
+
import { Link } from '@strapi/helper-plugin';
|
|
8
11
|
import { HeaderLayout } from '@strapi/design-system/Layout';
|
|
9
12
|
import { Box } from '@strapi/design-system/Box';
|
|
10
13
|
import { Button } from '@strapi/design-system/Button';
|
|
11
14
|
import { Dialog, DialogBody, DialogFooter } from '@strapi/design-system/Dialog';
|
|
12
|
-
import { Link } from '@strapi/design-system/Link';
|
|
13
15
|
import { Flex } from '@strapi/design-system/Flex';
|
|
14
16
|
import { Typography } from '@strapi/design-system/Typography';
|
|
15
17
|
import { Stack } from '@strapi/design-system/Stack';
|
|
16
18
|
import ExclamationMarkCircle from '@strapi/icons/ExclamationMarkCircle';
|
|
17
19
|
import Check from '@strapi/icons/Check';
|
|
18
|
-
import PropTypes from 'prop-types';
|
|
19
|
-
import isEqualFastCompare from 'react-fast-compare';
|
|
20
20
|
import { getTrad } from '../../../utils';
|
|
21
21
|
import { connect, getDraftRelations, select } from './utils';
|
|
22
22
|
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import React, { memo, useCallback, useMemo } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import get from 'lodash/get';
|
|
4
|
-
import { CheckPermissions, useTracking } from '@strapi/helper-plugin';
|
|
4
|
+
import { CheckPermissions, useTracking, LinkButton } from '@strapi/helper-plugin';
|
|
5
5
|
import { useIntl } from 'react-intl';
|
|
6
6
|
import { ContentLayout } from '@strapi/design-system/Layout';
|
|
7
7
|
import { Box } from '@strapi/design-system/Box';
|
|
8
8
|
import { Divider } from '@strapi/design-system/Divider';
|
|
9
9
|
import { Grid, GridItem } from '@strapi/design-system/Grid';
|
|
10
|
-
import { LinkButton } from '@strapi/design-system/LinkButton';
|
|
11
10
|
import { Main } from '@strapi/design-system/Main';
|
|
12
11
|
import { Stack } from '@strapi/design-system/Stack';
|
|
13
12
|
import { Typography } from '@strapi/design-system/Typography';
|
|
@@ -15,9 +14,7 @@ import Layer from '@strapi/icons/Layer';
|
|
|
15
14
|
import Pencil from '@strapi/icons/Pencil';
|
|
16
15
|
import { InjectionZone } from '../../../shared/components';
|
|
17
16
|
import permissions from '../../../permissions';
|
|
18
|
-
// import Container from '../../components/Container';
|
|
19
17
|
import DynamicZone from '../../components/DynamicZone';
|
|
20
|
-
// import FormWrapper from '../../components/FormWrapper';
|
|
21
18
|
import FieldComponent from '../../components/FieldComponent';
|
|
22
19
|
import Inputs from '../../components/Inputs';
|
|
23
20
|
import SelectWrapper from '../../components/SelectWrapper';
|
|
@@ -6,12 +6,11 @@ import upperFirst from 'lodash/upperFirst';
|
|
|
6
6
|
import pick from 'lodash/pick';
|
|
7
7
|
import get from 'lodash/get';
|
|
8
8
|
import { stringify } from 'qs';
|
|
9
|
-
import { useNotification, useTracking, ConfirmDialog } from '@strapi/helper-plugin';
|
|
9
|
+
import { useNotification, useTracking, ConfirmDialog, Link } from '@strapi/helper-plugin';
|
|
10
10
|
import { useIntl } from 'react-intl';
|
|
11
11
|
import { Box } from '@strapi/design-system/Box';
|
|
12
12
|
import { Divider } from '@strapi/design-system/Divider';
|
|
13
13
|
import { Layout, HeaderLayout, ContentLayout } from '@strapi/design-system/Layout';
|
|
14
|
-
import { Link } from '@strapi/design-system/Link';
|
|
15
14
|
import { Main } from '@strapi/design-system/Main';
|
|
16
15
|
import { Button } from '@strapi/design-system/Button';
|
|
17
16
|
import Check from '@strapi/icons/Check';
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
useNotification,
|
|
18
18
|
useRBACProvider,
|
|
19
19
|
useTracking,
|
|
20
|
+
Link,
|
|
20
21
|
} from '@strapi/helper-plugin';
|
|
21
22
|
import { IconButton } from '@strapi/design-system/IconButton';
|
|
22
23
|
import { Main } from '@strapi/design-system/Main';
|
|
@@ -24,7 +25,6 @@ import { Box } from '@strapi/design-system/Box';
|
|
|
24
25
|
import { ActionLayout, ContentLayout, HeaderLayout } from '@strapi/design-system/Layout';
|
|
25
26
|
import { useNotifyAT } from '@strapi/design-system/LiveRegions';
|
|
26
27
|
import { Button } from '@strapi/design-system/Button';
|
|
27
|
-
import { Link } from '@strapi/design-system/Link';
|
|
28
28
|
import ArrowLeft from '@strapi/icons/ArrowLeft';
|
|
29
29
|
import Plus from '@strapi/icons/Plus';
|
|
30
30
|
import Cog from '@strapi/icons/Cog';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { useFocusWhenNavigate } from '@strapi/helper-plugin';
|
|
2
|
+
import { useFocusWhenNavigate, LinkButton } from '@strapi/helper-plugin';
|
|
3
3
|
import { Main } from '@strapi/design-system/Main';
|
|
4
|
-
import { LinkButton } from '@strapi/design-system/LinkButton';
|
|
5
4
|
import { ContentLayout, HeaderLayout } from '@strapi/design-system/Layout';
|
|
6
5
|
import { EmptyStateLayout } from '@strapi/design-system/EmptyStateLayout';
|
|
7
6
|
import Plus from '@strapi/icons/Plus';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useQuery } from 'react-query';
|
|
2
|
+
import { useNotification } from '@strapi/helper-plugin';
|
|
3
|
+
import { fetchMarketplacePlugins } from './utils/api';
|
|
4
|
+
|
|
5
|
+
const useFetchMarketplaceProviders = (notifyLoad) => {
|
|
6
|
+
const toggleNotification = useNotification();
|
|
7
|
+
|
|
8
|
+
return useQuery('list-marketplace-providers', () => fetchMarketplacePlugins(), {
|
|
9
|
+
onSuccess: () => {
|
|
10
|
+
if (notifyLoad) {
|
|
11
|
+
notifyLoad();
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
onError: () => {
|
|
15
|
+
toggleNotification({
|
|
16
|
+
type: 'warning',
|
|
17
|
+
message: { id: 'notification.error', defaultMessage: 'An error occured' },
|
|
18
|
+
});
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default useFetchMarketplaceProviders;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
|
|
3
|
+
const MARKETPLACE_API_URL = 'https://market-api.strapi.io';
|
|
4
|
+
|
|
5
|
+
const fetchMarketplacePlugins = async () => {
|
|
6
|
+
const { data } = await axios.get(`${MARKETPLACE_API_URL}/providers`);
|
|
7
|
+
|
|
8
|
+
return data;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { fetchMarketplacePlugins };
|