@strapi/admin 4.15.0-alpha.0 → 4.15.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/.eslintrc.js +4 -1
- package/admin/.eslintrc.js +28 -0
- package/admin/custom.d.ts +28 -0
- package/admin/src/StrapiApp.js +27 -28
- package/admin/src/components/AuthenticatedApp.tsx +187 -0
- package/admin/src/components/ConfigurationProvider.tsx +68 -0
- package/admin/src/components/{DragLayer/DragLayer.js → DragLayer.tsx} +18 -10
- package/admin/src/components/GuidedTour/Homepage.tsx +111 -0
- package/admin/src/components/GuidedTour/Modal.tsx +303 -0
- package/admin/src/components/GuidedTour/Ornaments.tsx +74 -0
- package/admin/src/components/GuidedTour/Provider.tsx +253 -0
- package/admin/src/components/GuidedTour/{layout.js → constants.ts} +13 -3
- package/admin/src/components/LanguageProvider.tsx +130 -0
- package/admin/src/components/{LeftMenu/index.js → LeftMenu.tsx} +23 -18
- package/admin/src/components/{NpsSurvey/index.js → NpsSurvey.tsx} +68 -21
- package/admin/src/components/PluginsInitializer.tsx +124 -0
- package/admin/src/components/PrivateRoute.tsx +42 -0
- package/admin/src/components/Providers.tsx +125 -0
- package/admin/src/components/RBACProvider.tsx +124 -0
- package/admin/src/components/Theme.tsx +41 -0
- package/admin/src/components/ThemeToggleProvider.tsx +64 -0
- package/admin/src/components/{UnauthenticatedLogo/index.js → UnauthenticatedLogo.tsx} +3 -5
- package/admin/src/components/{LocalesProvider/__mocks__/useLocalesProvider.js → __mocks__/LanguageProvider.ts} +3 -1
- package/admin/src/{constants.js → constants.ts} +48 -0
- package/admin/src/content-manager/components/BlocksEditor/BlocksInput/index.js +68 -9
- package/admin/src/content-manager/components/BlocksEditor/Toolbar/index.js +433 -202
- package/admin/src/content-manager/components/BlocksEditor/hooks/useBlocksStore.js +463 -135
- package/admin/src/content-manager/components/BlocksEditor/hooks/useModifiersStore.js +23 -6
- package/admin/src/content-manager/components/BlocksEditor/index.js +97 -20
- package/admin/src/content-manager/components/BlocksEditor/plugins/index.js +4 -0
- package/admin/src/content-manager/components/BlocksEditor/plugins/withLinks.js +61 -0
- package/admin/src/content-manager/components/BlocksEditor/plugins/withStrapiSchema.js +33 -0
- package/admin/src/content-manager/components/BlocksEditor/utils/links.js +90 -0
- package/admin/src/content-manager/components/InputUID/index.js +1 -1
- package/admin/src/content-manager/hooks/useAllowedAttributes.js +9 -1
- package/admin/src/content-manager/pages/App/selectors.js +1 -1
- package/admin/src/content-manager/pages/App/useContentManagerInitData.js +3 -1
- package/admin/src/content-manager/pages/EditSettingsView/index.js +1 -0
- package/admin/src/content-manager/pages/EditSettingsView/utils/createPossibleMainFieldsForModelsAndComponents.js +1 -0
- package/admin/src/content-manager/pages/EditView/selectors.js +1 -1
- package/admin/src/content-manager/pages/EditViewLayoutManager/index.js +3 -1
- package/admin/src/content-manager/pages/ListSettingsView/constants.js +1 -0
- package/admin/src/content-manager/pages/ListView/components/Body/index.js +53 -56
- package/admin/src/content-manager/pages/ListView/components/BulkActionButtons/SelectedEntriesModal/index.js +5 -3
- package/admin/src/content-manager/pages/ListView/components/TableRows/index.js +1 -1
- package/admin/src/content-manager/pages/ListView/index.js +35 -51
- package/admin/src/content-manager/pages/ListView/selectors.js +1 -1
- package/admin/src/content-manager/utils/checkIfAttributeIsDisplayable.js +1 -1
- package/admin/src/content-manager/utils/schema.js +2 -2
- package/admin/src/contexts/admin.ts +19 -0
- package/admin/src/contexts/apiTokenPermissions.tsx +64 -0
- package/admin/src/contexts/configuration.ts +25 -0
- package/admin/src/contexts/themeToggle.ts +18 -0
- package/admin/src/core/store/configure.ts +91 -0
- package/admin/src/core/store/hooks.ts +15 -0
- package/admin/src/hooks/{useConfigurations/__mocks__/index.js → __mocks__/useConfigurations.ts} +4 -2
- package/admin/src/hooks/index.js +0 -8
- package/admin/src/hooks/{useAdminRoles/index.js → useAdminRoles.ts} +26 -10
- package/admin/src/hooks/useAdminUsers.ts +64 -0
- package/admin/src/hooks/useConfiguration.ts +5 -0
- package/admin/src/hooks/{useContentTypes/useContentTypes.js → useContentTypes.ts} +39 -16
- package/admin/src/hooks/useDebounce.ts +17 -0
- package/admin/src/hooks/{useEnterprise/useEnterprise.js → useEnterprise.ts} +15 -5
- package/admin/src/hooks/useLicenseLimitNotification.ts +3 -0
- package/admin/src/hooks/useMenu.ts +153 -0
- package/admin/src/hooks/useSettingsForm/index.js +14 -2
- package/admin/src/hooks/useSettingsMenu/constants.js +39 -0
- package/admin/src/hooks/useThemeToggle.ts +9 -0
- package/admin/src/index.js +7 -6
- package/admin/src/layouts/{AppLayout/index.js → AppLayout.tsx} +7 -10
- package/admin/src/layouts/UnauthenticatedLayout.tsx +77 -0
- package/admin/src/pages/Admin/index.js +15 -8
- package/admin/src/pages/App/index.js +13 -8
- package/admin/src/pages/App/selectors.js +1 -1
- package/admin/src/pages/AuthPage/components/ForgotPassword/index.js +3 -2
- package/admin/src/pages/AuthPage/components/ForgotPasswordSuccess/index.js +3 -2
- package/admin/src/pages/AuthPage/components/Login/BaseLogin.js +1 -1
- package/admin/src/pages/AuthPage/components/Login/index.js +1 -1
- package/admin/src/pages/AuthPage/components/Oops/index.js +3 -2
- package/admin/src/pages/AuthPage/components/Register/index.js +30 -35
- package/admin/src/pages/AuthPage/components/ResetPassword/index.js +3 -2
- package/admin/src/pages/AuthPage/index.js +4 -5
- package/admin/src/pages/HomePage/index.js +6 -3
- package/admin/src/pages/{InternalErrorPage/index.js → InternalErrorPage.tsx} +10 -6
- package/admin/src/pages/MarketplacePage/components/NpmPackageCard/index.js +0 -2
- package/admin/src/pages/MarketplacePage/hooks/__mocks__/useNavigatorOnline.ts +1 -0
- package/admin/src/{hooks/useNavigatorOnLine/index.js → pages/MarketplacePage/hooks/useNavigatorOnline.ts} +4 -6
- package/admin/src/pages/MarketplacePage/index.js +3 -3
- package/admin/src/pages/{NotFoundPage/index.js → NotFoundPage.tsx} +9 -7
- package/admin/src/pages/ProfilePage/components/Preferences/index.js +23 -9
- package/admin/src/pages/ProfilePage/index.js +4 -4
- package/admin/src/pages/SettingsPage/components/SettingsNav/index.js +20 -0
- package/admin/src/pages/SettingsPage/components/Tokens/Regenerate/index.js +1 -1
- package/admin/src/pages/SettingsPage/components/Tokens/Table/index.js +119 -87
- package/admin/src/pages/SettingsPage/constants.js +33 -0
- package/admin/src/{hooks/useRegenerate/index.js → pages/SettingsPage/hooks/useRegenerate.ts} +13 -7
- package/admin/src/pages/SettingsPage/index.js +2 -2
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/ActionBoundRoutes/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/CollapsableContentType/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/Permissions/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/Regenerate/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/index.js +2 -2
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/CustomizationInfos/index.js +2 -2
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/index.js +2 -2
- package/admin/src/pages/SettingsPage/pages/AuditLogs/SalesPage.js +50 -0
- package/admin/src/pages/SettingsPage/pages/ReviewWorkflows/SalesPage.js +53 -0
- package/admin/src/pages/SettingsPage/pages/Roles/CreatePage/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/ConditionsModal/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/ContentTypeCollapse/Collapse/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/ContentTypeCollapse/CollapsePropertyMatrix/ActionRow/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/ContentTypeCollapse/CollapsePropertyMatrix/SubActionRow/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/GlobalActions/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/PermissionsDataManagerProvider/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/PluginsAndSettings/SubCategory/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/hooks/usePermissionsDataManager.ts +28 -0
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/index.js +1 -1
- package/admin/src/{hooks/useAdminRolePermissions/index.js → pages/SettingsPage/pages/Roles/hooks/useAdminRolePermissions.ts} +13 -6
- package/admin/src/pages/SettingsPage/pages/SingleSignOn/SalesPage.js +53 -0
- package/admin/src/pages/SettingsPage/pages/TransferTokens/EditView/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/TransferTokens/ListView/index.js +3 -5
- package/admin/src/pages/SettingsPage/pages/Users/EditPage/index.js +2 -1
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/DynamicTable/TableRows/index.js +1 -1
- package/admin/src/pages/{UseCasePage/index.js → UseCasePage.tsx} +10 -12
- package/admin/src/shared/hooks/index.js +0 -1
- package/admin/src/shared/hooks/useInjectionZone/index.js +2 -2
- package/admin/src/translations/en.json +13 -0
- package/admin/src/types/adminAPI.ts +29 -0
- package/admin/src/utils/createRoute.tsx +54 -0
- package/admin/src/utils/formatAPIErrors.ts +18 -0
- package/admin/src/utils/getFullName.ts +3 -0
- package/admin/src/utils/{uniqueAdminHash.js → hashAdminUserEmail.ts} +6 -3
- package/admin/src/utils/makeUniqueRoutes.ts +11 -0
- package/admin/tsconfig.build.json +4 -0
- package/admin/tsconfig.json +11 -0
- package/build/0cd5f8915b265d5b1856.png +0 -0
- package/build/1049.ecc10c97.chunk.js +1 -0
- package/build/1217.96155682.chunk.js +35 -0
- package/build/1227.947ceaf9.chunk.js +1 -0
- package/build/1306.2699df52.chunk.js +79 -0
- package/build/135.ad267b59.chunk.js +1 -0
- package/build/1386.eabd8a1e.chunk.js +7 -0
- package/build/1727.b49f0713.chunk.js +1 -0
- package/build/1835.eaa696ba.chunk.js +1 -0
- package/build/19eb2dfcf2603eb55733.png +0 -0
- package/build/2325.d705b39a.chunk.js +1 -0
- package/build/2379.7ce8e110.chunk.js +1 -0
- package/build/2395.acb961a8.chunk.js +26 -0
- package/build/2421.79e5b3d0.chunk.js +1 -0
- package/build/267.073a3bcb.chunk.js +1 -0
- package/build/27d16aefee06412db90a.png +0 -0
- package/build/2801.4711ea5a.chunk.js +1 -0
- package/build/2878.145ebf7c.chunk.js +1 -0
- package/build/2950.216f2e89.chunk.js +1 -0
- package/build/2953.284a63c0.chunk.js +1 -0
- package/build/3019.fde2e1be.chunk.js +181 -0
- package/build/3100.2ba4df95.chunk.js +1 -0
- package/build/311.cb0884bb.chunk.js +1 -0
- package/build/3460.8644e608.chunk.js +146 -0
- package/build/3483.db8c1520.chunk.js +1 -0
- package/build/3911.488fbde3.chunk.js +95 -0
- package/build/4174.49cedb6a.chunk.js +1 -0
- package/build/4429.7f044dc7.chunk.js +1 -0
- package/build/4555.c883d697.chunk.js +1 -0
- package/build/4663.b906cc10.chunk.js +1 -0
- package/build/4732.149f5f8f.chunk.js +1 -0
- package/build/4916.480053a6.chunk.js +1 -0
- package/build/4996.d285c30b.chunk.js +1 -0
- package/build/502.f536f78b.chunk.js +1 -0
- package/build/570.2f3b4c56.chunk.js +1 -0
- package/build/5858.493b31ec.chunk.js +1 -0
- package/build/6158.c3c13c20.chunk.js +1 -0
- package/build/6345.334e7678.chunk.js +1 -0
- package/build/6453.4160b5b7.chunk.js +1 -0
- package/build/7030.b98dcedf.chunk.js +1 -0
- package/build/70674f63fc3904c20de0.svg +7 -0
- package/build/7448.6fd14dd3.chunk.js +1 -0
- package/build/7464.579564ac.chunk.js +1 -0
- package/build/7735.9e7c9fdd.chunk.js +10 -0
- package/build/78.dcc6df5c.chunk.js +1 -0
- package/build/7811.fdbe09af.chunk.js +103 -0
- package/build/782.7243b183.chunk.js +1 -0
- package/build/7849.2a500ed8.chunk.js +1 -0
- package/build/7897.63ba0a00.chunk.js +6 -0
- package/build/7e9af4fb7e723fcebf1f.svg +48 -0
- package/build/8162.7d1100a0.chunk.js +1 -0
- package/build/8276.9abe4679.chunk.js +26 -0
- package/build/8773.ee67141c.chunk.js +48 -0
- package/build/8980.f0045cc1.chunk.js +1 -0
- package/build/9077.2cc01ac8.chunk.js +105 -0
- package/build/9153.42c1428a.chunk.js +1 -0
- package/build/918.54414509.chunk.js +1 -0
- package/build/9218.b2d367f8.chunk.js +1 -0
- package/build/9285.5f174057.chunk.js +1 -0
- package/build/9547.62987774.chunk.js +1 -0
- package/build/9754.b4e73779.chunk.js +1 -0
- package/build/9d5d788027e86620c234.svg +5 -0
- package/build/Admin-authenticatedApp.059dc48f.chunk.js +79 -0
- package/build/Admin_InternalErrorPage.06eeef20.chunk.js +1 -0
- package/build/Admin_homePage.56b9eb3f.chunk.js +81 -0
- package/build/Admin_marketplace.d693a435.chunk.js +44 -0
- package/build/Admin_pluginsPage.ae2c872a.chunk.js +6 -0
- package/build/Admin_profilePage.89099d5b.chunk.js +13 -0
- package/build/Admin_settingsPage.88c45586.chunk.js +12 -0
- package/build/Upload_ConfigureTheView.44f28145.chunk.js +1 -0
- package/build/admin-app.990e112f.chunk.js +69 -0
- package/build/admin-edit-roles-page.4e1eb4a9.chunk.js +267 -0
- package/build/admin-edit-users.5b91404e.chunk.js +10 -0
- package/build/admin-roles-list.89dd94fe.chunk.js +22 -0
- package/build/admin-users.7be4fc5f.chunk.js +11 -0
- package/build/api-tokens-create-page.571920e5.chunk.js +1 -0
- package/build/api-tokens-edit-page.cbdc81b1.chunk.js +1 -0
- package/build/api-tokens-list-page.de0c49e8.chunk.js +16 -0
- package/build/ar-json.74e40bc7.chunk.js +1 -0
- package/build/audit-logs-sales-page.2955db88.chunk.js +1 -0
- package/build/audit-logs-settings-page.b0cb5164.chunk.js +1 -0
- package/build/bb3108f7fd1e6179bde1.svg +1 -0
- package/build/bb4d0d527bdfb161bc5a.svg +1 -0
- package/build/ca-json.fc6001d3.chunk.js +1 -0
- package/build/content-manager.de7ae330.chunk.js +1241 -0
- package/build/content-type-builder-list-view.6c8d3213.chunk.js +211 -0
- package/build/content-type-builder-translation-ar-json.3e808e2f.chunk.js +1 -0
- package/build/content-type-builder-translation-cs-json.1ef9e106.chunk.js +1 -0
- package/build/content-type-builder-translation-de-json.63fcff7b.chunk.js +1 -0
- package/build/content-type-builder-translation-dk-json.fd626b67.chunk.js +1 -0
- package/build/content-type-builder-translation-en-json.74d80f18.chunk.js +1 -0
- package/build/content-type-builder-translation-es-json.a4a361a9.chunk.js +1 -0
- package/build/content-type-builder-translation-fr-json.499c3a46.chunk.js +1 -0
- package/build/content-type-builder-translation-id-json.65255f93.chunk.js +1 -0
- package/build/content-type-builder-translation-it-json.e268ab74.chunk.js +1 -0
- package/build/content-type-builder-translation-ja-json.9be0d5b2.chunk.js +1 -0
- package/build/content-type-builder-translation-ko-json.04cb309d.chunk.js +1 -0
- package/build/content-type-builder-translation-ms-json.f6b743b9.chunk.js +1 -0
- package/build/content-type-builder-translation-nl-json.997fe8cc.chunk.js +1 -0
- package/build/content-type-builder-translation-pl-json.634f638b.chunk.js +1 -0
- package/build/content-type-builder-translation-pt-BR-json.6a95dc71.chunk.js +1 -0
- package/build/content-type-builder-translation-pt-json.ddb44f8c.chunk.js +1 -0
- package/build/content-type-builder-translation-ru-json.3af65503.chunk.js +1 -0
- package/build/content-type-builder-translation-sk-json.c6078082.chunk.js +1 -0
- package/build/content-type-builder-translation-sv-json.a6df2462.chunk.js +1 -0
- package/build/content-type-builder-translation-th-json.122277cc.chunk.js +1 -0
- package/build/content-type-builder-translation-tr-json.41f44f77.chunk.js +1 -0
- package/build/content-type-builder-translation-uk-json.e1315acd.chunk.js +1 -0
- package/build/content-type-builder-translation-zh-Hans-json.6ff57db6.chunk.js +1 -0
- package/build/content-type-builder-translation-zh-json.3532b962.chunk.js +1 -0
- package/build/content-type-builder.0bc97051.chunk.js +136 -0
- package/build/cs-json.4b44411c.chunk.js +1 -0
- package/build/de-json.e72545cf.chunk.js +1 -0
- package/build/dk-json.e77140ef.chunk.js +1 -0
- package/build/email-settings-page.07712efc.chunk.js +11 -0
- package/build/en-json.5b907f67.chunk.js +1 -0
- package/build/es-json.b1f2284b.chunk.js +1 -0
- package/build/eu-json.63d0a898.chunk.js +1 -0
- package/build/fr-json.33c6428b.chunk.js +1 -0
- package/build/gu-json.7efe8cc2.chunk.js +1 -0
- package/build/he-json.3cf0b48a.chunk.js +1 -0
- package/build/hi-json.0d633692.chunk.js +1 -0
- package/build/highlight.js.28a1547e.chunk.js +85 -0
- package/build/hu-json.c74b6a1e.chunk.js +1 -0
- package/build/i18n-settings-page.5c34f012.chunk.js +9 -0
- package/build/i18n-translation-de-json.362384a6.chunk.js +1 -0
- package/build/i18n-translation-dk-json.89401417.chunk.js +1 -0
- package/build/i18n-translation-en-json.1ec7becf.chunk.js +1 -0
- package/build/i18n-translation-es-json.87b494d1.chunk.js +1 -0
- package/build/i18n-translation-fr-json.57ddc77e.chunk.js +1 -0
- package/build/i18n-translation-ko-json.ef4f9471.chunk.js +1 -0
- package/build/i18n-translation-pl-json.dfac513d.chunk.js +1 -0
- package/build/i18n-translation-ru-json.a3dbc125.chunk.js +1 -0
- package/build/i18n-translation-tr-json.3bfc812f.chunk.js +1 -0
- package/build/i18n-translation-zh-Hans-json.757ce62d.chunk.js +1 -0
- package/build/i18n-translation-zh-json.bef2dc07.chunk.js +1 -0
- package/build/id-json.41e07c46.chunk.js +1 -0
- package/build/index.html +1 -0
- package/build/it-json.bfe27ed8.chunk.js +1 -0
- package/build/ja-json.e1959a1c.chunk.js +1 -0
- package/build/ko-json.ce5d6d94.chunk.js +1 -0
- package/build/main.f84563f1.js +2665 -0
- package/build/ml-json.940d7ace.chunk.js +1 -0
- package/build/ms-json.0eddffd9.chunk.js +1 -0
- package/build/nl-json.fe38f0fb.chunk.js +1 -0
- package/build/no-json.19a2dbfa.chunk.js +1 -0
- package/build/pl-json.d55e8e78.chunk.js +1 -0
- package/build/pt-BR-json.ae0a0d2e.chunk.js +1 -0
- package/build/pt-json.ee554a41.chunk.js +1 -0
- package/build/review-workflows-sales-page.f46a8f00.chunk.js +1 -0
- package/build/review-workflows-settings-create-view.d0544fb0.chunk.js +1 -0
- package/build/review-workflows-settings-edit-view.aabf49ef.chunk.js +1 -0
- package/build/review-workflows-settings-list-view.8b0525ab.chunk.js +56 -0
- package/build/ru-json.1c976644.chunk.js +1 -0
- package/build/runtime~main.270fd45f.js +2 -0
- package/build/sa-json.2c03ef4e.chunk.js +1 -0
- package/build/sk-json.b41847e8.chunk.js +1 -0
- package/build/sso-sales-page.ef22e469.chunk.js +1 -0
- package/build/sso-settings-page.21e16ae4.chunk.js +1 -0
- package/build/sv-json.568cb7ae.chunk.js +1 -0
- package/build/th-json.5f659396.chunk.js +1 -0
- package/build/tr-json.c9f22432.chunk.js +1 -0
- package/build/transfer-tokens-create-page.3366204d.chunk.js +1 -0
- package/build/transfer-tokens-edit-page.15cf0f73.chunk.js +1 -0
- package/build/transfer-tokens-list-page.0bc0e682.chunk.js +16 -0
- package/build/uk-json.b7e38370.chunk.js +1 -0
- package/build/upload-settings.1319dca0.chunk.js +14 -0
- package/build/upload-translation-ca-json.57954414.chunk.js +1 -0
- package/build/upload-translation-de-json.420c943b.chunk.js +1 -0
- package/build/upload-translation-dk-json.bbb2fa05.chunk.js +1 -0
- package/build/upload-translation-en-json.8b7573ce.chunk.js +1 -0
- package/build/upload-translation-es-json.ba2eb03a.chunk.js +1 -0
- package/build/upload-translation-fr-json.baab9911.chunk.js +1 -0
- package/build/upload-translation-he-json.0a830937.chunk.js +1 -0
- package/build/upload-translation-it-json.e87d7966.chunk.js +1 -0
- package/build/upload-translation-ja-json.44b88e7a.chunk.js +1 -0
- package/build/upload-translation-ko-json.a52eab64.chunk.js +1 -0
- package/build/upload-translation-ms-json.74f6d746.chunk.js +1 -0
- package/build/upload-translation-pl-json.426f31c9.chunk.js +1 -0
- package/build/upload-translation-pt-BR-json.d1704f0b.chunk.js +1 -0
- package/build/upload-translation-pt-json.6b937fdf.chunk.js +1 -0
- package/build/upload-translation-ru-json.675f6b93.chunk.js +1 -0
- package/build/upload-translation-sk-json.483a18f6.chunk.js +1 -0
- package/build/upload-translation-th-json.98d35574.chunk.js +1 -0
- package/build/upload-translation-tr-json.74117e5c.chunk.js +1 -0
- package/build/upload-translation-uk-json.9950466a.chunk.js +1 -0
- package/build/upload-translation-zh-Hans-json.db163b6b.chunk.js +1 -0
- package/build/upload-translation-zh-json.e1dd6eb2.chunk.js +1 -0
- package/build/upload.1ced11be.chunk.js +58 -0
- package/build/users-advanced-settings-page.8e657084.chunk.js +9 -0
- package/build/users-email-settings-page.e57745e5.chunk.js +9 -0
- package/build/users-permissions-translation-ar-json.7d87d54d.chunk.js +1 -0
- package/build/users-permissions-translation-cs-json.7e23424a.chunk.js +1 -0
- package/build/users-permissions-translation-de-json.a6fb670f.chunk.js +1 -0
- package/build/users-permissions-translation-dk-json.60e50f48.chunk.js +1 -0
- package/build/users-permissions-translation-en-json.4b302272.chunk.js +1 -0
- package/build/users-permissions-translation-es-json.35007573.chunk.js +1 -0
- package/build/users-permissions-translation-fr-json.7e55bbbb.chunk.js +1 -0
- package/build/users-permissions-translation-id-json.a5a0fb59.chunk.js +1 -0
- package/build/users-permissions-translation-it-json.0705465d.chunk.js +1 -0
- package/build/users-permissions-translation-ja-json.891fe76e.chunk.js +1 -0
- package/build/users-permissions-translation-ko-json.357d7a33.chunk.js +1 -0
- package/build/users-permissions-translation-ms-json.c83f87c4.chunk.js +1 -0
- package/build/users-permissions-translation-nl-json.c9f92a3c.chunk.js +1 -0
- package/build/users-permissions-translation-pl-json.0a7287d1.chunk.js +1 -0
- package/build/users-permissions-translation-pt-BR-json.1b6d2920.chunk.js +1 -0
- package/build/users-permissions-translation-pt-json.a7eda429.chunk.js +1 -0
- package/build/users-permissions-translation-ru-json.8e883c67.chunk.js +1 -0
- package/build/users-permissions-translation-sk-json.7f37180f.chunk.js +1 -0
- package/build/users-permissions-translation-sv-json.17187818.chunk.js +1 -0
- package/build/users-permissions-translation-th-json.1e9c0247.chunk.js +1 -0
- package/build/users-permissions-translation-tr-json.2bd7ff98.chunk.js +1 -0
- package/build/users-permissions-translation-uk-json.6a0a1572.chunk.js +1 -0
- package/build/users-permissions-translation-vi-json.6722a8a2.chunk.js +1 -0
- package/build/users-permissions-translation-zh-Hans-json.8d82c809.chunk.js +1 -0
- package/build/users-permissions-translation-zh-json.7978eaa6.chunk.js +1 -0
- package/build/users-providers-settings-page.55796d13.chunk.js +14 -0
- package/build/users-roles-settings-page.57079245.chunk.js +55 -0
- package/build/vi-json.ee4c5537.chunk.js +1 -0
- package/build/webhook-edit-page.3a28b2e7.chunk.js +33 -0
- package/build/webhook-list-page.ee80767b.chunk.js +63 -0
- package/build/zh-Hans-json.97efd015.chunk.js +1 -0
- package/build/zh-json.bfc2e036.chunk.js +1 -0
- package/ee/admin/hooks/{useLicenseLimitNotification.js → useLicenseLimitNotification.ts} +4 -4
- package/ee/admin/pages/AuthPage/components/Login/index.js +1 -1
- package/ee/admin/pages/AuthPage/components/Providers/index.js +3 -2
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/selectors.js +1 -1
- package/ee/admin/pages/SettingsPage/pages/Users/ListPage/index.js +1 -3
- package/ee/server/bootstrap.js +1 -1
- package/ee/server/controllers/admin.js +1 -1
- package/ee/server/controllers/user.js +1 -1
- package/ee/server/destroy.js +1 -1
- package/ee/server/register.js +1 -1
- package/ee/server/routes/utils.js +1 -1
- package/ee/server/services/audit-logs.js +1 -1
- package/ee/server/services/passport/sso.js +1 -1
- package/ee/server/services/passport.js +1 -1
- package/ee/server/services/seat-enforcement.js +1 -1
- package/ee/server/utils/sso-lock.js +1 -1
- package/ee/server/validation/role.js +1 -1
- package/ee/server/validation/user.js +1 -1
- package/jest.config.front.js +4 -0
- package/package.json +28 -22
- package/scripts/build.js +6 -2
- package/server/controllers/admin.js +4 -3
- package/shared/entities.ts +33 -0
- package/shared/permissions.ts +52 -0
- package/shared/schema.ts +9 -0
- package/webpack.config.js +1 -0
- package/admin/src/components/AuthenticatedApp/index.js +0 -120
- package/admin/src/components/AuthenticatedApp/utils/api.js +0 -85
- package/admin/src/components/AuthenticatedApp/utils/checkLatestStrapiVersion.js +0 -11
- package/admin/src/components/ConfigurationsProvider/index.js +0 -66
- package/admin/src/components/ConfigurationsProvider/reducer.js +0 -29
- package/admin/src/components/DragLayer/index.js +0 -1
- package/admin/src/components/GlobalStyle/index.js +0 -9
- package/admin/src/components/GuidedTour/Homepage/components/Step.js +0 -61
- package/admin/src/components/GuidedTour/Homepage/components/Stepper.js +0 -61
- package/admin/src/components/GuidedTour/Homepage/index.js +0 -71
- package/admin/src/components/GuidedTour/Modal/components/Content.js +0 -66
- package/admin/src/components/GuidedTour/Modal/components/Modal.js +0 -72
- package/admin/src/components/GuidedTour/Modal/components/StepNumberWithPadding.js +0 -26
- package/admin/src/components/GuidedTour/Modal/components/Stepper.js +0 -118
- package/admin/src/components/GuidedTour/Modal/index.js +0 -94
- package/admin/src/components/GuidedTour/Modal/reducer.js +0 -29
- package/admin/src/components/GuidedTour/Stepper/StepLine.js +0 -29
- package/admin/src/components/GuidedTour/Stepper/StepNumber.js +0 -71
- package/admin/src/components/GuidedTour/constants.js +0 -3
- package/admin/src/components/GuidedTour/index.js +0 -102
- package/admin/src/components/GuidedTour/init.js +0 -37
- package/admin/src/components/GuidedTour/reducer.js +0 -50
- package/admin/src/components/GuidedTour/utils/arePreviousSectionsDone.js +0 -13
- package/admin/src/components/GuidedTour/utils/arePreviousStepsDone.js +0 -12
- package/admin/src/components/GuidedTour/utils/isGuidedTourCompleted.js +0 -6
- package/admin/src/components/GuidedTour/utils/persistStateToLocaleStorage.js +0 -34
- package/admin/src/components/LanguageProvider/index.js +0 -54
- package/admin/src/components/LanguageProvider/init.js +0 -13
- package/admin/src/components/LanguageProvider/reducer.js +0 -30
- package/admin/src/components/LanguageProvider/utils/localStorageKey.js +0 -3
- package/admin/src/components/LocalesProvider/context.js +0 -5
- package/admin/src/components/LocalesProvider/index.js +0 -21
- package/admin/src/components/LocalesProvider/useLocalesProvider.js +0 -11
- package/admin/src/components/NpsSurvey/hooks/useNpsSurveySettings.js +0 -17
- package/admin/src/components/PluginsInitializer/index.js +0 -68
- package/admin/src/components/PluginsInitializer/init.js +0 -11
- package/admin/src/components/PluginsInitializer/reducer.js +0 -22
- package/admin/src/components/PrivateRoute/index.js +0 -46
- package/admin/src/components/Providers/index.js +0 -156
- package/admin/src/components/RBACProvider/actions.js +0 -10
- package/admin/src/components/RBACProvider/constants.js +0 -2
- package/admin/src/components/RBACProvider/index.js +0 -39
- package/admin/src/components/RBACProvider/reducer.js +0 -51
- package/admin/src/components/Theme/index.js +0 -26
- package/admin/src/components/ThemeToggleProvider/index.js +0 -79
- package/admin/src/contexts/Admin/index.js +0 -5
- package/admin/src/contexts/ApiTokenPermissions/index.js +0 -25
- package/admin/src/contexts/Configurations/index.js +0 -5
- package/admin/src/contexts/MarketPlace/index.js +0 -18
- package/admin/src/contexts/PermisssionsDataManagerContext/index.js +0 -5
- package/admin/src/contexts/ThemeToggle/index.js +0 -5
- package/admin/src/contexts/index.js +0 -4
- package/admin/src/core/store/configureStore.js +0 -47
- package/admin/src/exposedHooks.js +0 -27
- package/admin/src/hooks/useAdminRoles/__mocks__/index.js +0 -5
- package/admin/src/hooks/useAdminUsers/index.js +0 -1
- package/admin/src/hooks/useAdminUsers/useAdminUsers.js +0 -47
- package/admin/src/hooks/useConfigurations/index.js +0 -11
- package/admin/src/hooks/useContentTypes/index.js +0 -1
- package/admin/src/hooks/useDebounce/index.js +0 -19
- package/admin/src/hooks/useEnterprise/index.js +0 -1
- package/admin/src/hooks/useLicenseLimitNotification/index.js +0 -5
- package/admin/src/hooks/useMenu/index.js +0 -86
- package/admin/src/hooks/useMenu/utils/checkPermissions.js +0 -13
- package/admin/src/hooks/useMenu/utils/getGeneralLinks.js +0 -31
- package/admin/src/hooks/useMenu/utils/getPluginSectionLinks.js +0 -17
- package/admin/src/hooks/usePermissionsDataManager/index.js +0 -7
- package/admin/src/hooks/useReleaseNotification/index.js +0 -31
- package/admin/src/hooks/useReleaseNotification/utils/api.js +0 -20
- package/admin/src/hooks/useReleaseNotification/utils/checkLatestStrapiVersion.js +0 -11
- package/admin/src/hooks/useThemeToggle/index.js +0 -11
- package/admin/src/injectionZones.js +0 -25
- package/admin/src/layouts/UnauthenticatedLayout/LocaleToggle/index.js +0 -29
- package/admin/src/layouts/UnauthenticatedLayout/index.js +0 -55
- package/admin/src/reducers.js +0 -23
- package/admin/src/shared/hooks/useAdminProvider/index.js +0 -11
- package/admin/src/tsconfig.json +0 -10
- package/admin/src/utils/checkFormValidity.js +0 -15
- package/admin/src/utils/createRoute.js +0 -47
- package/admin/src/utils/formatAPIErrors.js +0 -17
- package/admin/src/utils/getAttributesToDisplay.js +0 -19
- package/admin/src/utils/getExistingActions.js +0 -32
- package/admin/src/utils/getFullName.js +0 -9
- package/admin/src/utils/index.js +0 -9
- package/admin/src/utils/makeUniqueRoutes.js +0 -6
- package/admin/src/utils/sortLinks.js +0 -5
- /package/admin/src/hooks/{useAdminUsers/__mocks__/index.js → __mocks__/useAdminUsers.ts} +0 -0
- /package/admin/src/hooks/{useContentTypes/__mocks__/index.js → __mocks__/useContentTypes.ts} +0 -0
- /package/admin/src/{hooks/useAdminRolePermissions/__mocks__/index.js → pages/SettingsPage/pages/Roles/hooks/__mocks__/useAdminRolePermissions.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { BaseCheckbox, IconButton,
|
|
3
|
+
import { BaseCheckbox, IconButton, Flex } from '@strapi/design-system';
|
|
4
4
|
import { useTracking, useTableContext, Table } from '@strapi/helper-plugin';
|
|
5
5
|
import { Trash, Duplicate, Pencil } from '@strapi/icons';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
@@ -29,15 +29,14 @@ const CheckboxDataCell = ({ rowId, index }) => {
|
|
|
29
29
|
);
|
|
30
30
|
|
|
31
31
|
return (
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
</Td>
|
|
32
|
+
<BaseCheckbox
|
|
33
|
+
aria-label={ariaLabel}
|
|
34
|
+
checked={isChecked}
|
|
35
|
+
onClick={stopPropagation}
|
|
36
|
+
onChange={() => {
|
|
37
|
+
onSelectRow({ name: rowId, value: !isChecked });
|
|
38
|
+
}}
|
|
39
|
+
/>
|
|
41
40
|
);
|
|
42
41
|
};
|
|
43
42
|
|
|
@@ -75,61 +74,59 @@ const EntityActionsDataCell = ({
|
|
|
75
74
|
);
|
|
76
75
|
|
|
77
76
|
return (
|
|
78
|
-
<
|
|
79
|
-
<
|
|
77
|
+
<Flex gap={1} justifyContent="end" onClick={stopPropagation}>
|
|
78
|
+
<IconButton
|
|
79
|
+
forwardedAs={Link}
|
|
80
|
+
onClick={() => {
|
|
81
|
+
trackUsage('willEditEntryFromButton');
|
|
82
|
+
}}
|
|
83
|
+
to={{
|
|
84
|
+
pathname: `${pathname}/${rowId}`,
|
|
85
|
+
state: { from: pathname },
|
|
86
|
+
search: pluginsQueryParams,
|
|
87
|
+
}}
|
|
88
|
+
label={formatMessage(
|
|
89
|
+
{ id: 'app.component.table.edit', defaultMessage: 'Edit {target}' },
|
|
90
|
+
{ target: itemLineText }
|
|
91
|
+
)}
|
|
92
|
+
noBorder
|
|
93
|
+
>
|
|
94
|
+
<Pencil />
|
|
95
|
+
</IconButton>
|
|
96
|
+
|
|
97
|
+
{canCreate && (
|
|
98
|
+
<IconButton
|
|
99
|
+
onClick={handleCloneClick(rowId)}
|
|
100
|
+
label={formatMessage(
|
|
101
|
+
{
|
|
102
|
+
id: 'app.component.table.duplicate',
|
|
103
|
+
defaultMessage: 'Duplicate {target}',
|
|
104
|
+
},
|
|
105
|
+
{ target: itemLineText }
|
|
106
|
+
)}
|
|
107
|
+
noBorder
|
|
108
|
+
>
|
|
109
|
+
<Duplicate />
|
|
110
|
+
</IconButton>
|
|
111
|
+
)}
|
|
112
|
+
|
|
113
|
+
{canDelete && (
|
|
80
114
|
<IconButton
|
|
81
|
-
forwardedAs={Link}
|
|
82
115
|
onClick={() => {
|
|
83
|
-
trackUsage('
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
pathname: `${pathname}/${rowId}`,
|
|
87
|
-
state: { from: pathname },
|
|
88
|
-
search: pluginsQueryParams,
|
|
116
|
+
trackUsage('willDeleteEntryFromList');
|
|
117
|
+
setSelectedEntries([rowId]);
|
|
118
|
+
setIsConfirmDeleteRowOpen(true);
|
|
89
119
|
}}
|
|
90
120
|
label={formatMessage(
|
|
91
|
-
{ id: '
|
|
121
|
+
{ id: 'global.delete-target', defaultMessage: 'Delete {target}' },
|
|
92
122
|
{ target: itemLineText }
|
|
93
123
|
)}
|
|
94
124
|
noBorder
|
|
95
125
|
>
|
|
96
|
-
<
|
|
126
|
+
<Trash />
|
|
97
127
|
</IconButton>
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
<IconButton
|
|
101
|
-
onClick={handleCloneClick(rowId)}
|
|
102
|
-
label={formatMessage(
|
|
103
|
-
{
|
|
104
|
-
id: 'app.component.table.duplicate',
|
|
105
|
-
defaultMessage: 'Duplicate {target}',
|
|
106
|
-
},
|
|
107
|
-
{ target: itemLineText }
|
|
108
|
-
)}
|
|
109
|
-
noBorder
|
|
110
|
-
>
|
|
111
|
-
<Duplicate />
|
|
112
|
-
</IconButton>
|
|
113
|
-
)}
|
|
114
|
-
|
|
115
|
-
{canDelete && (
|
|
116
|
-
<IconButton
|
|
117
|
-
onClick={() => {
|
|
118
|
-
trackUsage('willDeleteEntryFromList');
|
|
119
|
-
setSelectedEntries([rowId]);
|
|
120
|
-
setIsConfirmDeleteRowOpen(true);
|
|
121
|
-
}}
|
|
122
|
-
label={formatMessage(
|
|
123
|
-
{ id: 'global.delete-target', defaultMessage: 'Delete {target}' },
|
|
124
|
-
{ target: itemLineText }
|
|
125
|
-
)}
|
|
126
|
-
noBorder
|
|
127
|
-
>
|
|
128
|
-
<Trash />
|
|
129
|
-
</IconButton>
|
|
130
|
-
)}
|
|
131
|
-
</Flex>
|
|
132
|
-
</Td>
|
|
128
|
+
)}
|
|
129
|
+
</Flex>
|
|
133
130
|
);
|
|
134
131
|
};
|
|
135
132
|
|
|
@@ -32,7 +32,7 @@ import { useSelector } from 'react-redux';
|
|
|
32
32
|
import { Link, useHistory } from 'react-router-dom';
|
|
33
33
|
import styled from 'styled-components';
|
|
34
34
|
|
|
35
|
-
import
|
|
35
|
+
import { formatAPIErrors } from '../../../../../../utils/formatAPIErrors';
|
|
36
36
|
import { getTrad, createYupSchema } from '../../../../../utils';
|
|
37
37
|
import { listViewDomain } from '../../../selectors';
|
|
38
38
|
import { Body } from '../../Body';
|
|
@@ -156,7 +156,9 @@ const SelectedEntriesTableContent = ({
|
|
|
156
156
|
<Table.Body>
|
|
157
157
|
{rowsToDisplay.map((row, index) => (
|
|
158
158
|
<Tr key={row.id}>
|
|
159
|
-
<
|
|
159
|
+
<Td>
|
|
160
|
+
<Body.CheckboxDataCell rowId={row.id} index={index} />
|
|
161
|
+
</Td>
|
|
160
162
|
<Td>
|
|
161
163
|
<Typography>{row.id}</Typography>
|
|
162
164
|
</Td>
|
|
@@ -301,7 +303,7 @@ const SelectedEntriesModalContent = ({
|
|
|
301
303
|
onError(error) {
|
|
302
304
|
toggleNotification({
|
|
303
305
|
type: 'warning',
|
|
304
|
-
message:
|
|
306
|
+
message: formatAPIErrors(error),
|
|
305
307
|
});
|
|
306
308
|
},
|
|
307
309
|
}
|
|
@@ -23,7 +23,7 @@ import { useIntl } from 'react-intl';
|
|
|
23
23
|
import { Link, useHistory } from 'react-router-dom';
|
|
24
24
|
|
|
25
25
|
import { useEnterprise } from '../../../../../hooks/useEnterprise';
|
|
26
|
-
import { getFullName } from '../../../../../utils';
|
|
26
|
+
import { getFullName } from '../../../../../utils/getFullName';
|
|
27
27
|
import { usePluginsQueryParams } from '../../../../hooks';
|
|
28
28
|
import { getTrad } from '../../../../utils';
|
|
29
29
|
import CellContent from '../CellContent';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
+
import { bindActionCreators } from '@reduxjs/toolkit';
|
|
3
4
|
import {
|
|
4
5
|
Main,
|
|
5
6
|
ActionLayout,
|
|
@@ -39,11 +40,11 @@ import PropTypes from 'prop-types';
|
|
|
39
40
|
import { stringify } from 'qs';
|
|
40
41
|
import { useIntl } from 'react-intl';
|
|
41
42
|
import { useMutation } from 'react-query';
|
|
42
|
-
import {
|
|
43
|
+
import { useDispatch } from 'react-redux';
|
|
43
44
|
import { useHistory, useLocation, Link as ReactRouterLink } from 'react-router-dom';
|
|
44
|
-
import { bindActionCreators, compose } from 'redux';
|
|
45
45
|
|
|
46
|
-
import {
|
|
46
|
+
import { HOOKS } from '../../../constants';
|
|
47
|
+
import { useTypedSelector } from '../../../core/store/hooks';
|
|
47
48
|
import { useAdminUsers } from '../../../hooks/useAdminUsers';
|
|
48
49
|
import { useEnterprise } from '../../../hooks/useEnterprise';
|
|
49
50
|
import { InjectionZone } from '../../../shared/components';
|
|
@@ -53,7 +54,7 @@ import { CREATOR_FIELDS } from '../../constants/attributes';
|
|
|
53
54
|
import { useAllowedAttributes } from '../../hooks/useAllowedAttributes';
|
|
54
55
|
import { getTrad, getDisplayName } from '../../utils';
|
|
55
56
|
|
|
56
|
-
import
|
|
57
|
+
import * as Actions from './actions';
|
|
57
58
|
import { Body } from './components/Body';
|
|
58
59
|
import BulkActionButtons from './components/BulkActionButtons';
|
|
59
60
|
import CellContent from './components/CellContent';
|
|
@@ -61,24 +62,23 @@ import { ViewSettingsMenu } from './components/ViewSettingsMenu';
|
|
|
61
62
|
import makeSelectListView, { selectDisplayedHeaders } from './selectors';
|
|
62
63
|
import { buildValidGetParams } from './utils';
|
|
63
64
|
|
|
65
|
+
const { INJECT_COLUMN_IN_TABLE } = HOOKS;
|
|
64
66
|
const REVIEW_WORKFLOW_COLUMNS_CE = null;
|
|
65
67
|
const REVIEW_WORKFLOW_COLUMNS_CELL_CE = () => null;
|
|
66
68
|
const REVIEW_WORKFLOW_FILTER_CE = [];
|
|
67
69
|
const USER_FILTER_ATTRIBUTES = [...CREATOR_FIELDS, 'strapi_assignee'];
|
|
68
70
|
|
|
69
|
-
function ListView({
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
pagination,
|
|
80
|
-
slug,
|
|
81
|
-
}) {
|
|
71
|
+
function ListView({ canCreate, canDelete, canRead, canPublish, layout, slug }) {
|
|
72
|
+
const dispatch = useDispatch();
|
|
73
|
+
const { getData, getDataSucceeded } = React.useMemo(
|
|
74
|
+
() =>
|
|
75
|
+
bindActionCreators(
|
|
76
|
+
{ getData: Actions.getData, getDataSucceeded: Actions.getDataSucceeded },
|
|
77
|
+
dispatch
|
|
78
|
+
),
|
|
79
|
+
[dispatch]
|
|
80
|
+
);
|
|
81
|
+
const { pagination, isLoading, data } = useTypedSelector(makeSelectListView());
|
|
82
82
|
const { total } = pagination;
|
|
83
83
|
const { contentType } = layout;
|
|
84
84
|
const {
|
|
@@ -185,6 +185,7 @@ function ListView({
|
|
|
185
185
|
};
|
|
186
186
|
|
|
187
187
|
filter.fieldSchema.mainField = {
|
|
188
|
+
...mainField,
|
|
188
189
|
name: 'id',
|
|
189
190
|
};
|
|
190
191
|
}
|
|
@@ -467,7 +468,7 @@ function ListView({
|
|
|
467
468
|
});
|
|
468
469
|
|
|
469
470
|
const { runHookWaterfall } = useStrapiApp();
|
|
470
|
-
const displayedHeaders =
|
|
471
|
+
const displayedHeaders = useTypedSelector(selectDisplayedHeaders);
|
|
471
472
|
|
|
472
473
|
const tableHeaders = React.useMemo(() => {
|
|
473
474
|
const headers = runHookWaterfall(INJECT_COLUMN_IN_TABLE, {
|
|
@@ -720,7 +721,7 @@ function ListView({
|
|
|
720
721
|
{/* Empty content */}
|
|
721
722
|
<Table.EmptyBody
|
|
722
723
|
contentType={headerLayoutTitle}
|
|
723
|
-
|
|
724
|
+
action={getCreateAction({ variant: 'secondary' })}
|
|
724
725
|
/>
|
|
725
726
|
{/* Content */}
|
|
726
727
|
<Body.Root
|
|
@@ -730,9 +731,11 @@ function ListView({
|
|
|
730
731
|
>
|
|
731
732
|
{data.map((rowData, index) => {
|
|
732
733
|
return (
|
|
733
|
-
<Tr cursor="pointer" key={
|
|
734
|
+
<Tr cursor="pointer" key={rowData.id} onClick={handleRowClick(rowData.id)}>
|
|
734
735
|
{/* Bulk action row checkbox */}
|
|
735
|
-
<
|
|
736
|
+
<Td>
|
|
737
|
+
<Body.CheckboxDataCell rowId={rowData.id} index={index} />
|
|
738
|
+
</Td>
|
|
736
739
|
{/* Field data */}
|
|
737
740
|
{tableHeaders.map(({ key, name, cellFormatter, ...rest }) => {
|
|
738
741
|
if (hasDraftAndPublish && name === 'publishedAt') {
|
|
@@ -831,14 +834,16 @@ function ListView({
|
|
|
831
834
|
})}
|
|
832
835
|
{/* Actions: edit, duplicate, delete */}
|
|
833
836
|
{(canDelete || canPublish) && isBulkable && (
|
|
834
|
-
<
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
837
|
+
<Td>
|
|
838
|
+
<Body.EntityActionsDataCell
|
|
839
|
+
rowId={rowData.id}
|
|
840
|
+
index={index}
|
|
841
|
+
setIsConfirmDeleteRowOpen={setIsConfirmDeleteRowOpen}
|
|
842
|
+
canCreate={canCreate}
|
|
843
|
+
canDelete={canDelete}
|
|
844
|
+
handleCloneClick={handleCloneClick}
|
|
845
|
+
/>
|
|
846
|
+
</Td>
|
|
842
847
|
)}
|
|
843
848
|
</Tr>
|
|
844
849
|
);
|
|
@@ -864,7 +869,6 @@ ListView.propTypes = {
|
|
|
864
869
|
canDelete: PropTypes.bool.isRequired,
|
|
865
870
|
canRead: PropTypes.bool.isRequired,
|
|
866
871
|
canPublish: PropTypes.bool.isRequired,
|
|
867
|
-
data: PropTypes.array.isRequired,
|
|
868
872
|
layout: PropTypes.exact({
|
|
869
873
|
components: PropTypes.object.isRequired,
|
|
870
874
|
contentType: PropTypes.shape({
|
|
@@ -879,27 +883,7 @@ ListView.propTypes = {
|
|
|
879
883
|
settings: PropTypes.object.isRequired,
|
|
880
884
|
}).isRequired,
|
|
881
885
|
}).isRequired,
|
|
882
|
-
isLoading: PropTypes.bool.isRequired,
|
|
883
|
-
getData: PropTypes.func.isRequired,
|
|
884
|
-
getDataSucceeded: PropTypes.func.isRequired,
|
|
885
|
-
pagination: PropTypes.shape({ total: PropTypes.number.isRequired, pageCount: PropTypes.number })
|
|
886
|
-
.isRequired,
|
|
887
886
|
slug: PropTypes.string.isRequired,
|
|
888
887
|
};
|
|
889
888
|
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
export function mapDispatchToProps(dispatch) {
|
|
893
|
-
return bindActionCreators(
|
|
894
|
-
{
|
|
895
|
-
getData,
|
|
896
|
-
getDataSucceeded,
|
|
897
|
-
onChangeListHeaders,
|
|
898
|
-
onResetListHeaders,
|
|
899
|
-
},
|
|
900
|
-
dispatch
|
|
901
|
-
);
|
|
902
|
-
}
|
|
903
|
-
const withConnect = connect(mapStateToProps, mapDispatchToProps);
|
|
904
|
-
|
|
905
|
-
export default compose(withConnect)(React.memo(ListView, isEqual));
|
|
889
|
+
export default React.memo(ListView, isEqual);
|
|
@@ -5,7 +5,7 @@ const checkIfAttributeIsDisplayable = (attribute) => {
|
|
|
5
5
|
return !(attribute?.relationType ?? '').toLowerCase().includes('morph');
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
return !['json', 'dynamiczone', 'richtext', 'password'].includes(type) && !!type;
|
|
8
|
+
return !['json', 'dynamiczone', 'richtext', 'password', 'blocks'].includes(type) && !!type;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export default checkIfAttributeIsDisplayable;
|
|
@@ -228,8 +228,8 @@ const createYupSchemaAttribute = (type, validations, options) => {
|
|
|
228
228
|
return true;
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
-
// The backend validates the actual schema
|
|
232
|
-
if (!Array.isArray(value)) {
|
|
231
|
+
// The backend validates the actual schema, check if a value different than null is not an array
|
|
232
|
+
if (value && !Array.isArray(value)) {
|
|
233
233
|
return false;
|
|
234
234
|
}
|
|
235
235
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface AdminContextValue {
|
|
4
|
+
/**
|
|
5
|
+
* TODO: this should come from `StrapiApp['getAdminInjectedComponents']`
|
|
6
|
+
*/
|
|
7
|
+
getAdminInjectedComponents: () => unknown;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const AdminContext = React.createContext<AdminContextValue>({
|
|
11
|
+
getAdminInjectedComponents() {
|
|
12
|
+
throw new Error('AdminContext: getAdminInjectedComponents() not implemented');
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const useAdmin = () => React.useContext(AdminContext);
|
|
17
|
+
|
|
18
|
+
export { AdminContext, useAdmin };
|
|
19
|
+
export type { AdminContextValue };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/* eslint-disable check-file/filename-naming-convention */
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
|
|
5
|
+
import { Entity } from '@strapi/types';
|
|
6
|
+
|
|
7
|
+
interface PseudoEvent {
|
|
8
|
+
target: { value: string };
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface ApiTokenPermissionsContextValue {
|
|
12
|
+
selectedAction: string[] | null;
|
|
13
|
+
routes: string[];
|
|
14
|
+
selectedActions: string[];
|
|
15
|
+
data: {
|
|
16
|
+
allActionsIds: Entity.ID[];
|
|
17
|
+
permissions: {
|
|
18
|
+
apiId: string;
|
|
19
|
+
label: string;
|
|
20
|
+
controllers: { controller: string; actions: { actionId: string; action: string } }[];
|
|
21
|
+
}[];
|
|
22
|
+
};
|
|
23
|
+
onChange: ({ target: { value } }: PseudoEvent) => void;
|
|
24
|
+
onChangeSelectAll: ({ target: { value } }: PseudoEvent) => void;
|
|
25
|
+
setSelectedAction: ({ target: { value } }: PseudoEvent) => void;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface ApiTokenPermissionsContextProviderProps extends ApiTokenPermissionsContextValue {
|
|
29
|
+
children: React.ReactNode[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const ApiTokenPermissionsContext = React.createContext<ApiTokenPermissionsContextValue>({
|
|
33
|
+
selectedAction: null,
|
|
34
|
+
routes: [],
|
|
35
|
+
selectedActions: [],
|
|
36
|
+
data: {
|
|
37
|
+
allActionsIds: [],
|
|
38
|
+
permissions: [],
|
|
39
|
+
},
|
|
40
|
+
onChange: () => {},
|
|
41
|
+
onChangeSelectAll: () => {},
|
|
42
|
+
setSelectedAction: () => {},
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const ApiTokenPermissionsContextProvider = ({
|
|
46
|
+
children,
|
|
47
|
+
...rest
|
|
48
|
+
}: ApiTokenPermissionsContextProviderProps) => {
|
|
49
|
+
return (
|
|
50
|
+
<ApiTokenPermissionsContext.Provider value={rest}>
|
|
51
|
+
{children}
|
|
52
|
+
</ApiTokenPermissionsContext.Provider>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const useApiTokenPermissionsContext = () => React.useContext(ApiTokenPermissionsContext);
|
|
57
|
+
|
|
58
|
+
export {
|
|
59
|
+
ApiTokenPermissionsContext,
|
|
60
|
+
ApiTokenPermissionsContextProvider,
|
|
61
|
+
useApiTokenPermissionsContext,
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export type { ApiTokenPermissionsContextValue, ApiTokenPermissionsContextProviderProps };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface ConfigurationContextValue {
|
|
4
|
+
logos: {
|
|
5
|
+
auth: { custom?: string | null; default: string };
|
|
6
|
+
menu: { custom?: string | null; default: string };
|
|
7
|
+
};
|
|
8
|
+
showTutorials: boolean;
|
|
9
|
+
showReleaseNotification: boolean;
|
|
10
|
+
updateProjectSettings: (settings: { authLogo?: string; menuLogo?: string }) => void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const ConfigurationContext = createContext<ConfigurationContextValue>({
|
|
14
|
+
logos: {
|
|
15
|
+
auth: { default: '' },
|
|
16
|
+
menu: { default: '' },
|
|
17
|
+
},
|
|
18
|
+
showTutorials: false,
|
|
19
|
+
showReleaseNotification: false,
|
|
20
|
+
updateProjectSettings: () => {
|
|
21
|
+
throw new Error('updateProjectSettings was not implemented');
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export { ConfigurationContext };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
|
|
3
|
+
import { DefaultTheme } from 'styled-components';
|
|
4
|
+
|
|
5
|
+
export type ThemeName = 'light' | 'dark' | 'system';
|
|
6
|
+
export type NonSystemThemeName = Exclude<ThemeName, 'system'>;
|
|
7
|
+
|
|
8
|
+
interface ThemeToggleContextContextValue {
|
|
9
|
+
currentTheme?: ThemeName;
|
|
10
|
+
onChangeTheme?: (nextTheme: ThemeName) => void;
|
|
11
|
+
themes?: {
|
|
12
|
+
dark: DefaultTheme;
|
|
13
|
+
light: DefaultTheme;
|
|
14
|
+
};
|
|
15
|
+
systemTheme?: NonSystemThemeName;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const ThemeToggleContext = createContext<ThemeToggleContextContextValue>({});
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import {
|
|
2
|
+
configureStore,
|
|
3
|
+
StoreEnhancer,
|
|
4
|
+
Middleware,
|
|
5
|
+
Reducer,
|
|
6
|
+
combineReducers,
|
|
7
|
+
} from '@reduxjs/toolkit';
|
|
8
|
+
|
|
9
|
+
import { RBACReducer } from '../../components/RBACProvider';
|
|
10
|
+
// @ts-expect-error no types, yet.
|
|
11
|
+
import rbacManagerReducer from '../../content-manager/hooks/useSyncRbac/reducer';
|
|
12
|
+
// @ts-expect-error no types, yet.
|
|
13
|
+
import cmAppReducer from '../../content-manager/pages/App/reducer';
|
|
14
|
+
// @ts-expect-error no types, yet.
|
|
15
|
+
import editViewLayoutManagerReducer from '../../content-manager/pages/EditViewLayoutManager/reducer';
|
|
16
|
+
// @ts-expect-error no types, yet.
|
|
17
|
+
import listViewReducer from '../../content-manager/pages/ListView/reducer';
|
|
18
|
+
// @ts-expect-error no types, yet.
|
|
19
|
+
import editViewCrudReducer from '../../content-manager/sharedReducers/crudReducer/reducer';
|
|
20
|
+
// @ts-expect-error no types, yet.
|
|
21
|
+
import appReducer from '../../pages/App/reducer';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @description Static reducers are ones we know, they live in the admin package.
|
|
25
|
+
*/
|
|
26
|
+
const staticReducers = {
|
|
27
|
+
admin_app: appReducer,
|
|
28
|
+
rbacProvider: RBACReducer,
|
|
29
|
+
'content-manager_app': cmAppReducer,
|
|
30
|
+
'content-manager_listView': listViewReducer,
|
|
31
|
+
'content-manager_rbacManager': rbacManagerReducer,
|
|
32
|
+
'content-manager_editViewLayoutManager': editViewLayoutManagerReducer,
|
|
33
|
+
'content-manager_editViewCrudReducer': editViewCrudReducer,
|
|
34
|
+
} as const;
|
|
35
|
+
|
|
36
|
+
const injectReducerStoreEnhancer: (appReducers: Record<string, Reducer>) => StoreEnhancer =
|
|
37
|
+
(appReducers) =>
|
|
38
|
+
(next) =>
|
|
39
|
+
(...args) => {
|
|
40
|
+
const store = next(...args);
|
|
41
|
+
|
|
42
|
+
const asyncReducers: Record<string, Reducer> = {};
|
|
43
|
+
|
|
44
|
+
return {
|
|
45
|
+
...store,
|
|
46
|
+
asyncReducers,
|
|
47
|
+
injectReducer: (key: string, asyncReducer: Reducer) => {
|
|
48
|
+
asyncReducers[key] = asyncReducer;
|
|
49
|
+
store.replaceReducer(
|
|
50
|
+
// @ts-expect-error we dynamically add reducers which makes the types uncomfortable.
|
|
51
|
+
combineReducers({
|
|
52
|
+
...appReducers,
|
|
53
|
+
...asyncReducers,
|
|
54
|
+
})
|
|
55
|
+
);
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* @description This is the main store configuration function, injected Reducers use our legacy app.addReducer API,
|
|
62
|
+
* which we're trying to phase out. App Middlewares could potentially be improved...?
|
|
63
|
+
*/
|
|
64
|
+
const configureStoreImpl = (
|
|
65
|
+
appMiddlewares: Array<() => Middleware> = [],
|
|
66
|
+
injectedReducers: Record<string, Reducer> = {}
|
|
67
|
+
) => {
|
|
68
|
+
const coreReducers = { ...staticReducers, ...injectedReducers } as const;
|
|
69
|
+
|
|
70
|
+
const store = configureStore({
|
|
71
|
+
reducer: coreReducers,
|
|
72
|
+
devTools: process.env.NODE_ENV !== 'production',
|
|
73
|
+
middleware: (getDefaultMiddleware) => [
|
|
74
|
+
...getDefaultMiddleware(),
|
|
75
|
+
...appMiddlewares.map((m) => m()),
|
|
76
|
+
],
|
|
77
|
+
enhancers: [injectReducerStoreEnhancer(coreReducers)],
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
return store;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
type Store = ReturnType<typeof configureStoreImpl> & {
|
|
84
|
+
asyncReducers: Record<string, Reducer>;
|
|
85
|
+
injectReducer: (key: string, asyncReducer: Reducer) => void;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
type RootState = ReturnType<Store['getState']>;
|
|
89
|
+
|
|
90
|
+
export { configureStoreImpl as configureStore };
|
|
91
|
+
export type { RootState, Store };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createSelector, Selector } from '@reduxjs/toolkit';
|
|
2
|
+
import { useDispatch, useStore, TypedUseSelectorHook, useSelector } from 'react-redux';
|
|
3
|
+
|
|
4
|
+
import type { RootState, Store } from './configure';
|
|
5
|
+
|
|
6
|
+
type AppDispatch = Store['dispatch'];
|
|
7
|
+
|
|
8
|
+
const useTypedDispatch: () => AppDispatch = useDispatch;
|
|
9
|
+
const useTypedStore = useStore as () => Store;
|
|
10
|
+
const useTypedSelector: TypedUseSelectorHook<RootState> = useSelector;
|
|
11
|
+
|
|
12
|
+
const createTypedSelector = <TResult>(selector: Selector<RootState, TResult>) =>
|
|
13
|
+
createSelector((state: RootState) => state, selector);
|
|
14
|
+
|
|
15
|
+
export { useTypedDispatch, useTypedStore, useTypedSelector, createTypedSelector };
|
package/admin/src/hooks/index.js
CHANGED
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
export { default as useConfigurations } from './useConfigurations';
|
|
2
|
-
export { useContentTypes } from './useContentTypes';
|
|
3
|
-
export { default as useLicenseLimitNotification } from './useLicenseLimitNotification';
|
|
4
|
-
export { default as useMenu } from './useMenu';
|
|
5
|
-
export { default as usePermissionsDataManager } from './usePermissionsDataManager';
|
|
6
|
-
export { default as useRegenerate } from './useRegenerate';
|
|
7
|
-
export { default as useReleaseNotification } from './useReleaseNotification';
|
|
8
1
|
export { default as useSettingsForm } from './useSettingsForm';
|
|
9
2
|
export { default as useSettingsMenu } from './useSettingsMenu';
|
|
10
|
-
export { default as useThemeToggle } from './useThemeToggle';
|