@strapi/admin 4.5.0-alpha.0 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/admin/src/StrapiApp.js +21 -18
- package/admin/src/assets/images/hot-air-balloon.png +0 -0
- package/admin/src/assets/images/icon_offline-cloud.svg +3 -3
- package/admin/src/assets/images/logo-strapi-2022.svg +7 -0
- package/admin/src/assets/images/upgrade-details.png +0 -0
- package/admin/src/components/Providers/index.js +14 -10
- package/admin/src/content-manager/components/CollectionTypeFormWrapper/index.js +24 -0
- package/admin/src/content-manager/components/DynamicTable/CellContent/CellValue.js +1 -1
- package/admin/src/content-manager/components/DynamicTable/CellContent/RelationMultiple/index.js +5 -4
- package/admin/src/content-manager/components/DynamicTable/CellContent/index.js +10 -0
- package/admin/src/content-manager/components/DynamicTable/TableRows/index.js +20 -15
- package/admin/src/content-manager/components/DynamicTable/index.js +21 -4
- package/admin/src/content-manager/components/DynamicZone/components/Component/index.js +19 -9
- package/admin/src/content-manager/components/DynamicZone/index.js +6 -2
- package/admin/src/content-manager/components/EditViewDataManagerProvider/index.js +153 -63
- package/admin/src/content-manager/components/EditViewDataManagerProvider/reducer.js +180 -132
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/cleanData.js +70 -16
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/findLeafByPathAndReplace.js +52 -0
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/index.js +2 -0
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/recursivelyFindPathsBasedOnCondition.js +72 -0
- package/admin/src/content-manager/components/FieldComponent/index.js +9 -2
- package/admin/src/content-manager/components/FieldTypeIcon/index.js +31 -1
- package/admin/src/content-manager/components/Inputs/index.js +36 -14
- package/admin/src/content-manager/components/NonRepeatableComponent/index.js +2 -0
- package/admin/src/content-manager/components/PreviewWysiwyg/index.js +1 -1
- package/admin/src/content-manager/components/RelationInput/RelationInput.js +163 -96
- package/admin/src/content-manager/components/RelationInput/components/RelationItem.js +2 -2
- package/admin/src/content-manager/components/RelationInput/constants.js +1 -1
- package/admin/src/content-manager/components/RelationInputDataManager/RelationInputDataManager.js +116 -73
- package/admin/src/content-manager/components/RelationInputDataManager/utils/diffRelations.js +24 -0
- package/admin/src/content-manager/components/RelationInputDataManager/utils/index.js +3 -1
- package/admin/src/content-manager/components/RelationInputDataManager/utils/normalizeRelations.js +17 -31
- package/admin/src/content-manager/components/RelationInputDataManager/utils/normalizeSearchResults.js +16 -0
- package/admin/src/content-manager/components/RelationInputDataManager/utils/select.js +35 -11
- package/admin/src/content-manager/components/RepeatableComponent/DraggedItem/index.js +5 -0
- package/admin/src/content-manager/components/RepeatableComponent/index.js +4 -3
- package/admin/src/content-manager/components/SingleTypeFormWrapper/index.js +23 -0
- package/admin/src/content-manager/hooks/__test__/usePrev.test.js +26 -0
- package/admin/src/content-manager/hooks/index.js +1 -0
- package/admin/src/content-manager/hooks/useFetchContentTypeLayout/utils/formatLayouts.js +19 -48
- package/admin/src/content-manager/hooks/usePrev.js +14 -0
- package/admin/src/content-manager/hooks/useRelation/useRelation.js +116 -15
- package/admin/src/content-manager/pages/App/reducer.js +3 -0
- package/admin/src/content-manager/pages/EditSettingsView/components/FormModal.js +7 -2
- package/admin/src/content-manager/pages/EditSettingsView/index.js +2 -1
- package/admin/src/content-manager/pages/EditView/Header/index.js +118 -50
- package/admin/src/content-manager/pages/EditView/Header/utils/select.js +4 -0
- package/admin/src/content-manager/pages/EditView/index.js +102 -93
- package/admin/src/content-manager/pages/ListSettingsView/components/DraggableCard.js +3 -3
- package/admin/src/content-manager/pages/ListSettingsView/components/Settings.js +2 -2
- package/admin/src/content-manager/pages/ListSettingsView/components/SortDisplayedFields.js +1 -1
- package/admin/src/content-manager/pages/ListView/index.js +24 -15
- package/admin/src/content-manager/pages/ListView/utils/buildQueryString.js +14 -2
- package/admin/src/contexts/ApiTokenPermissions/index.js +24 -0
- package/admin/src/core/apis/CustomFields.js +79 -0
- package/admin/src/core/apis/index.js +1 -0
- package/admin/src/core/store/configureStore.js +17 -2
- package/admin/src/favicon.png +0 -0
- package/admin/src/hooks/index.js +1 -0
- package/admin/src/hooks/useFetchMarketplacePlugins/index.js +2 -2
- package/admin/src/hooks/useFetchMarketplacePlugins/utils/api.js +4 -2
- package/admin/src/hooks/useFetchMarketplaceProviders/index.js +3 -3
- package/admin/src/hooks/useFetchMarketplaceProviders/utils/api.js +5 -3
- package/admin/src/hooks/useRegenerate/index.js +34 -0
- package/admin/src/index.js +1 -0
- package/admin/src/pages/App/index.js +1 -1
- package/admin/src/pages/HomePage/SocialLinks.js +1 -1
- package/admin/src/pages/HomePage/assets/corner-ornament.svg +48 -0
- package/admin/src/pages/HomePage/index.js +3 -2
- package/admin/src/pages/MarketplacePage/components/NpmPackageCard/CardButton.js +110 -0
- package/admin/src/pages/MarketplacePage/components/NpmPackageCard/InstallPluginButton.js +32 -21
- package/admin/src/pages/MarketplacePage/components/NpmPackageCard/PackageStats.js +79 -0
- package/admin/src/pages/MarketplacePage/components/NpmPackageCard/index.js +28 -11
- package/admin/src/pages/MarketplacePage/components/NpmPackagesFilters/FilterSelect.js +41 -0
- package/admin/src/pages/MarketplacePage/components/NpmPackagesFilters/FiltersPopover.js +96 -0
- package/admin/src/pages/MarketplacePage/components/NpmPackagesFilters/index.js +106 -0
- package/admin/src/pages/MarketplacePage/components/NpmPackagesGrid/index.js +4 -0
- package/admin/src/pages/MarketplacePage/components/SortSelect/index.js +70 -0
- package/admin/src/pages/MarketplacePage/index.js +68 -8
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/ActionBoundRoutes/index.js +56 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/BoundRoute/getMethodColor.js +41 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/BoundRoute/index.js +72 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/CollapsableContentType/CheckBoxWrapper.js +30 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/CollapsableContentType/index.js +150 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/ContenTypesSection/index.js +37 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/FormApiTokenContainer/index.js +255 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/FormBody/index.js +78 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/FormHead/index.js +89 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/Permissions/index.js +40 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/Regenerate/index.js +68 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/index.js +216 -197
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/init.js +13 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/reducer.js +72 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/utils/getDateOfExpiration.js +16 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/utils/index.js +5 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/utils/schema.js +2 -1
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/utils/transformPermissionsData.js +36 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/DynamicTable/DefaultButton/index.js +63 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/DynamicTable/DeleteButton/index.js +1 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/DynamicTable/ReadButton/index.js +19 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/DynamicTable/UpdateButton/index.js +3 -36
- package/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/DynamicTable/index.js +13 -11
- package/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/index.js +3 -2
- package/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/utils/tableHeaders.js +8 -8
- package/admin/src/pages/SettingsPage/pages/ApiTokens/ProtectedEditView/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/ConditionsModal/ActionRow/index.js +7 -38
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/ConditionsModal/ActionRow/utils/options.js +31 -0
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/ConditionsModal/index.js +32 -43
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/ContentTypeCollapse/Collapse/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/ListPage/components/RoleRow/index.js +3 -1
- package/admin/src/pages/SettingsPage/pages/Roles/ListPage/index.js +2 -1
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/ModalForm/index.js +2 -2
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/EventInput/index.js +2 -2
- package/admin/src/permissions/defaultPermissions.js +2 -6
- package/admin/src/translations/ca.json +4 -2
- package/admin/src/translations/de.json +5 -2
- package/admin/src/translations/dk.json +4 -1
- package/admin/src/translations/en.json +38 -3
- package/admin/src/translations/es.json +157 -158
- package/admin/src/translations/fr.json +4 -1
- package/admin/src/translations/gu.json +608 -606
- package/admin/src/translations/he.json +1 -1
- package/admin/src/translations/hi.json +689 -687
- package/admin/src/translations/hu.json +3 -1
- package/admin/src/translations/id.json +3 -1
- package/admin/src/translations/it.json +3 -1
- package/admin/src/translations/ja.json +3 -1
- package/admin/src/translations/ko.json +3 -1
- package/admin/src/translations/ml.json +689 -687
- package/admin/src/translations/nl.json +4 -1
- package/admin/src/translations/no.json +1 -1
- package/admin/src/translations/pl.json +3 -1
- package/admin/src/translations/pt-BR.json +4 -1
- package/admin/src/translations/ru.json +489 -491
- package/admin/src/translations/sa.json +86 -83
- package/admin/src/translations/sk.json +4 -1
- package/admin/src/translations/sv.json +4 -1
- package/admin/src/translations/th.json +1 -1
- package/admin/src/translations/zh-Hans.json +5 -2
- package/admin/src/translations/zh.json +4 -1
- package/build/1856.172d5fa0.chunk.js +174 -0
- package/build/2077.058590f4.chunk.js +206 -0
- package/build/2912.2c42c07b.chunk.js +259 -0
- package/build/4318.5e670740.chunk.js +30 -0
- package/build/4715.22747b59.chunk.js +387 -0
- package/build/{4800.d09f1225.chunk.js → 4800.a6935af6.chunk.js} +1 -1
- package/build/4982.1b75ddb1.chunk.js +325 -0
- package/build/617f9c948fa79e6d73bd.png +0 -0
- package/build/6d21938306785f176538.png +0 -0
- package/build/70674f63fc3904c20de0.svg +7 -0
- package/build/7379.d246dd38.chunk.js +1 -0
- package/build/7692.a36fb2c2.chunk.js +470 -0
- package/build/7841.c50e9509.chunk.js +259 -0
- package/build/7866.ba215f99.chunk.js +505 -0
- package/build/7e9af4fb7e723fcebf1f.svg +48 -0
- package/build/8380.e53e7207.chunk.js +299 -0
- package/build/8549.832ed79d.chunk.js +159 -0
- package/build/8738.0fe8a61e.chunk.js +463 -0
- package/build/{9066.08049eb1.chunk.js → 9066.eaf76ff3.chunk.js} +5 -5
- package/build/{9166.037339e0.chunk.js → 9166.90876521.chunk.js} +16 -15
- package/build/{9420.43a86e7c.chunk.js → 9420.5292d1d2.chunk.js} +38 -37
- package/build/9649.468667d9.chunk.js +199 -0
- package/build/9d5d788027e86620c234.svg +5 -0
- package/build/{Admin-authenticatedApp.e39f36c9.chunk.js → Admin-authenticatedApp.c4f68103.chunk.js} +3 -3
- package/build/{Admin_homePage.118926e0.chunk.js → Admin_homePage.26d32e30.chunk.js} +6 -5
- package/build/Admin_marketplace.32375885.chunk.js +22 -0
- package/build/{Admin_profilePage.9d50ac44.chunk.js → Admin_profilePage.da32abbc.chunk.js} +1 -1
- package/build/Admin_settingsPage.bf2234e1.chunk.js +178 -0
- package/build/admin-app.9049056c.chunk.js +112 -0
- package/build/admin-edit-roles-page.69d9fcb2.chunk.js +1 -0
- package/build/{admin-users.97a08630.chunk.js → admin-users.d71f198a.chunk.js} +3 -3
- package/build/api-tokens-create-page.93dd0689.chunk.js +1 -0
- package/build/api-tokens-edit-page.b0adac81.chunk.js +1 -0
- package/build/api-tokens-list-page.bb36535f.chunk.js +16 -0
- package/build/ca-json.07ae0f2c.chunk.js +1 -0
- package/build/content-manager.ff998bed.chunk.js +1204 -0
- package/build/content-type-builder-list-view.5b3cd768.chunk.js +194 -0
- package/build/content-type-builder-translation-en-json.f985c9c4.chunk.js +1 -0
- package/build/content-type-builder-translation-sv-json.6deff030.chunk.js +1 -0
- package/build/content-type-builder.16af63a6.chunk.js +145 -0
- package/build/de-json.6b3e1894.chunk.js +1 -0
- package/build/dk-json.144c6a8e.chunk.js +1 -0
- package/build/{email-settings-page.64037147.chunk.js → email-settings-page.c3469093.chunk.js} +6 -6
- package/build/en-json.4a269f6b.chunk.js +1 -0
- package/build/es-json.6d123a82.chunk.js +1 -0
- package/build/fr-json.28ab54cb.chunk.js +1 -0
- package/build/gu-json.9a50ea64.chunk.js +1 -0
- package/build/he-json.72f18790.chunk.js +1 -0
- package/build/hi-json.0301b7ba.chunk.js +1 -0
- package/build/hu-json.c4b641bb.chunk.js +1 -0
- package/build/{i18n-settings-page.0b73785d.chunk.js → i18n-settings-page.46d894ff.chunk.js} +5 -5
- package/build/id-json.86035797.chunk.js +1 -0
- package/build/index.html +1 -1
- package/build/it-json.bbdc8993.chunk.js +1 -0
- package/build/ja-json.1c9eeeec.chunk.js +1 -0
- package/build/ko-json.e1f66398.chunk.js +1 -0
- package/build/main.91328e7a.js +9381 -0
- package/build/ml-json.963c889f.chunk.js +1 -0
- package/build/nl-json.2b8cc3a0.chunk.js +1 -0
- package/build/no-json.a58c28bd.chunk.js +1 -0
- package/build/pl-json.249626b3.chunk.js +1 -0
- package/build/pt-BR-json.7852f808.chunk.js +1 -0
- package/build/ru-json.d7cfc2ff.chunk.js +1 -0
- package/build/runtime~main.c9c319c0.js +2 -0
- package/build/sa-json.44e95991.chunk.js +1 -0
- package/build/sk-json.7ba4b330.chunk.js +1 -0
- package/build/sso-settings-page.9ceb0140.chunk.js +1 -0
- package/build/sv-json.8e5a7911.chunk.js +1 -0
- package/build/th-json.a67309b1.chunk.js +1 -0
- package/build/{upload-settings.80ff0974.chunk.js → upload-settings.53b690f3.chunk.js} +5 -5
- package/build/{upload-translation-en-json.004a86c1.chunk.js → upload-translation-en-json.86da7b0a.chunk.js} +1 -1
- package/build/{users-advanced-settings-page.a02f4806.chunk.js → users-advanced-settings-page.3f4ee86e.chunk.js} +5 -5
- package/build/{webhook-edit-page.d2ea3351.chunk.js → webhook-edit-page.dc9442ce.chunk.js} +2 -2
- package/build/webhook-list-page.02191138.chunk.js +134 -0
- package/build/zh-Hans-json.21617c24.chunk.js +1 -0
- package/build/zh-json.608aaf24.chunk.js +1 -0
- package/ee/admin/pages/SettingsPage/pages/Roles/ListPage/index.js +3 -2
- package/ee/server/controllers/user.js +5 -3
- package/env.js +1 -0
- package/package.json +13 -11
- package/scripts/build.js +11 -0
- package/server/bootstrap.js +19 -1
- package/server/config/admin-actions.js +20 -0
- package/server/content-types/api-token-permission.js +36 -0
- package/server/content-types/api-token.js +25 -1
- package/server/content-types/index.js +1 -0
- package/server/controllers/admin.js +3 -0
- package/server/controllers/api-token.js +24 -1
- package/server/controllers/content-api.js +15 -0
- package/server/controllers/index.js +1 -0
- package/server/controllers/user.js +3 -2
- package/server/routes/api-tokens.js +11 -0
- package/server/routes/content-api.js +20 -0
- package/server/routes/index.js +2 -0
- package/server/services/api-token.js +309 -29
- package/server/services/constants.js +10 -0
- package/server/services/permission/engine.js +36 -226
- package/server/services/permission.js +4 -1
- package/server/strategies/admin.js +7 -1
- package/server/strategies/api-token.js +72 -11
- package/server/validation/api-tokens.js +12 -2
- package/utils/create-plugins-exclude-path.js +40 -0
- package/utils/get-custom-app-config-file.js +5 -0
- package/webpack.alias.js +0 -13
- package/webpack.config.js +4 -1
- package/admin/src/assets/images/banner_strapi-rocket.png +0 -0
- package/admin/src/assets/images/big-logo-home.png +0 -0
- package/admin/src/assets/images/homepage-logo.png +0 -0
- package/admin/src/assets/images/icon_made-by-strapi.svg +0 -5
- package/admin/src/assets/images/logo_strapi_auth.png +0 -0
- package/admin/src/assets/images/logo_strapi_auth_v4.png +0 -0
- package/admin/src/assets/images/logo_strapi_menu.png +0 -0
- package/admin/src/assets/images/oops.png +0 -0
- package/admin/src/content-manager/components/State/index.js +0 -37
- package/admin/src/favicon.ico +0 -0
- package/build/15026a3d58aeb2828134.png +0 -0
- package/build/1856.47226450.chunk.js +0 -173
- package/build/2077.c935ee42.chunk.js +0 -205
- package/build/2912.a015078a.chunk.js +0 -258
- package/build/4715.58cd558f.chunk.js +0 -387
- package/build/4982.05eda880.chunk.js +0 -324
- package/build/7098.40dcd7bf.chunk.js +0 -1
- package/build/7841.91f793dc.chunk.js +0 -258
- package/build/7866.1201afbd.chunk.js +0 -504
- package/build/8380.8789ff76.chunk.js +0 -284
- package/build/8549.133c4473.chunk.js +0 -158
- package/build/8851.e4ac62f2.chunk.js +0 -158
- package/build/90f49a385afb000fb1d4.svg +0 -5
- package/build/9311.7cc03f29.chunk.js +0 -508
- package/build/Admin_marketplace.82c0570b.chunk.js +0 -11
- package/build/Admin_settingsPage.98a711e5.chunk.js +0 -178
- package/build/a6b842e0b6d2b61135d1.svg +0 -5
- package/build/admin-app.4f7618a9.chunk.js +0 -112
- package/build/admin-edit-roles-page.554ba3fa.chunk.js +0 -1
- package/build/api-tokens-create-page.4c262d6e.chunk.js +0 -1
- package/build/api-tokens-edit-page.10a9d368.chunk.js +0 -1
- package/build/api-tokens-list-page.442c9f3c.chunk.js +0 -15
- package/build/b997a22a2e0b87ef1fa2.ico +0 -0
- package/build/bd81ba6c07827282255d.png +0 -0
- package/build/c3de6118ef47086ad05c.png +0 -0
- package/build/ca-json.a16899ae.chunk.js +0 -1
- package/build/content-manager.7d57c9d1.chunk.js +0 -1200
- package/build/content-type-builder-list-view.8cc534e0.chunk.js +0 -194
- package/build/content-type-builder-translation-en-json.201bfb78.chunk.js +0 -1
- package/build/content-type-builder.684df7a4.chunk.js +0 -142
- package/build/de-json.aa6026b3.chunk.js +0 -1
- package/build/dk-json.fac2bcfb.chunk.js +0 -1
- package/build/en-json.0c69c7d7.chunk.js +0 -1
- package/build/es-json.d672e181.chunk.js +0 -1
- package/build/fb376b132d18bf4522ca.png +0 -0
- package/build/fde9b1ad0670d29a2516.png +0 -0
- package/build/fr-json.71a16175.chunk.js +0 -1
- package/build/gu-json.ca345cd1.chunk.js +0 -1
- package/build/he-json.3b825d80.chunk.js +0 -1
- package/build/hi-json.50c7e6d4.chunk.js +0 -1
- package/build/hu-json.e0521dcc.chunk.js +0 -1
- package/build/id-json.4b1ff8d6.chunk.js +0 -1
- package/build/it-json.86bac220.chunk.js +0 -1
- package/build/ja-json.4e44e36b.chunk.js +0 -1
- package/build/ko-json.1003756e.chunk.js +0 -1
- package/build/main.b47db1a3.js +0 -9337
- package/build/ml-json.c7774425.chunk.js +0 -1
- package/build/nl-json.f58ea235.chunk.js +0 -1
- package/build/no-json.40386397.chunk.js +0 -1
- package/build/pl-json.fed96aba.chunk.js +0 -1
- package/build/pt-BR-json.073799ab.chunk.js +0 -1
- package/build/ru-json.7ad2cbbf.chunk.js +0 -1
- package/build/runtime~main.feeac6d3.js +0 -2
- package/build/sa-json.f0f704f0.chunk.js +0 -1
- package/build/sk-json.a848961b.chunk.js +0 -1
- package/build/sso-settings-page.445184e0.chunk.js +0 -1
- package/build/sv-json.b038acbe.chunk.js +0 -1
- package/build/th-json.72e8de3d.chunk.js +0 -1
- package/build/webhook-list-page.2775a683.chunk.js +0 -134
- package/build/zh-Hans-json.03d2bda1.chunk.js +0 -1
- package/build/zh-json.3d0cc664.chunk.js +0 -1
- package/server/services/permission/engine-hooks.js +0 -82
package/admin/src/StrapiApp.js
CHANGED
|
@@ -8,10 +8,9 @@ import invariant from 'invariant';
|
|
|
8
8
|
import { Helmet } from 'react-helmet';
|
|
9
9
|
import { basename, createHook } from './core/utils';
|
|
10
10
|
import configureStore from './core/store/configureStore';
|
|
11
|
-
import { Plugin } from './core/apis';
|
|
11
|
+
import { customFields, Plugin } from './core/apis';
|
|
12
12
|
import App from './pages/App';
|
|
13
|
-
import
|
|
14
|
-
import MenuLogo from './assets/images/logo_strapi_menu.png';
|
|
13
|
+
import Logo from './assets/images/logo-strapi-2022.svg';
|
|
15
14
|
import Providers from './components/Providers';
|
|
16
15
|
import languageNativeNames from './translations/languageNativeNames';
|
|
17
16
|
import {
|
|
@@ -21,7 +20,7 @@ import {
|
|
|
21
20
|
MUTATE_SINGLE_TYPES_LINKS,
|
|
22
21
|
} from './exposedHooks';
|
|
23
22
|
import injectionZones from './injectionZones';
|
|
24
|
-
import favicon from './favicon.
|
|
23
|
+
import favicon from './favicon.png';
|
|
25
24
|
import localStorageKey from './components/LanguageProvider/utils/localStorageKey';
|
|
26
25
|
|
|
27
26
|
class StrapiApp {
|
|
@@ -29,10 +28,10 @@ class StrapiApp {
|
|
|
29
28
|
this.customConfigurations = adminConfig.config;
|
|
30
29
|
this.customBootstrapConfiguration = adminConfig.bootstrap;
|
|
31
30
|
this.configurations = {
|
|
32
|
-
authLogo:
|
|
31
|
+
authLogo: Logo,
|
|
33
32
|
head: { favicon },
|
|
34
33
|
locales: ['en'],
|
|
35
|
-
menuLogo:
|
|
34
|
+
menuLogo: Logo,
|
|
36
35
|
notifications: { releases: true },
|
|
37
36
|
themes: { light: lightTheme, dark: darkTheme },
|
|
38
37
|
translations: {},
|
|
@@ -48,6 +47,7 @@ class StrapiApp {
|
|
|
48
47
|
this.admin = {
|
|
49
48
|
injectionZones,
|
|
50
49
|
};
|
|
50
|
+
this.customFields = customFields;
|
|
51
51
|
|
|
52
52
|
this.menu = [];
|
|
53
53
|
this.settings = {
|
|
@@ -226,7 +226,19 @@ class StrapiApp {
|
|
|
226
226
|
}
|
|
227
227
|
|
|
228
228
|
if (this.customConfigurations?.theme) {
|
|
229
|
-
|
|
229
|
+
const darkTheme = this.customConfigurations.theme.dark;
|
|
230
|
+
const lightTheme = this.customConfigurations.theme.light;
|
|
231
|
+
|
|
232
|
+
if (!darkTheme && !lightTheme) {
|
|
233
|
+
console.warn(
|
|
234
|
+
`[deprecated] In future versions, Strapi will stop supporting this theme customization syntax. The theme configuration accepts a light and a dark key to customize each theme separately. See https://docs.strapi.io/developer-docs/latest/development/admin-customization.html#theme-extension.`
|
|
235
|
+
);
|
|
236
|
+
merge(this.configurations.themes.light, this.customConfigurations.theme);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
if (lightTheme) merge(this.configurations.themes.light, lightTheme);
|
|
240
|
+
|
|
241
|
+
if (darkTheme) merge(this.configurations.themes.dark, darkTheme);
|
|
230
242
|
}
|
|
231
243
|
|
|
232
244
|
if (this.customConfigurations?.notifications?.releases !== undefined) {
|
|
@@ -281,17 +293,7 @@ class StrapiApp {
|
|
|
281
293
|
|
|
282
294
|
async initialize() {
|
|
283
295
|
Object.keys(this.appPlugins).forEach((plugin) => {
|
|
284
|
-
this.appPlugins[plugin].register(
|
|
285
|
-
addComponents: this.addComponents,
|
|
286
|
-
addCorePluginMenuLink: this.addCorePluginMenuLink,
|
|
287
|
-
addFields: this.addFields,
|
|
288
|
-
addMenuLink: this.addMenuLink,
|
|
289
|
-
addMiddlewares: this.addMiddlewares,
|
|
290
|
-
addReducers: this.addReducers,
|
|
291
|
-
createHook: this.createHook,
|
|
292
|
-
createSettingSection: this.createSettingSection,
|
|
293
|
-
registerPlugin: this.registerPlugin,
|
|
294
|
-
});
|
|
296
|
+
this.appPlugins[plugin].register(this);
|
|
295
297
|
});
|
|
296
298
|
}
|
|
297
299
|
|
|
@@ -431,6 +433,7 @@ class StrapiApp {
|
|
|
431
433
|
authLogo={this.configurations.authLogo}
|
|
432
434
|
components={components}
|
|
433
435
|
fields={fields}
|
|
436
|
+
customFields={this.customFields}
|
|
434
437
|
localeNames={localeNames}
|
|
435
438
|
getAdminInjectedComponents={this.getAdminInjectedComponents}
|
|
436
439
|
getPlugin={this.getPlugin}
|
|
Binary file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<svg width="88" height="88" viewBox="0 0 88 88" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<rect x="
|
|
3
|
-
<path d="M34
|
|
4
|
-
<rect x="
|
|
2
|
+
<rect x=".5" y=".5" width="87" height="87" rx="43.5" fill="#F0F0FF"/>
|
|
3
|
+
<path d="M34 39.3h-4c-2.6 0-4.7 1-6.6 2.8a9 9 0 0 0-2.7 6.6 9 9 0 0 0 2.7 6.6A9 9 0 0 0 30 58h22.8L34 39.3Zm-11-11 3-3 39 39-3 3-4.7-4.6H30a13.8 13.8 0 0 1-14-14c0-3.8 1.3-7 4-9.7 2.6-2.7 5.7-4.2 9.5-4.3L23 28.2Zm38.2 11.1c3 .2 5.5 1.5 7.6 3.7A11 11 0 0 1 72 51c0 4-1.6 7.2-5 9.5l-3.3-3.4a6.5 6.5 0 0 0 3.6-6.1c0-1.9-.7-3.5-2-5-1.5-1.3-3.1-2-5-2h-3.5v-1.2c0-3.6-1.2-6.6-3.7-9a13 13 0 0 0-15-2.3L34.6 28a17 17 0 0 1 20.3 1.5c3.5 2.7 5.5 6 6.3 10Z" fill="#4945FF"/>
|
|
4
|
+
<rect x=".5" y=".5" width="87" height="87" rx="43.5" stroke="#D9D8FF"/>
|
|
5
5
|
</svg>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<svg width="800" height="800" viewBox="0 0 800 800" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M39 282c0-118 0-176.9 36.6-213.5C112.2 32 171.1 32 288.9 32h221.2c117.8 0 176.7 0 213.3 36.6C760 105.2 760 164.1 760 281.9v221.2c0 117.8 0 176.7-36.6 213.3C686.8 753 627.9 753 510.1 753H288.9c-117.8 0-176.7 0-213.3-36.6C39 679.8 39 620.9 39 503.1V281.9Z" fill="#4945FF"/>
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M536.4 250.7H293.7v123.8h123.8v123.7h123.8V255.5c0-2.6-2.2-4.8-4.9-4.8Z" fill="#fff"/>
|
|
4
|
+
<path fill="#fff" d="M412.7 374.5h4.8v4.8h-4.8z"/>
|
|
5
|
+
<path d="M293.8 374.5h119c2.6 0 4.8 2.1 4.8 4.8v119h-119a4.8 4.8 0 0 1-4.8-4.9v-119Z" fill="#9593FF"/>
|
|
6
|
+
<path d="M417.5 498.2h123.8L421.6 618a2.4 2.4 0 0 1-4-1.7v-118ZM293.8 374.5h-118a2.4 2.4 0 0 1-1.7-4.1l119.7-119.7v123.8Z" fill="#9593FF"/>
|
|
7
|
+
</svg>
|
|
Binary file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { QueryClientProvider, QueryClient } from 'react-query';
|
|
4
|
-
import { LibraryProvider, StrapiAppProvider } from '@strapi/helper-plugin';
|
|
4
|
+
import { LibraryProvider, CustomFieldsProvider, StrapiAppProvider } from '@strapi/helper-plugin';
|
|
5
5
|
import { Provider } from 'react-redux';
|
|
6
6
|
import { AdminContext } from '../../contexts';
|
|
7
7
|
import ConfigurationsProvider from '../ConfigurationsProvider';
|
|
@@ -25,6 +25,7 @@ const Providers = ({
|
|
|
25
25
|
authLogo,
|
|
26
26
|
children,
|
|
27
27
|
components,
|
|
28
|
+
customFields,
|
|
28
29
|
fields,
|
|
29
30
|
getAdminInjectedComponents,
|
|
30
31
|
getPlugin,
|
|
@@ -64,15 +65,17 @@ const Providers = ({
|
|
|
64
65
|
settings={settings}
|
|
65
66
|
>
|
|
66
67
|
<LibraryProvider components={components} fields={fields}>
|
|
67
|
-
<
|
|
68
|
-
<
|
|
69
|
-
<
|
|
70
|
-
<
|
|
71
|
-
<
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
68
|
+
<CustomFieldsProvider customFields={customFields}>
|
|
69
|
+
<LanguageProvider messages={messages} localeNames={localeNames}>
|
|
70
|
+
<AutoReloadOverlayBlockerProvider>
|
|
71
|
+
<OverlayBlocker>
|
|
72
|
+
<GuidedTour>
|
|
73
|
+
<Notifications>{children}</Notifications>
|
|
74
|
+
</GuidedTour>
|
|
75
|
+
</OverlayBlocker>
|
|
76
|
+
</AutoReloadOverlayBlockerProvider>
|
|
77
|
+
</LanguageProvider>
|
|
78
|
+
</CustomFieldsProvider>
|
|
76
79
|
</LibraryProvider>
|
|
77
80
|
</StrapiAppProvider>
|
|
78
81
|
</ConfigurationsProvider>
|
|
@@ -88,6 +91,7 @@ Providers.propTypes = {
|
|
|
88
91
|
authLogo: PropTypes.oneOfType([PropTypes.string, PropTypes.any]).isRequired,
|
|
89
92
|
children: PropTypes.element.isRequired,
|
|
90
93
|
components: PropTypes.object.isRequired,
|
|
94
|
+
customFields: PropTypes.object.isRequired,
|
|
91
95
|
fields: PropTypes.object.isRequired,
|
|
92
96
|
getAdminInjectedComponents: PropTypes.func.isRequired,
|
|
93
97
|
getPlugin: PropTypes.func.isRequired,
|
|
@@ -294,6 +294,29 @@ const CollectionTypeFormWrapper = ({ allLayoutData, children, slug, id, origin }
|
|
|
294
294
|
]
|
|
295
295
|
);
|
|
296
296
|
|
|
297
|
+
const onDraftRelationCheck = useCallback(async () => {
|
|
298
|
+
try {
|
|
299
|
+
trackUsageRef.current('willCheckDraftRelations');
|
|
300
|
+
|
|
301
|
+
const endPoint = getRequestUrl(
|
|
302
|
+
`collection-types/${slug}/${id}/actions/numberOfDraftRelations`
|
|
303
|
+
);
|
|
304
|
+
dispatch(setStatus('draft-relation-check-pending'));
|
|
305
|
+
|
|
306
|
+
const numberOfDraftRelations = await axiosInstance.get(endPoint);
|
|
307
|
+
trackUsageRef.current('didCheckDraftRelations');
|
|
308
|
+
|
|
309
|
+
dispatch(setStatus('resolved'));
|
|
310
|
+
|
|
311
|
+
return numberOfDraftRelations.data.data;
|
|
312
|
+
} catch (err) {
|
|
313
|
+
displayErrors(err);
|
|
314
|
+
dispatch(setStatus('resolved'));
|
|
315
|
+
|
|
316
|
+
return Promise.reject(err);
|
|
317
|
+
}
|
|
318
|
+
}, [displayErrors, id, slug, dispatch]);
|
|
319
|
+
|
|
297
320
|
const onPublish = useCallback(async () => {
|
|
298
321
|
try {
|
|
299
322
|
trackUsageRef.current('willPublishEntry');
|
|
@@ -397,6 +420,7 @@ const CollectionTypeFormWrapper = ({ allLayoutData, children, slug, id, origin }
|
|
|
397
420
|
onDeleteSucceeded,
|
|
398
421
|
onPost,
|
|
399
422
|
onPublish,
|
|
423
|
+
onDraftRelationCheck,
|
|
400
424
|
onPut,
|
|
401
425
|
onUnpublish,
|
|
402
426
|
status,
|
|
@@ -32,7 +32,7 @@ const CellValue = ({ type, value }) => {
|
|
|
32
32
|
formattedValue = formatNumber(value, {
|
|
33
33
|
// Should be kept in sync with the corresponding value
|
|
34
34
|
// in the design-system/NumberInput: https://github.com/strapi/design-system/blob/main/packages/strapi-design-system/src/NumberInput/NumberInput.js#L53
|
|
35
|
-
maximumFractionDigits:
|
|
35
|
+
maximumFractionDigits: 20,
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
|
package/admin/src/content-manager/components/DynamicTable/CellContent/RelationMultiple/index.js
CHANGED
|
@@ -31,9 +31,10 @@ const fetchRelation = async (endPoint, notifyStatus) => {
|
|
|
31
31
|
const RelationMultiple = ({ fieldSchema, metadatas, name, entityId, value, contentType }) => {
|
|
32
32
|
const { formatMessage } = useIntl();
|
|
33
33
|
const { notifyStatus } = useNotifyAT();
|
|
34
|
-
const relationFetchEndpoint = useMemo(
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
const relationFetchEndpoint = useMemo(
|
|
35
|
+
() => getRequestUrl(`relations/${contentType.uid}/${entityId}/${name.split('.')[0]}`),
|
|
36
|
+
[entityId, name, contentType]
|
|
37
|
+
);
|
|
37
38
|
const [isOpen, setIsOpen] = useState(false);
|
|
38
39
|
|
|
39
40
|
const Label = (
|
|
@@ -106,7 +107,7 @@ const RelationMultiple = ({ fieldSchema, metadatas, name, entityId, value, conte
|
|
|
106
107
|
defaultMessage: 'This relation contains more entities than displayed',
|
|
107
108
|
})}
|
|
108
109
|
>
|
|
109
|
-
<Typography
|
|
110
|
+
<Typography>…</Typography>
|
|
110
111
|
</MenuItem>
|
|
111
112
|
)}
|
|
112
113
|
</>
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { Typography } from '@strapi/design-system/Typography';
|
|
5
|
+
import { Tooltip } from '@strapi/design-system/Tooltip';
|
|
5
6
|
import Media from './Media';
|
|
6
7
|
import MultipleMedias from './MultipleMedias';
|
|
7
8
|
import RelationMultiple from './RelationMultiple';
|
|
@@ -55,6 +56,15 @@ const CellContent = ({ content, fieldSchema, metadatas, name, rowId, contentType
|
|
|
55
56
|
|
|
56
57
|
return <SingleComponent value={content} metadatas={metadatas} />;
|
|
57
58
|
|
|
59
|
+
case 'string':
|
|
60
|
+
return (
|
|
61
|
+
<Tooltip description={content}>
|
|
62
|
+
<TypographyMaxWidth ellipsis textColor="neutral800">
|
|
63
|
+
<CellValue type={type} value={content} />
|
|
64
|
+
</TypographyMaxWidth>
|
|
65
|
+
</Tooltip>
|
|
66
|
+
);
|
|
67
|
+
|
|
58
68
|
default:
|
|
59
69
|
return (
|
|
60
70
|
<TypographyMaxWidth ellipsis textColor="neutral800">
|
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { Link, useHistory } from 'react-router-dom';
|
|
4
|
+
import { useIntl } from 'react-intl';
|
|
5
|
+
|
|
3
6
|
import { BaseCheckbox } from '@strapi/design-system/BaseCheckbox';
|
|
4
7
|
import { Box } from '@strapi/design-system/Box';
|
|
5
8
|
import { IconButton } from '@strapi/design-system/IconButton';
|
|
6
9
|
import { Tbody, Td, Tr } from '@strapi/design-system/Table';
|
|
7
10
|
import { Flex } from '@strapi/design-system/Flex';
|
|
11
|
+
|
|
8
12
|
import Trash from '@strapi/icons/Trash';
|
|
9
13
|
import Duplicate from '@strapi/icons/Duplicate';
|
|
10
14
|
import Pencil from '@strapi/icons/Pencil';
|
|
15
|
+
|
|
11
16
|
import { useTracking, stopPropagation, onRowClick } from '@strapi/helper-plugin';
|
|
12
|
-
|
|
13
|
-
import { useIntl } from 'react-intl';
|
|
17
|
+
|
|
14
18
|
import { usePluginsQueryParams } from '../../../hooks';
|
|
15
|
-
|
|
19
|
+
|
|
16
20
|
import { getFullName } from '../../../../utils';
|
|
17
21
|
|
|
22
|
+
import CellContent from '../CellContent';
|
|
23
|
+
|
|
18
24
|
const TableRows = ({
|
|
19
25
|
canCreate,
|
|
20
26
|
canDelete,
|
|
@@ -102,13 +108,14 @@ const TableRows = ({
|
|
|
102
108
|
<Td>
|
|
103
109
|
<Flex justifyContent="end" {...stopPropagation}>
|
|
104
110
|
<IconButton
|
|
111
|
+
forwardedAs={Link}
|
|
105
112
|
onClick={() => {
|
|
106
113
|
trackUsage('willEditEntryFromButton');
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
114
|
+
}}
|
|
115
|
+
to={{
|
|
116
|
+
pathname: `${pathname}/${data.id}`,
|
|
117
|
+
state: { from: pathname },
|
|
118
|
+
search: pluginsQueryParams,
|
|
112
119
|
}}
|
|
113
120
|
label={formatMessage(
|
|
114
121
|
{ id: 'app.component.table.edit', defaultMessage: 'Edit {target}' },
|
|
@@ -121,12 +128,11 @@ const TableRows = ({
|
|
|
121
128
|
{canCreate && (
|
|
122
129
|
<Box paddingLeft={1}>
|
|
123
130
|
<IconButton
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
});
|
|
131
|
+
forwardedAs={Link}
|
|
132
|
+
to={{
|
|
133
|
+
pathname: `${pathname}/create/clone/${data.id}`,
|
|
134
|
+
state: { from: pathname },
|
|
135
|
+
search: pluginsQueryParams,
|
|
130
136
|
}}
|
|
131
137
|
label={formatMessage(
|
|
132
138
|
{
|
|
@@ -146,7 +152,6 @@ const TableRows = ({
|
|
|
146
152
|
<IconButton
|
|
147
153
|
onClick={() => {
|
|
148
154
|
trackUsage('willDeleteEntryFromList');
|
|
149
|
-
|
|
150
155
|
onClickDelete(data.id);
|
|
151
156
|
}}
|
|
152
157
|
label={formatMessage(
|
|
@@ -3,15 +3,22 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { useIntl } from 'react-intl';
|
|
4
4
|
import { DynamicTable as Table, useStrapiApp } from '@strapi/helper-plugin';
|
|
5
5
|
import { useSelector } from 'react-redux';
|
|
6
|
-
import
|
|
6
|
+
import styled from 'styled-components';
|
|
7
|
+
|
|
8
|
+
import { Status } from '@strapi/design-system/Status';
|
|
9
|
+
import { Typography } from '@strapi/design-system/Typography';
|
|
10
|
+
|
|
7
11
|
import { INJECT_COLUMN_IN_TABLE } from '../../../exposedHooks';
|
|
8
12
|
import { selectDisplayedHeaders } from '../../pages/ListView/selectors';
|
|
9
13
|
import { getTrad } from '../../utils';
|
|
10
|
-
import State from '../State';
|
|
11
14
|
import TableRows from './TableRows';
|
|
12
15
|
import ConfirmDialogDeleteAll from './ConfirmDialogDeleteAll';
|
|
13
16
|
import ConfirmDialogDelete from './ConfirmDialogDelete';
|
|
14
17
|
|
|
18
|
+
const StyledStatus = styled(Status)`
|
|
19
|
+
width: min-content;
|
|
20
|
+
`;
|
|
21
|
+
|
|
15
22
|
const DynamicTable = ({
|
|
16
23
|
canCreate,
|
|
17
24
|
canDelete,
|
|
@@ -87,9 +94,19 @@ const DynamicTable = ({
|
|
|
87
94
|
sortable: true,
|
|
88
95
|
},
|
|
89
96
|
cellFormatter(cellData) {
|
|
90
|
-
const isPublished =
|
|
97
|
+
const isPublished = cellData.publishedAt;
|
|
98
|
+
const variant = isPublished ? 'success' : 'secondary';
|
|
91
99
|
|
|
92
|
-
return
|
|
100
|
+
return (
|
|
101
|
+
<StyledStatus showBullet={false} variant={variant} size="S">
|
|
102
|
+
<Typography fontWeight="bold" textColor={`${variant}700`}>
|
|
103
|
+
{formatMessage({
|
|
104
|
+
id: getTrad(`containers.List.${isPublished ? 'published' : 'draft'}`),
|
|
105
|
+
defaultMessage: isPublished ? 'Published' : 'Draft',
|
|
106
|
+
})}
|
|
107
|
+
</Typography>
|
|
108
|
+
</StyledStatus>
|
|
109
|
+
);
|
|
93
110
|
},
|
|
94
111
|
},
|
|
95
112
|
];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { memo, useMemo } from 'react';
|
|
1
|
+
import React, { memo, Suspense, useMemo } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import isEqual from 'react-fast-compare';
|
|
@@ -8,7 +8,9 @@ import { Accordion, AccordionToggle, AccordionContent } from '@strapi/design-sys
|
|
|
8
8
|
import { IconButton } from '@strapi/design-system/IconButton';
|
|
9
9
|
import { FocusTrap } from '@strapi/design-system/FocusTrap';
|
|
10
10
|
import { Box } from '@strapi/design-system/Box';
|
|
11
|
+
import { Flex } from '@strapi/design-system/Flex';
|
|
11
12
|
import { Stack } from '@strapi/design-system/Stack';
|
|
13
|
+
import { Loader } from '@strapi/design-system/Loader';
|
|
12
14
|
import Trash from '@strapi/icons/Trash';
|
|
13
15
|
import ArrowDown from '@strapi/icons/ArrowDown';
|
|
14
16
|
import ArrowUp from '@strapi/icons/ArrowUp';
|
|
@@ -147,14 +149,22 @@ const Component = ({
|
|
|
147
149
|
/>
|
|
148
150
|
<AccordionContent>
|
|
149
151
|
<AccordionContentRadius background="neutral0">
|
|
150
|
-
<
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
152
|
+
<Suspense
|
|
153
|
+
fallback={
|
|
154
|
+
<Flex justifyContent="center" paddingTop={4} paddingBottom={4}>
|
|
155
|
+
<Loader>Loading content.</Loader>
|
|
156
|
+
</Flex>
|
|
157
|
+
}
|
|
158
|
+
>
|
|
159
|
+
<FocusTrap onEscape={() => onToggle(index)}>
|
|
160
|
+
<FieldComponent
|
|
161
|
+
componentUid={componentUid}
|
|
162
|
+
icon={icon}
|
|
163
|
+
name={`${name}.${index}`}
|
|
164
|
+
isFromDynamicZone
|
|
165
|
+
/>
|
|
166
|
+
</FocusTrap>
|
|
167
|
+
</Suspense>
|
|
158
168
|
</AccordionContentRadius>
|
|
159
169
|
</AccordionContent>
|
|
160
170
|
</Accordion>
|
|
@@ -13,6 +13,7 @@ import DzLabel from './components/DzLabel';
|
|
|
13
13
|
import Component from './components/Component';
|
|
14
14
|
|
|
15
15
|
import ComponentPicker from './components/ComponentPicker';
|
|
16
|
+
import { useContentTypeLayout } from '../../hooks';
|
|
16
17
|
|
|
17
18
|
/* eslint-disable react/no-array-index-key */
|
|
18
19
|
|
|
@@ -38,6 +39,7 @@ const DynamicZone = ({
|
|
|
38
39
|
const toggleNotification = useNotification();
|
|
39
40
|
const [isOpen, setIsOpen] = useState(false);
|
|
40
41
|
const [shouldOpenAddedComponent, setShouldOpenAddedComponent] = useState(false);
|
|
42
|
+
const { getComponentLayout, components } = useContentTypeLayout();
|
|
41
43
|
const dynamicDisplayedComponentsLength = dynamicDisplayedComponents.length;
|
|
42
44
|
const intlDescription = metadatas.description
|
|
43
45
|
? { id: metadatas.description, defaultMessage: metadatas.description }
|
|
@@ -92,10 +94,12 @@ const DynamicZone = ({
|
|
|
92
94
|
(componentUid) => {
|
|
93
95
|
setIsOpen(false);
|
|
94
96
|
|
|
95
|
-
|
|
97
|
+
const componentLayoutData = getComponentLayout(componentUid);
|
|
98
|
+
|
|
99
|
+
addComponentToDynamicZone(name, componentLayoutData, components, hasError);
|
|
96
100
|
setShouldOpenAddedComponent(true);
|
|
97
101
|
},
|
|
98
|
-
[addComponentToDynamicZone, hasError, name]
|
|
102
|
+
[addComponentToDynamicZone, hasError, name, components, getComponentLayout]
|
|
99
103
|
);
|
|
100
104
|
|
|
101
105
|
const handleClickOpenPicker = () => {
|