@strapi/admin 4.2.0-alpha.O → 4.2.0-beta.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/app.js +7 -4
- package/admin/src/assets/images/icon_made-by-strapi.svg +5 -0
- package/admin/src/assets/images/icon_offline-cloud.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 +1 -1
- package/admin/src/components/GuidedTour/Homepage/index.js +13 -3
- package/admin/src/components/GuidedTour/Modal/index.js +4 -1
- package/admin/src/components/GuidedTour/layout.js +9 -0
- package/admin/src/components/LeftMenu/index.js +2 -2
- package/admin/src/components/PrivateRoute/index.js +23 -17
- package/admin/src/content-manager/components/CollectionTypeFormWrapper/index.js +17 -3
- package/admin/src/content-manager/components/ComponentInitializer/index.js +9 -4
- package/admin/src/content-manager/components/DynamicTable/CellContent/RelationMultiple/index.js +135 -0
- package/admin/src/content-manager/components/DynamicTable/CellContent/RelationSingle/index.js +32 -0
- package/admin/src/content-manager/components/DynamicTable/CellContent/RepeatableComponent/index.js +62 -0
- package/admin/src/content-manager/components/DynamicTable/CellContent/SingleComponent/index.js +37 -0
- package/admin/src/content-manager/components/DynamicTable/CellContent/index.js +52 -27
- package/admin/src/content-manager/components/DynamicTable/CellContent/utils/hasContent.js +64 -0
- package/admin/src/content-manager/components/DynamicTable/CellContent/utils/isSingleRelation.js +3 -0
- package/admin/src/content-manager/components/DynamicTable/TableRows/index.js +1 -1
- package/admin/src/content-manager/components/DynamicZone/components/ComponentPicker/Category/index.js +4 -1
- package/admin/src/content-manager/components/EditViewDataManagerProvider/index.js +37 -37
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/getAPIInnerError.js +18 -0
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/handleAPIError.js +15 -0
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/index.js +0 -1
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/schema.js +9 -7
- package/admin/src/content-manager/components/FieldComponent/index.js +0 -1
- package/admin/src/content-manager/components/InputUID/index.js +1 -5
- package/admin/src/content-manager/components/Inputs/index.js +7 -10
- package/admin/src/content-manager/components/RepeatableComponent/AccordionGroupCustom/index.js +3 -1
- package/admin/src/content-manager/components/RepeatableComponent/index.js +3 -18
- package/admin/src/content-manager/components/RepeatableComponent/utils/getComponentErrorKeys.js +10 -0
- package/admin/src/content-manager/components/SelectMany/index.js +1 -1
- package/admin/src/content-manager/components/SelectOne/index.js +1 -1
- package/admin/src/content-manager/components/SelectWrapper/utils/getSelectStyles.js +2 -1
- package/admin/src/content-manager/components/SingleTypeFormWrapper/index.js +15 -3
- package/admin/src/content-manager/components/Wysiwyg/index.js +3 -4
- package/admin/src/content-manager/hooks/useFetchContentTypeLayout/utils/formatLayouts.js +23 -2
- package/admin/src/content-manager/pages/EditSettingsView/components/FieldButtonContent.js +1 -1
- package/admin/src/content-manager/pages/EditSettingsView/components/FormModal.js +1 -1
- package/admin/src/content-manager/pages/EditSettingsView/components/ModalForm.js +6 -1
- package/admin/src/content-manager/pages/EditSettingsView/index.js +3 -3
- package/admin/src/content-manager/pages/EditSettingsView/utils/layout.js +7 -1
- package/admin/src/content-manager/pages/EditView/DeleteLink/index.js +1 -4
- package/admin/src/content-manager/pages/EditView/DraftAndPublishBadge/index.js +1 -4
- package/admin/src/content-manager/pages/EditView/Header/index.js +1 -1
- package/admin/src/content-manager/pages/EditView/index.js +0 -188
- package/admin/src/content-manager/pages/ListSettingsView/components/EditFieldForm.js +1 -1
- package/admin/src/content-manager/pages/ListSettingsView/index.js +2 -2
- package/admin/src/content-manager/pages/ListView/actions.js +2 -1
- package/admin/src/content-manager/pages/ListView/index.js +2 -5
- package/admin/src/content-manager/pages/ListView/reducer.js +55 -21
- package/admin/src/content-manager/pages/ListView/selectors.js +3 -6
- package/admin/src/content-manager/pages/ListViewLayoutManager/index.js +1 -1
- package/admin/src/content-manager/testUtils/data.js +5 -1
- package/admin/src/content-manager/utils/checkIfAttributeIsDisplayable.js +1 -1
- package/admin/src/content-manager/utils/isFieldTypeNumber.js +3 -0
- 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/useMenu/reducer.js +3 -3
- package/admin/src/hooks/useNavigatorOnLine/index.js +31 -0
- package/admin/src/hooks/useReleaseNotification/index.js +1 -1
- package/admin/src/hooks/useSettingsMenu/init.js +2 -2
- package/admin/src/layouts/UnauthenticatedLayout/index.js +1 -1
- package/admin/src/pages/Admin/Onboarding/index.js +1 -1
- package/admin/src/pages/Admin/index.js +16 -8
- package/admin/src/pages/App/constants.js +1 -0
- package/admin/src/pages/App/index.js +17 -3
- package/admin/src/pages/App/reducer.js +22 -0
- package/admin/src/pages/AuthPage/components/Login/BaseLogin.js +1 -1
- package/admin/src/pages/AuthPage/components/Register/index.js +6 -6
- package/admin/src/pages/AuthPage/components/ResetPassword/index.js +3 -3
- package/admin/src/pages/AuthPage/index.js +28 -5
- package/admin/src/pages/HomePage/ContentBlocks.js +1 -1
- package/admin/src/pages/HomePage/SocialLinks.js +1 -4
- package/admin/src/pages/InstalledPluginsPage/Plugins.js +9 -18
- package/admin/src/pages/InstalledPluginsPage/index.js +1 -1
- 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/MissingPluginBanner/index.js +40 -0
- package/admin/src/pages/MarketplacePage/components/PageHeader/index.js +46 -0
- package/admin/src/pages/MarketplacePage/components/PluginCard/InstallPluginButton.js +66 -0
- package/admin/src/pages/MarketplacePage/components/PluginCard/index.js +163 -0
- package/admin/src/pages/MarketplacePage/index.js +231 -101
- 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 +1 -1
- package/admin/src/pages/SettingsPage/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/LoadingView/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/index.js +3 -3
- package/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/DynamicTable/DeleteButton/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/ConditionsButton/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/RoleForm/index.js +3 -3
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/index.js +2 -2
- package/admin/src/pages/SettingsPage/pages/Roles/ListPage/index.js +6 -6
- package/admin/src/pages/SettingsPage/pages/Users/EditPage/index.js +5 -5
- package/admin/src/pages/SettingsPage/pages/Users/EditPage/utils/layout.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/DynamicTable/TableRows/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/ModalForm/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/ModalForm/utils/stepper.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/WebhookForm/index.js +3 -3
- package/admin/src/pages/SettingsPage/pages/Webhooks/ListView/index.js +7 -7
- package/admin/src/pages/UseCasePage/index.js +2 -2
- package/admin/src/reducers.js +4 -2
- package/admin/src/translations/ar.json +0 -6
- package/admin/src/translations/ca.json +699 -0
- package/admin/src/translations/cs.json +0 -8
- package/admin/src/translations/de.json +244 -49
- package/admin/src/translations/dk.json +0 -53
- package/admin/src/translations/en.json +85 -94
- package/admin/src/translations/es.json +0 -53
- package/admin/src/translations/fr.json +0 -56
- package/admin/src/translations/he.json +0 -24
- package/admin/src/translations/hu.json +0 -53
- package/admin/src/translations/id.json +0 -21
- package/admin/src/translations/it.json +0 -22
- package/admin/src/translations/ja.json +2 -55
- package/admin/src/translations/ko.json +2 -58
- package/admin/src/translations/languageNativeNames.js +1 -0
- package/admin/src/translations/ms.json +0 -12
- package/admin/src/translations/nl.json +0 -53
- package/admin/src/translations/no.json +0 -22
- package/admin/src/translations/pl.json +0 -26
- package/admin/src/translations/pt-BR.json +0 -53
- package/admin/src/translations/pt.json +0 -13
- package/admin/src/translations/ru.json +34 -25
- package/admin/src/translations/sk.json +0 -21
- package/admin/src/translations/sv.json +0 -6
- package/admin/src/translations/th.json +0 -21
- package/admin/src/translations/tr.json +0 -13
- package/admin/src/translations/uk.json +0 -12
- package/admin/src/translations/vi.json +28 -11
- package/admin/src/translations/zh-Hans.json +0 -53
- package/admin/src/translations/zh.json +0 -56
- package/admin/src/tsconfig.json +10 -0
- package/build/1856.521a99fd.chunk.js +172 -0
- package/build/20.cf744c35.chunk.js +308 -0
- package/build/2077.51485bfb.chunk.js +194 -0
- package/build/2135.95ee6de1.chunk.js +162 -0
- package/build/2524.688d0355.chunk.js +1 -0
- package/build/2897.8e7d5853.chunk.js +184 -0
- package/build/2912.79c2b3c8.chunk.js +253 -0
- package/build/4073.f3936352.chunk.js +1 -0
- package/build/4715.77e04177.chunk.js +385 -0
- package/build/5232.928fea74.chunk.js +989 -0
- package/build/6229.26d93336.chunk.js +194 -0
- package/build/6281.f10a7e3a.chunk.js +1 -0
- package/build/6404.80bf5858.chunk.js +506 -0
- package/build/6925.fafef528.chunk.js +761 -0
- package/build/7009.79fce86d.chunk.js +164 -0
- package/build/7191.3bde3cbf.chunk.js +335 -0
- package/build/7393.8ae60738.chunk.js +336 -0
- package/build/7841.f0e7d629.chunk.js +253 -0
- package/build/7863.c1938f3f.chunk.js +112 -0
- package/build/8469.3af1823d.chunk.js +1 -0
- package/build/9066.118ecccd.chunk.js +101 -0
- package/build/90f49a385afb000fb1d4.svg +5 -0
- package/build/Admin-authenticatedApp.1f76af8f.chunk.js +80 -0
- package/build/Admin_homePage.8b391120.chunk.js +71 -0
- package/build/Admin_marketplace.21730109.chunk.js +11 -0
- package/build/Admin_pluginsPage.788fb2f6.chunk.js +1 -0
- package/build/Admin_profilePage.62c203ad.chunk.js +15 -0
- package/build/Admin_settingsPage.9ce20f16.chunk.js +170 -0
- package/build/a6b842e0b6d2b61135d1.svg +5 -0
- package/build/admin-edit-roles-page.75380ed4.chunk.js +1 -0
- package/build/admin-edit-users.05f7f389.chunk.js +10 -0
- package/build/admin-users.e03db115.chunk.js +11 -0
- package/build/api-tokens-create-page.c44e0c62.chunk.js +1 -0
- package/build/api-tokens-edit-page.30d0924d.chunk.js +1 -0
- package/build/api-tokens-list-page.6049cd23.chunk.js +15 -0
- package/build/ar-json.d4cb26d9.chunk.js +1 -0
- package/build/ca-json.0097e443.chunk.js +1 -0
- package/build/codemirror-addon-closebrackets.c0f97916.chunk.js +2 -0
- package/build/codemirror-addon-lint-js.7c35dcb0.chunk.js +1 -0
- package/build/codemirror-addon-lint.505ff1d4.chunk.js +1 -0
- package/build/codemirror-addon-mark-selection.653e904d.chunk.js +1 -0
- package/build/codemirror-css.b467b1de.chunk.js +346 -0
- package/build/codemirror-javacript.41bdefda.chunk.js +1 -0
- package/build/codemirror-theme.cf9f9eb6.chunk.js +34 -0
- package/build/content-manager.2f0f9b15.chunk.js +1204 -0
- package/build/content-type-builder-translation-ar-json.142327af.chunk.js +1 -0
- package/build/content-type-builder-translation-cs-json.4aafb972.chunk.js +1 -0
- package/build/content-type-builder-translation-de-json.0d7696b9.chunk.js +1 -0
- package/build/content-type-builder-translation-dk-json.4729f055.chunk.js +1 -0
- package/build/content-type-builder-translation-en-json.e5110288.chunk.js +1 -0
- package/build/content-type-builder-translation-es-json.333cf47f.chunk.js +1 -0
- package/build/content-type-builder-translation-fr-json.aa6eeea8.chunk.js +1 -0
- package/build/content-type-builder-translation-id-json.7c00a32a.chunk.js +1 -0
- package/build/content-type-builder-translation-it-json.a906b389.chunk.js +1 -0
- package/build/content-type-builder-translation-ja-json.87f71930.chunk.js +1 -0
- package/build/content-type-builder-translation-ko-json.51201b12.chunk.js +1 -0
- package/build/content-type-builder-translation-ms-json.963a1a01.chunk.js +1 -0
- package/build/content-type-builder-translation-nl-json.c46c8f30.chunk.js +1 -0
- package/build/content-type-builder-translation-pl-json.a866acda.chunk.js +1 -0
- package/build/content-type-builder-translation-pt-BR-json.5739a2aa.chunk.js +1 -0
- package/build/content-type-builder-translation-pt-json.766bd747.chunk.js +1 -0
- package/build/content-type-builder-translation-ru-json.cf8d7c5c.chunk.js +1 -0
- package/build/content-type-builder-translation-sk-json.3a6defe0.chunk.js +1 -0
- package/build/content-type-builder-translation-th-json.c96a2d3f.chunk.js +1 -0
- package/build/content-type-builder-translation-tr-json.2e52bc60.chunk.js +1 -0
- package/build/content-type-builder-translation-uk-json.d8c0b6dd.chunk.js +1 -0
- package/build/content-type-builder-translation-zh-Hans-json.92a27f59.chunk.js +1 -0
- package/build/content-type-builder-translation-zh-json.2cc55621.chunk.js +1 -0
- package/build/content-type-builder.ce7b7f42.chunk.js +141 -0
- package/build/cropper-css.ecc0d670.chunk.js +306 -0
- package/build/cs-json.c8f28ba8.chunk.js +1 -0
- package/build/de-json.0b92acd2.chunk.js +1 -0
- package/build/dk-json.9f1bc016.chunk.js +1 -0
- package/build/email-settings-page.f67d13b2.chunk.js +103 -0
- package/build/{email-translation-de-json.559a7d5f.chunk.js → email-translation-ar-json.c624512d.chunk.js} +1 -1
- package/build/{email-translation-ar-json.95d90eb4.chunk.js → email-translation-cs-json.cb18caab.chunk.js} +1 -1
- package/build/{email-translation-it-json.3de61cb6.chunk.js → email-translation-de-json.54743260.chunk.js} +1 -1
- package/build/{email-translation-dk-json.f8a595bf.chunk.js → email-translation-dk-json.f323fe4e.chunk.js} +1 -1
- package/build/{email-translation-en-json.fa0dc92b.chunk.js → email-translation-en-json.6da7e388.chunk.js} +1 -1
- package/build/{email-translation-es-json.eb303dea.chunk.js → email-translation-es-json.9021417d.chunk.js} +1 -1
- package/build/{email-translation-fr-json.49c3c888.chunk.js → email-translation-fr-json.9f125db0.chunk.js} +1 -1
- package/build/email-translation-id-json.3bcae5f5.chunk.js +1 -0
- package/build/{email-translation-cs-json.dfd1f3f2.chunk.js → email-translation-it-json.6ffd1774.chunk.js} +1 -1
- package/build/email-translation-ja-json.72b3f73c.chunk.js +1 -0
- package/build/email-translation-ko-json.e61d4e7a.chunk.js +1 -0
- package/build/email-translation-ms-json.b2b11e05.chunk.js +1 -0
- package/build/email-translation-nl-json.5349635f.chunk.js +1 -0
- package/build/email-translation-pl-json.6da50d0f.chunk.js +1 -0
- package/build/email-translation-pt-BR-json.2c98ab20.chunk.js +1 -0
- package/build/email-translation-pt-json.959ea070.chunk.js +1 -0
- package/build/email-translation-ru-json.d508cf3e.chunk.js +1 -0
- package/build/email-translation-sk-json.fa1fd4b3.chunk.js +1 -0
- package/build/email-translation-th-json.989cfecc.chunk.js +1 -0
- package/build/email-translation-tr-json.87f2feb3.chunk.js +1 -0
- package/build/email-translation-uk-json.0396a803.chunk.js +1 -0
- package/build/email-translation-vi-json.c0d8c414.chunk.js +1 -0
- package/build/email-translation-zh-Hans-json.b463cb25.chunk.js +1 -0
- package/build/email-translation-zh-json.3455468b.chunk.js +1 -0
- package/build/en-json.3e1a222e.chunk.js +1 -0
- package/build/es-json.2a5a9fc1.chunk.js +1 -0
- package/build/fontawesome-css-all.04f33619.chunk.js +4618 -0
- package/build/fontawesome-css.477ba714.chunk.js +6 -0
- package/build/fontawesome-js.252cc5f3.chunk.js +7 -0
- package/build/fr-json.84064a0b.chunk.js +1 -0
- package/build/he-json.d40da459.chunk.js +1 -0
- package/build/highlight.js.3381ffc3.chunk.js +86 -0
- package/build/hu-json.c81ce352.chunk.js +1 -0
- package/build/i18n-settings-page.6b67cb75.chunk.js +101 -0
- package/build/i18n-translation-de-json.92534555.chunk.js +1 -0
- package/build/{i18n-translation-dk-json.ecf02d28.chunk.js → i18n-translation-dk-json.54f410ca.chunk.js} +1 -1
- package/build/{i18n-translation-en-json.4d823f62.chunk.js → i18n-translation-en-json.85bc892c.chunk.js} +1 -1
- package/build/i18n-translation-es-json.488206ae.chunk.js +1 -0
- package/build/i18n-translation-fr-json.0839d68d.chunk.js +1 -0
- package/build/i18n-translation-ko-json.d0bc1203.chunk.js +1 -0
- package/build/i18n-translation-zh-Hans-json.560a98e3.chunk.js +1 -0
- package/build/id-json.fad45d17.chunk.js +1 -0
- package/build/index.html +1 -1
- package/build/it-json.12df4cdf.chunk.js +1 -0
- package/build/ja-json.850237e9.chunk.js +1 -0
- package/build/ko-json.2f3d256e.chunk.js +1 -0
- package/build/main.e6045245.js +7909 -0
- package/build/ms-json.836ed013.chunk.js +1 -0
- package/build/nl-json.465b173f.chunk.js +1 -0
- package/build/no-json.e8749dd4.chunk.js +1 -0
- package/build/pl-json.94f05d2c.chunk.js +1 -0
- package/build/pt-BR-json.6301d49b.chunk.js +1 -0
- package/build/pt-json.c23020ab.chunk.js +1 -0
- package/build/ru-json.28147733.chunk.js +1 -0
- package/build/runtime~main.a32b12c8.js +2 -0
- package/build/sk-json.5b33afc2.chunk.js +1 -0
- package/build/sso-settings-page.e9034e22.chunk.js +1 -0
- package/build/sv-json.cdcac02d.chunk.js +1 -0
- package/build/th-json.3aadaec6.chunk.js +1 -0
- package/build/tr-json.276e59fe.chunk.js +1 -0
- package/build/uk-json.5b5b9c27.chunk.js +1 -0
- package/build/upload-settings.3db55de0.chunk.js +101 -0
- package/build/upload-translation-de-json.b642da08.chunk.js +1 -0
- package/build/upload-translation-dk-json.fc61df13.chunk.js +1 -0
- package/build/upload-translation-en-json.59269508.chunk.js +1 -0
- package/build/upload-translation-es-json.8ec935ef.chunk.js +1 -0
- package/build/upload-translation-fr-json.eb9b4f84.chunk.js +1 -0
- package/build/upload-translation-he-json.c226f2dc.chunk.js +1 -0
- package/build/upload-translation-it-json.8e58456e.chunk.js +1 -0
- package/build/upload-translation-ja-json.1378a2e7.chunk.js +1 -0
- package/build/upload-translation-ko-json.5e06e112.chunk.js +1 -0
- package/build/upload-translation-ms-json.dc3bf0d7.chunk.js +1 -0
- package/build/upload-translation-pl-json.6071e38c.chunk.js +1 -0
- package/build/upload-translation-pt-BR-json.7e8d9550.chunk.js +1 -0
- package/build/upload-translation-ru-json.da2529f3.chunk.js +1 -0
- package/build/upload-translation-sk-json.bfdf4f09.chunk.js +1 -0
- package/build/upload-translation-th-json.6a48b826.chunk.js +1 -0
- package/build/upload-translation-uk-json.6fb09148.chunk.js +1 -0
- package/build/upload-translation-zh-Hans-json.c9622577.chunk.js +1 -0
- package/build/upload-translation-zh-json.711f804b.chunk.js +1 -0
- package/build/upload.070c189b.chunk.js +105 -0
- package/build/users-advanced-settings-page.a23cda17.chunk.js +101 -0
- package/build/users-email-settings-page.0a096388.chunk.js +1 -0
- package/build/users-permissions-translation-ar-json.e8123ed2.chunk.js +1 -0
- package/build/users-permissions-translation-cs-json.e6649c5f.chunk.js +1 -0
- package/build/users-permissions-translation-de-json.c3628843.chunk.js +1 -0
- package/build/users-permissions-translation-dk-json.fe39c74b.chunk.js +1 -0
- package/build/users-permissions-translation-en-json.3fe86528.chunk.js +1 -0
- package/build/users-permissions-translation-es-json.1bb9cde2.chunk.js +1 -0
- package/build/users-permissions-translation-fr-json.172aa69f.chunk.js +1 -0
- package/build/users-permissions-translation-id-json.5aadd143.chunk.js +1 -0
- package/build/users-permissions-translation-it-json.7d377480.chunk.js +1 -0
- package/build/users-permissions-translation-ja-json.4967badf.chunk.js +1 -0
- package/build/users-permissions-translation-ko-json.3be77775.chunk.js +1 -0
- package/build/users-permissions-translation-ms-json.ea8a2baf.chunk.js +1 -0
- package/build/users-permissions-translation-nl-json.d638c4ce.chunk.js +1 -0
- package/build/users-permissions-translation-pl-json.3c4fe81c.chunk.js +1 -0
- package/build/users-permissions-translation-pt-BR-json.f6791a86.chunk.js +1 -0
- package/build/users-permissions-translation-pt-json.38afed04.chunk.js +1 -0
- package/build/users-permissions-translation-ru-json.319d51ef.chunk.js +1 -0
- package/build/users-permissions-translation-sk-json.ba1cd385.chunk.js +1 -0
- package/build/users-permissions-translation-sv-json.83c60841.chunk.js +1 -0
- package/build/users-permissions-translation-th-json.68873214.chunk.js +1 -0
- package/build/users-permissions-translation-tr-json.cdc49a3c.chunk.js +1 -0
- package/build/users-permissions-translation-uk-json.63eaa01c.chunk.js +1 -0
- package/build/users-permissions-translation-vi-json.dccc02fc.chunk.js +1 -0
- package/build/users-permissions-translation-zh-Hans-json.c3fd301b.chunk.js +1 -0
- package/build/users-permissions-translation-zh-json.e03ae2a4.chunk.js +1 -0
- package/build/users-providers-settings-page.bfe7755a.chunk.js +1 -0
- package/build/users-roles-settings-page.c01bec1d.chunk.js +30 -0
- package/build/vi-json.3d14e91e.chunk.js +1 -0
- package/build/webhook-edit-page.d457087d.chunk.js +23 -0
- package/build/webhook-list-page.a4217ff2.chunk.js +133 -0
- package/build/zh-Hans-json.c84ce330.chunk.js +1 -0
- package/build/zh-json.96bf6019.chunk.js +1 -0
- package/ee/admin/pages/AuthPage/components/Providers/SSOProviders.js +1 -1
- package/ee/admin/pages/SettingsPage/SingleSignOn/index.js +2 -2
- package/ee/admin/pages/SettingsPage/pages/Roles/CreatePage/index.js +5 -5
- package/ee/admin/pages/SettingsPage/pages/Roles/ListPage/index.js +6 -6
- package/index.js +53 -239
- package/package.json +14 -14
- package/scripts/build.js +32 -4
- package/server/bootstrap.js +9 -7
- package/server/config/index.js +0 -1
- package/server/controllers/admin.js +34 -2
- package/server/policies/index.js +1 -0
- package/server/policies/isTelemetryEnabled.js +16 -0
- package/server/routes/admin.js +9 -0
- package/server/routes/serve-admin-panel.js +1 -1
- package/server/services/api-token.js +15 -14
- package/server/services/token.js +13 -0
- package/server/validation/permission.js +5 -1
- package/utils/create-cache-dir.js +161 -0
- package/utils/get-custom-app-config-file.js +23 -0
- package/utils/get-custom-webpack-config.js +38 -0
- package/utils/get-plugins-path.js +26 -0
- package/utils/index.js +13 -0
- package/utils/should-build-admin.js +52 -0
- package/utils/watch-admin-files.js +59 -0
- package/webpack.config.js +105 -63
- package/.env +0 -0
- package/admin/src/content-manager/components/DynamicTable/CellContent/Relation/PopoverContent.js +0 -87
- package/admin/src/content-manager/components/DynamicTable/CellContent/Relation/index.js +0 -107
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/getYupInnerErrors.js +0 -17
- 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/1094.e1db3a1a.chunk.js +0 -1
- package/build/1454.f065d92a.chunk.js +0 -2
- package/build/1454.f065d92a.chunk.js.LICENSE.txt +0 -7
- package/build/1856.a30bd09b.chunk.js +0 -1
- package/build/2481.4eae9408.chunk.js +0 -1
- package/build/2912.c5f76e65.chunk.js +0 -1
- package/build/4362.86a4e939.chunk.js +0 -1
- package/build/4715.8a2db02a.chunk.js +0 -1
- package/build/4800.f4a1384a.chunk.js +0 -1
- package/build/497.3fcf6196.chunk.js +0 -1
- package/build/4982.601f6196.chunk.js +0 -1
- package/build/6404.3c2d0a81.chunk.js +0 -1
- package/build/6925.bd694b04.chunk.js +0 -2
- package/build/6925.bd694b04.chunk.js.LICENSE.txt +0 -5
- package/build/7841.490dbbf1.chunk.js +0 -1
- package/build/8042.1d66811a.chunk.js +0 -2
- package/build/8042.1d66811a.chunk.js.LICENSE.txt +0 -4
- package/build/8469.8d819a3c.chunk.js +0 -1
- package/build/849.17f011e8.chunk.js +0 -1
- package/build/9235.ced8aebf.chunk.js +0 -1
- package/build/9260.fa40c7bd.chunk.js +0 -2
- package/build/9260.fa40c7bd.chunk.js.LICENSE.txt +0 -15
- package/build/9853.6ff595fa.chunk.js +0 -1
- package/build/9988.fe838ba6.chunk.js +0 -2
- package/build/9988.fe838ba6.chunk.js.LICENSE.txt +0 -9
- package/build/Admin-authenticatedApp.a5d2c5fa.chunk.js +0 -1
- package/build/Admin_homePage.d6754c66.chunk.js +0 -1
- package/build/Admin_marketplace.419010d8.chunk.js +0 -1
- package/build/Admin_pluginsPage.7d1bd7ce.chunk.js +0 -1
- package/build/Admin_profilePage.d7192d06.chunk.js +0 -1
- package/build/Admin_settingsPage.a8c7ded5.chunk.js +0 -1
- package/build/admin-edit-roles-page.49b6f01d.chunk.js +0 -1
- package/build/admin-edit-users.381e4a0d.chunk.js +0 -1
- package/build/admin-users.1fda1f27.chunk.js +0 -1
- package/build/api-tokens-create-page.db17bb39.chunk.js +0 -1
- package/build/api-tokens-edit-page.c7299a77.chunk.js +0 -1
- package/build/api-tokens-list-page.26a05a21.chunk.js +0 -1
- package/build/ar-json.6a2565af.chunk.js +0 -1
- package/build/codemirror-addon-closebrackets.0cfe64d0.chunk.js +0 -1
- package/build/codemirror-addon-lint-js.a6eeef9c.chunk.js +0 -1
- package/build/codemirror-addon-lint.91580cda.chunk.js +0 -1
- package/build/codemirror-addon-mark-selection.4dca121f.chunk.js +0 -1
- package/build/codemirror-css.48b438c9.chunk.js +0 -1
- package/build/codemirror-javacript.8c7c015d.chunk.js +0 -1
- package/build/codemirror-theme.b5559efc.chunk.js +0 -1
- package/build/content-manager.8412e024.chunk.js +0 -1
- package/build/content-type-builder-translation-ar-json.f1fedc12.chunk.js +0 -1
- package/build/content-type-builder-translation-cs-json.89f7272e.chunk.js +0 -1
- package/build/content-type-builder-translation-de-json.0205697c.chunk.js +0 -1
- package/build/content-type-builder-translation-dk-json.235ff56e.chunk.js +0 -1
- package/build/content-type-builder-translation-en-json.8034dab6.chunk.js +0 -1
- package/build/content-type-builder-translation-es-json.13b2e2aa.chunk.js +0 -1
- package/build/content-type-builder-translation-fr-json.bee621f7.chunk.js +0 -1
- package/build/content-type-builder-translation-id-json.2fbf4f8c.chunk.js +0 -1
- package/build/content-type-builder-translation-it-json.a1afd7a9.chunk.js +0 -1
- package/build/content-type-builder-translation-ja-json.1459fb88.chunk.js +0 -1
- package/build/content-type-builder-translation-ko-json.d2080111.chunk.js +0 -1
- package/build/content-type-builder-translation-ms-json.048122eb.chunk.js +0 -1
- package/build/content-type-builder-translation-nl-json.8d59e86b.chunk.js +0 -1
- package/build/content-type-builder-translation-pl-json.01dc068c.chunk.js +0 -1
- package/build/content-type-builder-translation-pt-BR-json.d311d056.chunk.js +0 -1
- package/build/content-type-builder-translation-pt-json.4893266f.chunk.js +0 -1
- package/build/content-type-builder-translation-ru-json.1285874d.chunk.js +0 -1
- package/build/content-type-builder-translation-sk-json.0064156b.chunk.js +0 -1
- package/build/content-type-builder-translation-th-json.5f690524.chunk.js +0 -1
- package/build/content-type-builder-translation-tr-json.696283a5.chunk.js +0 -1
- package/build/content-type-builder-translation-uk-json.87496bf9.chunk.js +0 -1
- package/build/content-type-builder-translation-zh-Hans-json.283c640e.chunk.js +0 -1
- package/build/content-type-builder-translation-zh-json.77aa2275.chunk.js +0 -1
- package/build/content-type-builder.cda4ba3c.chunk.js +0 -1
- package/build/cropper-css.ace19575.chunk.js +0 -1
- package/build/cs-json.8df09876.chunk.js +0 -1
- package/build/de-json.6e14f607.chunk.js +0 -1
- package/build/dk-json.be388470.chunk.js +0 -1
- package/build/email-settings-page.40ee2bda.chunk.js +0 -1
- package/build/email-translation-id-json.e3c2101d.chunk.js +0 -1
- package/build/email-translation-ja-json.66337e44.chunk.js +0 -1
- package/build/email-translation-ko-json.52bbd7b4.chunk.js +0 -1
- package/build/email-translation-ms-json.e39256df.chunk.js +0 -1
- package/build/email-translation-nl-json.12d28adb.chunk.js +0 -1
- package/build/email-translation-pl-json.9585a84e.chunk.js +0 -1
- package/build/email-translation-pt-BR-json.6c04b3ef.chunk.js +0 -1
- package/build/email-translation-pt-json.0239be04.chunk.js +0 -1
- package/build/email-translation-ru-json.f3b4fecc.chunk.js +0 -1
- package/build/email-translation-sk-json.76dbaaa6.chunk.js +0 -1
- package/build/email-translation-th-json.25ad73e7.chunk.js +0 -1
- package/build/email-translation-tr-json.ae04a9f2.chunk.js +0 -1
- package/build/email-translation-uk-json.03b27b08.chunk.js +0 -1
- package/build/email-translation-vi-json.3e1dd5b3.chunk.js +0 -1
- package/build/email-translation-zh-Hans-json.0df4ca59.chunk.js +0 -1
- package/build/email-translation-zh-json.82978eb0.chunk.js +0 -1
- package/build/en-json.b35c285f.chunk.js +0 -1
- package/build/es-json.61553168.chunk.js +0 -1
- package/build/fontawesome-css-all.3b89f909.chunk.js +0 -1
- package/build/fontawesome-css.36cff9ae.chunk.js +0 -1
- package/build/fontawesome-js.2639263c.chunk.js +0 -2
- package/build/fontawesome-js.2639263c.chunk.js.LICENSE.txt +0 -4
- package/build/fr-json.a9ce0700.chunk.js +0 -1
- package/build/he-json.1742494e.chunk.js +0 -1
- package/build/highlight.js.6321cb45.chunk.js +0 -1
- package/build/hu-json.e667d285.chunk.js +0 -1
- package/build/i18n-settings-page.c4018651.chunk.js +0 -1
- package/build/i18n-translation-de-json.c5c9054f.chunk.js +0 -1
- package/build/i18n-translation-es-json.7049afa2.chunk.js +0 -1
- package/build/i18n-translation-fr-json.c6367bc9.chunk.js +0 -1
- package/build/i18n-translation-ko-json.aecb7e01.chunk.js +0 -1
- package/build/i18n-translation-zh-Hans-json.258b2e1a.chunk.js +0 -1
- package/build/id-json.d87ebb20.chunk.js +0 -1
- package/build/it-json.a2880b81.chunk.js +0 -1
- package/build/ja-json.46e29f04.chunk.js +0 -1
- package/build/ko-json.dd36fdc0.chunk.js +0 -1
- package/build/main.3e719c82.js +0 -2
- package/build/main.3e719c82.js.LICENSE.txt +0 -91
- package/build/ms-json.3a062984.chunk.js +0 -1
- package/build/nl-json.30ce02cb.chunk.js +0 -1
- package/build/no-json.9af40e9d.chunk.js +0 -1
- package/build/pl-json.fd373053.chunk.js +0 -1
- package/build/pt-BR-json.30e2d716.chunk.js +0 -1
- package/build/pt-json.3aaf9e05.chunk.js +0 -1
- package/build/ru-json.78c56e1c.chunk.js +0 -1
- package/build/runtime~main.66becdbd.js +0 -1
- package/build/sk-json.c0bf144c.chunk.js +0 -1
- package/build/sso-settings-page.121dd0a6.chunk.js +0 -1
- package/build/sv-json.aad187b9.chunk.js +0 -1
- package/build/th-json.e2b4a0fb.chunk.js +0 -1
- package/build/tr-json.0add11cd.chunk.js +0 -1
- package/build/uk-json.eb78e77e.chunk.js +0 -1
- package/build/upload-settings.4401f36d.chunk.js +0 -1
- package/build/upload-translation-de-json.1308dce5.chunk.js +0 -1
- package/build/upload-translation-dk-json.0d4e855f.chunk.js +0 -1
- package/build/upload-translation-en-json.c3373c8d.chunk.js +0 -1
- package/build/upload-translation-es-json.81b13eac.chunk.js +0 -1
- package/build/upload-translation-fr-json.1bec79ec.chunk.js +0 -1
- package/build/upload-translation-he-json.1d28982f.chunk.js +0 -1
- package/build/upload-translation-it-json.7d4bdc5a.chunk.js +0 -1
- package/build/upload-translation-ja-json.97fcacd8.chunk.js +0 -1
- package/build/upload-translation-ko-json.d7345fe1.chunk.js +0 -1
- package/build/upload-translation-ms-json.081effd5.chunk.js +0 -1
- package/build/upload-translation-pl-json.2dfe78bb.chunk.js +0 -1
- package/build/upload-translation-pt-BR-json.65936d7b.chunk.js +0 -1
- package/build/upload-translation-ru-json.2d3b6f69.chunk.js +0 -1
- package/build/upload-translation-sk-json.f15c7fd6.chunk.js +0 -1
- package/build/upload-translation-th-json.6d3c2370.chunk.js +0 -1
- package/build/upload-translation-uk-json.a6c38449.chunk.js +0 -1
- package/build/upload-translation-zh-Hans-json.f6b26c45.chunk.js +0 -1
- package/build/upload-translation-zh-json.06052336.chunk.js +0 -1
- package/build/upload.5a2dded7.chunk.js +0 -1
- package/build/users-advanced-settings-page.8905d8d8.chunk.js +0 -1
- package/build/users-email-settings-page.5abb9575.chunk.js +0 -1
- package/build/users-permissions-translation-ar-json.bdddd0d7.chunk.js +0 -1
- package/build/users-permissions-translation-cs-json.7881d3ff.chunk.js +0 -1
- package/build/users-permissions-translation-de-json.8d53c619.chunk.js +0 -1
- package/build/users-permissions-translation-dk-json.89d41c4b.chunk.js +0 -1
- package/build/users-permissions-translation-en-json.21b0fd2f.chunk.js +0 -1
- package/build/users-permissions-translation-es-json.a4f81eaa.chunk.js +0 -1
- package/build/users-permissions-translation-fr-json.a2172545.chunk.js +0 -1
- package/build/users-permissions-translation-id-json.8f17982a.chunk.js +0 -1
- package/build/users-permissions-translation-it-json.87952a24.chunk.js +0 -1
- package/build/users-permissions-translation-ja-json.5915d9ef.chunk.js +0 -1
- package/build/users-permissions-translation-ko-json.f1ca6cc4.chunk.js +0 -1
- package/build/users-permissions-translation-ms-json.2268324c.chunk.js +0 -1
- package/build/users-permissions-translation-nl-json.4e1231dd.chunk.js +0 -1
- package/build/users-permissions-translation-pl-json.107638b5.chunk.js +0 -1
- package/build/users-permissions-translation-pt-BR-json.8dafc053.chunk.js +0 -1
- package/build/users-permissions-translation-pt-json.3322464f.chunk.js +0 -1
- package/build/users-permissions-translation-ru-json.5709c5a0.chunk.js +0 -1
- package/build/users-permissions-translation-sk-json.fe7cc044.chunk.js +0 -1
- package/build/users-permissions-translation-sv-json.e7e1684b.chunk.js +0 -1
- package/build/users-permissions-translation-th-json.bb544ee3.chunk.js +0 -1
- package/build/users-permissions-translation-tr-json.30f3ca90.chunk.js +0 -1
- package/build/users-permissions-translation-uk-json.634f2569.chunk.js +0 -1
- package/build/users-permissions-translation-vi-json.605d88bc.chunk.js +0 -1
- package/build/users-permissions-translation-zh-Hans-json.85480dab.chunk.js +0 -1
- package/build/users-permissions-translation-zh-json.99932731.chunk.js +0 -1
- package/build/users-providers-settings-page.368893ed.chunk.js +0 -1
- package/build/users-roles-settings-page.a2f6277a.chunk.js +0 -1
- package/build/vi-json.55a11ac0.chunk.js +0 -1
- package/build/webhook-edit-page.d170eda1.chunk.js +0 -1
- package/build/webhook-list-page.c21b5a9a.chunk.js +0 -1
- package/build/zh-Hans-json.55f6475b.chunk.js +0 -1
- package/build/zh-json.c3c2b225.chunk.js +0 -1
- package/server/config/api-token.js +0 -7
package/admin/src/app.js
CHANGED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect x="3" y="3" width="18" height="18" rx="4" fill="#4945FF"/>
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.8075 7.625H9.03058V11.1792H12.2533C12.4977 11.1792 12.6958 11.3773 12.6958 11.6216V14.8444H16.25V8.06746C16.25 7.82309 16.0519 7.625 15.8075 7.625Z" fill="white"/>
|
|
4
|
+
<path opacity="0.4" fill-rule="evenodd" clip-rule="evenodd" d="M9.0308 7.625V11.1792H6.01073C5.81364 11.1792 5.71494 10.9409 5.8543 10.8015L9.0308 7.625ZM13.0735 18.0209C12.9342 18.1603 12.6959 18.0616 12.6959 17.8645V14.8444H16.25L13.0735 18.0209ZM12.4746 11.1792H9.03058V14.4019C9.03058 14.6463 9.22868 14.8444 9.47304 14.8444H12.6958V11.4004C12.6958 11.2782 12.5968 11.1792 12.4746 11.1792Z" fill="#DAD9FF"/>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg width="88" height="88" viewBox="0 0 88 88" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect x="0.5" y="0.5" width="87" height="87" rx="43.5" fill="#F0F0FF"/>
|
|
3
|
+
<path d="M34.0469 39.2969H30C27.4479 39.2969 25.2604 40.2448 23.4375 42.1406C21.6146 43.9635 20.7031 46.151 20.7031 48.7031C20.7031 51.2552 21.6146 53.4427 23.4375 55.2656C25.2604 57.0885 27.4479 58 30 58H52.75L34.0469 39.2969ZM23 28.25L25.9531 25.2969L65 64.3438L62.0469 67.2969L57.3438 62.7031H30C26.1354 62.7031 22.8177 61.3542 20.0469 58.6562C17.349 55.8854 16 52.5677 16 48.7031C16 44.9115 17.3125 41.6667 19.9375 38.9688C22.5625 36.2708 25.7344 34.849 29.4531 34.7031L23 28.25ZM61.1719 39.4062C64.1615 39.625 66.7135 40.8646 68.8281 43.125C70.9427 45.3125 72 47.9375 72 51C72 55.0104 70.3594 58.1823 67.0781 60.5156L63.6875 57.125C66.0938 55.8125 67.2969 53.7708 67.2969 51C67.2969 49.1042 66.6042 47.4635 65.2188 46.0781C63.8333 44.6927 62.1927 44 60.2969 44H56.7969V42.7969C56.7969 39.224 55.5573 36.1979 53.0781 33.7188C50.599 31.2396 47.5729 30 44 30C41.9583 30 39.9896 30.474 38.0938 31.4219L34.5938 28.0312C37.4375 26.2083 40.5729 25.2969 44 25.2969C47.9375 25.2969 51.5833 26.6823 54.9375 29.4531C58.3646 32.224 60.4427 35.5417 61.1719 39.4062Z" fill="#4945FF"/>
|
|
4
|
+
<rect x="0.5" y="0.5" width="87" height="87" rx="43.5" stroke="#D9D8FF"/>
|
|
5
|
+
</svg>
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import React, { useMemo, useState, useEffect, useRef } from 'react';
|
|
2
2
|
// TODO: DS add loader
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
auth,
|
|
5
|
+
LoadingIndicatorPage,
|
|
6
|
+
AppInfosContext,
|
|
7
|
+
useGuidedTour,
|
|
8
|
+
useNotification,
|
|
9
|
+
} from '@strapi/helper-plugin';
|
|
4
10
|
import { useQueries } from 'react-query';
|
|
5
11
|
import get from 'lodash/get';
|
|
6
12
|
import packageJSON from '../../../../package.json';
|
|
@@ -20,6 +26,7 @@ const strapiVersion = packageJSON.version;
|
|
|
20
26
|
|
|
21
27
|
const AuthenticatedApp = () => {
|
|
22
28
|
const { setGuidedTourVisibility } = useGuidedTour();
|
|
29
|
+
const toggleNotification = useNotification();
|
|
23
30
|
const setGuidedTourVisibilityRef = useRef(setGuidedTourVisibility);
|
|
24
31
|
const userInfo = auth.getUserInfo();
|
|
25
32
|
const userName = get(userInfo, 'username') || getFullName(userInfo.firstname, userInfo.lastname);
|
|
@@ -34,7 +41,7 @@ const AuthenticatedApp = () => {
|
|
|
34
41
|
{ queryKey: 'app-infos', queryFn: fetchAppInfo },
|
|
35
42
|
{
|
|
36
43
|
queryKey: 'strapi-release',
|
|
37
|
-
queryFn: fetchStrapiLatestRelease,
|
|
44
|
+
queryFn: () => fetchStrapiLatestRelease(toggleNotification),
|
|
38
45
|
enabled: showReleaseNotification,
|
|
39
46
|
initialData: strapiVersion,
|
|
40
47
|
},
|
|
@@ -1,15 +1,34 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
|
+
import checkLatestStrapiVersion from './checkLatestStrapiVersion';
|
|
2
3
|
import { axiosInstance } from '../../../core/utils';
|
|
3
4
|
import packageJSON from '../../../../../package.json';
|
|
4
5
|
|
|
5
6
|
const strapiVersion = packageJSON.version;
|
|
7
|
+
const showUpdateNotif = !JSON.parse(localStorage.getItem('STRAPI_UPDATE_NOTIF'));
|
|
6
8
|
|
|
7
|
-
const fetchStrapiLatestRelease = async
|
|
9
|
+
const fetchStrapiLatestRelease = async toggleNotification => {
|
|
8
10
|
try {
|
|
9
11
|
const {
|
|
10
12
|
data: { tag_name },
|
|
11
13
|
} = await axios.get('https://api.github.com/repos/strapi/strapi/releases/latest');
|
|
12
14
|
|
|
15
|
+
const shouldUpdateStrapi = checkLatestStrapiVersion(strapiVersion, tag_name);
|
|
16
|
+
|
|
17
|
+
if (shouldUpdateStrapi && showUpdateNotif) {
|
|
18
|
+
toggleNotification({
|
|
19
|
+
type: 'info',
|
|
20
|
+
message: { id: 'notification.version.update.message' },
|
|
21
|
+
link: {
|
|
22
|
+
url: `https://github.com/strapi/strapi/releases/tag/${tag_name}`,
|
|
23
|
+
label: {
|
|
24
|
+
id: 'global.see-more',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
blockTransition: true,
|
|
28
|
+
onClose: () => localStorage.setItem('STRAPI_UPDATE_NOTIF', true),
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
13
32
|
return tag_name;
|
|
14
33
|
} catch (err) {
|
|
15
34
|
// Don't throw an error
|
|
@@ -78,7 +78,7 @@ const Blocker = ({ displayedIcon, description, title, isOpen }) => {
|
|
|
78
78
|
rel="noopener noreferrer nofollow"
|
|
79
79
|
>
|
|
80
80
|
{formatMessage({
|
|
81
|
-
id: '
|
|
81
|
+
id: 'global.documentation',
|
|
82
82
|
defaultMessage: 'Read the documentation',
|
|
83
83
|
})}
|
|
84
84
|
</Link>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { useGuidedTour } from '@strapi/helper-plugin';
|
|
2
|
+
import { useGuidedTour, useTracking } from '@strapi/helper-plugin';
|
|
3
3
|
import { useIntl } from 'react-intl';
|
|
4
4
|
import { Stack } from '@strapi/design-system/Stack';
|
|
5
5
|
import { Flex } from '@strapi/design-system/Flex';
|
|
@@ -14,12 +14,17 @@ import layout from '../layout';
|
|
|
14
14
|
const GuidedTourHomepage = () => {
|
|
15
15
|
const { guidedTourState, setSkipped } = useGuidedTour();
|
|
16
16
|
const { formatMessage } = useIntl();
|
|
17
|
+
const { trackUsage } = useTracking();
|
|
17
18
|
|
|
18
19
|
const sections = Object.entries(layout).map(([key, val]) => ({
|
|
19
20
|
key,
|
|
20
21
|
title: val.home.title,
|
|
21
22
|
content: (
|
|
22
|
-
<LinkButton
|
|
23
|
+
<LinkButton
|
|
24
|
+
onClick={() => trackUsage(val.home.trackingEvent)}
|
|
25
|
+
to={val.home.cta.target}
|
|
26
|
+
endIcon={<ArrowRight />}
|
|
27
|
+
>
|
|
23
28
|
{formatMessage(val.home.cta.title)}
|
|
24
29
|
</LinkButton>
|
|
25
30
|
),
|
|
@@ -32,6 +37,11 @@ const GuidedTourHomepage = () => {
|
|
|
32
37
|
|
|
33
38
|
const activeSection = enrichedSections.find(section => !section.isDone)?.key;
|
|
34
39
|
|
|
40
|
+
const handleSkip = () => {
|
|
41
|
+
setSkipped(true);
|
|
42
|
+
trackUsage('didSkipGuidedtour');
|
|
43
|
+
};
|
|
44
|
+
|
|
35
45
|
return (
|
|
36
46
|
<Box
|
|
37
47
|
hasRadius
|
|
@@ -52,7 +62,7 @@ const GuidedTourHomepage = () => {
|
|
|
52
62
|
<StepperHomepage sections={sections} currentSectionKey={activeSection} />
|
|
53
63
|
</Stack>
|
|
54
64
|
<Flex justifyContent="flex-end">
|
|
55
|
-
<Button variant="tertiary" onClick={
|
|
65
|
+
<Button variant="tertiary" onClick={handleSkip}>
|
|
56
66
|
{formatMessage({ id: 'app.components.GuidedTour.skip', defaultMessage: 'Skip the tour' })}
|
|
57
67
|
</Button>
|
|
58
68
|
</Flex>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState, useReducer } from 'react';
|
|
2
2
|
import at from 'lodash/at';
|
|
3
|
-
import { useGuidedTour } from '@strapi/helper-plugin';
|
|
3
|
+
import { useGuidedTour, useTracking } from '@strapi/helper-plugin';
|
|
4
4
|
import layout from '../layout';
|
|
5
5
|
import Modal from './components/Modal';
|
|
6
6
|
import reducer, { initialState } from './reducer';
|
|
@@ -20,6 +20,7 @@ const GuidedTourModal = () => {
|
|
|
20
20
|
{ stepContent, sectionIndex, stepIndex, hasSectionAfter, hasStepAfter },
|
|
21
21
|
dispatch,
|
|
22
22
|
] = useReducer(reducer, initialState);
|
|
23
|
+
const { trackUsage } = useTracking();
|
|
23
24
|
|
|
24
25
|
useEffect(() => {
|
|
25
26
|
if (!currentStep) {
|
|
@@ -56,6 +57,7 @@ const GuidedTourModal = () => {
|
|
|
56
57
|
|
|
57
58
|
const handleCtaClick = () => {
|
|
58
59
|
setStepState(currentStep, true);
|
|
60
|
+
trackUsage(stepContent.trackingEvent);
|
|
59
61
|
|
|
60
62
|
setCurrentStep(null);
|
|
61
63
|
};
|
|
@@ -63,6 +65,7 @@ const GuidedTourModal = () => {
|
|
|
63
65
|
const handleSkip = () => {
|
|
64
66
|
setSkipped(true);
|
|
65
67
|
setCurrentStep(null);
|
|
68
|
+
trackUsage('didSkipGuidedtour');
|
|
66
69
|
};
|
|
67
70
|
|
|
68
71
|
if (isVisible && stepContent) {
|
|
@@ -13,6 +13,7 @@ const layout = {
|
|
|
13
13
|
type: 'REDIRECT',
|
|
14
14
|
target: '/plugins/content-type-builder',
|
|
15
15
|
},
|
|
16
|
+
trackingEvent: 'didClickGuidedTourHomepageContentTypeBuilder',
|
|
16
17
|
},
|
|
17
18
|
create: {
|
|
18
19
|
title: {
|
|
@@ -31,6 +32,7 @@ const layout = {
|
|
|
31
32
|
},
|
|
32
33
|
type: 'CLOSE',
|
|
33
34
|
},
|
|
35
|
+
trackingEvent: 'didClickGuidedTourStep1CollectionType',
|
|
34
36
|
},
|
|
35
37
|
success: {
|
|
36
38
|
title: {
|
|
@@ -49,6 +51,7 @@ const layout = {
|
|
|
49
51
|
type: 'REDIRECT',
|
|
50
52
|
target: '/content-manager',
|
|
51
53
|
},
|
|
54
|
+
trackingEvent: 'didCreateGuidedTourCollectionType',
|
|
52
55
|
},
|
|
53
56
|
},
|
|
54
57
|
contentManager: {
|
|
@@ -65,6 +68,7 @@ const layout = {
|
|
|
65
68
|
type: 'REDIRECT',
|
|
66
69
|
target: '/content-manager',
|
|
67
70
|
},
|
|
71
|
+
trackingEvent: 'didClickGuidedTourHomepageContentManager',
|
|
68
72
|
},
|
|
69
73
|
create: {
|
|
70
74
|
title: {
|
|
@@ -83,6 +87,7 @@ const layout = {
|
|
|
83
87
|
},
|
|
84
88
|
type: 'CLOSE',
|
|
85
89
|
},
|
|
90
|
+
trackingEvent: 'didClickGuidedTourStep2ContentManager',
|
|
86
91
|
},
|
|
87
92
|
success: {
|
|
88
93
|
title: {
|
|
@@ -101,6 +106,7 @@ const layout = {
|
|
|
101
106
|
type: 'REDIRECT',
|
|
102
107
|
target: '/settings/api-tokens',
|
|
103
108
|
},
|
|
109
|
+
trackingEvent: 'didCreateGuidedTourEntry',
|
|
104
110
|
},
|
|
105
111
|
},
|
|
106
112
|
apiTokens: {
|
|
@@ -117,6 +123,7 @@ const layout = {
|
|
|
117
123
|
type: 'REDIRECT',
|
|
118
124
|
target: '/settings/api-tokens',
|
|
119
125
|
},
|
|
126
|
+
trackingEvent: 'didClickGuidedTourHomepageApiTokens',
|
|
120
127
|
},
|
|
121
128
|
create: {
|
|
122
129
|
title: {
|
|
@@ -135,6 +142,7 @@ const layout = {
|
|
|
135
142
|
},
|
|
136
143
|
type: 'CLOSE',
|
|
137
144
|
},
|
|
145
|
+
trackingEvent: 'didClickGuidedTourStep3ApiTokens',
|
|
138
146
|
},
|
|
139
147
|
success: {
|
|
140
148
|
title: {
|
|
@@ -146,6 +154,7 @@ const layout = {
|
|
|
146
154
|
defaultMessage:
|
|
147
155
|
"<p>See content in action by making an HTTP request:</p><ul><li><p>To this URL: <light>https://'<'YOUR_DOMAIN'>'/api/'<'YOUR_CT'>'</light></p></li><li><p>With the header: <light>Authorization: bearer '<'YOUR_API_TOKEN'>'</light></p></li></ul><p>For more ways to interact with content, see the <documentationLink>documentation</documentationLink>.</p>",
|
|
148
156
|
},
|
|
157
|
+
trackingEvent: 'didGenerateGuidedTourApiTokens',
|
|
149
158
|
},
|
|
150
159
|
},
|
|
151
160
|
};
|
|
@@ -100,7 +100,7 @@ const LeftMenu = ({ generalSectionLinks, pluginsSectionLinks }) => {
|
|
|
100
100
|
|
|
101
101
|
<NavSections>
|
|
102
102
|
<NavLink to="/content-manager" icon={<Write />}>
|
|
103
|
-
{formatMessage({ id: 'content-manager
|
|
103
|
+
{formatMessage({ id: 'global.content-manager', defaultMessage: 'Content manager' })}
|
|
104
104
|
</NavLink>
|
|
105
105
|
|
|
106
106
|
{pluginsSectionLinks.length > 0 ? (
|
|
@@ -160,7 +160,7 @@ const LeftMenu = ({ generalSectionLinks, pluginsSectionLinks }) => {
|
|
|
160
160
|
<LinkUser tabIndex={0} onClick={handleToggleUserLinks} to="/me">
|
|
161
161
|
<Typography>
|
|
162
162
|
{formatMessage({
|
|
163
|
-
id: '
|
|
163
|
+
id: 'global.profile',
|
|
164
164
|
defaultMessage: 'Profile',
|
|
165
165
|
})}
|
|
166
166
|
</Typography>
|
|
@@ -8,28 +8,34 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import React, { memo } from 'react';
|
|
11
|
-
import { Redirect, Route } from 'react-router-dom';
|
|
11
|
+
import { Redirect, Route, useLocation } from 'react-router-dom';
|
|
12
12
|
import PropTypes from 'prop-types';
|
|
13
13
|
import { auth } from '@strapi/helper-plugin';
|
|
14
14
|
|
|
15
15
|
/* eslint-disable react/jsx-curly-newline */
|
|
16
16
|
|
|
17
|
-
const PrivateRoute = ({ component: Component, path, ...rest }) =>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
17
|
+
const PrivateRoute = ({ component: Component, path, ...rest }) => {
|
|
18
|
+
const { pathname, search } = useLocation();
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<Route
|
|
22
|
+
path={path}
|
|
23
|
+
render={props =>
|
|
24
|
+
auth.getToken() !== null ? (
|
|
25
|
+
<Component {...rest} {...props} />
|
|
26
|
+
) : (
|
|
27
|
+
<Redirect
|
|
28
|
+
to={{
|
|
29
|
+
pathname: '/auth/login',
|
|
30
|
+
search:
|
|
31
|
+
pathname !== '/' && `?redirectTo=${encodeURIComponent(`${pathname}${search}`)}`,
|
|
32
|
+
}}
|
|
33
|
+
/>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
/>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
33
39
|
|
|
34
40
|
PrivateRoute.propTypes = {
|
|
35
41
|
component: PropTypes.any.isRequired,
|
|
@@ -203,8 +203,6 @@ const CollectionTypeFormWrapper = ({ allLayoutData, children, slug, id, origin }
|
|
|
203
203
|
const displayErrors = useCallback(
|
|
204
204
|
err => {
|
|
205
205
|
const errorPayload = err.response.data;
|
|
206
|
-
console.error(errorPayload);
|
|
207
|
-
|
|
208
206
|
let errorMessage = get(errorPayload, ['error', 'message'], 'Bad Request');
|
|
209
207
|
|
|
210
208
|
// TODO handle errors correctly when back-end ready
|
|
@@ -272,10 +270,14 @@ const CollectionTypeFormWrapper = ({ allLayoutData, children, slug, id, origin }
|
|
|
272
270
|
dispatch(setStatus('resolved'));
|
|
273
271
|
|
|
274
272
|
replace(`/content-manager/collectionType/${slug}/${data.id}${rawQuery}`);
|
|
273
|
+
|
|
274
|
+
return Promise.resolve(data);
|
|
275
275
|
} catch (err) {
|
|
276
|
-
trackUsageRef.current('didNotCreateEntry', { error: err, trackerProperty });
|
|
277
276
|
displayErrors(err);
|
|
277
|
+
trackUsageRef.current('didNotCreateEntry', { error: err, trackerProperty });
|
|
278
278
|
dispatch(setStatus('resolved'));
|
|
279
|
+
|
|
280
|
+
return Promise.reject(err);
|
|
279
281
|
}
|
|
280
282
|
},
|
|
281
283
|
[
|
|
@@ -308,9 +310,13 @@ const CollectionTypeFormWrapper = ({ allLayoutData, children, slug, id, origin }
|
|
|
308
310
|
type: 'success',
|
|
309
311
|
message: { id: getTrad('success.record.publish') },
|
|
310
312
|
});
|
|
313
|
+
|
|
314
|
+
return Promise.resolve(data);
|
|
311
315
|
} catch (err) {
|
|
312
316
|
displayErrors(err);
|
|
313
317
|
dispatch(setStatus('resolved'));
|
|
318
|
+
|
|
319
|
+
return Promise.reject(err);
|
|
314
320
|
}
|
|
315
321
|
}, [cleanReceivedData, displayErrors, id, slug, dispatch, toggleNotification]);
|
|
316
322
|
|
|
@@ -334,11 +340,15 @@ const CollectionTypeFormWrapper = ({ allLayoutData, children, slug, id, origin }
|
|
|
334
340
|
dispatch(submitSucceeded(cleanReceivedData(data)));
|
|
335
341
|
|
|
336
342
|
dispatch(setStatus('resolved'));
|
|
343
|
+
|
|
344
|
+
return Promise.resolve(data);
|
|
337
345
|
} catch (err) {
|
|
338
346
|
trackUsageRef.current('didNotEditEntry', { error: err, trackerProperty });
|
|
339
347
|
displayErrors(err);
|
|
340
348
|
|
|
341
349
|
dispatch(setStatus('resolved'));
|
|
350
|
+
|
|
351
|
+
return Promise.reject(err);
|
|
342
352
|
}
|
|
343
353
|
},
|
|
344
354
|
[cleanReceivedData, displayErrors, slug, id, dispatch, toggleNotification]
|
|
@@ -362,9 +372,13 @@ const CollectionTypeFormWrapper = ({ allLayoutData, children, slug, id, origin }
|
|
|
362
372
|
|
|
363
373
|
dispatch(submitSucceeded(cleanReceivedData(data)));
|
|
364
374
|
dispatch(setStatus('resolved'));
|
|
375
|
+
|
|
376
|
+
return Promise.resolve(data);
|
|
365
377
|
} catch (err) {
|
|
366
378
|
dispatch(setStatus('resolved'));
|
|
367
379
|
displayErrors(err);
|
|
380
|
+
|
|
381
|
+
return Promise.reject(err);
|
|
368
382
|
}
|
|
369
383
|
}, [cleanReceivedData, displayErrors, id, slug, dispatch, toggleNotification]);
|
|
370
384
|
|
|
@@ -57,10 +57,13 @@ const ComponentInitializer = ({ error, isReadOnly, onClick }) => {
|
|
|
57
57
|
</Box>
|
|
58
58
|
{error?.id && (
|
|
59
59
|
<Typography textColor="danger600" variant="pi">
|
|
60
|
-
{formatMessage(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
{formatMessage(
|
|
61
|
+
{
|
|
62
|
+
id: error.id,
|
|
63
|
+
defaultMessage: error.id,
|
|
64
|
+
},
|
|
65
|
+
{ ...error.values }
|
|
66
|
+
)}
|
|
64
67
|
</Typography>
|
|
65
68
|
)}
|
|
66
69
|
</>
|
|
@@ -75,6 +78,8 @@ ComponentInitializer.defaultProps = {
|
|
|
75
78
|
ComponentInitializer.propTypes = {
|
|
76
79
|
error: PropTypes.shape({
|
|
77
80
|
id: PropTypes.string.isRequired,
|
|
81
|
+
defaultMessage: PropTypes.string.isRequired,
|
|
82
|
+
values: PropTypes.object,
|
|
78
83
|
}),
|
|
79
84
|
isReadOnly: PropTypes.bool,
|
|
80
85
|
onClick: PropTypes.func.isRequired,
|
package/admin/src/content-manager/components/DynamicTable/CellContent/RelationMultiple/index.js
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { useQuery } from 'react-query';
|
|
4
|
+
import { useIntl } from 'react-intl';
|
|
5
|
+
import { Typography } from '@strapi/design-system/Typography';
|
|
6
|
+
import { Box } from '@strapi/design-system/Box';
|
|
7
|
+
import { Badge } from '@strapi/design-system/Badge';
|
|
8
|
+
import { SimpleMenu, MenuItem } from '@strapi/design-system/SimpleMenu';
|
|
9
|
+
import { Loader } from '@strapi/design-system/Loader';
|
|
10
|
+
import styled from 'styled-components';
|
|
11
|
+
import { useNotifyAT } from '@strapi/design-system/LiveRegions';
|
|
12
|
+
import { stopPropagation } from '@strapi/helper-plugin';
|
|
13
|
+
import CellValue from '../CellValue';
|
|
14
|
+
import { axiosInstance } from '../../../../../core/utils';
|
|
15
|
+
import { getRequestUrl, getTrad } from '../../../../utils';
|
|
16
|
+
|
|
17
|
+
const TypographyMaxWidth = styled(Typography)`
|
|
18
|
+
max-width: 500px;
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
const fetchRelation = async (endPoint, notifyStatus) => {
|
|
22
|
+
const {
|
|
23
|
+
data: { results, pagination },
|
|
24
|
+
} = await axiosInstance.get(endPoint);
|
|
25
|
+
|
|
26
|
+
notifyStatus();
|
|
27
|
+
|
|
28
|
+
return { results, pagination };
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const RelationMultiple = ({ fieldSchema, metadatas, queryInfos, name, rowId, value }) => {
|
|
32
|
+
const { formatMessage } = useIntl();
|
|
33
|
+
const { notifyStatus } = useNotifyAT();
|
|
34
|
+
const requestURL = getRequestUrl(`${queryInfos.endPoint}/${rowId}/${name.split('.')[0]}`);
|
|
35
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
36
|
+
|
|
37
|
+
const Label = (
|
|
38
|
+
<>
|
|
39
|
+
<Badge>{value.count}</Badge>{' '}
|
|
40
|
+
{formatMessage(
|
|
41
|
+
{
|
|
42
|
+
id: 'content-manager.containers.ListPage.items',
|
|
43
|
+
defaultMessage: '{number, plural, =0 {items} one {item} other {items}}',
|
|
44
|
+
},
|
|
45
|
+
{ number: value.count }
|
|
46
|
+
)}
|
|
47
|
+
</>
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
const notify = () => {
|
|
51
|
+
const message = formatMessage({
|
|
52
|
+
id: getTrad('DynamicTable.relation-loaded'),
|
|
53
|
+
defaultMessage: 'Relations have been loaded',
|
|
54
|
+
});
|
|
55
|
+
notifyStatus(message);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const { data, status } = useQuery(
|
|
59
|
+
[fieldSchema.targetModel, rowId],
|
|
60
|
+
() => fetchRelation(requestURL, notify),
|
|
61
|
+
{
|
|
62
|
+
enabled: isOpen,
|
|
63
|
+
staleTime: 0,
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<Box {...stopPropagation}>
|
|
69
|
+
<SimpleMenu
|
|
70
|
+
label={Label}
|
|
71
|
+
size="S"
|
|
72
|
+
onOpen={() => setIsOpen(true)}
|
|
73
|
+
onClose={() => setIsOpen(false)}
|
|
74
|
+
>
|
|
75
|
+
{status !== 'success' && (
|
|
76
|
+
<MenuItem aria-disabled>
|
|
77
|
+
<Loader small>
|
|
78
|
+
{formatMessage({
|
|
79
|
+
id: getTrad('DynamicTable.relation-loading'),
|
|
80
|
+
defaultMessage: 'Relations are loading',
|
|
81
|
+
})}
|
|
82
|
+
</Loader>
|
|
83
|
+
</MenuItem>
|
|
84
|
+
)}
|
|
85
|
+
|
|
86
|
+
{status === 'success' && (
|
|
87
|
+
<>
|
|
88
|
+
{data?.results.map(entry => (
|
|
89
|
+
<MenuItem key={entry.id} aria-disabled>
|
|
90
|
+
<TypographyMaxWidth ellipsis>
|
|
91
|
+
<CellValue
|
|
92
|
+
type={metadatas.mainField.schema.type}
|
|
93
|
+
value={entry[metadatas.mainField.name] || entry.id}
|
|
94
|
+
/>
|
|
95
|
+
</TypographyMaxWidth>
|
|
96
|
+
</MenuItem>
|
|
97
|
+
))}
|
|
98
|
+
|
|
99
|
+
{data?.pagination.total > 10 && (
|
|
100
|
+
<MenuItem
|
|
101
|
+
aria-disabled
|
|
102
|
+
aria-label={formatMessage({
|
|
103
|
+
id: getTrad('DynamicTable.relation-more'),
|
|
104
|
+
defaultMessage: 'This relation contains more entities than displayed',
|
|
105
|
+
})}
|
|
106
|
+
>
|
|
107
|
+
<Typography>...</Typography>
|
|
108
|
+
</MenuItem>
|
|
109
|
+
)}
|
|
110
|
+
</>
|
|
111
|
+
)}
|
|
112
|
+
</SimpleMenu>
|
|
113
|
+
</Box>
|
|
114
|
+
);
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
RelationMultiple.propTypes = {
|
|
118
|
+
fieldSchema: PropTypes.shape({
|
|
119
|
+
relation: PropTypes.string,
|
|
120
|
+
targetModel: PropTypes.string,
|
|
121
|
+
type: PropTypes.string.isRequired,
|
|
122
|
+
}).isRequired,
|
|
123
|
+
metadatas: PropTypes.shape({
|
|
124
|
+
mainField: PropTypes.shape({
|
|
125
|
+
name: PropTypes.string.isRequired,
|
|
126
|
+
schema: PropTypes.shape({ type: PropTypes.string.isRequired }).isRequired,
|
|
127
|
+
}),
|
|
128
|
+
}).isRequired,
|
|
129
|
+
name: PropTypes.string.isRequired,
|
|
130
|
+
rowId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
131
|
+
queryInfos: PropTypes.shape({ endPoint: PropTypes.string.isRequired }).isRequired,
|
|
132
|
+
value: PropTypes.object.isRequired,
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
export default RelationMultiple;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { Typography } from '@strapi/design-system/Typography';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import CellValue from '../CellValue';
|
|
6
|
+
|
|
7
|
+
const TypographyMaxWidth = styled(Typography)`
|
|
8
|
+
max-width: 500px;
|
|
9
|
+
`;
|
|
10
|
+
|
|
11
|
+
const RelationSingle = ({ metadatas, value }) => {
|
|
12
|
+
return (
|
|
13
|
+
<TypographyMaxWidth textColor="neutral800" ellipsis>
|
|
14
|
+
<CellValue
|
|
15
|
+
type={metadatas.mainField.schema.type}
|
|
16
|
+
value={value[metadatas.mainField.name] || value.id}
|
|
17
|
+
/>
|
|
18
|
+
</TypographyMaxWidth>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
RelationSingle.propTypes = {
|
|
23
|
+
metadatas: PropTypes.shape({
|
|
24
|
+
mainField: PropTypes.shape({
|
|
25
|
+
name: PropTypes.string.isRequired,
|
|
26
|
+
schema: PropTypes.shape({ type: PropTypes.string.isRequired }).isRequired,
|
|
27
|
+
}),
|
|
28
|
+
}).isRequired,
|
|
29
|
+
value: PropTypes.object.isRequired,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export default RelationSingle;
|
package/admin/src/content-manager/components/DynamicTable/CellContent/RepeatableComponent/index.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { useIntl } from 'react-intl';
|
|
5
|
+
import { Badge } from '@strapi/design-system/Badge';
|
|
6
|
+
import { Box } from '@strapi/design-system/Box';
|
|
7
|
+
import { Typography } from '@strapi/design-system/Typography';
|
|
8
|
+
import { SimpleMenu, MenuItem } from '@strapi/design-system/SimpleMenu';
|
|
9
|
+
import { stopPropagation } from '@strapi/helper-plugin';
|
|
10
|
+
|
|
11
|
+
import CellValue from '../CellValue';
|
|
12
|
+
|
|
13
|
+
const TypographyMaxWidth = styled(Typography)`
|
|
14
|
+
max-width: 500px;
|
|
15
|
+
`;
|
|
16
|
+
|
|
17
|
+
const RepeatableComponentCell = ({ value, metadatas }) => {
|
|
18
|
+
const { formatMessage } = useIntl();
|
|
19
|
+
const {
|
|
20
|
+
mainField: { type: mainFieldType, name: mainFieldName },
|
|
21
|
+
} = metadatas;
|
|
22
|
+
|
|
23
|
+
const Label = (
|
|
24
|
+
<>
|
|
25
|
+
<Badge>{value.length}</Badge>{' '}
|
|
26
|
+
{formatMessage(
|
|
27
|
+
{
|
|
28
|
+
id: 'content-manager.containers.ListPage.items',
|
|
29
|
+
defaultMessage: '{number, plural, =0 {items} one {item} other {items}}',
|
|
30
|
+
},
|
|
31
|
+
{ number: value.length }
|
|
32
|
+
)}
|
|
33
|
+
</>
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<Box {...stopPropagation}>
|
|
38
|
+
<SimpleMenu label={Label} size="S">
|
|
39
|
+
{value.map(item => (
|
|
40
|
+
<MenuItem key={item.id} aria-disabled>
|
|
41
|
+
<TypographyMaxWidth ellipsis>
|
|
42
|
+
<CellValue type={mainFieldType} value={item[mainFieldName] || item.id} />
|
|
43
|
+
</TypographyMaxWidth>
|
|
44
|
+
</MenuItem>
|
|
45
|
+
))}
|
|
46
|
+
</SimpleMenu>
|
|
47
|
+
</Box>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
RepeatableComponentCell.propTypes = {
|
|
52
|
+
metadatas: PropTypes.shape({
|
|
53
|
+
mainField: PropTypes.shape({
|
|
54
|
+
name: PropTypes.string,
|
|
55
|
+
type: PropTypes.string,
|
|
56
|
+
value: PropTypes.string,
|
|
57
|
+
}),
|
|
58
|
+
}).isRequired,
|
|
59
|
+
value: PropTypes.array.isRequired,
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export default RepeatableComponentCell;
|