@strapi/admin 4.3.0-beta.1 → 4.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/admin/src/components/LeftMenu/index.js +12 -2
- package/admin/src/components/OverlayBlocker/index.js +4 -0
- package/admin/src/content-manager/components/DynamicTable/CellContent/utils/hasContent.js +1 -1
- package/admin/src/content-manager/components/EditViewDataManagerProvider/index.js +10 -15
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/cleanData.js +1 -8
- package/admin/src/content-manager/components/PreviewWysiwyg/Wrapper.js +7 -13
- package/admin/src/content-manager/components/SelectOne/SingleValue.js +3 -1
- package/admin/src/content-manager/components/SelectOne/index.js +1 -4
- package/admin/src/content-manager/components/SelectWrapper/Option.js +21 -21
- package/admin/src/content-manager/components/Wysiwyg/EditorStylesContainer.js +1 -1
- package/admin/src/content-manager/hooks/useFetchContentTypeLayout/index.js +2 -2
- package/admin/src/content-manager/pages/EditSettingsView/components/ModalForm.js +2 -2
- package/admin/src/content-manager/pages/ListView/FieldPicker/index.js +9 -1
- package/admin/src/content-manager/pages/ListView/index.js +2 -2
- package/admin/src/content-manager/utils/removeKeyInObject.js +0 -4
- package/admin/src/hooks/{useFetchInstalledPlugins → useFetchEnabledPlugins}/index.js +4 -4
- package/admin/src/hooks/{useFetchInstalledPlugins → useFetchEnabledPlugins}/utils/api.js +2 -2
- package/admin/src/index.js +1 -1
- package/admin/src/pages/Admin/index.js +6 -2
- package/admin/src/pages/App/index.js +4 -0
- package/admin/src/pages/InstalledPluginsPage/Plugins.js +12 -4
- package/admin/src/pages/MarketplacePage/components/NpmPackageCard/index.js +7 -8
- package/admin/src/pages/MarketplacePage/components/NpmPackagesGrid/index.js +8 -2
- package/admin/src/pages/MarketplacePage/index.js +9 -39
- package/admin/src/pages/ProfilePage/index.js +19 -18
- package/admin/src/pages/SettingsPage/pages/Users/EditPage/utils/layout.js +3 -1
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/DynamicTable/TableRows/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/utils/tableHeaders.js +18 -4
- package/admin/src/pages/SettingsPage/pages/Users/components/SelectRoles/index.js +4 -1
- package/admin/src/translations/en.json +38 -0
- package/admin/src/translations/gu.json +618 -0
- package/admin/src/translations/hi.json +699 -0
- package/admin/src/translations/languageNativeNames.js +4 -0
- package/admin/src/translations/ml.json +699 -0
- package/admin/src/translations/pl.json +238 -233
- package/admin/src/translations/sa.json +698 -0
- package/admin/src/translations/zh-Hans.json +83 -9
- package/ee/admin/pages/SettingsPage/pages/Roles/CreatePage/index.js +3 -3
- package/package.json +42 -33
- package/server/controllers/admin.js +2 -0
- package/webpack.alias.js +31 -21
- package/webpack.config.js +8 -6
- package/admin/src/pages/MarketplacePage/utils/api.js +0 -9
- package/build/15026a3d58aeb2828134.png +0 -0
- package/build/1551f4f60c37af51121f.woff2 +0 -0
- package/build/1820.ca954075.chunk.js +0 -503
- package/build/1856.6a94980b.chunk.js +0 -172
- package/build/1e59d2330b4c6deb84b3.ttf +0 -0
- package/build/20.9e5a98b6.chunk.js +0 -308
- package/build/2077.5456ccd1.chunk.js +0 -194
- package/build/20fd1704ea223900efa9.woff2 +0 -0
- package/build/2285773e6b4b172f07d9.woff +0 -0
- package/build/23f19bb08961f37aaf69.eot +0 -0
- package/build/2f517e09eb2ca6650ff5.svg +0 -3717
- package/build/3531.231e0eb6.chunk.js +0 -10
- package/build/4073.e144a91a.chunk.js +0 -1
- package/build/413.d5986568.chunk.js +0 -284
- package/build/4689f52cc96215721344.svg +0 -801
- package/build/4715.4588fdf5.chunk.js +0 -385
- package/build/472.d43be8bb.chunk.js +0 -338
- package/build/4800.d3ebc81d.chunk.js +0 -1
- package/build/491974d108fe4002b2aa.ttf +0 -0
- package/build/5250.24040688.chunk.js +0 -11
- package/build/527940b104eb2ea366c8.ttf +0 -0
- package/build/6229.53b33cf0.chunk.js +0 -194
- package/build/6925.fafef528.chunk.js +0 -761
- package/build/7418.6db737ce.chunk.js +0 -112
- package/build/77206a6bb316fa0aded5.eot +0 -0
- package/build/7a3337626410ca2f4071.woff2 +0 -0
- package/build/7a8b4f130182d19a2d7c.svg +0 -5034
- package/build/8469.3af1823d.chunk.js +0 -1
- package/build/8773.54a26ded.chunk.js +0 -327
- package/build/8b43027f47b20503057d.eot +0 -0
- package/build/9066.2847fdff.chunk.js +0 -101
- package/build/90f49a385afb000fb1d4.svg +0 -5
- package/build/9262.25aa12a5.chunk.js +0 -1
- package/build/9420.ba035f29.chunk.js +0 -508
- package/build/9bbb245e67a133f6e486.eot +0 -0
- package/build/Admin-authenticatedApp.52f3c150.chunk.js +0 -80
- package/build/Admin_homePage.0ac648e8.chunk.js +0 -71
- package/build/Admin_marketplace.71c66b49.chunk.js +0 -11
- package/build/Admin_pluginsPage.788fb2f6.chunk.js +0 -1
- package/build/Admin_profilePage.27191ed2.chunk.js +0 -15
- package/build/Admin_settingsPage.021da806.chunk.js +0 -178
- package/build/a6b842e0b6d2b61135d1.svg +0 -5
- package/build/admin-edit-roles-page.fb374555.chunk.js +0 -1
- package/build/admin-edit-users.a360deaf.chunk.js +0 -10
- package/build/admin-users.47d06d24.chunk.js +0 -11
- package/build/api-tokens-create-page.698f132d.chunk.js +0 -1
- package/build/api-tokens-edit-page.afece2fe.chunk.js +0 -1
- package/build/api-tokens-list-page.46d96dee.chunk.js +0 -15
- package/build/ar-json.d4cb26d9.chunk.js +0 -1
- package/build/b997a22a2e0b87ef1fa2.ico +0 -0
- package/build/bb58e57c48a3e911f15f.woff +0 -0
- package/build/bd81ba6c07827282255d.png +0 -0
- package/build/be9ee23c0c6390141475.ttf +0 -0
- package/build/c1e38fd9e0e74ba58f7a.svg +0 -2671
- package/build/c3de6118ef47086ad05c.png +0 -0
- package/build/ca-json.0097e443.chunk.js +0 -1
- package/build/codemirror-addon-closebrackets.c0f97916.chunk.js +0 -2
- package/build/codemirror-addon-lint-js.7c35dcb0.chunk.js +0 -1
- package/build/codemirror-addon-lint.505ff1d4.chunk.js +0 -1
- package/build/codemirror-addon-mark-selection.653e904d.chunk.js +0 -1
- package/build/codemirror-css.b467b1de.chunk.js +0 -346
- package/build/codemirror-javacript.41bdefda.chunk.js +0 -1
- package/build/codemirror-theme.cf9f9eb6.chunk.js +0 -34
- package/build/content-manager.afcc3624.chunk.js +0 -1182
- package/build/content-type-builder-translation-ar-json.142327af.chunk.js +0 -1
- package/build/content-type-builder-translation-cs-json.4aafb972.chunk.js +0 -1
- package/build/content-type-builder-translation-de-json.0d7696b9.chunk.js +0 -1
- package/build/content-type-builder-translation-dk-json.4729f055.chunk.js +0 -1
- package/build/content-type-builder-translation-en-json.e5110288.chunk.js +0 -1
- package/build/content-type-builder-translation-es-json.333cf47f.chunk.js +0 -1
- package/build/content-type-builder-translation-fr-json.aa6eeea8.chunk.js +0 -1
- package/build/content-type-builder-translation-id-json.7c00a32a.chunk.js +0 -1
- package/build/content-type-builder-translation-it-json.a906b389.chunk.js +0 -1
- package/build/content-type-builder-translation-ja-json.87f71930.chunk.js +0 -1
- package/build/content-type-builder-translation-ko-json.51201b12.chunk.js +0 -1
- package/build/content-type-builder-translation-ms-json.963a1a01.chunk.js +0 -1
- package/build/content-type-builder-translation-nl-json.c46c8f30.chunk.js +0 -1
- package/build/content-type-builder-translation-pl-json.a866acda.chunk.js +0 -1
- package/build/content-type-builder-translation-pt-BR-json.5739a2aa.chunk.js +0 -1
- package/build/content-type-builder-translation-pt-json.766bd747.chunk.js +0 -1
- package/build/content-type-builder-translation-ru-json.cf8d7c5c.chunk.js +0 -1
- package/build/content-type-builder-translation-sk-json.3a6defe0.chunk.js +0 -1
- package/build/content-type-builder-translation-th-json.c96a2d3f.chunk.js +0 -1
- package/build/content-type-builder-translation-tr-json.2e52bc60.chunk.js +0 -1
- package/build/content-type-builder-translation-uk-json.d8c0b6dd.chunk.js +0 -1
- package/build/content-type-builder-translation-zh-Hans-json.92a27f59.chunk.js +0 -1
- package/build/content-type-builder-translation-zh-json.2cc55621.chunk.js +0 -1
- package/build/content-type-builder.e73879b9.chunk.js +0 -141
- package/build/cropper-css.ecc0d670.chunk.js +0 -306
- package/build/cs-json.c8f28ba8.chunk.js +0 -1
- package/build/d878b0a6a1144760244f.woff2 +0 -0
- package/build/de-json.0b92acd2.chunk.js +0 -1
- package/build/dk-json.9f1bc016.chunk.js +0 -1
- package/build/eeccf4f66002c6f2ba24.woff +0 -0
- package/build/email-settings-page.8871dfe8.chunk.js +0 -103
- package/build/email-translation-ar-json.c624512d.chunk.js +0 -1
- package/build/email-translation-cs-json.cb18caab.chunk.js +0 -1
- package/build/email-translation-de-json.54743260.chunk.js +0 -1
- package/build/email-translation-dk-json.f323fe4e.chunk.js +0 -1
- package/build/email-translation-en-json.6da7e388.chunk.js +0 -1
- package/build/email-translation-es-json.9021417d.chunk.js +0 -1
- package/build/email-translation-fr-json.9f125db0.chunk.js +0 -1
- package/build/email-translation-id-json.3bcae5f5.chunk.js +0 -1
- package/build/email-translation-it-json.6ffd1774.chunk.js +0 -1
- package/build/email-translation-ja-json.72b3f73c.chunk.js +0 -1
- package/build/email-translation-ko-json.e61d4e7a.chunk.js +0 -1
- package/build/email-translation-ms-json.b2b11e05.chunk.js +0 -1
- package/build/email-translation-nl-json.5349635f.chunk.js +0 -1
- package/build/email-translation-pl-json.6da50d0f.chunk.js +0 -1
- package/build/email-translation-pt-BR-json.2c98ab20.chunk.js +0 -1
- package/build/email-translation-pt-json.959ea070.chunk.js +0 -1
- package/build/email-translation-ru-json.d508cf3e.chunk.js +0 -1
- package/build/email-translation-sk-json.fa1fd4b3.chunk.js +0 -1
- package/build/email-translation-th-json.989cfecc.chunk.js +0 -1
- package/build/email-translation-tr-json.87f2feb3.chunk.js +0 -1
- package/build/email-translation-uk-json.0396a803.chunk.js +0 -1
- package/build/email-translation-vi-json.c0d8c414.chunk.js +0 -1
- package/build/email-translation-zh-Hans-json.b463cb25.chunk.js +0 -1
- package/build/email-translation-zh-json.3455468b.chunk.js +0 -1
- package/build/en-json.0a5ba154.chunk.js +0 -1
- package/build/es-json.2a5a9fc1.chunk.js +0 -1
- package/build/f691f37e57f04c152e23.woff +0 -0
- package/build/fb376b132d18bf4522ca.png +0 -0
- package/build/fde9b1ad0670d29a2516.png +0 -0
- package/build/fontawesome-css-all.04f33619.chunk.js +0 -4618
- package/build/fontawesome-css.477ba714.chunk.js +0 -6
- package/build/fontawesome-js.252cc5f3.chunk.js +0 -7
- package/build/fr-json.84064a0b.chunk.js +0 -1
- package/build/he-json.d40da459.chunk.js +0 -1
- package/build/highlight.js.3381ffc3.chunk.js +0 -86
- package/build/hu-json.c81ce352.chunk.js +0 -1
- package/build/i18n-settings-page.dfb4eb01.chunk.js +0 -101
- package/build/i18n-translation-de-json.92534555.chunk.js +0 -1
- package/build/i18n-translation-dk-json.54f410ca.chunk.js +0 -1
- package/build/i18n-translation-en-json.85bc892c.chunk.js +0 -1
- package/build/i18n-translation-es-json.488206ae.chunk.js +0 -1
- package/build/i18n-translation-fr-json.0839d68d.chunk.js +0 -1
- package/build/i18n-translation-ko-json.d0bc1203.chunk.js +0 -1
- package/build/i18n-translation-zh-Hans-json.560a98e3.chunk.js +0 -1
- package/build/id-json.fad45d17.chunk.js +0 -1
- package/build/index.html +0 -1
- package/build/it-json.12df4cdf.chunk.js +0 -1
- package/build/ja-json.850237e9.chunk.js +0 -1
- package/build/ko-json.2f3d256e.chunk.js +0 -1
- package/build/main.ca3856ed.js +0 -8640
- package/build/ms-json.836ed013.chunk.js +0 -1
- package/build/nl-json.465b173f.chunk.js +0 -1
- package/build/no-json.e8749dd4.chunk.js +0 -1
- package/build/pl-json.f65302c2.chunk.js +0 -1
- package/build/pt-BR-json.6301d49b.chunk.js +0 -1
- package/build/pt-json.c23020ab.chunk.js +0 -1
- package/build/ru-json.28147733.chunk.js +0 -1
- package/build/runtime~main.48a46dd2.js +0 -2
- package/build/sk-json.5b33afc2.chunk.js +0 -1
- package/build/sso-settings-page.dfb0b917.chunk.js +0 -1
- package/build/sv-json.cdcac02d.chunk.js +0 -1
- package/build/th-json.3aadaec6.chunk.js +0 -1
- package/build/tr-json.276e59fe.chunk.js +0 -1
- package/build/uk-json.5b5b9c27.chunk.js +0 -1
- package/build/upload-settings.8d8c672a.chunk.js +0 -101
- package/build/upload-translation-ca-json.79159984.chunk.js +0 -1
- package/build/upload-translation-de-json.745613c0.chunk.js +0 -1
- package/build/upload-translation-dk-json.cb25dcf0.chunk.js +0 -1
- package/build/upload-translation-en-json.e78688a0.chunk.js +0 -1
- package/build/upload-translation-es-json.1f344b53.chunk.js +0 -1
- package/build/upload-translation-fr-json.e21c0c7a.chunk.js +0 -1
- package/build/upload-translation-he-json.4ce77b7b.chunk.js +0 -1
- package/build/upload-translation-it-json.5ce11e0b.chunk.js +0 -1
- package/build/upload-translation-ja-json.22afae44.chunk.js +0 -1
- package/build/upload-translation-ko-json.9a2c21cb.chunk.js +0 -1
- package/build/upload-translation-ms-json.0605d6da.chunk.js +0 -1
- package/build/upload-translation-pl-json.e534b676.chunk.js +0 -1
- package/build/upload-translation-pt-BR-json.95686cfb.chunk.js +0 -1
- package/build/upload-translation-ru-json.37bd1546.chunk.js +0 -1
- package/build/upload-translation-sk-json.b03d4904.chunk.js +0 -1
- package/build/upload-translation-th-json.64dd70ce.chunk.js +0 -1
- package/build/upload-translation-uk-json.1328cb3e.chunk.js +0 -1
- package/build/upload-translation-zh-Hans-json.6832ff81.chunk.js +0 -1
- package/build/upload-translation-zh-json.ee8fba96.chunk.js +0 -1
- package/build/upload.5622b777.chunk.js +0 -7
- package/build/users-advanced-settings-page.4af9e241.chunk.js +0 -101
- package/build/users-email-settings-page.d69c0d87.chunk.js +0 -101
- package/build/users-permissions-translation-ar-json.e8123ed2.chunk.js +0 -1
- package/build/users-permissions-translation-cs-json.e6649c5f.chunk.js +0 -1
- package/build/users-permissions-translation-de-json.c3628843.chunk.js +0 -1
- package/build/users-permissions-translation-dk-json.fe39c74b.chunk.js +0 -1
- package/build/users-permissions-translation-en-json.3fe86528.chunk.js +0 -1
- package/build/users-permissions-translation-es-json.1bb9cde2.chunk.js +0 -1
- package/build/users-permissions-translation-fr-json.172aa69f.chunk.js +0 -1
- package/build/users-permissions-translation-id-json.5aadd143.chunk.js +0 -1
- package/build/users-permissions-translation-it-json.7d377480.chunk.js +0 -1
- package/build/users-permissions-translation-ja-json.4967badf.chunk.js +0 -1
- package/build/users-permissions-translation-ko-json.3be77775.chunk.js +0 -1
- package/build/users-permissions-translation-ms-json.ea8a2baf.chunk.js +0 -1
- package/build/users-permissions-translation-nl-json.d638c4ce.chunk.js +0 -1
- package/build/users-permissions-translation-pl-json.3c4fe81c.chunk.js +0 -1
- package/build/users-permissions-translation-pt-BR-json.f6791a86.chunk.js +0 -1
- package/build/users-permissions-translation-pt-json.38afed04.chunk.js +0 -1
- package/build/users-permissions-translation-ru-json.319d51ef.chunk.js +0 -1
- package/build/users-permissions-translation-sk-json.ba1cd385.chunk.js +0 -1
- package/build/users-permissions-translation-sv-json.83c60841.chunk.js +0 -1
- package/build/users-permissions-translation-th-json.68873214.chunk.js +0 -1
- package/build/users-permissions-translation-tr-json.cdc49a3c.chunk.js +0 -1
- package/build/users-permissions-translation-uk-json.63eaa01c.chunk.js +0 -1
- package/build/users-permissions-translation-vi-json.dccc02fc.chunk.js +0 -1
- package/build/users-permissions-translation-zh-Hans-json.c3fd301b.chunk.js +0 -1
- package/build/users-permissions-translation-zh-json.e03ae2a4.chunk.js +0 -1
- package/build/users-providers-settings-page.fc1fda6d.chunk.js +0 -101
- package/build/users-roles-settings-page.988ebc3b.chunk.js +0 -30
- package/build/vi-json.bf3424be.chunk.js +0 -1
- package/build/webhook-edit-page.a7ae6e3b.chunk.js +0 -23
- package/build/webhook-list-page.057f396c.chunk.js +0 -133
- package/build/zh-Hans-json.c84ce330.chunk.js +0 -1
- package/build/zh-json.96bf6019.chunk.js +0 -1
|
@@ -115,7 +115,12 @@ const LeftMenu = ({ generalSectionLinks, pluginsSectionLinks }) => {
|
|
|
115
115
|
</NavLink>
|
|
116
116
|
|
|
117
117
|
{pluginsSectionLinks.length > 0 ? (
|
|
118
|
-
<NavSection
|
|
118
|
+
<NavSection
|
|
119
|
+
label={formatMessage({
|
|
120
|
+
id: 'app.components.LeftMenu.plugins',
|
|
121
|
+
defaultMessage: 'Plugins',
|
|
122
|
+
})}
|
|
123
|
+
>
|
|
119
124
|
{pluginsSectionLinks.map(link => {
|
|
120
125
|
const Icon = link.icon;
|
|
121
126
|
|
|
@@ -129,7 +134,12 @@ const LeftMenu = ({ generalSectionLinks, pluginsSectionLinks }) => {
|
|
|
129
134
|
) : null}
|
|
130
135
|
|
|
131
136
|
{generalSectionLinks.length > 0 ? (
|
|
132
|
-
<NavSection
|
|
137
|
+
<NavSection
|
|
138
|
+
label={formatMessage({
|
|
139
|
+
id: 'app.components.LeftMenu.general',
|
|
140
|
+
defaultMessage: 'General',
|
|
141
|
+
})}
|
|
142
|
+
>
|
|
133
143
|
{generalSectionLinks.map(link => {
|
|
134
144
|
const LinkIcon = link.icon;
|
|
135
145
|
|
|
@@ -233,9 +233,14 @@ const EditViewDataManagerProvider = ({
|
|
|
233
233
|
({ target: { name, value, type } }, shouldSetInitialValue = false) => {
|
|
234
234
|
let inputValue = value;
|
|
235
235
|
|
|
236
|
-
//
|
|
237
|
-
|
|
238
|
-
|
|
236
|
+
// Allow to reset text, textarea, email, uid, select/enum, and number
|
|
237
|
+
if (
|
|
238
|
+
['text', 'textarea', 'string', 'email', 'uid', 'select', 'select-one', 'number'].includes(
|
|
239
|
+
type
|
|
240
|
+
) &&
|
|
241
|
+
!value &&
|
|
242
|
+
value !== 0
|
|
243
|
+
) {
|
|
239
244
|
inputValue = null;
|
|
240
245
|
}
|
|
241
246
|
|
|
@@ -248,16 +253,6 @@ const EditViewDataManagerProvider = ({
|
|
|
248
253
|
return;
|
|
249
254
|
}
|
|
250
255
|
|
|
251
|
-
// Allow to reset enum
|
|
252
|
-
if (type === 'select-one' && value === '') {
|
|
253
|
-
inputValue = null;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
// Allow to reset number input
|
|
257
|
-
if (type === 'number' && value === '') {
|
|
258
|
-
inputValue = null;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
256
|
dispatch({
|
|
262
257
|
type: 'ON_CHANGE',
|
|
263
258
|
keys: name.split('.'),
|
|
@@ -316,7 +311,7 @@ const EditViewDataManagerProvider = ({
|
|
|
316
311
|
} catch (err) {
|
|
317
312
|
errors = {
|
|
318
313
|
...errors,
|
|
319
|
-
...getAPIInnerErrors(err),
|
|
314
|
+
...getAPIInnerErrors(err, { getTrad }),
|
|
320
315
|
};
|
|
321
316
|
}
|
|
322
317
|
|
|
@@ -352,7 +347,7 @@ const EditViewDataManagerProvider = ({
|
|
|
352
347
|
} catch (err) {
|
|
353
348
|
errors = {
|
|
354
349
|
...errors,
|
|
355
|
-
...getAPIInnerErrors(err),
|
|
350
|
+
...getAPIInnerErrors(err, { getTrad }),
|
|
356
351
|
};
|
|
357
352
|
}
|
|
358
353
|
|
|
@@ -20,14 +20,6 @@ const cleanData = (retrievedData, currentSchema, componentsSchema) => {
|
|
|
20
20
|
case 'json':
|
|
21
21
|
cleanedData = JSON.parse(value);
|
|
22
22
|
break;
|
|
23
|
-
// TODO
|
|
24
|
-
// case 'date':
|
|
25
|
-
// cleanedData =
|
|
26
|
-
// value && value._isAMomentObject === true ? value.format('YYYY-MM-DD') : value;
|
|
27
|
-
// break;
|
|
28
|
-
// case 'datetime':
|
|
29
|
-
// cleanedData = value && value._isAMomentObject === true ? value.toISOString() : value;
|
|
30
|
-
// break;
|
|
31
23
|
case 'time': {
|
|
32
24
|
cleanedData = value;
|
|
33
25
|
|
|
@@ -57,6 +49,7 @@ const cleanData = (retrievedData, currentSchema, componentsSchema) => {
|
|
|
57
49
|
} else {
|
|
58
50
|
cleanedData = value ? recursiveCleanData(value, componentsSchema[component]) : value;
|
|
59
51
|
}
|
|
52
|
+
|
|
60
53
|
break;
|
|
61
54
|
case 'dynamiczone':
|
|
62
55
|
cleanedData = value.map(componentData => {
|
|
@@ -70,29 +70,23 @@ const Wrapper = styled.div`
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
table {
|
|
73
|
-
font-size: 13px;
|
|
74
73
|
thead {
|
|
75
|
-
background:
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
background: ${({ theme }) => theme.colors.neutral150};
|
|
75
|
+
|
|
76
|
+
th {
|
|
77
|
+
padding: ${({ theme }) => theme.spaces[4]};
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
tr {
|
|
81
|
-
border: 1px solid
|
|
81
|
+
border: 1px solid ${({ theme }) => theme.colors.neutral200};
|
|
82
82
|
}
|
|
83
83
|
th,
|
|
84
84
|
td {
|
|
85
|
-
padding:
|
|
86
|
-
border: 1px solid
|
|
85
|
+
padding: ${({ theme }) => theme.spaces[4]};
|
|
86
|
+
border: 1px solid ${({ theme }) => theme.colors.neutral200};
|
|
87
87
|
border-bottom: 0;
|
|
88
88
|
border-top: 0;
|
|
89
89
|
}
|
|
90
|
-
|
|
91
|
-
tbody {
|
|
92
|
-
tr {
|
|
93
|
-
height: 54px;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
90
|
}
|
|
97
91
|
|
|
98
92
|
pre,
|
|
@@ -12,10 +12,12 @@ import isEmpty from 'lodash/isEmpty';
|
|
|
12
12
|
import { getTrad } from '../../utils';
|
|
13
13
|
|
|
14
14
|
const StyledBullet = styled.div`
|
|
15
|
+
flex-shrink: 0;
|
|
15
16
|
width: ${pxToRem(6)};
|
|
16
17
|
height: ${pxToRem(6)};
|
|
17
18
|
margin-right: ${({ theme }) => theme.spaces[2]};
|
|
18
|
-
background: ${({ theme, isDraft }) =>
|
|
19
|
+
background-color: ${({ theme, isDraft }) =>
|
|
20
|
+
theme.colors[isDraft ? 'secondary600' : 'success600']};
|
|
19
21
|
border-radius: 50%;
|
|
20
22
|
cursor: pointer;
|
|
21
23
|
`;
|
|
@@ -5,7 +5,7 @@ import { Stack } from '@strapi/design-system/Stack';
|
|
|
5
5
|
import { Typography } from '@strapi/design-system/Typography';
|
|
6
6
|
import get from 'lodash/get';
|
|
7
7
|
import isNull from 'lodash/isNull';
|
|
8
|
-
import Select from '
|
|
8
|
+
import { ReactSelect as Select } from '@strapi/helper-plugin';
|
|
9
9
|
import SingleValue from './SingleValue';
|
|
10
10
|
|
|
11
11
|
function SelectOne({
|
|
@@ -21,7 +21,6 @@ function SelectOne({
|
|
|
21
21
|
onMenuScrollToBottom,
|
|
22
22
|
options,
|
|
23
23
|
placeholder,
|
|
24
|
-
styles,
|
|
25
24
|
value,
|
|
26
25
|
description,
|
|
27
26
|
}) {
|
|
@@ -48,7 +47,6 @@ function SelectOne({
|
|
|
48
47
|
placeholder={formatMessage(
|
|
49
48
|
placeholder || { id: 'global.select', defaultMessage: 'Select...' }
|
|
50
49
|
)}
|
|
51
|
-
styles={styles}
|
|
52
50
|
value={isNull(value) ? null : { label: get(value, [mainField.name], ''), value }}
|
|
53
51
|
/>
|
|
54
52
|
|
|
@@ -89,7 +87,6 @@ SelectOne.propTypes = {
|
|
|
89
87
|
id: PropTypes.string.isRequired,
|
|
90
88
|
defaultMessage: PropTypes.string.isRequired,
|
|
91
89
|
}),
|
|
92
|
-
styles: PropTypes.object.isRequired,
|
|
93
90
|
value: PropTypes.object,
|
|
94
91
|
description: PropTypes.string,
|
|
95
92
|
};
|
|
@@ -10,10 +10,12 @@ import { pxToRem } from '@strapi/helper-plugin';
|
|
|
10
10
|
import { getTrad } from '../../utils';
|
|
11
11
|
|
|
12
12
|
const StyledBullet = styled.div`
|
|
13
|
+
flex-shrink: 0;
|
|
13
14
|
width: ${pxToRem(6)};
|
|
14
15
|
height: ${pxToRem(6)};
|
|
15
16
|
margin-right: ${({ theme }) => theme.spaces[2]};
|
|
16
|
-
background: ${({ theme, isDraft }) =>
|
|
17
|
+
background-color: ${({ theme, isDraft }) =>
|
|
18
|
+
theme.colors[isDraft ? 'secondary600' : 'success600']};
|
|
17
19
|
border-radius: 50%;
|
|
18
20
|
cursor: pointer;
|
|
19
21
|
`;
|
|
@@ -22,29 +24,27 @@ const Option = props => {
|
|
|
22
24
|
const { formatMessage } = useIntl();
|
|
23
25
|
const Component = components.Option;
|
|
24
26
|
const hasDraftAndPublish = has(get(props, 'data.value'), 'publishedAt');
|
|
25
|
-
const isDraft = isEmpty(get(props, 'data.value.publishedAt'));
|
|
26
27
|
|
|
27
28
|
if (hasDraftAndPublish) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
const isDraft = isEmpty(get(props, 'data.value.publishedAt'));
|
|
30
|
+
const draftMessage = {
|
|
31
|
+
id: getTrad('components.Select.draft-info-title'),
|
|
32
|
+
defaultMessage: 'State: Draft',
|
|
33
|
+
};
|
|
34
|
+
const publishedMessage = {
|
|
35
|
+
id: getTrad('components.Select.publish-info-title'),
|
|
36
|
+
defaultMessage: 'State: Published',
|
|
37
|
+
};
|
|
38
|
+
const title = isDraft ? formatMessage(draftMessage) : formatMessage(publishedMessage);
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
40
|
+
return (
|
|
41
|
+
<Component {...props}>
|
|
42
|
+
<Flex>
|
|
43
|
+
<StyledBullet title={title} isDraft={isDraft} />
|
|
44
|
+
<Typography ellipsis>{props.label || '-'}</Typography>
|
|
45
|
+
</Flex>
|
|
46
|
+
</Component>
|
|
47
|
+
);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
return <Component {...props}>{props.label || '-'}</Component>;
|
|
@@ -16,7 +16,7 @@ export const EditorStylesContainer = styled.div`
|
|
|
16
16
|
height: ${({ isExpandMode }) => (isExpandMode ? '100%' : '290px')};
|
|
17
17
|
color: ${({ theme }) => theme.colors.neutral800};
|
|
18
18
|
direction: ltr;
|
|
19
|
-
font-family:
|
|
19
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
|
|
20
20
|
'Open Sans', 'Helvetica Neue', sans-serif;
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -68,10 +68,10 @@ const useFetchContentTypeLayout = contentTypeUID => {
|
|
|
68
68
|
}, [contentTypeUID, getData]);
|
|
69
69
|
|
|
70
70
|
const updateLayout = useCallback(
|
|
71
|
-
|
|
71
|
+
data => {
|
|
72
72
|
dispatch({
|
|
73
73
|
type: 'UPDATE_LAYOUT',
|
|
74
|
-
newLayout: formatLayouts(
|
|
74
|
+
newLayout: formatLayouts(data, schemas),
|
|
75
75
|
});
|
|
76
76
|
},
|
|
77
77
|
[schemas]
|
|
@@ -59,8 +59,8 @@ const ModalForm = ({ onMetaChange, onSizeChange }) => {
|
|
|
59
59
|
const formType = get(attributes, [selectedField, 'type']);
|
|
60
60
|
|
|
61
61
|
if (
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
['component', 'dynamiczone'].includes(formType) &&
|
|
63
|
+
!['label', 'description'].includes(meta)
|
|
64
64
|
) {
|
|
65
65
|
return null;
|
|
66
66
|
}
|
|
@@ -8,6 +8,7 @@ import { useTracking } from '@strapi/helper-plugin';
|
|
|
8
8
|
import { onChangeListHeaders } from '../actions';
|
|
9
9
|
import { selectDisplayedHeaders } from '../selectors';
|
|
10
10
|
import getAllAllowedHeaders from './utils/getAllAllowedHeader';
|
|
11
|
+
import getTrad from '../../../utils/getTrad';
|
|
11
12
|
|
|
12
13
|
const FieldPicker = ({ layout }) => {
|
|
13
14
|
const dispatch = useDispatch();
|
|
@@ -50,7 +51,14 @@ const FieldPicker = ({ layout }) => {
|
|
|
50
51
|
aria-label="change displayed fields"
|
|
51
52
|
value={values}
|
|
52
53
|
onChange={handleChange}
|
|
53
|
-
customizeContent={values =>
|
|
54
|
+
customizeContent={values =>
|
|
55
|
+
formatMessage(
|
|
56
|
+
{
|
|
57
|
+
id: getTrad('select.currently.selected'),
|
|
58
|
+
defaultMessage: '{count} currently selected',
|
|
59
|
+
},
|
|
60
|
+
{ count: values.length }
|
|
61
|
+
)}
|
|
54
62
|
multi
|
|
55
63
|
size="S"
|
|
56
64
|
>
|
|
@@ -309,8 +309,8 @@ function ListView({
|
|
|
309
309
|
{ target: headerLayoutTitle }
|
|
310
310
|
)}
|
|
311
311
|
placeholder={formatMessage({
|
|
312
|
-
id: '
|
|
313
|
-
defaultMessage: 'Search
|
|
312
|
+
id: 'global.search',
|
|
313
|
+
defaultMessage: 'Search',
|
|
314
314
|
})}
|
|
315
315
|
trackedEvent="didSearch"
|
|
316
316
|
/>
|
|
@@ -21,10 +21,6 @@ const removeKeyInObject = (obj, keyToRemove) => {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
if (typeof value === 'object') {
|
|
24
|
-
if (value._isAMomentObject === true) {
|
|
25
|
-
return { ...acc, [current]: value };
|
|
26
|
-
}
|
|
27
|
-
|
|
28
24
|
if (Array.isArray(acc)) {
|
|
29
25
|
acc[current] = removeKeyInObject(value, keyToRemove);
|
|
30
26
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useQuery } from 'react-query';
|
|
2
2
|
import { useNotification } from '@strapi/helper-plugin';
|
|
3
|
-
import {
|
|
3
|
+
import { fetchEnabledPlugins } from './utils/api';
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const useFetchEnabledPlugins = notifyLoad => {
|
|
6
6
|
const toggleNotification = useNotification();
|
|
7
7
|
|
|
8
|
-
return useQuery('list-
|
|
8
|
+
return useQuery('list-enabled-plugins', () => fetchEnabledPlugins(), {
|
|
9
9
|
onSuccess: () => {
|
|
10
10
|
if (notifyLoad) {
|
|
11
11
|
notifyLoad();
|
|
@@ -20,4 +20,4 @@ const useFetchInstalledPlugins = notifyLoad => {
|
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
export default
|
|
23
|
+
export default useFetchEnabledPlugins;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { axiosInstance } from '../../../core/utils';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const fetchEnabledPlugins = async () => {
|
|
4
4
|
const { data } = await axiosInstance.get('/admin/plugins');
|
|
5
5
|
|
|
6
6
|
return data;
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
-
export {
|
|
9
|
+
export { fetchEnabledPlugins };
|
package/admin/src/index.js
CHANGED
|
@@ -48,7 +48,7 @@ const run = async () => {
|
|
|
48
48
|
|
|
49
49
|
// We need to make sure to fetch the project type before importing the StrapiApp
|
|
50
50
|
// otherwise the strapi-babel-plugin does not work correctly
|
|
51
|
-
const StrapiApp = await import('./StrapiApp');
|
|
51
|
+
const StrapiApp = await import(/* webpackChunkName: "admin-app" */ './StrapiApp');
|
|
52
52
|
|
|
53
53
|
const app = StrapiApp.default({
|
|
54
54
|
appPlugins: plugins,
|
|
@@ -28,8 +28,12 @@ const InstalledPluginsPage = lazy(() =>
|
|
|
28
28
|
const MarketplacePage = lazy(() =>
|
|
29
29
|
import(/* webpackChunkName: "Admin_marketplace" */ '../MarketplacePage')
|
|
30
30
|
);
|
|
31
|
-
const NotFoundPage = lazy(() =>
|
|
32
|
-
|
|
31
|
+
const NotFoundPage = lazy(() =>
|
|
32
|
+
import(/* webpackChunkName: "Admin_NotFoundPage" */ '../NotFoundPage')
|
|
33
|
+
);
|
|
34
|
+
const InternalErrorPage = lazy(() =>
|
|
35
|
+
import(/* webpackChunkName: "Admin_InternalErrorPage" */ '../InternalErrorPage')
|
|
36
|
+
);
|
|
33
37
|
|
|
34
38
|
const ProfilePage = lazy(() =>
|
|
35
39
|
import(/* webpackChunkName: "Admin_profilePage" */ '../ProfilePage')
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
useNotification,
|
|
14
14
|
TrackingContext,
|
|
15
15
|
prefixFileUrlWithBackendUrl,
|
|
16
|
+
useAppInfos,
|
|
16
17
|
} from '@strapi/helper-plugin';
|
|
17
18
|
import axios from 'axios';
|
|
18
19
|
import { SkipToContent } from '@strapi/design-system/Main';
|
|
@@ -35,6 +36,7 @@ function App() {
|
|
|
35
36
|
const { updateProjectSettings } = useConfigurations();
|
|
36
37
|
const { formatMessage } = useIntl();
|
|
37
38
|
const [{ isLoading, hasAdmin, uuid }, setState] = useState({ isLoading: true, hasAdmin: false });
|
|
39
|
+
const appInfo = useAppInfos();
|
|
38
40
|
|
|
39
41
|
const authRoutes = useMemo(() => {
|
|
40
42
|
return makeUniqueRoutes(
|
|
@@ -97,6 +99,7 @@ function App() {
|
|
|
97
99
|
deviceId,
|
|
98
100
|
properties: {
|
|
99
101
|
...properties,
|
|
102
|
+
environment: appInfo.currentEnvironment,
|
|
100
103
|
},
|
|
101
104
|
}),
|
|
102
105
|
headers: {
|
|
@@ -118,6 +121,7 @@ function App() {
|
|
|
118
121
|
};
|
|
119
122
|
|
|
120
123
|
getData();
|
|
124
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
121
125
|
}, [toggleNotification, updateProjectSettings]);
|
|
122
126
|
|
|
123
127
|
const setHasAdmin = hasAdmin => setState(prev => ({ ...prev, hasAdmin }));
|
|
@@ -6,7 +6,7 @@ import { Layout, HeaderLayout, ContentLayout } from '@strapi/design-system/Layou
|
|
|
6
6
|
import { Main } from '@strapi/design-system/Main';
|
|
7
7
|
import { Typography } from '@strapi/design-system/Typography';
|
|
8
8
|
import { Table, Thead, Tbody, Tr, Td, Th } from '@strapi/design-system/Table';
|
|
9
|
-
import
|
|
9
|
+
import useFetchEnabledPlugins from '../../hooks/useFetchEnabledPlugins';
|
|
10
10
|
|
|
11
11
|
const Plugins = () => {
|
|
12
12
|
const { formatMessage } = useIntl();
|
|
@@ -30,7 +30,7 @@ const Plugins = () => {
|
|
|
30
30
|
);
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
const { status, data } =
|
|
33
|
+
const { status, data } = useFetchEnabledPlugins(notifyPluginPageLoad);
|
|
34
34
|
|
|
35
35
|
const isLoading = status !== 'success' && status !== 'error';
|
|
36
36
|
|
|
@@ -82,11 +82,19 @@ const Plugins = () => {
|
|
|
82
82
|
<Tr key={name}>
|
|
83
83
|
<Td>
|
|
84
84
|
<Typography textColor="neutral800" variant="omega" fontWeight="bold">
|
|
85
|
-
{
|
|
85
|
+
{formatMessage({
|
|
86
|
+
id: `global.plugins.${name}`,
|
|
87
|
+
defaultMessage: displayName,
|
|
88
|
+
})}
|
|
86
89
|
</Typography>
|
|
87
90
|
</Td>
|
|
88
91
|
<Td>
|
|
89
|
-
<Typography textColor="neutral800">
|
|
92
|
+
<Typography textColor="neutral800">
|
|
93
|
+
{formatMessage({
|
|
94
|
+
id: `global.plugins.${name}.description`,
|
|
95
|
+
defaultMessage: description,
|
|
96
|
+
})}
|
|
97
|
+
</Typography>
|
|
90
98
|
</Td>
|
|
91
99
|
</Tr>
|
|
92
100
|
);
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { useIntl } from 'react-intl';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
|
+
import pluralize from 'pluralize';
|
|
5
6
|
import { Box } from '@strapi/design-system/Box';
|
|
6
7
|
import { Stack } from '@strapi/design-system/Stack';
|
|
7
8
|
import { Typography } from '@strapi/design-system/Typography';
|
|
@@ -27,7 +28,7 @@ const EllipsisText = styled(Typography)`
|
|
|
27
28
|
|
|
28
29
|
const NpmPackageCard = ({
|
|
29
30
|
npmPackage,
|
|
30
|
-
|
|
31
|
+
isInstalled,
|
|
31
32
|
useYarn,
|
|
32
33
|
isInDevelopmentMode,
|
|
33
34
|
npmPackageType,
|
|
@@ -36,8 +37,6 @@ const NpmPackageCard = ({
|
|
|
36
37
|
const { formatMessage } = useIntl();
|
|
37
38
|
const { trackUsage } = useTracking();
|
|
38
39
|
|
|
39
|
-
const isInstalled = installedPackageNames.includes(attributes.npmPackageName);
|
|
40
|
-
|
|
41
40
|
const commandToCopy = useYarn
|
|
42
41
|
? `yarn add ${attributes.npmPackageName}`
|
|
43
42
|
: `npm install ${attributes.npmPackageName}`;
|
|
@@ -47,10 +46,9 @@ const NpmPackageCard = ({
|
|
|
47
46
|
defaultMessage: 'Made by Strapi',
|
|
48
47
|
});
|
|
49
48
|
|
|
50
|
-
const npmPackageHref =
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
: `https://market.strapi.io/plugins/${attributes.slug}`;
|
|
49
|
+
const npmPackageHref = `https://market.strapi.io/${pluralize.plural(npmPackageType)}/${
|
|
50
|
+
attributes.slug
|
|
51
|
+
}`;
|
|
54
52
|
|
|
55
53
|
return (
|
|
56
54
|
<Flex
|
|
@@ -65,6 +63,7 @@ const NpmPackageCard = ({
|
|
|
65
63
|
shadow="tableShadow"
|
|
66
64
|
height="100%"
|
|
67
65
|
alignItems="normal"
|
|
66
|
+
data-testid="npm-package-card"
|
|
68
67
|
>
|
|
69
68
|
<Box>
|
|
70
69
|
<Box
|
|
@@ -167,7 +166,7 @@ NpmPackageCard.propTypes = {
|
|
|
167
166
|
strapiCompatibility: PropTypes.oneOf(['v3', 'v4']),
|
|
168
167
|
}).isRequired,
|
|
169
168
|
}).isRequired,
|
|
170
|
-
|
|
169
|
+
isInstalled: PropTypes.bool.isRequired,
|
|
171
170
|
useYarn: PropTypes.bool.isRequired,
|
|
172
171
|
isInDevelopmentMode: PropTypes.bool,
|
|
173
172
|
npmPackageType: PropTypes.string.isRequired,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { Grid, GridItem } from '@strapi/design-system/Grid';
|
|
4
4
|
import NpmPackageCard from '../NpmPackageCard';
|
|
@@ -10,13 +10,19 @@ const NpmPackagesGrid = ({
|
|
|
10
10
|
isInDevelopmentMode,
|
|
11
11
|
npmPackageType,
|
|
12
12
|
}) => {
|
|
13
|
+
// Check if an individual package is in the dependencies
|
|
14
|
+
const isAlreadyInstalled = useCallback(
|
|
15
|
+
npmPackageName => installedPackageNames.includes(npmPackageName),
|
|
16
|
+
[installedPackageNames]
|
|
17
|
+
);
|
|
18
|
+
|
|
13
19
|
return (
|
|
14
20
|
<Grid gap={4}>
|
|
15
21
|
{npmPackages.map(npmPackage => (
|
|
16
22
|
<GridItem col={4} s={6} xs={12} style={{ height: '100%' }} key={npmPackage.id}>
|
|
17
23
|
<NpmPackageCard
|
|
18
24
|
npmPackage={npmPackage}
|
|
19
|
-
|
|
25
|
+
isInstalled={isAlreadyInstalled(npmPackage.attributes.npmPackageName)}
|
|
20
26
|
useYarn={useYarn}
|
|
21
27
|
isInDevelopmentMode={isInDevelopmentMode}
|
|
22
28
|
npmPackageType={npmPackageType}
|