@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,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
// eslint-disable-next-line node/no-extraneous-require
|
|
4
|
-
const ee = require('@strapi/strapi/dist/utils/ee')
|
|
4
|
+
const ee = require('@strapi/strapi/dist/utils/ee');
|
|
5
5
|
const _ = require('lodash');
|
|
6
6
|
const { pick, isNil } = require('lodash/fp');
|
|
7
7
|
const { ApplicationError, ForbiddenError } = require('@strapi/utils').errors;
|
package/ee/server/destroy.js
CHANGED
package/ee/server/register.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const { features } = require('@strapi/strapi/dist/utils/ee')
|
|
3
|
+
const { features } = require('@strapi/strapi/dist/utils/ee');
|
|
4
4
|
const executeCERegister = require('../../server/register');
|
|
5
5
|
const migrateAuditLogsTable = require('./migrations/audit-logs-table');
|
|
6
6
|
const migrateReviewWorkflowStagesColor = require('./migrations/review-workflows-stages-color');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const localProvider = require('@strapi/provider-audit-logs-local');
|
|
4
4
|
const { scheduleJob } = require('node-schedule');
|
|
5
|
-
const { features } = require('@strapi/strapi/dist/utils/ee')
|
|
5
|
+
const { features } = require('@strapi/strapi/dist/utils/ee');
|
|
6
6
|
|
|
7
7
|
const DEFAULT_RETENTION_DAYS = 90;
|
|
8
8
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const ee = require('@strapi/strapi/dist/utils/ee')
|
|
3
|
+
const ee = require('@strapi/strapi/dist/utils/ee');
|
|
4
4
|
const { authEventsMapper } = require('../../../../server/services/passport');
|
|
5
5
|
const createProviderRegistry = require('./provider-registry');
|
|
6
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
// eslint-disable-next-line node/no-extraneous-require
|
|
4
|
-
const { features } = require('@strapi/strapi/dist/utils/ee')
|
|
4
|
+
const { features } = require('@strapi/strapi/dist/utils/ee');
|
|
5
5
|
|
|
6
6
|
const { UnauthorizedError } = require('@strapi/utils').errors;
|
|
7
7
|
const createLocalStrategy = require('../../../server/services/passport/local-strategy');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
// eslint-disable-next-line node/no-extraneous-require
|
|
4
|
-
const ee = require('@strapi/strapi/dist/utils/ee')
|
|
4
|
+
const ee = require('@strapi/strapi/dist/utils/ee');
|
|
5
5
|
const { take, drop, map, prop, pick, reverse, isNil } = require('lodash/fp');
|
|
6
6
|
const { getService } = require('../../../server/utils');
|
|
7
7
|
const { SUPER_ADMIN_CODE } = require('../../../server/services/constants');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const { yup, validateYupSchema } = require('@strapi/utils');
|
|
4
4
|
// eslint-disable-next-line node/no-extraneous-require
|
|
5
|
-
const { features } = require('@strapi/strapi/dist/utils/ee')
|
|
5
|
+
const { features } = require('@strapi/strapi/dist/utils/ee');
|
|
6
6
|
|
|
7
7
|
const roleCreateSchema = yup
|
|
8
8
|
.object()
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const { yup, validateYupSchema } = require('@strapi/utils');
|
|
4
4
|
// eslint-disable-next-line node/no-extraneous-require
|
|
5
|
-
const { features } = require('@strapi/strapi/dist/utils/ee')
|
|
5
|
+
const { features } = require('@strapi/strapi/dist/utils/ee');
|
|
6
6
|
const { schemas } = require('../../../server/validation/user');
|
|
7
7
|
|
|
8
8
|
const ssoUserCreationInputExtension = yup
|
package/jest.config.front.js
CHANGED
|
@@ -4,4 +4,8 @@ module.exports = {
|
|
|
4
4
|
preset: '../../../jest-preset.front.js',
|
|
5
5
|
collectCoverageFrom: ['<rootDir>/packages/core/admin/admin/**/*.js'],
|
|
6
6
|
displayName: 'Core admin',
|
|
7
|
+
moduleNameMapper: {
|
|
8
|
+
'^@tests/(.*)$': '<rootDir>/admin/tests/$1',
|
|
9
|
+
},
|
|
10
|
+
setupFilesAfterEnv: ['./admin/tests/setup.ts'],
|
|
7
11
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/admin",
|
|
3
|
-
"version": "4.15.0
|
|
3
|
+
"version": "4.15.0",
|
|
4
4
|
"description": "Strapi Admin",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,34 +23,37 @@
|
|
|
23
23
|
"scripts": {
|
|
24
24
|
"analyze:bundle": "ANALYZE_BUNDLE=true webpack --config webpack.config.dev.js",
|
|
25
25
|
"analyze:deps": "ANALYZE_DEPS=true webpack serve --config webpack.config.dev.js --progress profile",
|
|
26
|
+
"build": "rimraf build && node ./scripts/build.js",
|
|
27
|
+
"build:measure": "rimraf build && cross-env MEASURE_BUILD_SPEED=true node ./scripts/build.js",
|
|
26
28
|
"create:plugin-file": "node ./scripts/create-dev-plugins-file.js",
|
|
27
29
|
"develop": "yarn create:plugin-file && yarn develop:webpack",
|
|
28
30
|
"develop:webpack": "cross-env NODE_ENV=development webpack serve --config webpack.config.dev.js --progress profile",
|
|
31
|
+
"lint": "run -T eslint .",
|
|
29
32
|
"prepublishOnly": "yarn build",
|
|
30
|
-
"build": "rimraf build && node ./scripts/build.js",
|
|
31
|
-
"build:measure": "rimraf build && cross-env MEASURE_BUILD_SPEED=true node ./scripts/build.js",
|
|
32
33
|
"test": "echo \"no tests yet\"",
|
|
33
|
-
"test:unit": "run -T jest",
|
|
34
|
-
"test:unit:watch": "run -T jest --watch",
|
|
35
34
|
"test:front": "run -T cross-env IS_EE=true jest --config ./jest.config.front.js",
|
|
36
|
-
"test:front:watch": "run -T cross-env IS_EE=true jest --config ./jest.config.front.js --watchAll",
|
|
37
35
|
"test:front:ce": "run -T cross-env IS_EE=false jest --config ./jest.config.front.js",
|
|
38
|
-
"test:front:watch:ce": "run -T cross-env IS_EE=false jest --config ./jest.config.front.js --watchAll",
|
|
39
36
|
"test:front:ce:cov": "run -T cross-env IS_EE=false jest --config ./jest.config.front.js --coverage",
|
|
40
|
-
"
|
|
37
|
+
"test:front:watch": "run -T cross-env IS_EE=true jest --config ./jest.config.front.js --watchAll",
|
|
38
|
+
"test:front:watch:ce": "run -T cross-env IS_EE=false jest --config ./jest.config.front.js --watchAll",
|
|
39
|
+
"test:ts:front": "run -T tsc -p admin/tsconfig.json",
|
|
40
|
+
"test:unit": "run -T jest",
|
|
41
|
+
"test:unit:watch": "run -T jest --watch"
|
|
41
42
|
},
|
|
42
43
|
"dependencies": {
|
|
43
44
|
"@casl/ability": "6.5.0",
|
|
44
45
|
"@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
|
|
45
46
|
"@radix-ui/react-toolbar": "1.0.4",
|
|
46
|
-
"@
|
|
47
|
-
"@strapi/
|
|
48
|
-
"@strapi/
|
|
49
|
-
"@strapi/
|
|
50
|
-
"@strapi/
|
|
51
|
-
"@strapi/
|
|
52
|
-
"@strapi/
|
|
53
|
-
"@strapi/
|
|
47
|
+
"@reduxjs/toolkit": "1.9.7",
|
|
48
|
+
"@strapi/data-transfer": "4.15.0",
|
|
49
|
+
"@strapi/design-system": "1.13.0",
|
|
50
|
+
"@strapi/helper-plugin": "4.15.0",
|
|
51
|
+
"@strapi/icons": "1.13.0",
|
|
52
|
+
"@strapi/permissions": "4.15.0",
|
|
53
|
+
"@strapi/provider-audit-logs-local": "4.15.0",
|
|
54
|
+
"@strapi/types": "4.15.0",
|
|
55
|
+
"@strapi/typescript-utils": "4.15.0",
|
|
56
|
+
"@strapi/utils": "4.15.0",
|
|
54
57
|
"axios": "1.5.0",
|
|
55
58
|
"bcryptjs": "2.4.3",
|
|
56
59
|
"browserslist": "^4.22.1",
|
|
@@ -66,7 +69,7 @@
|
|
|
66
69
|
"execa": "5.1.1",
|
|
67
70
|
"fast-deep-equal": "3.1.3",
|
|
68
71
|
"find-root": "1.1.0",
|
|
69
|
-
"fork-ts-checker-webpack-plugin": "
|
|
72
|
+
"fork-ts-checker-webpack-plugin": "8.0.0",
|
|
70
73
|
"formik": "2.4.0",
|
|
71
74
|
"fractional-indexing": "3.2.0",
|
|
72
75
|
"fs-extra": "10.0.0",
|
|
@@ -114,8 +117,6 @@
|
|
|
114
117
|
"react-router-dom": "5.3.4",
|
|
115
118
|
"react-select": "5.7.0",
|
|
116
119
|
"react-window": "1.8.8",
|
|
117
|
-
"redux": "^4.2.1",
|
|
118
|
-
"reselect": "4.1.7",
|
|
119
120
|
"rimraf": "3.0.2",
|
|
120
121
|
"sanitize-html": "2.11.0",
|
|
121
122
|
"semver": "7.5.4",
|
|
@@ -133,6 +134,7 @@
|
|
|
133
134
|
"yup": "0.32.9"
|
|
134
135
|
},
|
|
135
136
|
"devDependencies": {
|
|
137
|
+
"@strapi/admin-test-utils": "4.15.0",
|
|
136
138
|
"@testing-library/dom": "9.2.0",
|
|
137
139
|
"@testing-library/react": "14.0.0",
|
|
138
140
|
"@testing-library/user-event": "14.4.3",
|
|
@@ -146,21 +148,25 @@
|
|
|
146
148
|
"@strapi/strapi": "^4.3.4"
|
|
147
149
|
},
|
|
148
150
|
"engines": {
|
|
149
|
-
"node": ">=
|
|
151
|
+
"node": ">=18.0.0 <=20.x.x",
|
|
150
152
|
"npm": ">=6.0.0"
|
|
151
153
|
},
|
|
152
154
|
"nx": {
|
|
153
155
|
"targets": {
|
|
154
156
|
"build": {
|
|
155
157
|
"outputs": [
|
|
156
|
-
"
|
|
158
|
+
"{projectRoot}/build"
|
|
157
159
|
]
|
|
158
160
|
}
|
|
159
161
|
},
|
|
160
162
|
"implicitDependencies": [
|
|
163
|
+
"@strapi/plugin-email",
|
|
164
|
+
"@strapi/plugin-content-manager",
|
|
165
|
+
"@strapi/plugin-content-type-builder",
|
|
166
|
+
"@strapi/plugin-upload",
|
|
161
167
|
"!@strapi/data-transfer",
|
|
162
168
|
"!@strapi/strapi"
|
|
163
169
|
]
|
|
164
170
|
},
|
|
165
|
-
"gitHead": "
|
|
171
|
+
"gitHead": "6e44e1e68db5153e485e61bdc03f42efb0311406"
|
|
166
172
|
}
|
package/scripts/build.js
CHANGED
|
@@ -15,7 +15,7 @@ const smp = new SpeedMeasurePlugin();
|
|
|
15
15
|
const buildAdmin = async () => {
|
|
16
16
|
const entry = path.join(__dirname, '..', 'admin', 'src');
|
|
17
17
|
const dest = path.join(__dirname, '..', 'build');
|
|
18
|
-
const tsConfigFilePath = path.join(__dirname, '..', 'admin', '
|
|
18
|
+
const tsConfigFilePath = path.join(__dirname, '..', 'admin', 'tsconfig.build.json');
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* We _always_ install these FE plugins, they're considered "core"
|
|
@@ -94,7 +94,11 @@ const buildAdmin = async () => {
|
|
|
94
94
|
return acc + error.message;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
if (Array.isArray(error)) {
|
|
98
|
+
return acc + error.join('\n\n');
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return acc + error;
|
|
98
102
|
}, '')
|
|
99
103
|
)
|
|
100
104
|
);
|
|
@@ -8,7 +8,7 @@ const { exists } = require('fs-extra');
|
|
|
8
8
|
const { env } = require('@strapi/utils');
|
|
9
9
|
const { isUsingTypeScript } = require('@strapi/typescript-utils');
|
|
10
10
|
// eslint-disable-next-line node/no-extraneous-require
|
|
11
|
-
const ee = require('@strapi/strapi/dist/utils/ee')
|
|
11
|
+
const ee = require('@strapi/strapi/dist/utils/ee');
|
|
12
12
|
|
|
13
13
|
const {
|
|
14
14
|
validateUpdateProjectSettings,
|
|
@@ -26,11 +26,12 @@ module.exports = {
|
|
|
26
26
|
// When removing this we need to update the /admin/src/index.js file
|
|
27
27
|
// where we set the strapi.window.isEE value
|
|
28
28
|
async getProjectType() {
|
|
29
|
+
const flags = strapi.config.get('admin.flags', {});
|
|
29
30
|
// FIXME
|
|
30
31
|
try {
|
|
31
|
-
return { data: { isEE: strapi.EE, features: ee.features.list() } };
|
|
32
|
+
return { data: { isEE: strapi.EE, features: ee.features.list(), flags } };
|
|
32
33
|
} catch (err) {
|
|
33
|
-
return { data: { isEE: false, features: [] } };
|
|
34
|
+
return { data: { isEE: false, features: [], flags } };
|
|
34
35
|
}
|
|
35
36
|
},
|
|
36
37
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Entity as TEntity } from '@strapi/types';
|
|
2
|
+
|
|
3
|
+
export interface Entity {
|
|
4
|
+
id: TEntity.ID;
|
|
5
|
+
createdAt: string;
|
|
6
|
+
updatedAt: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* TODO: is there a way to infer this from the content-type schema?
|
|
11
|
+
* TODO: define content-type schema for a role.
|
|
12
|
+
*/
|
|
13
|
+
export interface RoleEntity extends Entity {
|
|
14
|
+
name: string;
|
|
15
|
+
code: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
usersCount?: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* TODO: is there a way to infer this from the content-type schema?
|
|
22
|
+
* TODO: define content-type schema for a user.
|
|
23
|
+
*/
|
|
24
|
+
export interface UserEntity extends Entity {
|
|
25
|
+
firstname: string;
|
|
26
|
+
lastname?: string;
|
|
27
|
+
username?: null | string;
|
|
28
|
+
email: string;
|
|
29
|
+
isActive: boolean;
|
|
30
|
+
blocked: boolean;
|
|
31
|
+
preferedLanguage: null | string;
|
|
32
|
+
roles: RoleEntity[];
|
|
33
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
type Condition = {
|
|
2
|
+
id: string;
|
|
3
|
+
displayName: string;
|
|
4
|
+
category: string;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
type Permission = {
|
|
8
|
+
action: string;
|
|
9
|
+
displayName: string;
|
|
10
|
+
plugin: string;
|
|
11
|
+
subCategory: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
type ContentTypePermission = {
|
|
15
|
+
actionId: string;
|
|
16
|
+
applyToProperties: string[];
|
|
17
|
+
label: string;
|
|
18
|
+
subjects: string[];
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
type ContentTypeSubject = {
|
|
22
|
+
uid: string;
|
|
23
|
+
label: string;
|
|
24
|
+
properties: ContentTypeSubjectProperties[];
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
type ContentTypeSubjectPropertyChild = {
|
|
28
|
+
label: string;
|
|
29
|
+
value: string;
|
|
30
|
+
required?: boolean;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
type ContentTypeSubjectProperties = {
|
|
34
|
+
label: string;
|
|
35
|
+
value: string;
|
|
36
|
+
children: ContentTypeSubjectPropertyChild[];
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
type ContentTypePermissions = {
|
|
40
|
+
actions: ContentTypePermission[];
|
|
41
|
+
subjects: ContentTypeSubject[];
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export interface RolePermissions {
|
|
45
|
+
conditions: Condition[];
|
|
46
|
+
sections: {
|
|
47
|
+
plugins: Permission[];
|
|
48
|
+
settings: Permission[];
|
|
49
|
+
singleTypes: ContentTypePermissions;
|
|
50
|
+
collectionTypes: ContentTypePermissions;
|
|
51
|
+
};
|
|
52
|
+
}
|
package/shared/schema.ts
ADDED
package/webpack.config.js
CHANGED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
AppInfoProvider,
|
|
5
|
-
auth,
|
|
6
|
-
LoadingIndicatorPage,
|
|
7
|
-
useGuidedTour,
|
|
8
|
-
useNotification,
|
|
9
|
-
} from '@strapi/helper-plugin';
|
|
10
|
-
import get from 'lodash/get';
|
|
11
|
-
import { useQueries } from 'react-query';
|
|
12
|
-
// TODO: DS add loader
|
|
13
|
-
|
|
14
|
-
import packageJSON from '../../../../package.json';
|
|
15
|
-
import { useConfigurations } from '../../hooks';
|
|
16
|
-
import { getFullName, hashAdminUserEmail } from '../../utils';
|
|
17
|
-
import NpsSurvey from '../NpsSurvey';
|
|
18
|
-
import PluginsInitializer from '../PluginsInitializer';
|
|
19
|
-
import RBACProvider from '../RBACProvider';
|
|
20
|
-
|
|
21
|
-
import {
|
|
22
|
-
fetchAppInfo,
|
|
23
|
-
fetchCurrentUserPermissions,
|
|
24
|
-
fetchStrapiLatestRelease,
|
|
25
|
-
fetchUserRoles,
|
|
26
|
-
} from './utils/api';
|
|
27
|
-
import checkLatestStrapiVersion from './utils/checkLatestStrapiVersion';
|
|
28
|
-
|
|
29
|
-
const strapiVersion = packageJSON.version;
|
|
30
|
-
|
|
31
|
-
const AuthenticatedApp = () => {
|
|
32
|
-
const { setGuidedTourVisibility } = useGuidedTour();
|
|
33
|
-
const toggleNotification = useNotification();
|
|
34
|
-
const userInfo = auth.getUserInfo();
|
|
35
|
-
const userName = get(userInfo, 'username') || getFullName(userInfo.firstname, userInfo.lastname);
|
|
36
|
-
const [userDisplayName, setUserDisplayName] = useState(userName);
|
|
37
|
-
const [userId, setUserId] = useState(null);
|
|
38
|
-
const { showReleaseNotification } = useConfigurations();
|
|
39
|
-
const [
|
|
40
|
-
{ data: appInfos, status },
|
|
41
|
-
{ data: tagName, isLoading },
|
|
42
|
-
{ data: permissions, status: fetchPermissionsStatus, refetch, isFetching },
|
|
43
|
-
{ data: userRoles },
|
|
44
|
-
] = useQueries([
|
|
45
|
-
{ queryKey: 'app-infos', queryFn: fetchAppInfo },
|
|
46
|
-
{
|
|
47
|
-
queryKey: 'strapi-release',
|
|
48
|
-
queryFn: () => fetchStrapiLatestRelease(toggleNotification),
|
|
49
|
-
enabled: showReleaseNotification,
|
|
50
|
-
initialData: strapiVersion,
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
queryKey: 'admin-users-permission',
|
|
54
|
-
queryFn: fetchCurrentUserPermissions,
|
|
55
|
-
initialData: [],
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
queryKey: 'user-roles',
|
|
59
|
-
queryFn: fetchUserRoles,
|
|
60
|
-
},
|
|
61
|
-
]);
|
|
62
|
-
|
|
63
|
-
const shouldUpdateStrapi = checkLatestStrapiVersion(strapiVersion, tagName);
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* TODO: does this actually need to be an effect?
|
|
67
|
-
*/
|
|
68
|
-
useEffect(() => {
|
|
69
|
-
if (userRoles) {
|
|
70
|
-
const isUserSuperAdmin = userRoles.find(({ code }) => code === 'strapi-super-admin');
|
|
71
|
-
|
|
72
|
-
if (isUserSuperAdmin && appInfos?.autoReload) {
|
|
73
|
-
setGuidedTourVisibility(true);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}, [userRoles, appInfos, setGuidedTourVisibility]);
|
|
77
|
-
|
|
78
|
-
useEffect(() => {
|
|
79
|
-
const getUserId = async () => {
|
|
80
|
-
const userId = await hashAdminUserEmail(userInfo);
|
|
81
|
-
setUserId(userId);
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
getUserId();
|
|
85
|
-
}, [userInfo]);
|
|
86
|
-
|
|
87
|
-
// We don't need to wait for the release query to be fetched before rendering the plugins
|
|
88
|
-
// however, we need the appInfos and the permissions
|
|
89
|
-
const shouldShowNotDependentQueriesLoader =
|
|
90
|
-
isFetching || status === 'loading' || fetchPermissionsStatus === 'loading';
|
|
91
|
-
|
|
92
|
-
const shouldShowLoader = isLoading || shouldShowNotDependentQueriesLoader;
|
|
93
|
-
|
|
94
|
-
if (shouldShowLoader) {
|
|
95
|
-
return <LoadingIndicatorPage />;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// TODO: add error state
|
|
99
|
-
if (status === 'error') {
|
|
100
|
-
return <div>error...</div>;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return (
|
|
104
|
-
<AppInfoProvider
|
|
105
|
-
{...appInfos}
|
|
106
|
-
userId={userId}
|
|
107
|
-
latestStrapiReleaseTag={tagName}
|
|
108
|
-
setUserDisplayName={setUserDisplayName}
|
|
109
|
-
shouldUpdateStrapi={shouldUpdateStrapi}
|
|
110
|
-
userDisplayName={userDisplayName}
|
|
111
|
-
>
|
|
112
|
-
<RBACProvider permissions={permissions} refetchPermissions={refetch}>
|
|
113
|
-
<NpsSurvey />
|
|
114
|
-
<PluginsInitializer />
|
|
115
|
-
</RBACProvider>
|
|
116
|
-
</AppInfoProvider>
|
|
117
|
-
);
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
export default AuthenticatedApp;
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { getFetchClient } from '@strapi/helper-plugin';
|
|
2
|
-
|
|
3
|
-
import packageJSON from '../../../../../package.json';
|
|
4
|
-
|
|
5
|
-
import checkLatestStrapiVersion from './checkLatestStrapiVersion';
|
|
6
|
-
|
|
7
|
-
const strapiVersion = packageJSON.version;
|
|
8
|
-
const showUpdateNotif = !JSON.parse(localStorage.getItem('STRAPI_UPDATE_NOTIF'));
|
|
9
|
-
const { get } = getFetchClient();
|
|
10
|
-
|
|
11
|
-
const fetchStrapiLatestRelease = async (toggleNotification) => {
|
|
12
|
-
try {
|
|
13
|
-
const res = await fetch('https://api.github.com/repos/strapi/strapi/releases/latest');
|
|
14
|
-
|
|
15
|
-
if (!res.ok) {
|
|
16
|
-
throw new Error('Failed to fetch latest Strapi version.');
|
|
17
|
-
}
|
|
18
|
-
const { tag_name } = await res.json();
|
|
19
|
-
const shouldUpdateStrapi = checkLatestStrapiVersion(strapiVersion, tag_name);
|
|
20
|
-
|
|
21
|
-
if (shouldUpdateStrapi && showUpdateNotif) {
|
|
22
|
-
toggleNotification({
|
|
23
|
-
type: 'info',
|
|
24
|
-
message: { id: 'notification.version.update.message' },
|
|
25
|
-
link: {
|
|
26
|
-
url: `https://github.com/strapi/strapi/releases/tag/${tag_name}`,
|
|
27
|
-
label: {
|
|
28
|
-
id: 'global.see-more',
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
blockTransition: true,
|
|
32
|
-
onClose: () => localStorage.setItem('STRAPI_UPDATE_NOTIF', true),
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return tag_name;
|
|
37
|
-
} catch (err) {
|
|
38
|
-
// Don't throw an error
|
|
39
|
-
return strapiVersion;
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const fetchAppInfo = async () => {
|
|
44
|
-
try {
|
|
45
|
-
const { data, headers } = await get('/admin/information');
|
|
46
|
-
|
|
47
|
-
if (!headers['content-type'].includes('application/json')) {
|
|
48
|
-
throw new Error('Not found');
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return data.data;
|
|
52
|
-
} catch (error) {
|
|
53
|
-
throw new Error(error);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
const fetchCurrentUserPermissions = async () => {
|
|
58
|
-
try {
|
|
59
|
-
const { data, headers } = await get('/admin/users/me/permissions');
|
|
60
|
-
|
|
61
|
-
if (!headers['content-type'].includes('application/json')) {
|
|
62
|
-
throw new Error('Not found');
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return data.data;
|
|
66
|
-
} catch (err) {
|
|
67
|
-
throw new Error(err);
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
const fetchUserRoles = async () => {
|
|
72
|
-
try {
|
|
73
|
-
const {
|
|
74
|
-
data: {
|
|
75
|
-
data: { roles },
|
|
76
|
-
},
|
|
77
|
-
} = await get('/admin/users/me');
|
|
78
|
-
|
|
79
|
-
return roles;
|
|
80
|
-
} catch (err) {
|
|
81
|
-
throw new Error(err);
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
export { fetchAppInfo, fetchCurrentUserPermissions, fetchStrapiLatestRelease, fetchUserRoles };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import semver from 'semver';
|
|
2
|
-
|
|
3
|
-
const checkLatestStrapiVersion = (currentPackageVersion, latestPublishedVersion) => {
|
|
4
|
-
if (!semver.valid(currentPackageVersion) || !semver.valid(latestPublishedVersion)) {
|
|
5
|
-
return false;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
return semver.lt(currentPackageVersion, latestPublishedVersion);
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export default checkLatestStrapiVersion;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import React, { useCallback, useMemo, useReducer } from 'react';
|
|
2
|
-
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
|
|
5
|
-
import { ConfigurationsContext } from '../../contexts';
|
|
6
|
-
|
|
7
|
-
import reducer, { initialState } from './reducer';
|
|
8
|
-
|
|
9
|
-
const ConfigurationsProvider = ({
|
|
10
|
-
children,
|
|
11
|
-
authLogo: defaultAuthLogo,
|
|
12
|
-
menuLogo: defaultMenuLogo,
|
|
13
|
-
showReleaseNotification,
|
|
14
|
-
showTutorials,
|
|
15
|
-
}) => {
|
|
16
|
-
const [{ menuLogo, authLogo }, dispatch] = useReducer(reducer, initialState);
|
|
17
|
-
|
|
18
|
-
const updateProjectSettings = useCallback(
|
|
19
|
-
({ menuLogo, authLogo }) => {
|
|
20
|
-
return dispatch({
|
|
21
|
-
type: 'UPDATE_PROJECT_SETTINGS',
|
|
22
|
-
values: {
|
|
23
|
-
menuLogo: menuLogo || defaultMenuLogo,
|
|
24
|
-
authLogo: authLogo || defaultAuthLogo,
|
|
25
|
-
},
|
|
26
|
-
});
|
|
27
|
-
},
|
|
28
|
-
[defaultAuthLogo, defaultMenuLogo]
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
const configurationValue = useMemo(() => {
|
|
32
|
-
return {
|
|
33
|
-
logos: {
|
|
34
|
-
menu: { custom: menuLogo, default: defaultMenuLogo },
|
|
35
|
-
auth: { custom: authLogo, default: defaultAuthLogo },
|
|
36
|
-
},
|
|
37
|
-
updateProjectSettings,
|
|
38
|
-
showReleaseNotification,
|
|
39
|
-
showTutorials,
|
|
40
|
-
};
|
|
41
|
-
}, [
|
|
42
|
-
menuLogo,
|
|
43
|
-
defaultMenuLogo,
|
|
44
|
-
authLogo,
|
|
45
|
-
defaultAuthLogo,
|
|
46
|
-
updateProjectSettings,
|
|
47
|
-
showReleaseNotification,
|
|
48
|
-
showTutorials,
|
|
49
|
-
]);
|
|
50
|
-
|
|
51
|
-
return (
|
|
52
|
-
<ConfigurationsContext.Provider value={configurationValue}>
|
|
53
|
-
{children}
|
|
54
|
-
</ConfigurationsContext.Provider>
|
|
55
|
-
);
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
ConfigurationsProvider.propTypes = {
|
|
59
|
-
authLogo: PropTypes.string.isRequired,
|
|
60
|
-
children: PropTypes.element.isRequired,
|
|
61
|
-
menuLogo: PropTypes.string.isRequired,
|
|
62
|
-
showReleaseNotification: PropTypes.bool.isRequired,
|
|
63
|
-
showTutorials: PropTypes.bool.isRequired,
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export default ConfigurationsProvider;
|