@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
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import React, { memo, useCallback, useMemo } from 'react';
|
|
1
|
+
import React, { Suspense, memo, useCallback, useMemo } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import get from 'lodash/get';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
CheckPermissions,
|
|
6
|
+
LoadingIndicatorPage,
|
|
7
|
+
useTracking,
|
|
8
|
+
LinkButton,
|
|
9
|
+
} from '@strapi/helper-plugin';
|
|
5
10
|
import { useIntl } from 'react-intl';
|
|
6
11
|
import { ContentLayout } from '@strapi/design-system/Layout';
|
|
7
12
|
import { Box } from '@strapi/design-system/Box';
|
|
@@ -93,6 +98,7 @@ const EditView = ({
|
|
|
93
98
|
onDeleteSucceeded,
|
|
94
99
|
onPost,
|
|
95
100
|
onPublish,
|
|
101
|
+
onDraftRelationCheck,
|
|
96
102
|
onPut,
|
|
97
103
|
onUnpublish,
|
|
98
104
|
redirectionLink,
|
|
@@ -112,6 +118,7 @@ const EditView = ({
|
|
|
112
118
|
isSingleType={isSingleType}
|
|
113
119
|
onPost={onPost}
|
|
114
120
|
onPublish={onPublish}
|
|
121
|
+
onDraftRelationCheck={onDraftRelationCheck}
|
|
115
122
|
onPut={onPut}
|
|
116
123
|
onUnpublish={onUnpublish}
|
|
117
124
|
readActionAllowedFields={readActionAllowedFields}
|
|
@@ -125,108 +132,110 @@ const EditView = ({
|
|
|
125
132
|
<ContentLayout>
|
|
126
133
|
<Grid gap={4}>
|
|
127
134
|
<GridItem col={9} s={12}>
|
|
128
|
-
<
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
0: {
|
|
134
|
-
|
|
135
|
-
|
|
135
|
+
<Suspense fallback={<LoadingIndicatorPage />}>
|
|
136
|
+
<Stack spacing={6}>
|
|
137
|
+
{formattedContentTypeLayout.map((row, index) => {
|
|
138
|
+
if (isDynamicZone(row)) {
|
|
139
|
+
const {
|
|
140
|
+
0: {
|
|
141
|
+
0: { name, fieldSchema, metadatas, labelAction },
|
|
142
|
+
},
|
|
143
|
+
} = row;
|
|
144
|
+
|
|
145
|
+
return (
|
|
146
|
+
<Box key={index}>
|
|
147
|
+
<Grid gap={4}>
|
|
148
|
+
<GridItem col={12} s={12} xs={12}>
|
|
149
|
+
<DynamicZone
|
|
150
|
+
name={name}
|
|
151
|
+
fieldSchema={fieldSchema}
|
|
152
|
+
labelAction={labelAction}
|
|
153
|
+
metadatas={metadatas}
|
|
154
|
+
/>
|
|
155
|
+
</GridItem>
|
|
156
|
+
</Grid>
|
|
157
|
+
</Box>
|
|
158
|
+
);
|
|
159
|
+
}
|
|
136
160
|
|
|
137
161
|
return (
|
|
138
|
-
<Box
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
162
|
+
<Box
|
|
163
|
+
key={index}
|
|
164
|
+
hasRadius
|
|
165
|
+
background="neutral0"
|
|
166
|
+
shadow="tableShadow"
|
|
167
|
+
paddingLeft={6}
|
|
168
|
+
paddingRight={6}
|
|
169
|
+
paddingTop={6}
|
|
170
|
+
paddingBottom={6}
|
|
171
|
+
borderColor="neutral150"
|
|
172
|
+
>
|
|
173
|
+
<Stack spacing={6}>
|
|
174
|
+
{row.map((grid, gridIndex) => {
|
|
175
|
+
return (
|
|
176
|
+
<Grid gap={4} key={gridIndex}>
|
|
177
|
+
{grid.map(
|
|
178
|
+
({
|
|
179
|
+
fieldSchema,
|
|
180
|
+
labelAction,
|
|
181
|
+
metadatas,
|
|
182
|
+
name,
|
|
183
|
+
size,
|
|
184
|
+
queryInfos,
|
|
185
|
+
}) => {
|
|
186
|
+
const isComponent = fieldSchema.type === 'component';
|
|
152
187
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
paddingTop={6}
|
|
162
|
-
paddingBottom={6}
|
|
163
|
-
borderColor="neutral150"
|
|
164
|
-
>
|
|
165
|
-
<Stack spacing={6}>
|
|
166
|
-
{row.map((grid, gridIndex) => {
|
|
167
|
-
return (
|
|
168
|
-
<Grid gap={4} key={gridIndex}>
|
|
169
|
-
{grid.map(
|
|
170
|
-
({
|
|
171
|
-
fieldSchema,
|
|
172
|
-
labelAction,
|
|
173
|
-
metadatas,
|
|
174
|
-
name,
|
|
175
|
-
size,
|
|
176
|
-
queryInfos,
|
|
177
|
-
}) => {
|
|
178
|
-
const isComponent = fieldSchema.type === 'component';
|
|
188
|
+
if (isComponent) {
|
|
189
|
+
const {
|
|
190
|
+
component,
|
|
191
|
+
max,
|
|
192
|
+
min,
|
|
193
|
+
repeatable = false,
|
|
194
|
+
required = false,
|
|
195
|
+
} = fieldSchema;
|
|
179
196
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
197
|
+
return (
|
|
198
|
+
<GridItem col={size} s={12} xs={12} key={component}>
|
|
199
|
+
<FieldComponent
|
|
200
|
+
componentUid={component}
|
|
201
|
+
labelAction={labelAction}
|
|
202
|
+
isRepeatable={repeatable}
|
|
203
|
+
intlLabel={{
|
|
204
|
+
id: metadatas.label,
|
|
205
|
+
defaultMessage: metadatas.label,
|
|
206
|
+
}}
|
|
207
|
+
max={max}
|
|
208
|
+
min={min}
|
|
209
|
+
name={name}
|
|
210
|
+
required={required}
|
|
211
|
+
/>
|
|
212
|
+
</GridItem>
|
|
213
|
+
);
|
|
214
|
+
}
|
|
188
215
|
|
|
189
216
|
return (
|
|
190
|
-
<GridItem col={size}
|
|
191
|
-
<
|
|
192
|
-
|
|
217
|
+
<GridItem col={size} key={name} s={12} xs={12}>
|
|
218
|
+
<Inputs
|
|
219
|
+
size={size}
|
|
220
|
+
fieldSchema={fieldSchema}
|
|
221
|
+
keys={name}
|
|
193
222
|
labelAction={labelAction}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
id: metadatas.label,
|
|
197
|
-
defaultMessage: metadatas.label,
|
|
198
|
-
}}
|
|
199
|
-
max={max}
|
|
200
|
-
min={min}
|
|
201
|
-
name={name}
|
|
202
|
-
required={required}
|
|
223
|
+
metadatas={metadatas}
|
|
224
|
+
queryInfos={queryInfos}
|
|
203
225
|
/>
|
|
204
226
|
</GridItem>
|
|
205
227
|
);
|
|
206
228
|
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
/>
|
|
218
|
-
</GridItem>
|
|
219
|
-
);
|
|
220
|
-
}
|
|
221
|
-
)}
|
|
222
|
-
</Grid>
|
|
223
|
-
);
|
|
224
|
-
})}
|
|
225
|
-
</Stack>
|
|
226
|
-
</Box>
|
|
227
|
-
);
|
|
228
|
-
})}
|
|
229
|
-
</Stack>
|
|
229
|
+
)}
|
|
230
|
+
</Grid>
|
|
231
|
+
);
|
|
232
|
+
})}
|
|
233
|
+
</Stack>
|
|
234
|
+
</Box>
|
|
235
|
+
);
|
|
236
|
+
})}
|
|
237
|
+
</Stack>
|
|
238
|
+
</Suspense>
|
|
230
239
|
</GridItem>
|
|
231
240
|
<GridItem col={3} s={12}>
|
|
232
241
|
<Stack spacing={2}>
|
|
@@ -201,7 +201,7 @@ const DraggableCard = ({
|
|
|
201
201
|
id: getTrad('components.DraggableCard.move.field'),
|
|
202
202
|
defaultMessage: 'Move {item}',
|
|
203
203
|
},
|
|
204
|
-
{ item:
|
|
204
|
+
{ item: labelField }
|
|
205
205
|
)}
|
|
206
206
|
onClick={(e) => e.stopPropagation()}
|
|
207
207
|
ref={refs.dragRef}
|
|
@@ -223,7 +223,7 @@ const DraggableCard = ({
|
|
|
223
223
|
id: getTrad('components.DraggableCard.edit.field'),
|
|
224
224
|
defaultMessage: 'Edit {item}',
|
|
225
225
|
},
|
|
226
|
-
{ item:
|
|
226
|
+
{ item: labelField }
|
|
227
227
|
)}
|
|
228
228
|
type="button"
|
|
229
229
|
>
|
|
@@ -237,7 +237,7 @@ const DraggableCard = ({
|
|
|
237
237
|
id: getTrad('components.DraggableCard.delete.field'),
|
|
238
238
|
defaultMessage: 'Delete {item}',
|
|
239
239
|
},
|
|
240
|
-
{ item:
|
|
240
|
+
{ item: labelField }
|
|
241
241
|
)}
|
|
242
242
|
type="button"
|
|
243
243
|
>
|
|
@@ -16,7 +16,7 @@ const FlexGap = styled(Flex)`
|
|
|
16
16
|
|
|
17
17
|
const Settings = ({ modifiedData, onChange, sortOptions }) => {
|
|
18
18
|
const { formatMessage } = useIntl();
|
|
19
|
-
const { settings } = modifiedData;
|
|
19
|
+
const { settings, metadatas } = modifiedData;
|
|
20
20
|
|
|
21
21
|
return (
|
|
22
22
|
<>
|
|
@@ -122,7 +122,7 @@ const Settings = ({ modifiedData, onChange, sortOptions }) => {
|
|
|
122
122
|
>
|
|
123
123
|
{sortOptions.map((sortBy) => (
|
|
124
124
|
<Option key={sortBy} value={sortBy}>
|
|
125
|
-
{sortBy}
|
|
125
|
+
{metadatas[sortBy].list.label || sortBy}
|
|
126
126
|
</Option>
|
|
127
127
|
))}
|
|
128
128
|
</Select>
|
|
@@ -5,9 +5,11 @@ import { connect } from 'react-redux';
|
|
|
5
5
|
import isEqual from 'react-fast-compare';
|
|
6
6
|
import { bindActionCreators, compose } from 'redux';
|
|
7
7
|
import { useIntl } from 'react-intl';
|
|
8
|
-
import { useHistory, useLocation } from 'react-router-dom';
|
|
8
|
+
import { useHistory, useLocation, Link as ReactRouterLink } from 'react-router-dom';
|
|
9
9
|
import get from 'lodash/get';
|
|
10
10
|
import { stringify } from 'qs';
|
|
11
|
+
import axios from 'axios';
|
|
12
|
+
|
|
11
13
|
import {
|
|
12
14
|
NoPermissions,
|
|
13
15
|
CheckPermissions,
|
|
@@ -19,31 +21,37 @@ import {
|
|
|
19
21
|
useTracking,
|
|
20
22
|
Link,
|
|
21
23
|
} from '@strapi/helper-plugin';
|
|
24
|
+
|
|
22
25
|
import { IconButton } from '@strapi/design-system/IconButton';
|
|
23
26
|
import { Main } from '@strapi/design-system/Main';
|
|
24
27
|
import { Box } from '@strapi/design-system/Box';
|
|
25
28
|
import { ActionLayout, ContentLayout, HeaderLayout } from '@strapi/design-system/Layout';
|
|
26
29
|
import { useNotifyAT } from '@strapi/design-system/LiveRegions';
|
|
27
30
|
import { Button } from '@strapi/design-system/Button';
|
|
31
|
+
|
|
28
32
|
import ArrowLeft from '@strapi/icons/ArrowLeft';
|
|
29
33
|
import Plus from '@strapi/icons/Plus';
|
|
30
34
|
import Cog from '@strapi/icons/Cog';
|
|
31
|
-
|
|
35
|
+
|
|
32
36
|
import { axiosInstance } from '../../../core/utils';
|
|
33
|
-
|
|
37
|
+
|
|
34
38
|
import DynamicTable from '../../components/DynamicTable';
|
|
39
|
+
import AttributeFilter from '../../components/AttributeFilter';
|
|
40
|
+
import { InjectionZone } from '../../../shared/components';
|
|
41
|
+
|
|
35
42
|
import permissions from '../../../permissions';
|
|
43
|
+
|
|
36
44
|
import { getRequestUrl, getTrad } from '../../utils';
|
|
45
|
+
|
|
37
46
|
import FieldPicker from './FieldPicker';
|
|
38
47
|
import PaginationFooter from './PaginationFooter';
|
|
39
48
|
import { getData, getDataSucceeded, onChangeListHeaders, onResetListHeaders } from './actions';
|
|
40
49
|
import makeSelectListView from './selectors';
|
|
41
50
|
import { buildQueryString } from './utils';
|
|
42
|
-
import AttributeFilter from '../../components/AttributeFilter';
|
|
43
51
|
|
|
44
52
|
const cmPermissions = permissions.contentManager;
|
|
45
53
|
|
|
46
|
-
const
|
|
54
|
+
const ConfigureLayoutBox = styled(Box)`
|
|
47
55
|
svg {
|
|
48
56
|
path {
|
|
49
57
|
fill: ${({ theme }) => theme.colors.neutral900};
|
|
@@ -51,7 +59,6 @@ const IconButtonCustom = styled(IconButton)`
|
|
|
51
59
|
}
|
|
52
60
|
`;
|
|
53
61
|
|
|
54
|
-
/* eslint-disable react/no-array-index-key */
|
|
55
62
|
function ListView({
|
|
56
63
|
canCreate,
|
|
57
64
|
canDelete,
|
|
@@ -240,16 +247,18 @@ function ListView({
|
|
|
240
247
|
canCreate ? (
|
|
241
248
|
<Button
|
|
242
249
|
{...props}
|
|
250
|
+
forwardedAs={ReactRouterLink}
|
|
243
251
|
onClick={() => {
|
|
244
252
|
const trackerProperty = hasDraftAndPublish ? { status: 'draft' } : {};
|
|
245
253
|
|
|
246
254
|
trackUsageRef.current('willCreateEntry', trackerProperty);
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
255
|
+
}}
|
|
256
|
+
to={{
|
|
257
|
+
pathname: `${pathname}/create`,
|
|
258
|
+
search: query.plugins ? pluginsQueryParams : '',
|
|
251
259
|
}}
|
|
252
260
|
startIcon={<Plus />}
|
|
261
|
+
style={{ textDecoration: 'none' }}
|
|
253
262
|
>
|
|
254
263
|
{formatMessage({
|
|
255
264
|
id: getTrad('HeaderLayout.button.label-add-entry'),
|
|
@@ -283,20 +292,20 @@ function ListView({
|
|
|
283
292
|
<InjectionZone area="contentManager.listView.actions" />
|
|
284
293
|
<FieldPicker layout={layout} />
|
|
285
294
|
<CheckPermissions permissions={cmPermissions.collectionTypesConfigurations}>
|
|
286
|
-
<
|
|
287
|
-
<
|
|
295
|
+
<ConfigureLayoutBox paddingTop={1} paddingBottom={1}>
|
|
296
|
+
<IconButton
|
|
288
297
|
onClick={() => {
|
|
289
298
|
trackUsage('willEditListLayout');
|
|
290
|
-
|
|
291
|
-
push({ pathname: `${slug}/configurations/list`, search: pluginsQueryParams });
|
|
292
299
|
}}
|
|
300
|
+
forwardedAs={ReactRouterLink}
|
|
301
|
+
to={{ pathname: `${slug}/configurations/list`, search: pluginsQueryParams }}
|
|
293
302
|
icon={<Cog />}
|
|
294
303
|
label={formatMessage({
|
|
295
304
|
id: 'app.links.configure-view',
|
|
296
305
|
defaultMessage: 'Configure the view',
|
|
297
306
|
})}
|
|
298
307
|
/>
|
|
299
|
-
</
|
|
308
|
+
</ConfigureLayoutBox>
|
|
300
309
|
</CheckPermissions>
|
|
301
310
|
</>
|
|
302
311
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { stringify } from 'qs';
|
|
2
|
+
import set from 'lodash/set';
|
|
2
3
|
import createPluginsFilter from './createPluginsFilter';
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -12,12 +13,23 @@ const buildQueryString = (queryParams = {}) => {
|
|
|
12
13
|
* Extracting pluginOptions from the query since we don't want them to be part
|
|
13
14
|
* of the url
|
|
14
15
|
*/
|
|
15
|
-
const {
|
|
16
|
+
const {
|
|
17
|
+
plugins: _,
|
|
18
|
+
_q: query,
|
|
19
|
+
...otherQueryParams
|
|
20
|
+
} = {
|
|
16
21
|
...queryParams,
|
|
17
22
|
...createPluginsFilter(queryParams.plugins),
|
|
18
23
|
};
|
|
19
24
|
|
|
20
|
-
|
|
25
|
+
if (query) {
|
|
26
|
+
set(otherQueryParams, `_q`, encodeURIComponent(query));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return `${stringify(otherQueryParams, {
|
|
30
|
+
encode: false,
|
|
31
|
+
addQueryPrefix: true,
|
|
32
|
+
})}`;
|
|
21
33
|
};
|
|
22
34
|
|
|
23
35
|
export default buildQueryString;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React, { createContext, useContext } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
|
|
4
|
+
const ApiTokenPermissionsContext = createContext({});
|
|
5
|
+
|
|
6
|
+
const ApiTokenPermissionsContextProvider = ({ children, ...rest }) => {
|
|
7
|
+
return (
|
|
8
|
+
<ApiTokenPermissionsContext.Provider value={rest}>
|
|
9
|
+
{children}
|
|
10
|
+
</ApiTokenPermissionsContext.Provider>
|
|
11
|
+
);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const useApiTokenPermissionsContext = () => useContext(ApiTokenPermissionsContext);
|
|
15
|
+
|
|
16
|
+
ApiTokenPermissionsContextProvider.propTypes = {
|
|
17
|
+
children: PropTypes.node.isRequired,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export {
|
|
21
|
+
ApiTokenPermissionsContext,
|
|
22
|
+
ApiTokenPermissionsContextProvider,
|
|
23
|
+
useApiTokenPermissionsContext,
|
|
24
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import invariant from 'invariant';
|
|
2
|
+
|
|
3
|
+
const ALLOWED_TYPES = [
|
|
4
|
+
'biginteger',
|
|
5
|
+
'boolean',
|
|
6
|
+
'date',
|
|
7
|
+
'datetime',
|
|
8
|
+
'decimal',
|
|
9
|
+
'email',
|
|
10
|
+
'enumeration',
|
|
11
|
+
'float',
|
|
12
|
+
'integer',
|
|
13
|
+
'json',
|
|
14
|
+
'password',
|
|
15
|
+
'richtext',
|
|
16
|
+
'string',
|
|
17
|
+
'text',
|
|
18
|
+
'time',
|
|
19
|
+
'uid',
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
class CustomFields {
|
|
23
|
+
constructor() {
|
|
24
|
+
this.customFields = {};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
register(customFields) {
|
|
28
|
+
if (Array.isArray(customFields)) {
|
|
29
|
+
// If several custom fields are passed, register them one by one
|
|
30
|
+
customFields.forEach((customField) => {
|
|
31
|
+
this.register(customField);
|
|
32
|
+
});
|
|
33
|
+
} else {
|
|
34
|
+
// Handle individual custom field
|
|
35
|
+
const { name, pluginId, type, intlLabel, intlDescription, components } = customFields;
|
|
36
|
+
|
|
37
|
+
// Ensure required attributes are provided
|
|
38
|
+
invariant(name, 'A name must be provided');
|
|
39
|
+
invariant(type, 'A type must be provided');
|
|
40
|
+
invariant(intlLabel, 'An intlLabel must be provided');
|
|
41
|
+
invariant(intlDescription, 'An intlDescription must be provided');
|
|
42
|
+
invariant(components, 'A components object must be provided');
|
|
43
|
+
invariant(components.Input, 'An Input component must be provided');
|
|
44
|
+
|
|
45
|
+
// Ensure the type is valid
|
|
46
|
+
invariant(
|
|
47
|
+
ALLOWED_TYPES.includes(type),
|
|
48
|
+
`Custom field type: '${type}' is not a valid Strapi type or it can't be used with a Custom Field`
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
// Ensure name has no special characters
|
|
52
|
+
const isValidObjectKey = /^(?![0-9])[a-zA-Z0-9$_-]+$/g;
|
|
53
|
+
invariant(
|
|
54
|
+
isValidObjectKey.test(name),
|
|
55
|
+
`Custom field name: '${name}' is not a valid object key`
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
// When no plugin is specified, default to the global namespace
|
|
59
|
+
const uid = pluginId ? `plugin::${pluginId}.${name}` : `global::${name}`;
|
|
60
|
+
|
|
61
|
+
// Ensure the uid is unique
|
|
62
|
+
const uidAlreadyUsed = Object.prototype.hasOwnProperty.call(this.customFields, uid);
|
|
63
|
+
invariant(!uidAlreadyUsed, `Custom field: '${uid}' has already been registered`);
|
|
64
|
+
|
|
65
|
+
this.customFields[uid] = customFields;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
getAll() {
|
|
70
|
+
return this.customFields;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
get(uid) {
|
|
74
|
+
return this.customFields[uid];
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Export an instance since it's a singleton
|
|
79
|
+
export default new CustomFields();
|
|
@@ -1,14 +1,29 @@
|
|
|
1
|
-
import { createStore, applyMiddleware } from 'redux';
|
|
1
|
+
import { createStore, applyMiddleware, compose } from 'redux';
|
|
2
2
|
import createReducer from './createReducer';
|
|
3
3
|
|
|
4
4
|
const configureStore = (appMiddlewares, appReducers) => {
|
|
5
|
+
let composeEnhancers = compose;
|
|
6
|
+
|
|
5
7
|
const middlewares = [];
|
|
6
8
|
|
|
7
9
|
appMiddlewares.forEach((middleware) => {
|
|
8
10
|
middlewares.push(middleware());
|
|
9
11
|
});
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
// If Redux Dev Tools are installed, enable them
|
|
14
|
+
if (
|
|
15
|
+
process.env.NODE_ENV !== 'production' &&
|
|
16
|
+
typeof window === 'object' &&
|
|
17
|
+
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
|
|
18
|
+
) {
|
|
19
|
+
composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return createStore(
|
|
23
|
+
createReducer(appReducers),
|
|
24
|
+
{},
|
|
25
|
+
composeEnhancers(applyMiddleware(...middlewares))
|
|
26
|
+
);
|
|
12
27
|
};
|
|
13
28
|
|
|
14
29
|
export default configureStore;
|
|
Binary file
|
package/admin/src/hooks/index.js
CHANGED
|
@@ -9,3 +9,4 @@ export { default as useSettingsForm } from './useSettingsForm';
|
|
|
9
9
|
export { default as usePermissionsDataManager } from './usePermissionsDataManager';
|
|
10
10
|
export { default as useReleaseNotification } from './useReleaseNotification';
|
|
11
11
|
export { default as useThemeToggle } from './useThemeToggle';
|
|
12
|
+
export { default as useRegenerate } from './useRegenerate';
|
|
@@ -2,10 +2,10 @@ import { useQuery } from 'react-query';
|
|
|
2
2
|
import { useNotification } from '@strapi/helper-plugin';
|
|
3
3
|
import { fetchMarketplacePlugins } from './utils/api';
|
|
4
4
|
|
|
5
|
-
const useFetchMarketplacePlugins = (notifyLoad) => {
|
|
5
|
+
const useFetchMarketplacePlugins = (notifyLoad, params) => {
|
|
6
6
|
const toggleNotification = useNotification();
|
|
7
7
|
|
|
8
|
-
return useQuery('list-marketplace-plugins', () => fetchMarketplacePlugins(), {
|
|
8
|
+
return useQuery(['list-marketplace-plugins', params], () => fetchMarketplacePlugins(params), {
|
|
9
9
|
onSuccess() {
|
|
10
10
|
if (notifyLoad) {
|
|
11
11
|
notifyLoad();
|
|
@@ -2,8 +2,10 @@ import axios from 'axios';
|
|
|
2
2
|
|
|
3
3
|
const MARKETPLACE_API_URL = 'https://market-api.strapi.io';
|
|
4
4
|
|
|
5
|
-
const fetchMarketplacePlugins = async () => {
|
|
6
|
-
const { data: response } = await axios.get(`${MARKETPLACE_API_URL}/plugins
|
|
5
|
+
const fetchMarketplacePlugins = async (params = {}) => {
|
|
6
|
+
const { data: response } = await axios.get(`${MARKETPLACE_API_URL}/plugins`, {
|
|
7
|
+
params,
|
|
8
|
+
});
|
|
7
9
|
|
|
8
10
|
// Only keep v4 plugins
|
|
9
11
|
const filteredResponse = {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useQuery } from 'react-query';
|
|
2
2
|
import { useNotification } from '@strapi/helper-plugin';
|
|
3
|
-
import {
|
|
3
|
+
import { fetchMarketplaceProviders } from './utils/api';
|
|
4
4
|
|
|
5
|
-
const useFetchMarketplaceProviders = (notifyLoad) => {
|
|
5
|
+
const useFetchMarketplaceProviders = (notifyLoad, params) => {
|
|
6
6
|
const toggleNotification = useNotification();
|
|
7
7
|
|
|
8
|
-
return useQuery('list-marketplace-providers', () =>
|
|
8
|
+
return useQuery(['list-marketplace-providers', params], () => fetchMarketplaceProviders(params), {
|
|
9
9
|
onSuccess() {
|
|
10
10
|
if (notifyLoad) {
|
|
11
11
|
notifyLoad();
|
|
@@ -2,10 +2,12 @@ import axios from 'axios';
|
|
|
2
2
|
|
|
3
3
|
const MARKETPLACE_API_URL = 'https://market-api.strapi.io';
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
const { data } = await axios.get(`${MARKETPLACE_API_URL}/providers
|
|
5
|
+
const fetchMarketplaceProviders = async (params = {}) => {
|
|
6
|
+
const { data } = await axios.get(`${MARKETPLACE_API_URL}/providers`, {
|
|
7
|
+
params,
|
|
8
|
+
});
|
|
7
9
|
|
|
8
10
|
return data;
|
|
9
11
|
};
|
|
10
12
|
|
|
11
|
-
export {
|
|
13
|
+
export { fetchMarketplaceProviders };
|