@strapi/admin 4.1.3 → 4.1.4-alpha.2
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/assets/images/icon_made-by-strapi.svg +5 -0
- package/admin/src/components/AuthenticatedApp/index.js +9 -2
- package/admin/src/components/AuthenticatedApp/utils/api.js +20 -1
- package/admin/src/components/AutoReloadOverlayBlockerProvider/Blocker.js +2 -2
- package/admin/src/components/GuidedTour/Homepage/index.js +1 -1
- package/admin/src/components/GuidedTour/Modal/components/Content.js +1 -1
- package/admin/src/components/GuidedTour/Modal/components/Modal.js +1 -1
- package/admin/src/components/LeftMenu/index.js +1 -1
- package/admin/src/components/Notifications/index.js +1 -1
- package/admin/src/components/UpgradePlanModal/index.js +2 -2
- package/admin/src/content-manager/components/CollectionTypeFormWrapper/index.js +4 -4
- package/admin/src/content-manager/components/ComponentInitializer/index.js +1 -1
- package/admin/src/content-manager/components/DynamicTable/ConfirmDialogDelete/index.js +1 -1
- package/admin/src/content-manager/components/DynamicTable/ConfirmDialogDeleteAll/index.js +1 -1
- package/admin/src/content-manager/components/DynamicZone/components/Component/index.js +2 -2
- package/admin/src/content-manager/components/DynamicZone/components/ComponentPicker/Category/ComponentCard/index.js +1 -1
- package/admin/src/content-manager/components/DynamicZone/components/ComponentPicker/Category/index.js +5 -2
- package/admin/src/content-manager/components/DynamicZone/index.js +2 -5
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/cleanData.js +1 -6
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/schema.js +0 -9
- package/admin/src/content-manager/components/FieldComponent/index.js +2 -5
- package/admin/src/content-manager/components/InputJSON/index.js +2 -5
- package/admin/src/content-manager/components/InputUID/index.js +1 -2
- package/admin/src/content-manager/components/NonRepeatableComponent/index.js +1 -1
- package/admin/src/content-manager/components/RepeatableComponent/DraggedItem/DraggingSibling.js +2 -2
- package/admin/src/content-manager/components/RepeatableComponent/DraggedItem/index.js +4 -7
- package/admin/src/content-manager/components/SelectMany/index.js +2 -2
- package/admin/src/content-manager/components/SelectOne/index.js +1 -1
- package/admin/src/content-manager/components/SelectWrapper/index.js +2 -5
- package/admin/src/content-manager/components/SingleTypeFormWrapper/index.js +4 -4
- package/admin/src/content-manager/components/Wysiwyg/EditorStylesContainer.js +1 -1
- package/admin/src/content-manager/components/Wysiwyg/WysiwygNav.js +2 -2
- package/admin/src/content-manager/components/Wysiwyg/index.js +2 -2
- package/admin/src/content-manager/pages/EditSettingsView/components/DisplayedFields.js +2 -2
- package/admin/src/content-manager/pages/EditSettingsView/components/DynamicZoneList.js +1 -1
- package/admin/src/content-manager/pages/EditSettingsView/components/RelationalFields.js +2 -2
- package/admin/src/content-manager/pages/EditSettingsView/index.js +1 -1
- package/admin/src/content-manager/pages/EditView/Header/index.js +4 -7
- package/admin/src/content-manager/pages/EditView/Informations/index.js +1 -1
- package/admin/src/content-manager/pages/EditView/index.js +5 -193
- package/admin/src/content-manager/pages/ListSettingsView/components/CardPreview.js +1 -1
- package/admin/src/content-manager/pages/ListSettingsView/components/DraggableCard.js +1 -1
- package/admin/src/content-manager/pages/ListSettingsView/components/SortDisplayedFields.js +1 -1
- package/admin/src/hooks/index.js +0 -1
- package/admin/src/hooks/useFetchInstalledPlugins/index.js +23 -0
- package/admin/src/{pages/InstalledPluginsPage → hooks/useFetchInstalledPlugins}/utils/api.js +2 -4
- package/admin/src/hooks/useFetchMarketplacePlugins/index.js +23 -0
- package/admin/src/hooks/useFetchMarketplacePlugins/utils/api.js +17 -0
- package/admin/src/hooks/useSettingsMenu/init.js +2 -2
- package/admin/src/pages/Admin/index.js +1 -3
- package/admin/src/pages/AuthPage/components/ForgotPassword/index.js +1 -1
- package/admin/src/pages/AuthPage/components/Login/BaseLogin.js +1 -1
- package/admin/src/pages/AuthPage/components/Register/index.js +219 -214
- package/admin/src/pages/AuthPage/components/ResetPassword/index.js +1 -1
- package/admin/src/pages/AuthPage/index.js +7 -1
- package/admin/src/pages/HomePage/ContentBlocks.js +1 -1
- package/admin/src/pages/HomePage/HomeHeader.js +1 -1
- package/admin/src/pages/HomePage/SocialLinks.js +2 -2
- package/admin/src/pages/InstalledPluginsPage/Plugins.js +6 -15
- package/admin/src/pages/MarketplacePage/components/EmptyPluginSearch/EmptyPluginGrid.js +27 -0
- package/admin/src/pages/MarketplacePage/components/EmptyPluginSearch/index.js +30 -0
- package/admin/src/pages/MarketplacePage/components/PluginCard/index.js +186 -0
- package/admin/src/pages/MarketplacePage/index.js +199 -107
- package/admin/src/pages/MarketplacePage/utils/api.js +9 -0
- package/admin/src/pages/ProfilePage/index.js +5 -5
- package/admin/src/pages/SettingsPage/components/SettingsNav/index.js +4 -1
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/index.js +2 -2
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/ConditionsModal/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/GlobalActions/index.js +2 -2
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/PluginsAndSettings/Row/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/RoleForm/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/index.js +2 -2
- package/admin/src/pages/SettingsPage/pages/Users/EditPage/index.js +3 -3
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/ModalForm/index.js +2 -2
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/EventInput/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/HeadersInput/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/TriggerContainer/index.js +4 -4
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/WebhookForm/index.js +3 -3
- package/admin/src/pages/SettingsPage/pages/Webhooks/ListView/index.js +1 -1
- package/admin/src/pages/UseCasePage/index.js +1 -1
- package/admin/src/translations/en.json +16 -13
- package/build/{1094.1087a368.chunk.js → 1094.e1db3a1a.chunk.js} +1 -1
- package/build/1454.f065d92a.chunk.js +2 -0
- package/build/{1454.c0f0c2df.chunk.js.LICENSE.txt → 1454.f065d92a.chunk.js.LICENSE.txt} +0 -0
- package/build/1856.a30bd09b.chunk.js +1 -0
- package/build/2481.4eae9408.chunk.js +1 -0
- package/build/{2912.38fb9bd1.chunk.js → 2912.c5f76e65.chunk.js} +1 -1
- package/build/4362.5c92d240.chunk.js +1 -0
- package/build/4715.8a2db02a.chunk.js +1 -0
- package/build/{4800.18e59c83.chunk.js → 4800.f4a1384a.chunk.js} +1 -1
- package/build/497.3fcf6196.chunk.js +1 -0
- package/build/4982.601f6196.chunk.js +1 -0
- package/build/6250.836851ca.chunk.js +1 -0
- package/build/{7841.ef9bcee9.chunk.js → 7841.490dbbf1.chunk.js} +1 -1
- package/build/{8042.9b85175a.chunk.js → 8042.1d66811a.chunk.js} +2 -2
- package/build/{8042.9b85175a.chunk.js.LICENSE.txt → 8042.1d66811a.chunk.js.LICENSE.txt} +0 -0
- package/build/849.17f011e8.chunk.js +1 -0
- package/build/90f49a385afb000fb1d4.svg +5 -0
- package/build/{2736.53cd9bba.chunk.js → 9260.fa40c7bd.chunk.js} +2 -2
- package/build/{2736.53cd9bba.chunk.js.LICENSE.txt → 9260.fa40c7bd.chunk.js.LICENSE.txt} +0 -0
- package/build/9853.6ff595fa.chunk.js +1 -0
- package/build/{9988.b4229043.chunk.js → 9988.fe838ba6.chunk.js} +2 -2
- package/build/{9988.b4229043.chunk.js.LICENSE.txt → 9988.fe838ba6.chunk.js.LICENSE.txt} +0 -0
- package/build/Admin-authenticatedApp.6d27d55a.chunk.js +1 -0
- package/build/Admin_homePage.964ff5d7.chunk.js +1 -0
- package/build/Admin_marketplace.89a0a014.chunk.js +1 -0
- package/build/Admin_pluginsPage.97a514db.chunk.js +1 -0
- package/build/Admin_profilePage.c497b39d.chunk.js +1 -0
- package/build/Admin_settingsPage.55ec1f30.chunk.js +1 -0
- package/build/admin-edit-roles-page.49b6f01d.chunk.js +1 -0
- package/build/admin-edit-users.381e4a0d.chunk.js +1 -0
- package/build/admin-users.2740c223.chunk.js +1 -0
- package/build/{api-tokens-create-page.0981141a.chunk.js → api-tokens-create-page.db17bb39.chunk.js} +1 -1
- package/build/{api-tokens-edit-page.3faf1af1.chunk.js → api-tokens-edit-page.c7299a77.chunk.js} +1 -1
- package/build/content-manager.e1189026.chunk.js +1 -0
- package/build/content-type-builder.de5d18ad.chunk.js +1 -0
- package/build/{email-settings-page.4338588d.chunk.js → email-settings-page.27ee4a98.chunk.js} +1 -1
- package/build/en-json.086acf41.chunk.js +1 -0
- package/build/i18n-settings-page.c4018651.chunk.js +1 -0
- package/build/i18n-translation-de-json.c5c9054f.chunk.js +1 -0
- package/build/index.html +1 -1
- package/build/main.7fa5bc38.js +2 -0
- package/build/{main.2667673b.js.LICENSE.txt → main.7fa5bc38.js.LICENSE.txt} +0 -0
- package/build/runtime~main.7bb09ab1.js +1 -0
- package/build/{sso-settings-page.c073b6d7.chunk.js → sso-settings-page.121dd0a6.chunk.js} +1 -1
- package/build/{upload-settings.8e7cbc3b.chunk.js → upload-settings.4401f36d.chunk.js} +1 -1
- package/build/{upload.803ab265.chunk.js → upload.5a2dded7.chunk.js} +1 -1
- package/build/{users-advanced-settings-page.7694d3c9.chunk.js → users-advanced-settings-page.8905d8d8.chunk.js} +1 -1
- package/build/users-permissions-translation-en-json.21b0fd2f.chunk.js +1 -0
- package/build/users-providers-settings-page.368893ed.chunk.js +1 -0
- package/build/users-roles-settings-page.a2f6277a.chunk.js +1 -0
- package/build/webhook-edit-page.d170eda1.chunk.js +1 -0
- package/build/{webhook-list-page.5c8f2a91.chunk.js → webhook-list-page.c21b5a9a.chunk.js} +1 -1
- package/ee/admin/pages/AuthPage/components/Login/index.js +1 -1
- package/ee/admin/pages/AuthPage/components/Providers/index.js +1 -1
- package/ee/admin/pages/SettingsPage/SingleSignOn/index.js +1 -1
- package/ee/admin/pages/SettingsPage/pages/Roles/CreatePage/index.js +3 -3
- package/package.json +7 -7
- package/server/controllers/admin.js +12 -1
- package/server/routes/serve-admin-panel.js +18 -6
- package/.env +0 -0
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/isValidJSONString.js +0 -15
- package/admin/src/hooks/useFetchPluginsFromMarketPlace/index.js +0 -49
- package/admin/src/pages/MarketplacePage/MarketplaceBanner/Wrapper.js +0 -28
- package/admin/src/pages/MarketplacePage/MarketplaceBanner/index.js +0 -37
- package/admin/src/pages/MarketplacePage/PluginCard/Wrapper.js +0 -148
- package/admin/src/pages/MarketplacePage/PluginCard/index.js +0 -185
- package/admin/src/pages/MarketplacePage/Wrapper.js +0 -5
- package/admin/src/pages/MarketplacePage/assets/marketplace-coming-soon.png +0 -0
- package/build/01a600d9e6e0dea21e33.png +0 -0
- package/build/1454.c0f0c2df.chunk.js +0 -2
- package/build/1856.a06395b4.chunk.js +0 -1
- package/build/2481.7d15bd79.chunk.js +0 -1
- package/build/4362.70618acb.chunk.js +0 -1
- package/build/4715.31ca1967.chunk.js +0 -1
- package/build/497.8f30da61.chunk.js +0 -1
- package/build/4982.da4adb38.chunk.js +0 -1
- package/build/6250.dc6d7a58.chunk.js +0 -1
- package/build/849.9075d399.chunk.js +0 -1
- package/build/9853.b75be3f0.chunk.js +0 -1
- package/build/Admin-authenticatedApp.872a6e3b.chunk.js +0 -1
- package/build/Admin_homePage.e4779166.chunk.js +0 -1
- package/build/Admin_marketplace.e8654056.chunk.js +0 -1
- package/build/Admin_pluginsPage.7d1bd7ce.chunk.js +0 -1
- package/build/Admin_profilePage.67dd744c.chunk.js +0 -1
- package/build/Admin_settingsPage.2d0d2cca.chunk.js +0 -1
- package/build/admin-edit-roles-page.2d1b6461.chunk.js +0 -1
- package/build/admin-edit-users.e736db15.chunk.js +0 -1
- package/build/admin-users.5f79c031.chunk.js +0 -1
- package/build/content-manager.141d110d.chunk.js +0 -1
- package/build/content-type-builder.5544bc9f.chunk.js +0 -1
- package/build/en-json.5aa9e5ec.chunk.js +0 -1
- package/build/i18n-settings-page.51e37957.chunk.js +0 -1
- package/build/main.2667673b.js +0 -2
- package/build/runtime~main.4b356df3.js +0 -1
- package/build/users-permissions-translation-en-json.1993655e.chunk.js +0 -1
- package/build/users-providers-settings-page.f3e86700.chunk.js +0 -1
- package/build/users-roles-settings-page.b67e2b4d.chunk.js +0 -1
- package/build/webhook-edit-page.b2e22743.chunk.js +0 -1
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { FormattedMessage, useIntl } from 'react-intl';
|
|
3
|
-
import { useTracking } from '@strapi/helper-plugin';
|
|
4
|
-
import Wrapper from './Wrapper';
|
|
5
|
-
import LogoStrapi from '../../../assets/images/banner_strapi-rocket.png';
|
|
6
|
-
|
|
7
|
-
const MarketplaceBanner = () => {
|
|
8
|
-
const { formatMessage } = useIntl();
|
|
9
|
-
const { trackUsage } = useTracking();
|
|
10
|
-
|
|
11
|
-
return (
|
|
12
|
-
<Wrapper>
|
|
13
|
-
<img
|
|
14
|
-
className="bannerImage"
|
|
15
|
-
src={LogoStrapi}
|
|
16
|
-
alt={formatMessage({ id: 'app.components.MarketplaceBanner.image.alt' })}
|
|
17
|
-
/>
|
|
18
|
-
<div>
|
|
19
|
-
<div>
|
|
20
|
-
<FormattedMessage id="app.components.MarketplaceBanner" />
|
|
21
|
-
</div>
|
|
22
|
-
<a
|
|
23
|
-
href="https://github.com/strapi/awesome-strapi"
|
|
24
|
-
target="_blank"
|
|
25
|
-
rel="noopener noreferrer"
|
|
26
|
-
className="bannerLink"
|
|
27
|
-
onClick={() => trackUsage('didGoToStrapiAwesome')}
|
|
28
|
-
>
|
|
29
|
-
<FormattedMessage id="app.components.MarketplaceBanner.link" />
|
|
30
|
-
<i className="fa fa-external-link-alt" />
|
|
31
|
-
</a>
|
|
32
|
-
</div>
|
|
33
|
-
</Wrapper>
|
|
34
|
-
);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export default MarketplaceBanner;
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
|
|
3
|
-
const Wrapper = styled.div`
|
|
4
|
-
.wrapper {
|
|
5
|
-
position: relative;
|
|
6
|
-
min-height: 216px;
|
|
7
|
-
margin-bottom: 3.6rem;
|
|
8
|
-
padding: 1.2rem 1.5rem;
|
|
9
|
-
padding-bottom: 0;
|
|
10
|
-
background-color: #fff;
|
|
11
|
-
box-shadow: 0 2px 4px #e3e9f3;
|
|
12
|
-
-webkit-font-smoothing: antialiased;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.cardTitle {
|
|
16
|
-
display: flex;
|
|
17
|
-
font-size: 13px;
|
|
18
|
-
font-weight: 600;
|
|
19
|
-
text-transform: uppercase;
|
|
20
|
-
letter-spacing: 0.5px;
|
|
21
|
-
|
|
22
|
-
> div:first-child {
|
|
23
|
-
margin-right: 14px;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
> div:last-child {
|
|
27
|
-
height: 36px;
|
|
28
|
-
line-height: 36px;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
i,
|
|
32
|
-
svg {
|
|
33
|
-
margin-left: 7px;
|
|
34
|
-
color: #b3b5b9;
|
|
35
|
-
font-size: 1rem;
|
|
36
|
-
vertical-align: baseline;
|
|
37
|
-
cursor: pointer;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.cardDescription {
|
|
42
|
-
height: 54px;
|
|
43
|
-
margin-top: 27px;
|
|
44
|
-
margin-bottom: 9px;
|
|
45
|
-
font-size: 13px;
|
|
46
|
-
font-weight: 400;
|
|
47
|
-
|
|
48
|
-
> span:last-child {
|
|
49
|
-
color: #1c5de7;
|
|
50
|
-
}
|
|
51
|
-
-webkit-font-smoothing: antialiased;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.cardFooter {
|
|
55
|
-
position: absolute;
|
|
56
|
-
bottom: 0;
|
|
57
|
-
left: 0;
|
|
58
|
-
display: flex;
|
|
59
|
-
width: 100%;
|
|
60
|
-
height: 45px;
|
|
61
|
-
padding: 0.9rem 1.5rem 1rem;
|
|
62
|
-
background-color: #fafafb;
|
|
63
|
-
justify-content: space-between;
|
|
64
|
-
flex-direction: row-reverse;
|
|
65
|
-
cursor: initial;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.compatible {
|
|
69
|
-
margin-top: 3px;
|
|
70
|
-
color: #5a9e06;
|
|
71
|
-
font-size: 1.3rem;
|
|
72
|
-
font-style: italic;
|
|
73
|
-
|
|
74
|
-
> i,
|
|
75
|
-
> svg {
|
|
76
|
-
margin-right: 7px;
|
|
77
|
-
font-size: 12px;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.settings {
|
|
82
|
-
margin-top: 3px;
|
|
83
|
-
color: #323740;
|
|
84
|
-
font-size: 1.3rem;
|
|
85
|
-
font-weight: 500;
|
|
86
|
-
cursor: pointer;
|
|
87
|
-
|
|
88
|
-
> i,
|
|
89
|
-
> svg {
|
|
90
|
-
margin-right: 7px;
|
|
91
|
-
font-size: 11px;
|
|
92
|
-
vertical-align: inherit;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.button {
|
|
97
|
-
height: 26px;
|
|
98
|
-
min-width: 89px !important;
|
|
99
|
-
padding: 0 15px;
|
|
100
|
-
margin: 0;
|
|
101
|
-
border-radius: 2px !important;
|
|
102
|
-
line-height: 23px;
|
|
103
|
-
font-size: 13px;
|
|
104
|
-
cursor: pointer;
|
|
105
|
-
span {
|
|
106
|
-
display: inline-block;
|
|
107
|
-
width: 100%;
|
|
108
|
-
height: 100%;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.frame {
|
|
113
|
-
width: 70px;
|
|
114
|
-
height: 36px;
|
|
115
|
-
margin: auto 0;
|
|
116
|
-
text-align: center;
|
|
117
|
-
border: 1px solid #f3f3f7;
|
|
118
|
-
border-radius: 3px;
|
|
119
|
-
white-space: nowrap;
|
|
120
|
-
> img {
|
|
121
|
-
max-height: 36px;
|
|
122
|
-
vertical-align: middle;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
.helper {
|
|
127
|
-
display: inline-block;
|
|
128
|
-
height: 100%;
|
|
129
|
-
vertical-align: middle;
|
|
130
|
-
}
|
|
131
|
-
.primary {
|
|
132
|
-
background: linear-gradient(315deg, #0097f6 0%, #005eea 100%);
|
|
133
|
-
color: white;
|
|
134
|
-
font-weight: 500;
|
|
135
|
-
-webkit-font-smoothing: antialiased;
|
|
136
|
-
|
|
137
|
-
&:active {
|
|
138
|
-
box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.15);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.secondary {
|
|
143
|
-
border: 1px solid #dfe0e1;
|
|
144
|
-
font-weight: 600;
|
|
145
|
-
}
|
|
146
|
-
`;
|
|
147
|
-
|
|
148
|
-
export default Wrapper;
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* PluginCard
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
/* eslint-disable */
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import PropTypes from 'prop-types';
|
|
9
|
-
import { FormattedMessage } from 'react-intl';
|
|
10
|
-
import { Button, PopUpWarning, CheckPermissions } from '@strapi/helper-plugin';
|
|
11
|
-
import adminPermissions from '../../../permissions';
|
|
12
|
-
import Wrapper from './Wrapper';
|
|
13
|
-
|
|
14
|
-
/* eslint-disable react/no-unused-state */
|
|
15
|
-
class PluginCard extends React.Component {
|
|
16
|
-
state = {
|
|
17
|
-
boostrapCol: 'col-lg-4',
|
|
18
|
-
showModalAutoReload: false,
|
|
19
|
-
showModalEnv: false,
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
componentDidMount() {
|
|
23
|
-
// Listen window resize.
|
|
24
|
-
window.addEventListener('resize', this.setBoostrapCol);
|
|
25
|
-
this.setBoostrapCol();
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
componentWillUnmount() {
|
|
29
|
-
window.removeEventListener('resize', this.setBoostrapCol);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
setBoostrapCol = () => {
|
|
33
|
-
let boostrapCol = 'col-lg-4';
|
|
34
|
-
|
|
35
|
-
if (window.innerWidth > 1680) {
|
|
36
|
-
boostrapCol = 'col-lg-3';
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (window.innerWidth > 2300) {
|
|
40
|
-
boostrapCol = 'col-lg-2';
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
this.setState({ boostrapCol });
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
handleDownloadPlugin = e => {
|
|
47
|
-
const {
|
|
48
|
-
autoReload,
|
|
49
|
-
currentEnvironment,
|
|
50
|
-
downloadPlugin,
|
|
51
|
-
history: { push },
|
|
52
|
-
isAlreadyInstalled,
|
|
53
|
-
plugin: { id },
|
|
54
|
-
} = this.props;
|
|
55
|
-
|
|
56
|
-
if (!autoReload) {
|
|
57
|
-
this.setState({ showModalAutoReload: true });
|
|
58
|
-
} else if (currentEnvironment !== 'development') {
|
|
59
|
-
this.setState({ showModalEnv: true });
|
|
60
|
-
} else if (!isAlreadyInstalled) {
|
|
61
|
-
downloadPlugin(id);
|
|
62
|
-
} else {
|
|
63
|
-
push('/list-plugins');
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
render() {
|
|
68
|
-
const buttonClass = !this.props.isAlreadyInstalled ? 'primary' : 'secondary';
|
|
69
|
-
const buttonLabel = this.props.isAlreadyInstalled
|
|
70
|
-
? 'app.components.PluginCard.Button.label.install'
|
|
71
|
-
: 'app.components.PluginCard.Button.label.download';
|
|
72
|
-
|
|
73
|
-
const settingsComponent = null;
|
|
74
|
-
|
|
75
|
-
const descriptions = {
|
|
76
|
-
short:
|
|
77
|
-
this.props.plugin.id === 'support-us' ? (
|
|
78
|
-
<FormattedMessage id={this.props.plugin.description.short} />
|
|
79
|
-
) : (
|
|
80
|
-
this.props.plugin.description.short
|
|
81
|
-
),
|
|
82
|
-
long:
|
|
83
|
-
this.props.plugin.id === 'support-us' ? (
|
|
84
|
-
<FormattedMessage
|
|
85
|
-
id={this.props.plugin.description.long || this.props.plugin.description.short}
|
|
86
|
-
/>
|
|
87
|
-
) : (
|
|
88
|
-
this.props.plugin.description.long || this.props.plugin.description.short
|
|
89
|
-
),
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
return (
|
|
93
|
-
<Wrapper className={this.state.boostrapCol}>
|
|
94
|
-
<div className="wrapper">
|
|
95
|
-
<div className="cardTitle">
|
|
96
|
-
<div className="frame">
|
|
97
|
-
<span className="helper" />
|
|
98
|
-
<img src={this.props.plugin.logo} alt="icon" />
|
|
99
|
-
</div>
|
|
100
|
-
<div
|
|
101
|
-
onClick={e => {
|
|
102
|
-
// FIXME: dead link as we are changing the naming. Would be better to use a url comming from the api call directly
|
|
103
|
-
window.open(
|
|
104
|
-
`https://github.com/strapi/strapi/tree/master/packages/strapi-plugin-${this.props.plugin.id}`,
|
|
105
|
-
'_blank'
|
|
106
|
-
);
|
|
107
|
-
}}
|
|
108
|
-
>
|
|
109
|
-
{this.props.plugin.name} <i className="fa fa-external-link-alt" />
|
|
110
|
-
</div>
|
|
111
|
-
</div>
|
|
112
|
-
<div className="cardDescription">{descriptions.long}</div>
|
|
113
|
-
<div className="cardFooter" onClick={e => e.stopPropagation()}>
|
|
114
|
-
<div className="cardFooterButton">
|
|
115
|
-
<CheckPermissions permissions={adminPermissions.marketplace.install}>
|
|
116
|
-
<Button
|
|
117
|
-
className={`${buttonClass} button`}
|
|
118
|
-
label={buttonLabel}
|
|
119
|
-
type="button"
|
|
120
|
-
onClick={this.handleDownloadPlugin}
|
|
121
|
-
/>
|
|
122
|
-
</CheckPermissions>
|
|
123
|
-
</div>
|
|
124
|
-
{this.props.isAlreadyInstalled ? (
|
|
125
|
-
settingsComponent
|
|
126
|
-
) : (
|
|
127
|
-
<div className="compatible">
|
|
128
|
-
<i className={`fa fa-${this.props.plugin.isCompatible ? 'check' : 'times'}`} />
|
|
129
|
-
<FormattedMessage
|
|
130
|
-
id={`app.components.PluginCard.compatible${
|
|
131
|
-
this.props.plugin.id === 'support-us' ? 'Community' : ''
|
|
132
|
-
}`}
|
|
133
|
-
/>
|
|
134
|
-
</div>
|
|
135
|
-
)}
|
|
136
|
-
</div>
|
|
137
|
-
</div>
|
|
138
|
-
|
|
139
|
-
<PopUpWarning
|
|
140
|
-
content={{
|
|
141
|
-
message: 'app.components.PluginCard.PopUpWarning.install.impossible.autoReload.needed',
|
|
142
|
-
title: 'app.components.PluginCard.PopUpWarning.install.impossible.title',
|
|
143
|
-
confirm: 'app.components.PluginCard.PopUpWarning.install.impossible.confirm',
|
|
144
|
-
}}
|
|
145
|
-
isOpen={this.state.showModalAutoReload}
|
|
146
|
-
onlyConfirmButton
|
|
147
|
-
onConfirm={() => this.setState({ showModalAutoReload: false })}
|
|
148
|
-
popUpWarningType="warning"
|
|
149
|
-
/>
|
|
150
|
-
<PopUpWarning
|
|
151
|
-
content={{
|
|
152
|
-
message: 'app.components.PluginCard.PopUpWarning.install.impossible.environment',
|
|
153
|
-
title: 'app.components.PluginCard.PopUpWarning.install.impossible.title',
|
|
154
|
-
confirm: 'app.components.PluginCard.PopUpWarning.install.impossible.confirm',
|
|
155
|
-
}}
|
|
156
|
-
isOpen={this.state.showModalEnv}
|
|
157
|
-
onlyConfirmButton
|
|
158
|
-
onConfirm={() => this.setState({ showModalEnv: false })}
|
|
159
|
-
popUpWarningType="warning"
|
|
160
|
-
/>
|
|
161
|
-
</Wrapper>
|
|
162
|
-
);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
PluginCard.defaultProps = {
|
|
167
|
-
isAlreadyInstalled: false,
|
|
168
|
-
plugin: {
|
|
169
|
-
description: '',
|
|
170
|
-
id: '',
|
|
171
|
-
name: '',
|
|
172
|
-
price: 0,
|
|
173
|
-
ratings: 5,
|
|
174
|
-
},
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
PluginCard.propTypes = {
|
|
178
|
-
currentEnvironment: PropTypes.string.isRequired,
|
|
179
|
-
downloadPlugin: PropTypes.func.isRequired,
|
|
180
|
-
history: PropTypes.object.isRequired,
|
|
181
|
-
isAlreadyInstalled: PropTypes.bool,
|
|
182
|
-
plugin: PropTypes.object,
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
export default PluginCard;
|
|
Binary file
|
|
Binary file
|