@strapi/admin 4.1.4 → 4.1.6-alpha.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/StrapiApp.js +40 -42
- package/admin/src/components/AuthenticatedApp/utils/api.js +1 -1
- package/admin/src/components/AutoReloadOverlayBlockerProvider/Blocker.js +1 -1
- package/admin/src/components/GuidedTour/Homepage/index.js +2 -2
- package/admin/src/components/GuidedTour/Modal/components/Modal.js +1 -1
- package/admin/src/components/LeftMenu/index.js +2 -2
- package/admin/src/components/Providers/index.js +65 -32
- package/admin/src/components/Theme/index.js +11 -12
- package/admin/src/components/ThemeToggleProvider/index.js +66 -0
- 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 +29 -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/RepeatableComponent/AccordionGroupCustom/index.js +3 -1
- 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 +3 -1
- package/admin/src/content-manager/components/Wysiwyg/EditorStylesContainer.js +4 -2
- 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/index.js +2 -2
- package/admin/src/content-manager/pages/EditView/Header/index.js +1 -1
- 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/ListViewLayoutManager/index.js +1 -1
- package/admin/src/content-manager/utils/checkIfAttributeIsDisplayable.js +1 -1
- package/admin/src/contexts/ThemeToggle/index.js +5 -0
- package/admin/src/contexts/index.js +1 -0
- package/admin/src/hooks/index.js +1 -0
- package/admin/src/hooks/useMenu/reducer.js +3 -3
- package/admin/src/hooks/useReleaseNotification/index.js +1 -1
- package/admin/src/hooks/useSettingsMenu/init.js +2 -2
- package/admin/src/hooks/useThemeToggle/index.js +10 -0
- package/admin/src/layouts/UnauthenticatedLayout/index.js +1 -1
- package/admin/src/pages/Admin/Onboarding/index.js +2 -2
- 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 +8 -3
- package/admin/src/pages/HomePage/ContentBlocks.js +1 -1
- package/admin/src/pages/HomePage/SocialLinks.js +1 -7
- package/admin/src/pages/InstalledPluginsPage/Plugins.js +3 -3
- package/admin/src/pages/InstalledPluginsPage/index.js +1 -1
- package/admin/src/pages/MarketplacePage/components/PluginCard/InstallPluginButton.js +66 -0
- package/admin/src/pages/MarketplacePage/components/PluginCard/index.js +13 -36
- package/admin/src/pages/MarketplacePage/index.js +18 -2
- package/admin/src/pages/ProfilePage/index.js +79 -15
- package/admin/src/pages/ProfilePage/utils/api.js +4 -2
- 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/translations/ar.json +0 -6
- package/admin/src/translations/cs.json +0 -8
- package/admin/src/translations/de.json +0 -26
- package/admin/src/translations/dk.json +0 -53
- package/admin/src/translations/en.json +87 -102
- 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 +0 -53
- package/admin/src/translations/ko.json +0 -56
- 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 +0 -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 +1 -10
- package/admin/src/translations/zh-Hans.json +0 -53
- package/admin/src/translations/zh.json +0 -56
- package/build/4362.d8299f0c.chunk.js +1 -0
- package/build/{6250.836851ca.chunk.js → 6404.3c2d0a81.chunk.js} +1 -1
- package/build/849.82c29ba7.chunk.js +1 -0
- package/build/9260.4233fae2.chunk.js +2 -0
- package/build/{9260.fa40c7bd.chunk.js.LICENSE.txt → 9260.4233fae2.chunk.js.LICENSE.txt} +0 -0
- package/build/Admin-authenticatedApp.cf7104f9.chunk.js +1 -0
- package/build/Admin_homePage.4a3aa22e.chunk.js +1 -0
- package/build/Admin_marketplace.4748c8f6.chunk.js +1 -0
- package/build/Admin_pluginsPage.89a96d29.chunk.js +1 -0
- package/build/Admin_profilePage.7869a07a.chunk.js +1 -0
- package/build/Admin_settingsPage.2763454c.chunk.js +1 -0
- package/build/admin-edit-roles-page.fbcc195d.chunk.js +1 -0
- package/build/admin-edit-users.91e8f5e4.chunk.js +1 -0
- package/build/admin-users.0a6acd73.chunk.js +1 -0
- package/build/api-tokens-create-page.76e13a35.chunk.js +1 -0
- package/build/api-tokens-edit-page.b3d48a7f.chunk.js +1 -0
- package/build/api-tokens-list-page.4e822ac8.chunk.js +1 -0
- package/build/ar-json.cc19c13c.chunk.js +1 -0
- package/build/content-manager.2f6a2082.chunk.js +1 -0
- package/build/{content-type-builder-translation-ar-json.f1fedc12.chunk.js → content-type-builder-translation-ar-json.ab0a0caa.chunk.js} +1 -1
- package/build/content-type-builder-translation-cs-json.e3913c9f.chunk.js +1 -0
- package/build/content-type-builder-translation-de-json.5eb3135d.chunk.js +1 -0
- package/build/content-type-builder-translation-dk-json.52805572.chunk.js +1 -0
- package/build/content-type-builder-translation-en-json.e51b2ec3.chunk.js +1 -0
- package/build/content-type-builder-translation-es-json.5a362abf.chunk.js +1 -0
- package/build/content-type-builder-translation-fr-json.afd4a12f.chunk.js +1 -0
- package/build/content-type-builder-translation-id-json.4a21dfab.chunk.js +1 -0
- package/build/content-type-builder-translation-it-json.4fa203b1.chunk.js +1 -0
- package/build/{content-type-builder-translation-ja-json.1459fb88.chunk.js → content-type-builder-translation-ja-json.cbb3b88a.chunk.js} +1 -1
- package/build/content-type-builder-translation-ko-json.7daf86c3.chunk.js +1 -0
- package/build/content-type-builder-translation-ms-json.3755f8c8.chunk.js +1 -0
- package/build/content-type-builder-translation-nl-json.6f8d924b.chunk.js +1 -0
- package/build/{content-type-builder-translation-pl-json.01dc068c.chunk.js → content-type-builder-translation-pl-json.fc0b0c20.chunk.js} +1 -1
- package/build/{content-type-builder-translation-pt-BR-json.d311d056.chunk.js → content-type-builder-translation-pt-BR-json.86b192fa.chunk.js} +1 -1
- package/build/{content-type-builder-translation-pt-json.4893266f.chunk.js → content-type-builder-translation-pt-json.b584f79f.chunk.js} +1 -1
- package/build/content-type-builder-translation-ru-json.7648049a.chunk.js +1 -0
- package/build/content-type-builder-translation-sk-json.c12a8dec.chunk.js +1 -0
- package/build/content-type-builder-translation-th-json.668cd5f5.chunk.js +1 -0
- package/build/{content-type-builder-translation-tr-json.696283a5.chunk.js → content-type-builder-translation-tr-json.0f52e1e8.chunk.js} +1 -1
- package/build/content-type-builder-translation-uk-json.4bf80448.chunk.js +1 -0
- package/build/content-type-builder-translation-zh-Hans-json.76e58138.chunk.js +1 -0
- package/build/content-type-builder-translation-zh-json.0bec81f1.chunk.js +1 -0
- package/build/content-type-builder.19ae7eef.chunk.js +1 -0
- package/build/cs-json.ce6f2e52.chunk.js +1 -0
- package/build/de-json.2087d61e.chunk.js +1 -0
- package/build/dk-json.fb9ee45a.chunk.js +1 -0
- package/build/{email-settings-page.27ee4a98.chunk.js → email-settings-page.40ee2bda.chunk.js} +1 -1
- package/build/en-json.c55e5344.chunk.js +1 -0
- package/build/es-json.8f4d89e2.chunk.js +1 -0
- package/build/fr-json.2a0b93ed.chunk.js +1 -0
- package/build/he-json.917d416c.chunk.js +1 -0
- package/build/hu-json.bee23c51.chunk.js +1 -0
- package/build/{i18n-settings-page.c4018651.chunk.js → i18n-settings-page.1f6be747.chunk.js} +1 -1
- package/build/i18n-translation-de-json.96ae1f68.chunk.js +1 -0
- package/build/id-json.fef679cb.chunk.js +1 -0
- package/build/index.html +1 -1
- package/build/it-json.937b2108.chunk.js +1 -0
- package/build/ja-json.b4818378.chunk.js +1 -0
- package/build/ko-json.8294a7fc.chunk.js +1 -0
- package/build/{main.4f8479af.js → main.06e1a4bf.js} +2 -2
- package/build/{main.4f8479af.js.LICENSE.txt → main.06e1a4bf.js.LICENSE.txt} +0 -0
- package/build/ms-json.f46167ef.chunk.js +1 -0
- package/build/nl-json.86eae27d.chunk.js +1 -0
- package/build/no-json.17ecda5d.chunk.js +1 -0
- package/build/pl-json.0db77f2c.chunk.js +1 -0
- package/build/pt-BR-json.4c90cb2d.chunk.js +1 -0
- package/build/pt-json.ef0efd89.chunk.js +1 -0
- package/build/ru-json.da33236d.chunk.js +1 -0
- package/build/{runtime~main.0e904492.js → runtime~main.b090a1bb.js} +1 -1
- package/build/sk-json.797e898f.chunk.js +1 -0
- package/build/sso-settings-page.c5dda65d.chunk.js +1 -0
- package/build/sv-json.5bbe6a4f.chunk.js +1 -0
- package/build/th-json.c1393c06.chunk.js +1 -0
- package/build/tr-json.57cde8b0.chunk.js +1 -0
- package/build/uk-json.c6df66d2.chunk.js +1 -0
- package/build/{upload-settings.4401f36d.chunk.js → upload-settings.9d3231f4.chunk.js} +1 -1
- package/build/upload-translation-de-json.55a7e43a.chunk.js +1 -0
- package/build/upload-translation-dk-json.b74134c8.chunk.js +1 -0
- package/build/upload-translation-en-json.c4e56528.chunk.js +1 -0
- package/build/upload-translation-es-json.15a3015f.chunk.js +1 -0
- package/build/upload-translation-fr-json.b12f7247.chunk.js +1 -0
- package/build/upload-translation-he-json.bee013d1.chunk.js +1 -0
- package/build/upload-translation-it-json.43ec0a8d.chunk.js +1 -0
- package/build/upload-translation-ja-json.03f1af04.chunk.js +1 -0
- package/build/upload-translation-ko-json.08ad9013.chunk.js +1 -0
- package/build/upload-translation-ms-json.30974c82.chunk.js +1 -0
- package/build/upload-translation-pl-json.3740abed.chunk.js +1 -0
- package/build/upload-translation-pt-BR-json.c7656183.chunk.js +1 -0
- package/build/upload-translation-ru-json.0dd4f526.chunk.js +1 -0
- package/build/upload-translation-sk-json.55cacd22.chunk.js +1 -0
- package/build/upload-translation-th-json.f7aa9392.chunk.js +1 -0
- package/build/upload-translation-uk-json.696a16f3.chunk.js +1 -0
- package/build/upload-translation-zh-Hans-json.de7bc63f.chunk.js +1 -0
- package/build/upload-translation-zh-json.bbc1ed41.chunk.js +1 -0
- package/build/{upload.5a2dded7.chunk.js → upload.8edef1ea.chunk.js} +1 -1
- package/build/{users-advanced-settings-page.8905d8d8.chunk.js → users-advanced-settings-page.48c437f0.chunk.js} +1 -1
- package/build/users-email-settings-page.f39866d6.chunk.js +1 -0
- package/build/users-permissions-translation-ar-json.667e7eee.chunk.js +1 -0
- package/build/users-permissions-translation-cs-json.995b5d76.chunk.js +1 -0
- package/build/users-permissions-translation-de-json.a5c8db9c.chunk.js +1 -0
- package/build/users-permissions-translation-dk-json.1fe5e07a.chunk.js +1 -0
- package/build/users-permissions-translation-en-json.0e0bc290.chunk.js +1 -0
- package/build/users-permissions-translation-es-json.05669296.chunk.js +1 -0
- package/build/users-permissions-translation-fr-json.3e3522c3.chunk.js +1 -0
- package/build/users-permissions-translation-id-json.186a3f65.chunk.js +1 -0
- package/build/users-permissions-translation-it-json.ee5742c4.chunk.js +1 -0
- package/build/users-permissions-translation-ja-json.c9cafa6e.chunk.js +1 -0
- package/build/users-permissions-translation-ko-json.170f89c2.chunk.js +1 -0
- package/build/users-permissions-translation-ms-json.3a128ff4.chunk.js +1 -0
- package/build/users-permissions-translation-nl-json.4146aed1.chunk.js +1 -0
- package/build/users-permissions-translation-pl-json.a61de7ed.chunk.js +1 -0
- package/build/users-permissions-translation-pt-BR-json.51b1cc15.chunk.js +1 -0
- package/build/users-permissions-translation-pt-json.85f0e0e1.chunk.js +1 -0
- package/build/users-permissions-translation-ru-json.a19b2400.chunk.js +1 -0
- package/build/users-permissions-translation-sk-json.27af7260.chunk.js +1 -0
- package/build/users-permissions-translation-sv-json.739657b9.chunk.js +1 -0
- package/build/users-permissions-translation-th-json.f001fff3.chunk.js +1 -0
- package/build/users-permissions-translation-tr-json.3aae5dda.chunk.js +1 -0
- package/build/users-permissions-translation-uk-json.a66c7a8c.chunk.js +1 -0
- package/build/users-permissions-translation-vi-json.685c65cc.chunk.js +1 -0
- package/build/users-permissions-translation-zh-Hans-json.2202741e.chunk.js +1 -0
- package/build/users-permissions-translation-zh-json.429a3190.chunk.js +1 -0
- package/build/users-providers-settings-page.574ed765.chunk.js +1 -0
- package/build/{users-roles-settings-page.a2f6277a.chunk.js → users-roles-settings-page.b836dc30.chunk.js} +1 -1
- package/build/vi-json.104a6f3a.chunk.js +1 -0
- package/build/webhook-edit-page.b791c6f9.chunk.js +1 -0
- package/build/{webhook-list-page.c21b5a9a.chunk.js → webhook-list-page.502d1236.chunk.js} +1 -1
- package/build/zh-Hans-json.9afc1adf.chunk.js +1 -0
- package/build/zh-json.f36abb77.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/package.json +5 -5
- package/scripts/build.js +15 -1
- package/server/bootstrap.js +6 -6
- 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/themes/colors.js +0 -51
- package/admin/src/themes/fontWeights.js +0 -8
- package/admin/src/themes/index.js +0 -13
- package/admin/src/themes/sizes.js +0 -31
- package/build/4362.d13f7b42.chunk.js +0 -1
- package/build/849.17f011e8.chunk.js +0 -1
- package/build/9260.fa40c7bd.chunk.js +0 -2
- package/build/Admin-authenticatedApp.8766b04d.chunk.js +0 -1
- package/build/Admin_homePage.86604515.chunk.js +0 -1
- package/build/Admin_marketplace.89a0a014.chunk.js +0 -1
- package/build/Admin_pluginsPage.97a514db.chunk.js +0 -1
- package/build/Admin_profilePage.c497b39d.chunk.js +0 -1
- package/build/Admin_settingsPage.55ec1f30.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.2740c223.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/content-manager.31be1448.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-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-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-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.de5d18ad.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/en-json.2bc27a3d.chunk.js +0 -1
- package/build/es-json.61553168.chunk.js +0 -1
- package/build/fr-json.a9ce0700.chunk.js +0 -1
- package/build/he-json.1742494e.chunk.js +0 -1
- package/build/hu-json.e667d285.chunk.js +0 -1
- package/build/i18n-translation-de-json.c5c9054f.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.e13f04e8.chunk.js +0 -1
- package/build/ko-json.2200c9c9.chunk.js +0 -1
- 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/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-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.c334dd82.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/users-email-settings-page.862eb51e.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/vi-json.1e850069.chunk.js +0 -1
- package/build/webhook-edit-page.d170eda1.chunk.js +0 -1
- package/build/zh-Hans-json.55f6475b.chunk.js +0 -1
- package/build/zh-json.c3c2b225.chunk.js +0 -1
package/admin/src/StrapiApp.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BrowserRouter } from 'react-router-dom';
|
|
3
|
-
import { lightTheme } from '@strapi/design-system/themes';
|
|
3
|
+
import { lightTheme, darkTheme } from '@strapi/design-system/themes';
|
|
4
4
|
import merge from 'lodash/merge';
|
|
5
5
|
import pick from 'lodash/pick';
|
|
6
6
|
import isFunction from 'lodash/isFunction';
|
|
@@ -13,7 +13,6 @@ import App from './pages/App';
|
|
|
13
13
|
import AuthLogo from './assets/images/logo_strapi_auth_v4.png';
|
|
14
14
|
import MenuLogo from './assets/images/logo_strapi_menu.png';
|
|
15
15
|
import Providers from './components/Providers';
|
|
16
|
-
import Theme from './components/Theme';
|
|
17
16
|
import languageNativeNames from './translations/languageNativeNames';
|
|
18
17
|
import {
|
|
19
18
|
INJECT_COLUMN_IN_TABLE,
|
|
@@ -34,7 +33,7 @@ class StrapiApp {
|
|
|
34
33
|
locales: ['en'],
|
|
35
34
|
menuLogo: MenuLogo,
|
|
36
35
|
notifications: { releases: true },
|
|
37
|
-
|
|
36
|
+
themes: { light: lightTheme, dark: darkTheme },
|
|
38
37
|
translations: {},
|
|
39
38
|
tutorials: true,
|
|
40
39
|
};
|
|
@@ -226,7 +225,7 @@ class StrapiApp {
|
|
|
226
225
|
}
|
|
227
226
|
|
|
228
227
|
if (this.customConfigurations?.theme) {
|
|
229
|
-
|
|
228
|
+
merge(this.configurations.themes.light, this.customConfigurations.theme);
|
|
230
229
|
}
|
|
231
230
|
|
|
232
231
|
if (this.customConfigurations?.notifications?.releases !== undefined) {
|
|
@@ -427,44 +426,43 @@ class StrapiApp {
|
|
|
427
426
|
} = this.library;
|
|
428
427
|
|
|
429
428
|
return (
|
|
430
|
-
<
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
runHookWaterfall
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
</Theme>
|
|
429
|
+
<Providers
|
|
430
|
+
authLogo={this.configurations.authLogo}
|
|
431
|
+
components={components}
|
|
432
|
+
fields={fields}
|
|
433
|
+
localeNames={localeNames}
|
|
434
|
+
getAdminInjectedComponents={this.getAdminInjectedComponents}
|
|
435
|
+
getPlugin={this.getPlugin}
|
|
436
|
+
messages={this.configurations.translations}
|
|
437
|
+
menu={this.menu}
|
|
438
|
+
menuLogo={this.configurations.menuLogo}
|
|
439
|
+
plugins={this.plugins}
|
|
440
|
+
runHookParallel={this.runHookParallel}
|
|
441
|
+
runHookWaterfall={(name, initialValue, async = false) => {
|
|
442
|
+
return this.runHookWaterfall(name, initialValue, async, store);
|
|
443
|
+
}}
|
|
444
|
+
runHookSeries={this.runHookSeries}
|
|
445
|
+
themes={this.configurations.themes}
|
|
446
|
+
settings={this.settings}
|
|
447
|
+
showTutorials={this.configurations.tutorials}
|
|
448
|
+
showReleaseNotification={this.configurations.notifications.releases}
|
|
449
|
+
store={store}
|
|
450
|
+
>
|
|
451
|
+
<>
|
|
452
|
+
<Helmet
|
|
453
|
+
link={[
|
|
454
|
+
{
|
|
455
|
+
rel: 'icon',
|
|
456
|
+
type: 'image/png',
|
|
457
|
+
href: this.configurations.head.favicon,
|
|
458
|
+
},
|
|
459
|
+
]}
|
|
460
|
+
/>
|
|
461
|
+
<BrowserRouter basename={basename}>
|
|
462
|
+
<App store={store} />
|
|
463
|
+
</BrowserRouter>
|
|
464
|
+
</>
|
|
465
|
+
</Providers>
|
|
468
466
|
);
|
|
469
467
|
}
|
|
470
468
|
}
|
|
@@ -21,7 +21,7 @@ const fetchStrapiLatestRelease = async toggleNotification => {
|
|
|
21
21
|
link: {
|
|
22
22
|
url: `https://github.com/strapi/strapi/releases/tag/${tag_name}`,
|
|
23
23
|
label: {
|
|
24
|
-
id: '
|
|
24
|
+
id: 'global.see-more',
|
|
25
25
|
},
|
|
26
26
|
},
|
|
27
27
|
blockTransition: true,
|
|
@@ -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>
|
|
@@ -38,9 +38,9 @@ const GuidedTourHomepage = () => {
|
|
|
38
38
|
const activeSection = enrichedSections.find(section => !section.isDone)?.key;
|
|
39
39
|
|
|
40
40
|
const handleSkip = () => {
|
|
41
|
-
setSkipped(true)
|
|
41
|
+
setSkipped(true);
|
|
42
42
|
trackUsage('didSkipGuidedtour');
|
|
43
|
-
}
|
|
43
|
+
};
|
|
44
44
|
|
|
45
45
|
return (
|
|
46
46
|
<Box
|
|
@@ -17,7 +17,7 @@ const ModalWrapper = styled(Flex)`
|
|
|
17
17
|
z-index: 4;
|
|
18
18
|
inset: 0;
|
|
19
19
|
/* this is theme.colors.neutral800 with opacity */
|
|
20
|
-
background: ${({ theme }) => `${theme.colors.neutral800}
|
|
20
|
+
background: ${({ theme }) => `${theme.colors.neutral800}1F`};
|
|
21
21
|
`;
|
|
22
22
|
|
|
23
23
|
const Modal = ({ onClose, onSkip, children, hideSkip }) => {
|
|
@@ -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>
|
|
@@ -9,6 +9,8 @@ import GuidedTour from '../GuidedTour';
|
|
|
9
9
|
import AutoReloadOverlayBlockerProvider from '../AutoReloadOverlayBlockerProvider';
|
|
10
10
|
import Notifications from '../Notifications';
|
|
11
11
|
import OverlayBlocker from '../OverlayBlocker';
|
|
12
|
+
import ThemeToggleProvider from '../ThemeToggleProvider';
|
|
13
|
+
import Theme from '../Theme';
|
|
12
14
|
|
|
13
15
|
const queryClient = new QueryClient({
|
|
14
16
|
defaultOptions: {
|
|
@@ -36,41 +38,45 @@ const Providers = ({
|
|
|
36
38
|
settings,
|
|
37
39
|
showReleaseNotification,
|
|
38
40
|
showTutorials,
|
|
39
|
-
|
|
40
41
|
store,
|
|
42
|
+
themes,
|
|
41
43
|
}) => {
|
|
42
44
|
return (
|
|
43
|
-
<
|
|
44
|
-
<
|
|
45
|
-
<
|
|
46
|
-
<
|
|
47
|
-
value={{
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
<
|
|
61
|
-
<
|
|
62
|
-
<
|
|
63
|
-
<
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
45
|
+
<ThemeToggleProvider themes={themes}>
|
|
46
|
+
<Theme>
|
|
47
|
+
<QueryClientProvider client={queryClient}>
|
|
48
|
+
<Provider store={store}>
|
|
49
|
+
<AdminContext.Provider value={{ getAdminInjectedComponents }}>
|
|
50
|
+
<ConfigurationsContext.Provider
|
|
51
|
+
value={{ authLogo, menuLogo, showReleaseNotification, showTutorials }}
|
|
52
|
+
>
|
|
53
|
+
<StrapiAppProvider
|
|
54
|
+
getPlugin={getPlugin}
|
|
55
|
+
menu={menu}
|
|
56
|
+
plugins={plugins}
|
|
57
|
+
runHookParallel={runHookParallel}
|
|
58
|
+
runHookWaterfall={runHookWaterfall}
|
|
59
|
+
runHookSeries={runHookSeries}
|
|
60
|
+
settings={settings}
|
|
61
|
+
>
|
|
62
|
+
<LibraryProvider components={components} fields={fields}>
|
|
63
|
+
<LanguageProvider messages={messages} localeNames={localeNames}>
|
|
64
|
+
<AutoReloadOverlayBlockerProvider>
|
|
65
|
+
<OverlayBlocker>
|
|
66
|
+
<GuidedTour>
|
|
67
|
+
<Notifications>{children}</Notifications>
|
|
68
|
+
</GuidedTour>
|
|
69
|
+
</OverlayBlocker>
|
|
70
|
+
</AutoReloadOverlayBlockerProvider>
|
|
71
|
+
</LanguageProvider>
|
|
72
|
+
</LibraryProvider>
|
|
73
|
+
</StrapiAppProvider>
|
|
74
|
+
</ConfigurationsContext.Provider>
|
|
75
|
+
</AdminContext.Provider>
|
|
76
|
+
</Provider>
|
|
77
|
+
</QueryClientProvider>
|
|
78
|
+
</Theme>
|
|
79
|
+
</ThemeToggleProvider>
|
|
74
80
|
);
|
|
75
81
|
};
|
|
76
82
|
|
|
@@ -104,6 +110,33 @@ Providers.propTypes = {
|
|
|
104
110
|
showReleaseNotification: PropTypes.bool.isRequired,
|
|
105
111
|
showTutorials: PropTypes.bool.isRequired,
|
|
106
112
|
store: PropTypes.object.isRequired,
|
|
113
|
+
themes: PropTypes.shape({
|
|
114
|
+
light: PropTypes.shape({
|
|
115
|
+
colors: PropTypes.object.isRequired,
|
|
116
|
+
shadows: PropTypes.object.isRequired,
|
|
117
|
+
sizes: PropTypes.object.isRequired,
|
|
118
|
+
zIndices: PropTypes.array.isRequired,
|
|
119
|
+
spaces: PropTypes.array.isRequired,
|
|
120
|
+
borderRadius: PropTypes.string.isRequired,
|
|
121
|
+
mediaQueries: PropTypes.object.isRequired,
|
|
122
|
+
fontSizes: PropTypes.array.isRequired,
|
|
123
|
+
lineHeights: PropTypes.array.isRequired,
|
|
124
|
+
fontWeights: PropTypes.object.isRequired,
|
|
125
|
+
}).isRequired,
|
|
126
|
+
dark: PropTypes.shape({
|
|
127
|
+
colors: PropTypes.object.isRequired,
|
|
128
|
+
shadows: PropTypes.object.isRequired,
|
|
129
|
+
sizes: PropTypes.object.isRequired,
|
|
130
|
+
zIndices: PropTypes.array.isRequired,
|
|
131
|
+
spaces: PropTypes.array.isRequired,
|
|
132
|
+
borderRadius: PropTypes.string.isRequired,
|
|
133
|
+
mediaQueries: PropTypes.object.isRequired,
|
|
134
|
+
fontSizes: PropTypes.array.isRequired,
|
|
135
|
+
lineHeights: PropTypes.array.isRequired,
|
|
136
|
+
fontWeights: PropTypes.object.isRequired,
|
|
137
|
+
}).isRequired,
|
|
138
|
+
custom: PropTypes.object,
|
|
139
|
+
}).isRequired,
|
|
107
140
|
};
|
|
108
141
|
|
|
109
142
|
export default Providers;
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ThemeProvider } from '@strapi/design-system/ThemeProvider';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import {
|
|
4
|
+
import { useThemeToggle } from '../../hooks';
|
|
5
5
|
import GlobalStyle from '../GlobalStyle';
|
|
6
6
|
|
|
7
|
-
const Theme = ({ children
|
|
8
|
-
|
|
9
|
-
{children}
|
|
10
|
-
<GlobalStyle />
|
|
11
|
-
</ThemeProvider>
|
|
12
|
-
);
|
|
7
|
+
const Theme = ({ children }) => {
|
|
8
|
+
const { currentTheme, themes } = useThemeToggle();
|
|
13
9
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
return (
|
|
11
|
+
<ThemeProvider theme={themes[currentTheme] || themes.light}>
|
|
12
|
+
{children}
|
|
13
|
+
<GlobalStyle />
|
|
14
|
+
</ThemeProvider>
|
|
15
|
+
);
|
|
17
16
|
};
|
|
18
17
|
|
|
19
|
-
Theme.
|
|
20
|
-
|
|
18
|
+
Theme.propTypes = {
|
|
19
|
+
children: PropTypes.element.isRequired,
|
|
21
20
|
};
|
|
22
21
|
|
|
23
22
|
export default Theme;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* ThemeToggleProvider
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import React, { useState } from 'react';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
|
+
import { ThemeToggleContext } from '../../contexts';
|
|
10
|
+
|
|
11
|
+
const THEME_KEY = 'STRAPI_THEME';
|
|
12
|
+
|
|
13
|
+
const getDefaultTheme = () => {
|
|
14
|
+
const browserTheme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
15
|
+
const persistedTheme = localStorage.getItem(THEME_KEY);
|
|
16
|
+
|
|
17
|
+
return persistedTheme || browserTheme;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const ThemeToggleProvider = ({ children, themes }) => {
|
|
21
|
+
const [currentTheme, setCurrentTheme] = useState(getDefaultTheme());
|
|
22
|
+
|
|
23
|
+
const handleChangeTheme = nextTheme => {
|
|
24
|
+
setCurrentTheme(nextTheme);
|
|
25
|
+
localStorage.setItem(THEME_KEY, nextTheme);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<ThemeToggleContext.Provider value={{ currentTheme, onChangeTheme: handleChangeTheme, themes }}>
|
|
30
|
+
{children}
|
|
31
|
+
</ThemeToggleContext.Provider>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
ThemeToggleProvider.propTypes = {
|
|
36
|
+
children: PropTypes.node.isRequired,
|
|
37
|
+
themes: PropTypes.shape({
|
|
38
|
+
light: PropTypes.shape({
|
|
39
|
+
colors: PropTypes.object.isRequired,
|
|
40
|
+
shadows: PropTypes.object.isRequired,
|
|
41
|
+
sizes: PropTypes.object.isRequired,
|
|
42
|
+
zIndices: PropTypes.array.isRequired,
|
|
43
|
+
spaces: PropTypes.array.isRequired,
|
|
44
|
+
borderRadius: PropTypes.string.isRequired,
|
|
45
|
+
mediaQueries: PropTypes.object.isRequired,
|
|
46
|
+
fontSizes: PropTypes.array.isRequired,
|
|
47
|
+
lineHeights: PropTypes.array.isRequired,
|
|
48
|
+
fontWeights: PropTypes.object.isRequired,
|
|
49
|
+
}).isRequired,
|
|
50
|
+
dark: PropTypes.shape({
|
|
51
|
+
colors: PropTypes.object.isRequired,
|
|
52
|
+
shadows: PropTypes.object.isRequired,
|
|
53
|
+
sizes: PropTypes.object.isRequired,
|
|
54
|
+
zIndices: PropTypes.array.isRequired,
|
|
55
|
+
spaces: PropTypes.array.isRequired,
|
|
56
|
+
borderRadius: PropTypes.string.isRequired,
|
|
57
|
+
mediaQueries: PropTypes.object.isRequired,
|
|
58
|
+
fontSizes: PropTypes.array.isRequired,
|
|
59
|
+
lineHeights: PropTypes.array.isRequired,
|
|
60
|
+
fontWeights: PropTypes.object.isRequired,
|
|
61
|
+
}).isRequired,
|
|
62
|
+
custom: PropTypes.object,
|
|
63
|
+
}).isRequired,
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export default ThemeToggleProvider;
|
|
@@ -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;
|