@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
|
@@ -6,17 +6,16 @@
|
|
|
6
6
|
|
|
7
7
|
import React, { Suspense, useEffect, useMemo, lazy } from 'react';
|
|
8
8
|
import { Switch, Route } from 'react-router-dom';
|
|
9
|
+
// Components from @strapi/helper-plugin
|
|
9
10
|
import { useTracking, LoadingIndicatorPage, useStrapiApp } from '@strapi/helper-plugin';
|
|
10
|
-
import { useDispatch, useSelector } from 'react-redux';
|
|
11
11
|
import { DndProvider } from 'react-dnd';
|
|
12
12
|
import { HTML5Backend } from 'react-dnd-html5-backend';
|
|
13
|
-
import GuidedTourModal from '../../components/GuidedTour/Modal';
|
|
14
13
|
import LeftMenu from '../../components/LeftMenu';
|
|
15
14
|
import AppLayout from '../../layouts/AppLayout';
|
|
16
15
|
import { useMenu } from '../../hooks';
|
|
17
|
-
import { createRoute } from '../../utils';
|
|
18
|
-
import { SET_APP_RUNTIME_STATUS } from '../App/constants';
|
|
19
16
|
import Onboarding from './Onboarding';
|
|
17
|
+
import { createRoute } from '../../utils';
|
|
18
|
+
import GuidedTourModal from '../../components/GuidedTour/Modal';
|
|
20
19
|
|
|
21
20
|
const CM = lazy(() =>
|
|
22
21
|
import(/* webpackChunkName: "content-manager" */ '../../content-manager/pages/App')
|
|
@@ -41,20 +40,11 @@ const SettingsPage = lazy(() =>
|
|
|
41
40
|
// Simple hook easier for testing
|
|
42
41
|
const useTrackUsage = () => {
|
|
43
42
|
const { trackUsage } = useTracking();
|
|
44
|
-
const dispatch = useDispatch();
|
|
45
|
-
const appStatus = useSelector(state => state.admin_app.status);
|
|
46
43
|
|
|
47
44
|
useEffect(() => {
|
|
48
|
-
|
|
49
|
-
// and not at runtime for example when regenerating the permissions with the ctb
|
|
50
|
-
// or with i18n
|
|
51
|
-
if (appStatus === 'init') {
|
|
52
|
-
trackUsage('didAccessAuthenticatedAdministration');
|
|
53
|
-
|
|
54
|
-
dispatch({ type: SET_APP_RUNTIME_STATUS });
|
|
55
|
-
}
|
|
45
|
+
trackUsage('didAccessAuthenticatedAdministration');
|
|
56
46
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
57
|
-
}, [
|
|
47
|
+
}, []);
|
|
58
48
|
};
|
|
59
49
|
|
|
60
50
|
const Admin = () => {
|
|
@@ -12,8 +12,8 @@ import {
|
|
|
12
12
|
request,
|
|
13
13
|
useNotification,
|
|
14
14
|
TrackingContext,
|
|
15
|
+
prefixFileUrlWithBackendUrl,
|
|
15
16
|
} from '@strapi/helper-plugin';
|
|
16
|
-
import axios from 'axios';
|
|
17
17
|
import { SkipToContent } from '@strapi/design-system/Main';
|
|
18
18
|
import { useIntl } from 'react-intl';
|
|
19
19
|
import PrivateRoute from '../../components/PrivateRoute';
|
|
@@ -23,6 +23,7 @@ import NotFoundPage from '../NotFoundPage';
|
|
|
23
23
|
import UseCasePage from '../UseCasePage';
|
|
24
24
|
import { getUID } from './utils';
|
|
25
25
|
import routes from './utils/routes';
|
|
26
|
+
import { useConfigurations } from '../../hooks';
|
|
26
27
|
|
|
27
28
|
const AuthenticatedApp = lazy(() =>
|
|
28
29
|
import(/* webpackChunkName: "Admin-authenticatedApp" */ '../../components/AuthenticatedApp')
|
|
@@ -30,6 +31,7 @@ const AuthenticatedApp = lazy(() =>
|
|
|
30
31
|
|
|
31
32
|
function App() {
|
|
32
33
|
const toggleNotification = useNotification();
|
|
34
|
+
const { updateProjectSettings } = useConfigurations();
|
|
33
35
|
const { formatMessage } = useIntl();
|
|
34
36
|
const [{ isLoading, hasAdmin, uuid }, setState] = useState({ isLoading: true, hasAdmin: false });
|
|
35
37
|
|
|
@@ -39,8 +41,6 @@ function App() {
|
|
|
39
41
|
);
|
|
40
42
|
}, []);
|
|
41
43
|
|
|
42
|
-
const [telemetryProperties, setTelemetryProperties] = useState(null);
|
|
43
|
-
|
|
44
44
|
useEffect(() => {
|
|
45
45
|
const currentToken = auth.getToken();
|
|
46
46
|
|
|
@@ -69,18 +69,12 @@ function App() {
|
|
|
69
69
|
const getData = async () => {
|
|
70
70
|
try {
|
|
71
71
|
const {
|
|
72
|
-
data: {
|
|
73
|
-
|
|
74
|
-
},
|
|
75
|
-
} = await axios.get(`${strapi.backendURL}/admin/init`);
|
|
76
|
-
|
|
77
|
-
if (uuid) {
|
|
78
|
-
const {
|
|
79
|
-
data: { data: properties },
|
|
80
|
-
} = await axios.get(`${strapi.backendURL}/admin/telemetry-properties`);
|
|
72
|
+
data: { hasAdmin, uuid, menuLogo },
|
|
73
|
+
} = await request('/admin/init', { method: 'GET' });
|
|
81
74
|
|
|
82
|
-
|
|
75
|
+
updateProjectSettings({ menuLogo: prefixFileUrlWithBackendUrl(menuLogo) });
|
|
83
76
|
|
|
77
|
+
if (uuid) {
|
|
84
78
|
try {
|
|
85
79
|
const deviceId = await getUID();
|
|
86
80
|
|
|
@@ -90,9 +84,6 @@ function App() {
|
|
|
90
84
|
event: 'didInitializeAdministration',
|
|
91
85
|
uuid,
|
|
92
86
|
deviceId,
|
|
93
|
-
properties: {
|
|
94
|
-
...properties,
|
|
95
|
-
},
|
|
96
87
|
}),
|
|
97
88
|
headers: {
|
|
98
89
|
'Content-Type': 'application/json',
|
|
@@ -113,7 +104,7 @@ function App() {
|
|
|
113
104
|
};
|
|
114
105
|
|
|
115
106
|
getData();
|
|
116
|
-
}, [toggleNotification]);
|
|
107
|
+
}, [toggleNotification, updateProjectSettings]);
|
|
117
108
|
|
|
118
109
|
const setHasAdmin = hasAdmin => setState(prev => ({ ...prev, hasAdmin }));
|
|
119
110
|
|
|
@@ -124,7 +115,7 @@ function App() {
|
|
|
124
115
|
return (
|
|
125
116
|
<Suspense fallback={<LoadingIndicatorPage />}>
|
|
126
117
|
<SkipToContent>{formatMessage({ id: 'skipToContent' })}</SkipToContent>
|
|
127
|
-
<TrackingContext.Provider value={
|
|
118
|
+
<TrackingContext.Provider value={uuid}>
|
|
128
119
|
<Switch>
|
|
129
120
|
{authRoutes}
|
|
130
121
|
<Route
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import { Form } from '@strapi/helper-plugin';
|
|
4
|
+
import { Form, Link } from '@strapi/helper-plugin';
|
|
5
5
|
import { Box } from '@strapi/design-system/Box';
|
|
6
6
|
import { Stack } from '@strapi/design-system/Stack';
|
|
7
7
|
import { Main } from '@strapi/design-system/Main';
|
|
8
8
|
import { Flex } from '@strapi/design-system/Flex';
|
|
9
|
-
import { Link } from '@strapi/design-system/Link';
|
|
10
9
|
import { Button } from '@strapi/design-system/Button';
|
|
11
10
|
import { TextInput } from '@strapi/design-system/TextInput';
|
|
12
11
|
import { Typography } from '@strapi/design-system/Typography';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
|
+
import { Link } from '@strapi/helper-plugin';
|
|
3
4
|
import { Box } from '@strapi/design-system/Box';
|
|
4
5
|
import { Main } from '@strapi/design-system/Main';
|
|
5
6
|
import { Flex } from '@strapi/design-system/Flex';
|
|
6
|
-
import { Link } from '@strapi/design-system/Link';
|
|
7
7
|
import { Typography } from '@strapi/design-system/Typography';
|
|
8
8
|
import UnauthenticatedLayout, {
|
|
9
9
|
Column,
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
+
import { Form, Link } from '@strapi/helper-plugin';
|
|
2
3
|
import EyeStriked from '@strapi/icons/EyeStriked';
|
|
3
4
|
import Eye from '@strapi/icons/Eye';
|
|
4
5
|
import { Box } from '@strapi/design-system/Box';
|
|
5
6
|
import { Stack } from '@strapi/design-system/Stack';
|
|
6
7
|
import { Main } from '@strapi/design-system/Main';
|
|
7
8
|
import { Flex } from '@strapi/design-system/Flex';
|
|
8
|
-
import { Link } from '@strapi/design-system/Link';
|
|
9
9
|
import { Button } from '@strapi/design-system/Button';
|
|
10
10
|
import { TextInput } from '@strapi/design-system/TextInput';
|
|
11
11
|
import { Checkbox } from '@strapi/design-system/Checkbox';
|
|
12
12
|
import { Typography } from '@strapi/design-system/Typography';
|
|
13
|
-
import { Form } from '@strapi/helper-plugin';
|
|
14
13
|
import PropTypes from 'prop-types';
|
|
15
14
|
import { useIntl } from 'react-intl';
|
|
16
15
|
import styled from 'styled-components';
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
|
-
import { useQuery } from '@strapi/helper-plugin';
|
|
3
|
+
import { useQuery, Link } from '@strapi/helper-plugin';
|
|
4
4
|
import { Box } from '@strapi/design-system/Box';
|
|
5
5
|
import { Main } from '@strapi/design-system/Main';
|
|
6
6
|
import { Flex } from '@strapi/design-system/Flex';
|
|
7
|
-
import { Link } from '@strapi/design-system/Link';
|
|
8
7
|
import { Typography } from '@strapi/design-system/Typography';
|
|
9
8
|
import UnauthenticatedLayout, {
|
|
10
9
|
Column,
|
|
@@ -3,11 +3,22 @@ import { useIntl } from 'react-intl';
|
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import get from 'lodash/get';
|
|
5
5
|
import omit from 'lodash/omit';
|
|
6
|
+
import { useHistory } from 'react-router-dom';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import { Formik } from 'formik';
|
|
9
|
+
import axios from 'axios';
|
|
10
|
+
import {
|
|
11
|
+
Form,
|
|
12
|
+
useQuery,
|
|
13
|
+
useNotification,
|
|
14
|
+
useTracking,
|
|
15
|
+
getYupInnerErrors,
|
|
16
|
+
Link,
|
|
17
|
+
} from '@strapi/helper-plugin';
|
|
6
18
|
import { Box } from '@strapi/design-system/Box';
|
|
7
19
|
import { Stack } from '@strapi/design-system/Stack';
|
|
8
20
|
import { Main } from '@strapi/design-system/Main';
|
|
9
21
|
import { Flex } from '@strapi/design-system/Flex';
|
|
10
|
-
import { Link } from '@strapi/design-system/Link';
|
|
11
22
|
import { Button } from '@strapi/design-system/Button';
|
|
12
23
|
import { TextInput } from '@strapi/design-system/TextInput';
|
|
13
24
|
import { Checkbox } from '@strapi/design-system/Checkbox';
|
|
@@ -15,17 +26,6 @@ import { Grid, GridItem } from '@strapi/design-system/Grid';
|
|
|
15
26
|
import { Typography } from '@strapi/design-system/Typography';
|
|
16
27
|
import EyeStriked from '@strapi/icons/EyeStriked';
|
|
17
28
|
import Eye from '@strapi/icons/Eye';
|
|
18
|
-
import {
|
|
19
|
-
Form,
|
|
20
|
-
useQuery,
|
|
21
|
-
useNotification,
|
|
22
|
-
useTracking,
|
|
23
|
-
getYupInnerErrors,
|
|
24
|
-
} from '@strapi/helper-plugin';
|
|
25
|
-
import { useHistory } from 'react-router-dom';
|
|
26
|
-
import PropTypes from 'prop-types';
|
|
27
|
-
import { Formik } from 'formik';
|
|
28
|
-
import axios from 'axios';
|
|
29
29
|
import UnauthenticatedLayout, {
|
|
30
30
|
Column,
|
|
31
31
|
LayoutContent,
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import { Formik } from 'formik';
|
|
6
|
+
import { Form, Link } from '@strapi/helper-plugin';
|
|
5
7
|
import { Box } from '@strapi/design-system/Box';
|
|
6
8
|
import { Stack } from '@strapi/design-system/Stack';
|
|
7
9
|
import { Main } from '@strapi/design-system/Main';
|
|
8
10
|
import { Flex } from '@strapi/design-system/Flex';
|
|
9
|
-
import { Link } from '@strapi/design-system/Link';
|
|
10
11
|
import { Button } from '@strapi/design-system/Button';
|
|
11
12
|
import { TextInput } from '@strapi/design-system/TextInput';
|
|
12
13
|
import { Typography } from '@strapi/design-system/Typography';
|
|
13
14
|
import EyeStriked from '@strapi/icons/EyeStriked';
|
|
14
15
|
import Eye from '@strapi/icons/Eye';
|
|
15
|
-
import styled from 'styled-components';
|
|
16
|
-
import { Formik } from 'formik';
|
|
17
16
|
import UnauthenticatedLayout, {
|
|
18
17
|
Column,
|
|
19
18
|
LayoutContent,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { useIntl } from 'react-intl';
|
|
4
|
+
import { ContentBox, useTracking } from '@strapi/helper-plugin';
|
|
4
5
|
import { Stack } from '@strapi/design-system/Stack';
|
|
5
6
|
import InformationSquare from '@strapi/icons/InformationSquare';
|
|
6
7
|
import CodeSquare from '@strapi/icons/CodeSquare';
|
|
7
8
|
import PlaySquare from '@strapi/icons/PlaySquare';
|
|
8
9
|
import FeatherSquare from '@strapi/icons/FeatherSquare';
|
|
9
|
-
import { ContentBox } from '@strapi/helper-plugin';
|
|
10
10
|
|
|
11
11
|
const BlockLink = styled.a`
|
|
12
12
|
text-decoration: none;
|
|
@@ -14,6 +14,11 @@ const BlockLink = styled.a`
|
|
|
14
14
|
|
|
15
15
|
const ContentBlocks = () => {
|
|
16
16
|
const { formatMessage } = useIntl();
|
|
17
|
+
const { trackUsage } = useTracking();
|
|
18
|
+
|
|
19
|
+
const handleClick = eventName => {
|
|
20
|
+
trackUsage(eventName);
|
|
21
|
+
};
|
|
17
22
|
|
|
18
23
|
return (
|
|
19
24
|
<Stack spacing={5}>
|
|
@@ -21,6 +26,7 @@ const ContentBlocks = () => {
|
|
|
21
26
|
href="https://strapi.io/resource-center"
|
|
22
27
|
target="_blank"
|
|
23
28
|
rel="noopener noreferrer nofollow"
|
|
29
|
+
onClick={() => handleClick('didClickonReadTheDocumentationSection')}
|
|
24
30
|
>
|
|
25
31
|
<ContentBox
|
|
26
32
|
title={formatMessage({
|
|
@@ -39,6 +45,7 @@ const ContentBlocks = () => {
|
|
|
39
45
|
href="https://strapi.io/starters"
|
|
40
46
|
target="_blank"
|
|
41
47
|
rel="noopener noreferrer nofollow"
|
|
48
|
+
onClick={() => handleClick('didClickonCodeExampleSection')}
|
|
42
49
|
>
|
|
43
50
|
<ContentBox
|
|
44
51
|
title={formatMessage({
|
|
@@ -57,6 +64,7 @@ const ContentBlocks = () => {
|
|
|
57
64
|
href="https://strapi.io/blog/categories/tutorials"
|
|
58
65
|
target="_blank"
|
|
59
66
|
rel="noopener noreferrer nofollow"
|
|
67
|
+
onClick={() => handleClick('didClickonTutorialSection')}
|
|
60
68
|
>
|
|
61
69
|
<ContentBox
|
|
62
70
|
title={formatMessage({
|
|
@@ -71,7 +79,12 @@ const ContentBlocks = () => {
|
|
|
71
79
|
iconBackground="secondary100"
|
|
72
80
|
/>
|
|
73
81
|
</BlockLink>
|
|
74
|
-
<BlockLink
|
|
82
|
+
<BlockLink
|
|
83
|
+
href="https://strapi.io/blog"
|
|
84
|
+
target="_blank"
|
|
85
|
+
rel="noopener noreferrer nofollow"
|
|
86
|
+
onClick={() => handleClick('didClickonBlogSection')}
|
|
87
|
+
>
|
|
75
88
|
<ContentBox
|
|
76
89
|
title={formatMessage({
|
|
77
90
|
id: 'app.components.BlockLink.blog',
|
|
@@ -3,7 +3,7 @@ import styled from 'styled-components';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { useIntl } from 'react-intl';
|
|
5
5
|
import { Typography } from '@strapi/design-system/Typography';
|
|
6
|
-
import { Link } from '@strapi/design-system/Link';
|
|
6
|
+
import { Link } from '@strapi/design-system/v2/Link';
|
|
7
7
|
import { Stack } from '@strapi/design-system/Stack';
|
|
8
8
|
import { Box } from '@strapi/design-system/Box';
|
|
9
9
|
import { Button } from '@strapi/design-system/Button';
|
|
@@ -49,7 +49,7 @@ const HomeHeader = ({ hasCreatedContentType, onCreateCT }) => {
|
|
|
49
49
|
})}
|
|
50
50
|
</WordWrap>
|
|
51
51
|
{hasCreatedContentType ? (
|
|
52
|
-
<Link href="https://strapi.io/blog">
|
|
52
|
+
<Link isExternal href="https://strapi.io/blog">
|
|
53
53
|
{formatMessage({
|
|
54
54
|
id: 'app.components.HomePage.button.blog',
|
|
55
55
|
defaultMessage: 'See more on the blog',
|
|
@@ -10,8 +10,8 @@ import { Typography } from '@strapi/design-system/Typography';
|
|
|
10
10
|
import { Box } from '@strapi/design-system/Box';
|
|
11
11
|
import { Stack } from '@strapi/design-system/Stack';
|
|
12
12
|
import { Grid, GridItem } from '@strapi/design-system/Grid';
|
|
13
|
-
import { LinkButton } from '@strapi/design-system/LinkButton';
|
|
14
|
-
import { Link } from '@strapi/design-system/Link';
|
|
13
|
+
import { LinkButton } from '@strapi/design-system/v2/LinkButton';
|
|
14
|
+
import { Link } from '@strapi/design-system/v2/Link';
|
|
15
15
|
import ExternalLink from '@strapi/icons/ExternalLink';
|
|
16
16
|
import Github from '@strapi/icons/Github';
|
|
17
17
|
import Discord from '@strapi/icons/Discord';
|
|
@@ -167,7 +167,7 @@ const SocialLinks = () => {
|
|
|
167
167
|
})}
|
|
168
168
|
</Typography>
|
|
169
169
|
</Stack>
|
|
170
|
-
<Link href="https://feedback.strapi.io/" endIcon={<ExternalLink />}>
|
|
170
|
+
<Link href="https://feedback.strapi.io/" isExternal endIcon={<ExternalLink />}>
|
|
171
171
|
{formatMessage({
|
|
172
172
|
id: 'app.components.HomePage.roadmap',
|
|
173
173
|
defaultMessage: 'See our road map',
|
|
@@ -184,6 +184,7 @@ const SocialLinks = () => {
|
|
|
184
184
|
startIcon={socialLink.icon}
|
|
185
185
|
variant="tertiary"
|
|
186
186
|
href={socialLink.link}
|
|
187
|
+
isExternal
|
|
187
188
|
>
|
|
188
189
|
{socialLink.name}
|
|
189
190
|
</LinkCustom>
|
|
@@ -5,9 +5,8 @@
|
|
|
5
5
|
*
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
|
-
import { useFocusWhenNavigate } from '@strapi/helper-plugin';
|
|
8
|
+
import { useFocusWhenNavigate, LinkButton } from '@strapi/helper-plugin';
|
|
9
9
|
import { Main } from '@strapi/design-system/Main';
|
|
10
|
-
import { LinkButton } from '@strapi/design-system/LinkButton';
|
|
11
10
|
import { ContentLayout, HeaderLayout } from '@strapi/design-system/Layout';
|
|
12
11
|
import { EmptyStateLayout } from '@strapi/design-system/EmptyStateLayout';
|
|
13
12
|
import EmptyPictures from '@strapi/icons/EmptyPictures';
|
|
@@ -5,12 +5,12 @@ import { Box } from '@strapi/design-system/Box';
|
|
|
5
5
|
import { Flex } from '@strapi/design-system/Flex';
|
|
6
6
|
import { Icon } from '@strapi/design-system/Icon';
|
|
7
7
|
import EmptyStateDocument from '@strapi/icons/EmptyDocuments';
|
|
8
|
-
import {
|
|
8
|
+
import { EmptyNpmPackageGrid } from './EmptyNpmPackageGrid';
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
const EmptyNpmPackageSearch = ({ content }) => {
|
|
11
11
|
return (
|
|
12
12
|
<Box position="relative">
|
|
13
|
-
<
|
|
13
|
+
<EmptyNpmPackageGrid />
|
|
14
14
|
<Box position="absolute" top={11} width="100%">
|
|
15
15
|
<Flex alignItems="center" justifyContent="center" direction="column">
|
|
16
16
|
<Icon as={EmptyStateDocument} color="" width="160px" height="88px" />
|
|
@@ -25,6 +25,8 @@ export const EmptyPluginSearch = ({ content }) => {
|
|
|
25
25
|
);
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
EmptyNpmPackageSearch.propTypes = {
|
|
29
29
|
content: PropTypes.string.isRequired,
|
|
30
30
|
};
|
|
31
|
+
|
|
32
|
+
export default EmptyNpmPackageSearch;
|
|
File without changes
|
|
@@ -5,7 +5,7 @@ import styled from 'styled-components';
|
|
|
5
5
|
import { Box } from '@strapi/design-system/Box';
|
|
6
6
|
import { Stack } from '@strapi/design-system/Stack';
|
|
7
7
|
import { Typography } from '@strapi/design-system/Typography';
|
|
8
|
-
import { LinkButton } from '@strapi/design-system/LinkButton';
|
|
8
|
+
import { LinkButton } from '@strapi/design-system/v2/LinkButton';
|
|
9
9
|
import { Flex } from '@strapi/design-system/Flex';
|
|
10
10
|
import { Icon } from '@strapi/design-system/Icon';
|
|
11
11
|
import { Tooltip } from '@strapi/design-system/Tooltip';
|
|
@@ -25,12 +25,18 @@ const EllipsisText = styled(Typography)`
|
|
|
25
25
|
overflow: hidden;
|
|
26
26
|
`;
|
|
27
27
|
|
|
28
|
-
const
|
|
29
|
-
|
|
28
|
+
const NpmPackageCard = ({
|
|
29
|
+
npmPackage,
|
|
30
|
+
installedPackageNames,
|
|
31
|
+
useYarn,
|
|
32
|
+
isInDevelopmentMode,
|
|
33
|
+
npmPackageType,
|
|
34
|
+
}) => {
|
|
35
|
+
const { attributes } = npmPackage;
|
|
30
36
|
const { formatMessage } = useIntl();
|
|
31
37
|
const { trackUsage } = useTracking();
|
|
32
38
|
|
|
33
|
-
const isInstalled =
|
|
39
|
+
const isInstalled = installedPackageNames.includes(attributes.npmPackageName);
|
|
34
40
|
|
|
35
41
|
const commandToCopy = useYarn
|
|
36
42
|
? `yarn add ${attributes.npmPackageName}`
|
|
@@ -41,14 +47,19 @@ const PluginCard = ({ plugin, installedPluginNames, useYarn, isInDevelopmentMode
|
|
|
41
47
|
defaultMessage: 'Made by Strapi',
|
|
42
48
|
});
|
|
43
49
|
|
|
50
|
+
const npmPackageHref =
|
|
51
|
+
npmPackageType === 'provider'
|
|
52
|
+
? attributes.npmPackageUrl
|
|
53
|
+
: `https://market.strapi.io/plugins/${attributes.slug}`;
|
|
54
|
+
|
|
44
55
|
return (
|
|
45
56
|
<Flex
|
|
46
57
|
direction="column"
|
|
47
58
|
justifyContent="space-between"
|
|
48
59
|
paddingTop={4}
|
|
49
|
-
paddingRight={
|
|
60
|
+
paddingRight={4}
|
|
50
61
|
paddingBottom={4}
|
|
51
|
-
paddingLeft={
|
|
62
|
+
paddingLeft={4}
|
|
52
63
|
hasRadius
|
|
53
64
|
background="neutral0"
|
|
54
65
|
shadow="tableShadow"
|
|
@@ -107,7 +118,8 @@ const PluginCard = ({ plugin, installedPluginNames, useYarn, isInDevelopmentMode
|
|
|
107
118
|
<Stack horizontal spacing={2} style={{ alignSelf: 'flex-end' }} paddingTop={6}>
|
|
108
119
|
<LinkButton
|
|
109
120
|
size="S"
|
|
110
|
-
href={
|
|
121
|
+
href={npmPackageHref}
|
|
122
|
+
isExternal
|
|
111
123
|
endIcon={<ExternalLink />}
|
|
112
124
|
aria-label={formatMessage(
|
|
113
125
|
{
|
|
@@ -134,12 +146,12 @@ const PluginCard = ({ plugin, installedPluginNames, useYarn, isInDevelopmentMode
|
|
|
134
146
|
);
|
|
135
147
|
};
|
|
136
148
|
|
|
137
|
-
|
|
149
|
+
NpmPackageCard.defaultProps = {
|
|
138
150
|
isInDevelopmentMode: false,
|
|
139
151
|
};
|
|
140
152
|
|
|
141
|
-
|
|
142
|
-
|
|
153
|
+
NpmPackageCard.propTypes = {
|
|
154
|
+
npmPackage: PropTypes.shape({
|
|
143
155
|
id: PropTypes.string.isRequired,
|
|
144
156
|
attributes: PropTypes.shape({
|
|
145
157
|
name: PropTypes.string.isRequired,
|
|
@@ -152,12 +164,13 @@ PluginCard.propTypes = {
|
|
|
152
164
|
developerName: PropTypes.string.isRequired,
|
|
153
165
|
validated: PropTypes.bool.isRequired,
|
|
154
166
|
madeByStrapi: PropTypes.bool.isRequired,
|
|
155
|
-
strapiCompatibility: PropTypes.oneOf(['v3', 'v4'])
|
|
167
|
+
strapiCompatibility: PropTypes.oneOf(['v3', 'v4']),
|
|
156
168
|
}).isRequired,
|
|
157
169
|
}).isRequired,
|
|
158
|
-
|
|
170
|
+
installedPackageNames: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
159
171
|
useYarn: PropTypes.bool.isRequired,
|
|
160
172
|
isInDevelopmentMode: PropTypes.bool,
|
|
173
|
+
npmPackageType: PropTypes.string.isRequired,
|
|
161
174
|
};
|
|
162
175
|
|
|
163
|
-
export default
|
|
176
|
+
export default NpmPackageCard;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { Grid, GridItem } from '@strapi/design-system/Grid';
|
|
4
|
+
import NpmPackageCard from '../NpmPackageCard';
|
|
5
|
+
|
|
6
|
+
const NpmPackagesGrid = ({
|
|
7
|
+
npmPackages,
|
|
8
|
+
installedPackageNames,
|
|
9
|
+
useYarn,
|
|
10
|
+
isInDevelopmentMode,
|
|
11
|
+
npmPackageType,
|
|
12
|
+
}) => {
|
|
13
|
+
return (
|
|
14
|
+
<Grid gap={4}>
|
|
15
|
+
{npmPackages.map((npmPackage) => (
|
|
16
|
+
<GridItem col={4} s={6} xs={12} style={{ height: '100%' }} key={npmPackage.id}>
|
|
17
|
+
<NpmPackageCard
|
|
18
|
+
npmPackage={npmPackage}
|
|
19
|
+
installedPackageNames={installedPackageNames}
|
|
20
|
+
useYarn={useYarn}
|
|
21
|
+
isInDevelopmentMode={isInDevelopmentMode}
|
|
22
|
+
npmPackageType={npmPackageType}
|
|
23
|
+
/>
|
|
24
|
+
</GridItem>
|
|
25
|
+
))}
|
|
26
|
+
</Grid>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
NpmPackagesGrid.defaultProps = {
|
|
31
|
+
installedPackageNames: [],
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
NpmPackagesGrid.propTypes = {
|
|
35
|
+
npmPackages: PropTypes.array.isRequired,
|
|
36
|
+
installedPackageNames: PropTypes.arrayOf(PropTypes.string),
|
|
37
|
+
useYarn: PropTypes.bool.isRequired,
|
|
38
|
+
isInDevelopmentMode: PropTypes.bool.isRequired,
|
|
39
|
+
npmPackageType: PropTypes.string.isRequired,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default NpmPackagesGrid;
|
|
@@ -2,14 +2,16 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { useIntl } from 'react-intl';
|
|
4
4
|
import { HeaderLayout } from '@strapi/design-system/Layout';
|
|
5
|
-
import { LinkButton } from '@strapi/design-system/LinkButton';
|
|
5
|
+
import { LinkButton } from '@strapi/design-system/v2/LinkButton';
|
|
6
6
|
import Upload from '@strapi/icons/Upload';
|
|
7
7
|
import { useTracking } from '@strapi/helper-plugin';
|
|
8
8
|
|
|
9
|
-
const PageHeader = ({ isOnline }) => {
|
|
9
|
+
const PageHeader = ({ isOnline, npmPackageType }) => {
|
|
10
10
|
const { formatMessage } = useIntl();
|
|
11
11
|
const { trackUsage } = useTracking();
|
|
12
12
|
|
|
13
|
+
const tracking = npmPackageType === 'provider' ? 'didSubmitProvider' : 'didSubmitPlugin';
|
|
14
|
+
|
|
13
15
|
return (
|
|
14
16
|
<HeaderLayout
|
|
15
17
|
title={formatMessage({
|
|
@@ -25,12 +27,13 @@ const PageHeader = ({ isOnline }) => {
|
|
|
25
27
|
<LinkButton
|
|
26
28
|
startIcon={<Upload />}
|
|
27
29
|
variant="tertiary"
|
|
28
|
-
href=
|
|
29
|
-
onClick={() => trackUsage(
|
|
30
|
+
href={`https://market.strapi.io/submit-${npmPackageType}`}
|
|
31
|
+
onClick={() => trackUsage(tracking)}
|
|
32
|
+
isExternal
|
|
30
33
|
>
|
|
31
34
|
{formatMessage({
|
|
32
|
-
id:
|
|
33
|
-
defaultMessage:
|
|
35
|
+
id: `admin.pages.MarketPlacePage.submit.${npmPackageType}.link`,
|
|
36
|
+
defaultMessage: `Submit ${npmPackageType}`,
|
|
34
37
|
})}
|
|
35
38
|
</LinkButton>
|
|
36
39
|
)
|
|
@@ -41,6 +44,11 @@ const PageHeader = ({ isOnline }) => {
|
|
|
41
44
|
|
|
42
45
|
export default PageHeader;
|
|
43
46
|
|
|
47
|
+
PageHeader.defaultProps = {
|
|
48
|
+
npmPackageType: 'plugin',
|
|
49
|
+
};
|
|
50
|
+
|
|
44
51
|
PageHeader.propTypes = {
|
|
45
52
|
isOnline: PropTypes.bool.isRequired,
|
|
53
|
+
npmPackageType: PropTypes.string,
|
|
46
54
|
};
|