@strapi/admin 4.12.0-beta.0 → 4.12.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/admin/src/content-manager/components/CollectionTypeFormWrapper/index.js +1 -3
- package/admin/src/content-manager/components/RelationInput/components/Option.js +6 -5
- package/admin/src/content-manager/components/SingleTypeFormWrapper/index.js +7 -7
- package/admin/src/content-manager/pages/EditSettingsView/components/DisplayedFields.js +23 -21
- package/admin/src/content-manager/pages/EditSettingsView/components/ModalForm.js +21 -23
- package/admin/src/content-manager/pages/EditView/Information/index.js +1 -1
- package/admin/src/content-manager/pages/EditView/InformationBox/InformationBoxCE.js +1 -2
- package/admin/src/content-manager/pages/EditView/InformationBox/index.js +1 -3
- package/admin/src/content-manager/pages/EditView/index.js +14 -2
- package/admin/src/content-manager/pages/ListSettingsView/components/SortDisplayedFields.js +24 -22
- package/admin/src/content-manager/pages/ListView/components/Body/index.js +191 -0
- package/admin/src/content-manager/pages/ListView/components/BulkActionButtons/ConfirmBulkActionDialog/index.js +164 -0
- package/admin/src/content-manager/pages/ListView/components/BulkActionButtons/SelectedEntriesModal/index.js +468 -0
- package/admin/src/content-manager/{components/DynamicTable/BulkActionsBar → pages/ListView/components/BulkActionButtons}/index.js +56 -132
- package/admin/src/content-manager/pages/ListView/components/CellContent/RelationMultiple/index.js +63 -69
- package/admin/src/content-manager/pages/ListView/components/CellContent/RepeatableComponent/index.js +28 -21
- package/admin/src/content-manager/pages/ListView/index.js +191 -132
- package/admin/src/hooks/useSettingsMenu/index.js +35 -21
- package/admin/src/layouts/UnauthenticatedLayout/LocaleToggle/index.js +7 -7
- package/admin/src/pages/AuthPage/components/Login/index.js +3 -5
- package/admin/src/pages/AuthPage/constants.js +3 -2
- package/admin/src/pages/AuthPage/index.js +18 -1
- package/admin/src/pages/HomePage/index.js +19 -7
- package/admin/src/pages/ProfilePage/index.js +6 -11
- package/admin/src/pages/SettingsPage/components/SettingsNav/index.js +13 -11
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/index.js +17 -1
- package/admin/src/pages/SettingsPage/pages/Users/EditPage/index.js +15 -2
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/CreateAction/index.js +2 -4
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/ModalForm/index.js +15 -1
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/index.js +36 -5
- package/admin/src/pages/SettingsPage/pages/Users/components/MagicLink/index.js +3 -5
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/EventTable/index.js +1 -3
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/WebhookForm/index.js +16 -1
- package/admin/src/translations/ca.json +4 -4
- package/admin/src/translations/de.json +4 -4
- package/admin/src/translations/dk.json +2 -2
- package/admin/src/translations/en.json +23 -4
- package/admin/src/translations/es.json +4 -4
- package/admin/src/translations/eu.json +4 -4
- package/admin/src/translations/fr.json +2 -2
- package/admin/src/translations/gu.json +4 -4
- package/admin/src/translations/hi.json +4 -4
- package/admin/src/translations/hu.json +4 -4
- package/admin/src/translations/ja.json +2 -2
- package/admin/src/translations/ko.json +2 -2
- package/admin/src/translations/ml.json +4 -4
- package/admin/src/translations/nl.json +4 -4
- package/admin/src/translations/pl.json +4 -4
- package/admin/src/translations/pt-BR.json +4 -4
- package/admin/src/translations/ru.json +4 -4
- package/admin/src/translations/sa.json +4 -4
- package/admin/src/translations/sk.json +4 -4
- package/admin/src/translations/sv.json +4 -4
- package/admin/src/translations/tr.json +4 -4
- package/admin/src/translations/zh-Hans.json +4 -4
- package/admin/src/translations/zh.json +4 -4
- package/build/1049.758a01f5.chunk.js +1 -0
- package/build/{3528.4845cf92.chunk.js → 1386.762d6eb8.chunk.js} +1 -1
- package/build/1727.b49f0713.chunk.js +1 -0
- package/build/{5563.a146acac.chunk.js → 2225.15d1df72.chunk.js} +2 -2
- package/build/2379.d33a2e16.chunk.js +1 -0
- package/build/2395.b0419a54.chunk.js +26 -0
- package/build/2801.18f38baf.chunk.js +1 -0
- package/build/{7394.423886bd.chunk.js → 3100.21c343fa.chunk.js} +1 -1
- package/build/311.cb0884bb.chunk.js +1 -0
- package/build/3483.ddd2d6df.chunk.js +1 -0
- package/build/{970.89601f27.chunk.js → 3739.63e352f1.chunk.js} +52 -20
- package/build/3984.ea7b8036.chunk.js +1 -0
- package/build/4546.ff9fdf30.chunk.js +1 -0
- package/build/502.ccb38223.chunk.js +1 -0
- package/build/5483.ed2c7efa.chunk.js +6 -0
- package/build/{5542.c62d0daf.chunk.js → 5542.2415a393.chunk.js} +6 -6
- package/build/6158.c974fd83.chunk.js +1 -0
- package/build/6691.f880a0b6.chunk.js +105 -0
- package/build/7030.b98dcedf.chunk.js +1 -0
- package/build/7464.c6d0565c.chunk.js +1 -0
- package/build/8276.23e0763b.chunk.js +26 -0
- package/build/8298.fd253c9f.chunk.js +117 -0
- package/build/918.54414509.chunk.js +1 -0
- package/build/{9932.7e2b71de.chunk.js → 9806.91360bb6.chunk.js} +79 -79
- package/build/{9944.29289a16.chunk.js → 9944.7af075a5.chunk.js} +1 -1
- package/build/{Admin-authenticatedApp.9d3afb79.chunk.js → Admin-authenticatedApp.36b3826c.chunk.js} +5 -5
- package/build/Admin_InternalErrorPage.f45f2462.chunk.js +1 -0
- package/build/{Admin_homePage.be30ef4e.chunk.js → Admin_homePage.ac9dfb86.chunk.js} +23 -15
- package/build/{Admin_marketplace.74a58e20.chunk.js → Admin_marketplace.f0b87fce.chunk.js} +1 -1
- package/build/{Admin_pluginsPage.ce464189.chunk.js → Admin_pluginsPage.8728ff6e.chunk.js} +1 -1
- package/build/{Admin_profilePage.2131eb68.chunk.js → Admin_profilePage.a968035f.chunk.js} +2 -2
- package/build/Admin_settingsPage.8c600d1a.chunk.js +111 -0
- package/build/Upload_ConfigureTheView.345ac1e0.chunk.js +1 -0
- package/build/admin-app.1c3f7fd6.chunk.js +36 -0
- package/build/{admin-edit-roles-page.3fdd6b9d.chunk.js → admin-edit-roles-page.a49b9f4f.chunk.js} +4 -4
- package/build/admin-edit-users.67704088.chunk.js +10 -0
- package/build/{admin-roles-list.e17b00d7.chunk.js → admin-roles-list.0c129e98.chunk.js} +1 -1
- package/build/admin-users.3279ffb0.chunk.js +11 -0
- package/build/api-tokens-create-page.46c2ea84.chunk.js +1 -0
- package/build/{api-tokens-edit-page.9a1dd2fa.chunk.js → api-tokens-edit-page.58139df9.chunk.js} +1 -1
- package/build/{api-tokens-list-page.a103f526.chunk.js → api-tokens-list-page.505bf7e0.chunk.js} +2 -2
- package/build/audit-logs-settings-page.4b422831.chunk.js +1 -0
- package/build/{ca-json.1fed5d8b.chunk.js → ca-json.a53c10b6.chunk.js} +1 -1
- package/build/content-manager.b8d593d4.chunk.js +1103 -0
- package/build/{content-type-builder-list-view.a200a358.chunk.js → content-type-builder-list-view.bf9be456.chunk.js} +9 -9
- package/build/{content-type-builder-translation-ar-json.56d8fcf4.chunk.js → content-type-builder-translation-ar-json.3e808e2f.chunk.js} +1 -1
- package/build/{content-type-builder-translation-cs-json.a5b299ca.chunk.js → content-type-builder-translation-cs-json.1ef9e106.chunk.js} +1 -1
- package/build/{content-type-builder-translation-de-json.393a76c0.chunk.js → content-type-builder-translation-de-json.63fcff7b.chunk.js} +1 -1
- package/build/{content-type-builder-translation-dk-json.fbd39bb7.chunk.js → content-type-builder-translation-dk-json.fd626b67.chunk.js} +1 -1
- package/build/{content-type-builder-translation-en-json.38e20391.chunk.js → content-type-builder-translation-en-json.ed29ff4d.chunk.js} +1 -1
- package/build/{content-type-builder-translation-es-json.9288474b.chunk.js → content-type-builder-translation-es-json.a4a361a9.chunk.js} +1 -1
- package/build/{content-type-builder-translation-fr-json.d35e269c.chunk.js → content-type-builder-translation-fr-json.499c3a46.chunk.js} +1 -1
- package/build/{content-type-builder-translation-id-json.f0513929.chunk.js → content-type-builder-translation-id-json.65255f93.chunk.js} +1 -1
- package/build/{content-type-builder-translation-it-json.aaf16753.chunk.js → content-type-builder-translation-it-json.e268ab74.chunk.js} +1 -1
- package/build/{content-type-builder-translation-ko-json.8fe21a7f.chunk.js → content-type-builder-translation-ko-json.04cb309d.chunk.js} +1 -1
- package/build/{content-type-builder-translation-ms-json.3b5d2d3e.chunk.js → content-type-builder-translation-ms-json.f6b743b9.chunk.js} +1 -1
- package/build/{content-type-builder-translation-nl-json.225ef5d3.chunk.js → content-type-builder-translation-nl-json.997fe8cc.chunk.js} +1 -1
- package/build/{content-type-builder-translation-pl-json.92f36be2.chunk.js → content-type-builder-translation-pl-json.634f638b.chunk.js} +1 -1
- package/build/{content-type-builder-translation-pt-BR-json.3bd10f89.chunk.js → content-type-builder-translation-pt-BR-json.6a95dc71.chunk.js} +1 -1
- package/build/{content-type-builder-translation-ru-json.9bfe47ce.chunk.js → content-type-builder-translation-ru-json.3af65503.chunk.js} +1 -1
- package/build/{content-type-builder-translation-sk-json.d03cc18a.chunk.js → content-type-builder-translation-sk-json.c6078082.chunk.js} +1 -1
- package/build/{content-type-builder-translation-sv-json.d23dcd32.chunk.js → content-type-builder-translation-sv-json.a6df2462.chunk.js} +1 -1
- package/build/{content-type-builder-translation-th-json.7ad256e2.chunk.js → content-type-builder-translation-th-json.122277cc.chunk.js} +1 -1
- package/build/{content-type-builder-translation-tr-json.926f6191.chunk.js → content-type-builder-translation-tr-json.41f44f77.chunk.js} +1 -1
- package/build/{content-type-builder-translation-uk-json.7bf19546.chunk.js → content-type-builder-translation-uk-json.e1315acd.chunk.js} +1 -1
- package/build/{content-type-builder-translation-zh-Hans-json.415577fb.chunk.js → content-type-builder-translation-zh-Hans-json.6ff57db6.chunk.js} +1 -1
- package/build/{content-type-builder-translation-zh-json.ad24dbeb.chunk.js → content-type-builder-translation-zh-json.3532b962.chunk.js} +1 -1
- package/build/content-type-builder.40534de5.chunk.js +170 -0
- package/build/{de-json.fcac7381.chunk.js → de-json.b3be02c7.chunk.js} +1 -1
- package/build/{dk-json.e34cad0d.chunk.js → dk-json.842aa391.chunk.js} +1 -1
- package/build/{email-settings-page.45695daa.chunk.js → email-settings-page.d494d1eb.chunk.js} +2 -2
- package/build/{en-json.fb9f6ddd.chunk.js → en-json.4c733bd1.chunk.js} +1 -1
- package/build/{es-json.42096084.chunk.js → es-json.f57b5335.chunk.js} +1 -1
- package/build/{eu-json.fb17c8f9.chunk.js → eu-json.633025f0.chunk.js} +1 -1
- package/build/{fr-json.69789980.chunk.js → fr-json.aa8839d2.chunk.js} +1 -1
- package/build/{gu-json.4d667d0c.chunk.js → gu-json.5bd62812.chunk.js} +1 -1
- package/build/{hi-json.323be97d.chunk.js → hi-json.9104eb78.chunk.js} +1 -1
- package/build/{hu-json.fe71e6c8.chunk.js → hu-json.9f4aae42.chunk.js} +1 -1
- package/build/{i18n-settings-page.29308d0b.chunk.js → i18n-settings-page.47f78016.chunk.js} +1 -1
- package/build/index.html +1 -1
- package/build/{ja-json.81b6d1e3.chunk.js → ja-json.91286391.chunk.js} +1 -1
- package/build/{ko-json.4539f4ba.chunk.js → ko-json.fcf3ec4b.chunk.js} +1 -1
- package/build/main.a12c4c0f.js +2856 -0
- package/build/{ml-json.8988e374.chunk.js → ml-json.557aa14c.chunk.js} +1 -1
- package/build/{nl-json.98345913.chunk.js → nl-json.b2b16eea.chunk.js} +1 -1
- package/build/{pl-json.59a5dab3.chunk.js → pl-json.f094a417.chunk.js} +1 -1
- package/build/{pt-BR-json.9410688b.chunk.js → pt-BR-json.dec7fb01.chunk.js} +1 -1
- package/build/review-workflows-settings-create-view.dfd87e1f.chunk.js +1 -0
- package/build/review-workflows-settings-edit-view.53c00afe.chunk.js +1 -0
- package/build/review-workflows-settings-list-view.a34be805.chunk.js +56 -0
- package/build/{ru-json.678cd48b.chunk.js → ru-json.8193d8c4.chunk.js} +1 -1
- package/build/{runtime~main.5e9bf4b3.js → runtime~main.d197f488.js} +2 -2
- package/build/{sa-json.6359a11c.chunk.js → sa-json.a56836f1.chunk.js} +1 -1
- package/build/{sk-json.2374f129.chunk.js → sk-json.bf2f057a.chunk.js} +1 -1
- package/build/sso-settings-page.ed6f3f15.chunk.js +1 -0
- package/build/{sv-json.ae6e71ea.chunk.js → sv-json.fd0e86c6.chunk.js} +1 -1
- package/build/{tr-json.bac5dbd3.chunk.js → tr-json.56c32cf6.chunk.js} +1 -1
- package/build/transfer-tokens-create-page.1597e6ab.chunk.js +1 -0
- package/build/transfer-tokens-edit-page.8741529f.chunk.js +1 -0
- package/build/{transfer-tokens-list-page.7237443d.chunk.js → transfer-tokens-list-page.22147d2c.chunk.js} +2 -2
- package/build/upload-settings.cac210a0.chunk.js +14 -0
- package/build/upload.cbfeefa5.chunk.js +58 -0
- package/build/{users-advanced-settings-page.750b1f76.chunk.js → users-advanced-settings-page.18379a56.chunk.js} +1 -1
- package/build/users-email-settings-page.a87978e5.chunk.js +9 -0
- package/build/users-providers-settings-page.8876c1ee.chunk.js +14 -0
- package/build/{users-roles-settings-page.d286426a.chunk.js → users-roles-settings-page.0431f48c.chunk.js} +2 -2
- package/build/webhook-edit-page.a91f27a1.chunk.js +33 -0
- package/build/{webhook-list-page.940a40f1.chunk.js → webhook-list-page.65e1b5bb.chunk.js} +1 -1
- package/build/{zh-Hans-json.fada6f40.chunk.js → zh-Hans-json.36d81cdc.chunk.js} +1 -1
- package/build/{zh-json.3529f1e5.chunk.js → zh-json.1cc86ff0.chunk.js} +1 -1
- package/ee/admin/content-manager/pages/EditView/InformationBox/InformationBoxEE.js +6 -3
- package/ee/admin/content-manager/pages/EditView/InformationBox/index.js +1 -3
- package/ee/admin/content-manager/pages/ListView/ReviewWorkflowsColumn/constants.js +2 -2
- package/ee/admin/pages/AuthPage/components/Login/index.js +3 -5
- package/ee/admin/pages/HomePage/index.js +11 -0
- package/ee/admin/pages/SettingsPage/pages/ApplicationInfosPage/components/AdminSeatInfo/index.js +1 -3
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/ProtectedPage/ProtectedPage.js +1 -1
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/Stages/Stage/Stage.js +1 -1
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/pages/CreateView/CreateView.js +38 -10
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/pages/EditView/EditView.js +57 -8
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/pages/ListView/ListView.js +3 -3
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/utils/{getWorkflowValidationSchema.js → validateWorkflow.js} +33 -2
- package/ee/admin/pages/SettingsPage/pages/Users/ListPage/CreateAction/index.js +2 -4
- package/ee/admin/pages/SettingsPage/pages/Users/ListPage/index.js +13 -0
- package/ee/admin/pages/SettingsPage/pages/Users/components/MagicLink/index.js +3 -5
- package/ee/admin/pages/SettingsPage/pages/Webhooks/EditView/components/EventTable/index.js +1 -3
- package/ee/server/constants/default-stages.json +1 -1
- package/ee/server/constants/workflows.js +1 -0
- package/ee/server/services/review-workflows/validation.js +6 -0
- package/ee/server/validation/review-workflows.js +6 -2
- package/index.js +0 -14
- package/package.json +12 -20
- package/webpack.alias.js +0 -3
- package/webpack.config.js +1 -75
- package/admin/src/content-manager/pages/ListView/components/TableRows/index.js +0 -300
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/AdminSeatInfo/index.js +0 -5
- package/build/1386.3b2aa6a7.chunk.js +0 -3
- package/build/1970.39a2d75e.chunk.js +0 -1
- package/build/2799.cf9b491f.chunk.js +0 -1
- package/build/3269.1ea0f5a6.chunk.js +0 -1
- package/build/4485.d3c6dd1d.chunk.js +0 -6
- package/build/539.865446c0.chunk.js +0 -1
- package/build/6691.e6d5ac38.chunk.js +0 -105
- package/build/7018.f3dad3c1.chunk.js +0 -1
- package/build/7259.0e25ab5d.chunk.js +0 -1
- package/build/9465.d8fc1377.chunk.js +0 -112
- package/build/Admin_InternalErrorPage.8911cb49.chunk.js +0 -1
- package/build/Admin_settingsPage.074655f6.chunk.js +0 -79
- package/build/Upload_ConfigureTheView.7a1cb9c9.chunk.js +0 -1
- package/build/admin-app.3ede71ad.chunk.js +0 -61
- package/build/admin-edit-users.78552758.chunk.js +0 -10
- package/build/admin-users.c23322fc.chunk.js +0 -11
- package/build/api-tokens-create-page.3dd4e921.chunk.js +0 -1
- package/build/audit-logs-settings-page.37fe915c.chunk.js +0 -1
- package/build/content-manager.08541eeb.chunk.js +0 -1094
- package/build/content-type-builder.de22f7c9.chunk.js +0 -166
- package/build/main.a8ede50d.js +0 -2927
- package/build/review-workflows-settings-create-view.56f61e18.chunk.js +0 -1
- package/build/review-workflows-settings-edit-view.912bc9c0.chunk.js +0 -1
- package/build/review-workflows-settings-list-view.cf6a08d3.chunk.js +0 -56
- package/build/sso-settings-page.0cdb96a6.chunk.js +0 -1
- package/build/transfer-tokens-create-page.de14cad4.chunk.js +0 -1
- package/build/transfer-tokens-edit-page.4f5e39af.chunk.js +0 -1
- package/build/upload-settings.cb6c14c3.chunk.js +0 -14
- package/build/upload.7e629643.chunk.js +0 -26
- package/build/users-email-settings-page.e9bcd865.chunk.js +0 -9
- package/build/users-providers-settings-page.a94253e9.chunk.js +0 -14
- package/build/webhook-edit-page.77ef4f1a.chunk.js +0 -33
- /package/admin/src/content-manager/components/{DynamicTable → ListViewTable}/CellContent/PublicationState/PublicationState.js +0 -0
- /package/admin/src/content-manager/components/{DynamicTable → ListViewTable}/CellContent/PublicationState/index.js +0 -0
|
@@ -10,6 +10,11 @@ import {
|
|
|
10
10
|
HeaderLayout,
|
|
11
11
|
useNotifyAT,
|
|
12
12
|
Flex,
|
|
13
|
+
Td,
|
|
14
|
+
Tr,
|
|
15
|
+
Typography,
|
|
16
|
+
Status,
|
|
17
|
+
lightTheme,
|
|
13
18
|
} from '@strapi/design-system';
|
|
14
19
|
import {
|
|
15
20
|
NoPermissions,
|
|
@@ -23,14 +28,13 @@ import {
|
|
|
23
28
|
useTracking,
|
|
24
29
|
Link,
|
|
25
30
|
useAPIErrorHandler,
|
|
26
|
-
getYupInnerErrors,
|
|
27
31
|
useStrapiApp,
|
|
28
|
-
|
|
32
|
+
Table,
|
|
29
33
|
PaginationURLQuery,
|
|
30
34
|
PageSizeURLQuery,
|
|
31
35
|
} from '@strapi/helper-plugin';
|
|
32
36
|
import { ArrowLeft, Cog, Plus } from '@strapi/icons';
|
|
33
|
-
import axios from 'axios';
|
|
37
|
+
import axios, { AxiosError } from 'axios';
|
|
34
38
|
import isEqual from 'lodash/isEqual';
|
|
35
39
|
import PropTypes from 'prop-types';
|
|
36
40
|
import { stringify } from 'qs';
|
|
@@ -46,14 +50,13 @@ import { useEnterprise } from '../../../hooks/useEnterprise';
|
|
|
46
50
|
import { selectAdminPermissions } from '../../../pages/App/selectors';
|
|
47
51
|
import { InjectionZone } from '../../../shared/components';
|
|
48
52
|
import AttributeFilter from '../../components/AttributeFilter';
|
|
49
|
-
import
|
|
50
|
-
import { createYupSchema, getRequestUrl, getTrad } from '../../utils';
|
|
53
|
+
import { getRequestUrl, getTrad } from '../../utils';
|
|
51
54
|
|
|
52
55
|
import { getData, getDataSucceeded, onChangeListHeaders, onResetListHeaders } from './actions';
|
|
53
|
-
import {
|
|
54
|
-
import
|
|
56
|
+
import { Body } from './components/Body';
|
|
57
|
+
import BulkActionButtons from './components/BulkActionButtons';
|
|
58
|
+
import CellContent from './components/CellContent';
|
|
55
59
|
import { FieldPicker } from './components/FieldPicker';
|
|
56
|
-
import { TableRows } from './components/TableRows';
|
|
57
60
|
import makeSelectListView, { selectDisplayedHeaders } from './selectors';
|
|
58
61
|
import { buildValidGetParams } from './utils';
|
|
59
62
|
|
|
@@ -66,6 +69,7 @@ const ConfigureLayoutBox = styled(Box)`
|
|
|
66
69
|
`;
|
|
67
70
|
|
|
68
71
|
const REVIEW_WORKFLOW_COLUMNS_CE = null;
|
|
72
|
+
const REVIEW_WORKFLOW_COLUMNS_CELL_CE = () => null;
|
|
69
73
|
|
|
70
74
|
function ListView({
|
|
71
75
|
canCreate,
|
|
@@ -88,7 +92,7 @@ function ListView({
|
|
|
88
92
|
metadatas,
|
|
89
93
|
settings: { bulkable: isBulkable, filterable: isFilterable, searchable: isSearchable },
|
|
90
94
|
} = contentType;
|
|
91
|
-
|
|
95
|
+
const [isConfirmDeleteRowOpen, setIsConfirmDeleteRowOpen] = React.useState(false);
|
|
92
96
|
const toggleNotification = useNotification();
|
|
93
97
|
const { trackUsage } = useTracking();
|
|
94
98
|
const { refetchPermissions } = useRBACProvider();
|
|
@@ -124,29 +128,18 @@ function ListView({
|
|
|
124
128
|
enabled: !!options?.reviewWorkflows,
|
|
125
129
|
}
|
|
126
130
|
);
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
post(`/content-manager/collection-types/${contentType.uid}/actions/bulkPublish`, data),
|
|
131
|
+
const ReviewWorkflowsStage = useEnterprise(
|
|
132
|
+
REVIEW_WORKFLOW_COLUMNS_CELL_CE,
|
|
133
|
+
async () =>
|
|
134
|
+
(await import('../../../../../ee/admin/content-manager/pages/ListView/ReviewWorkflowsColumn'))
|
|
135
|
+
.ReviewWorkflowsStageEE,
|
|
133
136
|
{
|
|
134
|
-
|
|
135
|
-
toggleNotification({
|
|
136
|
-
type: 'success',
|
|
137
|
-
message: { id: 'content-manager.success.record.publish', defaultMessage: 'Published' },
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
fetchData(`/content-manager/collection-types/${slug}`, { params });
|
|
141
|
-
},
|
|
142
|
-
onError(error) {
|
|
143
|
-
toggleNotification({
|
|
144
|
-
type: 'warning',
|
|
145
|
-
message: formatAPIError(error),
|
|
146
|
-
});
|
|
147
|
-
},
|
|
137
|
+
enabled: hasReviewWorkflows,
|
|
148
138
|
}
|
|
149
139
|
);
|
|
140
|
+
|
|
141
|
+
const { post, del } = fetchClient;
|
|
142
|
+
|
|
150
143
|
const bulkUnpublishMutation = useMutation(
|
|
151
144
|
(data) =>
|
|
152
145
|
post(`/content-manager/collection-types/${contentType.uid}/actions/bulkUnpublish`, data),
|
|
@@ -271,66 +264,6 @@ function ListView({
|
|
|
271
264
|
[slug, toggleNotification, formatAPIError, del, fetchData, params]
|
|
272
265
|
);
|
|
273
266
|
|
|
274
|
-
/**
|
|
275
|
-
* @param {number[]} selectedEntries - Array of ids to publish
|
|
276
|
-
* @returns {{validIds: number[], errors: Object.<number, string>}} - Returns an object with the valid ids and the errors
|
|
277
|
-
*/
|
|
278
|
-
const validateEntriesToPublish = async (selectedEntries) => {
|
|
279
|
-
const validations = { validIds: [], errors: {} };
|
|
280
|
-
// Create the validation schema based on the contentType
|
|
281
|
-
const schema = createYupSchema(
|
|
282
|
-
contentType,
|
|
283
|
-
{ components: layout.components },
|
|
284
|
-
{ isDraft: false }
|
|
285
|
-
);
|
|
286
|
-
// Get the selected entries
|
|
287
|
-
const entries = data.filter((entry) => {
|
|
288
|
-
return selectedEntries.includes(entry.id);
|
|
289
|
-
});
|
|
290
|
-
// Validate each entry and map the unresolved promises
|
|
291
|
-
const validationPromises = entries.map((entry) =>
|
|
292
|
-
schema.validate(entry, { abortEarly: false })
|
|
293
|
-
);
|
|
294
|
-
// Resolve all the promises in one go
|
|
295
|
-
const resolvedPromises = await Promise.allSettled(validationPromises);
|
|
296
|
-
// Set the validations
|
|
297
|
-
resolvedPromises.forEach((promise) => {
|
|
298
|
-
if (promise.status === 'rejected') {
|
|
299
|
-
const entityId = promise.reason.value.id;
|
|
300
|
-
validations.errors[entityId] = getYupInnerErrors(promise.reason);
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
if (promise.status === 'fulfilled') {
|
|
304
|
-
validations.validIds.push(promise.value.id);
|
|
305
|
-
}
|
|
306
|
-
});
|
|
307
|
-
|
|
308
|
-
return validations;
|
|
309
|
-
};
|
|
310
|
-
|
|
311
|
-
const handleConfirmPublishAllData = async (selectedEntries) => {
|
|
312
|
-
const validations = await validateEntriesToPublish(selectedEntries);
|
|
313
|
-
|
|
314
|
-
if (Object.values(validations.errors).length) {
|
|
315
|
-
toggleNotification({
|
|
316
|
-
type: 'warning',
|
|
317
|
-
title: {
|
|
318
|
-
id: 'content-manager.listView.validation.errors.title',
|
|
319
|
-
defaultMessage: 'Action required',
|
|
320
|
-
},
|
|
321
|
-
message: {
|
|
322
|
-
id: 'content-manager.listView.validation.errors.message',
|
|
323
|
-
defaultMessage:
|
|
324
|
-
'Please make sure all fields are valid before publishing (required field, min/max character limit, etc.)',
|
|
325
|
-
},
|
|
326
|
-
});
|
|
327
|
-
|
|
328
|
-
throw new Error('Validation error');
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
return bulkPublishMutation.mutateAsync({ ids: selectedEntries });
|
|
332
|
-
};
|
|
333
|
-
|
|
334
267
|
const handleConfirmUnpublishAllData = (selectedEntries) => {
|
|
335
268
|
return bulkUnpublishMutation.mutateAsync({ ids: selectedEntries });
|
|
336
269
|
};
|
|
@@ -475,6 +408,57 @@ function ListView({
|
|
|
475
408
|
</Button>
|
|
476
409
|
) : null;
|
|
477
410
|
|
|
411
|
+
/**
|
|
412
|
+
*
|
|
413
|
+
* @param {string} id
|
|
414
|
+
* @returns void
|
|
415
|
+
*/
|
|
416
|
+
const handleRowClick = (id) => () => {
|
|
417
|
+
trackUsage('willEditEntryFromList');
|
|
418
|
+
push({
|
|
419
|
+
pathname: `${pathname}/${id}`,
|
|
420
|
+
state: { from: pathname },
|
|
421
|
+
search: pluginsQueryParams,
|
|
422
|
+
});
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
const handleCloneClick = (id) => async () => {
|
|
426
|
+
try {
|
|
427
|
+
const { data } = await post(
|
|
428
|
+
`/content-manager/collection-types/${contentType.uid}/auto-clone/${id}?${pluginsQueryParams}`
|
|
429
|
+
);
|
|
430
|
+
|
|
431
|
+
if ('id' in data) {
|
|
432
|
+
push({
|
|
433
|
+
pathname: `${pathname}/${data.id}`,
|
|
434
|
+
state: { from: pathname },
|
|
435
|
+
search: pluginsQueryParams,
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
} catch (err) {
|
|
439
|
+
if (err instanceof AxiosError) {
|
|
440
|
+
push({
|
|
441
|
+
pathname: `${pathname}/create/clone/${id}`,
|
|
442
|
+
state: { from: pathname, error: formatAPIError(err) },
|
|
443
|
+
search: pluginsQueryParams,
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
};
|
|
448
|
+
|
|
449
|
+
// Add 1 column for the checkbox and 1 for the actions
|
|
450
|
+
const colCount = tableHeaders.length + 2;
|
|
451
|
+
|
|
452
|
+
// We have this function to refetch data when selected entries modal is closed
|
|
453
|
+
const refetchData = () => {
|
|
454
|
+
fetchData(`/content-manager/collection-types/${slug}`, { params });
|
|
455
|
+
};
|
|
456
|
+
|
|
457
|
+
// Block rendering until the review stage component is fully loaded in EE
|
|
458
|
+
if (!ReviewWorkflowsStage) {
|
|
459
|
+
return null;
|
|
460
|
+
}
|
|
461
|
+
|
|
478
462
|
return (
|
|
479
463
|
<Main aria-busy={isLoading}>
|
|
480
464
|
<HeaderLayout
|
|
@@ -544,54 +528,129 @@ function ListView({
|
|
|
544
528
|
<ContentLayout>
|
|
545
529
|
{canRead ? (
|
|
546
530
|
<Flex gap={4} direction="column" alignItems="stretch">
|
|
547
|
-
<
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
canPublish={canPublish}
|
|
551
|
-
contentTypeName={headerLayoutTitle}
|
|
552
|
-
onConfirmDelete={handleConfirmDeleteData}
|
|
553
|
-
onConfirmDeleteAll={handleConfirmDeleteAllData}
|
|
554
|
-
onConfirmPublishAll={handleConfirmPublishAllData}
|
|
555
|
-
onConfirmUnpublishAll={handleConfirmUnpublishAllData}
|
|
556
|
-
isBulkable={isBulkable}
|
|
557
|
-
isLoading={isLoading}
|
|
558
|
-
// FIXME: remove the layout props drilling
|
|
559
|
-
layout={layout}
|
|
560
|
-
rows={data}
|
|
561
|
-
components={{ ConfirmDialogDelete, ConfirmDialogDeleteAll }}
|
|
562
|
-
contentType={headerLayoutTitle}
|
|
563
|
-
action={getCreateAction({ variant: 'secondary' })}
|
|
564
|
-
headers={tableHeaders}
|
|
565
|
-
onOpenDeleteAllModalTrackedEvent="willBulkDeleteEntries"
|
|
566
|
-
withBulkActions
|
|
567
|
-
withMainAction={canDelete && isBulkable}
|
|
568
|
-
renderBulkActionsBar={({ selectedEntries, clearSelectedEntries }) => (
|
|
569
|
-
<BulkActionsBar
|
|
531
|
+
<Table.Root rows={data} isLoading={isLoading} colCount={colCount}>
|
|
532
|
+
<Table.ActionBar>
|
|
533
|
+
<BulkActionButtons
|
|
570
534
|
showPublish={canPublish && hasDraftAndPublish}
|
|
571
535
|
showDelete={canDelete}
|
|
572
536
|
onConfirmDeleteAll={handleConfirmDeleteAllData}
|
|
573
|
-
onConfirmPublishAll={handleConfirmPublishAllData}
|
|
574
537
|
onConfirmUnpublishAll={handleConfirmUnpublishAllData}
|
|
575
|
-
|
|
576
|
-
clearSelectedEntries={clearSelectedEntries}
|
|
538
|
+
refetchData={refetchData}
|
|
577
539
|
/>
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
540
|
+
</Table.ActionBar>
|
|
541
|
+
<Table.Content>
|
|
542
|
+
<Table.Head>
|
|
543
|
+
{/* Bulk action select all checkbox */}
|
|
544
|
+
<Table.HeaderCheckboxCell />
|
|
545
|
+
{/* Dynamic headers based on fields */}
|
|
546
|
+
{tableHeaders.map(({ fieldSchema, key, name, metadatas }) => (
|
|
547
|
+
<Table.HeaderCell
|
|
548
|
+
key={key}
|
|
549
|
+
name={name}
|
|
550
|
+
fieldSchemaType={fieldSchema.type}
|
|
551
|
+
relationFieldName={metadatas.mainField?.name}
|
|
552
|
+
isSortable={metadatas.sortable}
|
|
553
|
+
label={metadatas.label}
|
|
554
|
+
/>
|
|
555
|
+
))}
|
|
556
|
+
{/* Visually hidden header for actions */}
|
|
557
|
+
<Table.HeaderHiddenActionsCell />
|
|
558
|
+
</Table.Head>
|
|
559
|
+
{/* Loading content */}
|
|
560
|
+
<Table.LoadingBody />
|
|
561
|
+
{/* Empty content */}
|
|
562
|
+
<Table.EmptyBody
|
|
563
|
+
contentType={headerLayoutTitle}
|
|
564
|
+
aciton={getCreateAction({ variant: 'secondary' })}
|
|
565
|
+
/>
|
|
566
|
+
{/* Content */}
|
|
567
|
+
<Body.Root
|
|
568
|
+
onConfirmDelete={handleConfirmDeleteData}
|
|
569
|
+
isConfirmDeleteRowOpen={isConfirmDeleteRowOpen}
|
|
570
|
+
setIsConfirmDeleteRowOpen={setIsConfirmDeleteRowOpen}
|
|
571
|
+
>
|
|
572
|
+
{data.map((rowData, index) => {
|
|
573
|
+
return (
|
|
574
|
+
<Tr cursor="pointer" key={data.id} onClick={handleRowClick(rowData.id)}>
|
|
575
|
+
{/* Bulk action row checkbox */}
|
|
576
|
+
<Body.CheckboxDataCell rowId={rowData.id} index={index} />
|
|
577
|
+
{/* Field data */}
|
|
578
|
+
{tableHeaders.map(({ key, name, ...rest }) => {
|
|
579
|
+
if (hasDraftAndPublish && name === 'publishedAt') {
|
|
580
|
+
return (
|
|
581
|
+
<Td key={key}>
|
|
582
|
+
<Status
|
|
583
|
+
width="min-content"
|
|
584
|
+
showBullet={false}
|
|
585
|
+
variant={rowData.publishedAt ? 'success' : 'secondary'}
|
|
586
|
+
size="S"
|
|
587
|
+
>
|
|
588
|
+
<Typography
|
|
589
|
+
fontWeight="bold"
|
|
590
|
+
textColor={`${
|
|
591
|
+
rowData.publishedAt ? 'success' : 'secondary'
|
|
592
|
+
}700`}
|
|
593
|
+
>
|
|
594
|
+
{formatMessage({
|
|
595
|
+
id: getTrad(
|
|
596
|
+
`containers.List.${
|
|
597
|
+
rowData.publishedAt ? 'published' : 'draft'
|
|
598
|
+
}`
|
|
599
|
+
),
|
|
600
|
+
defaultMessage: rowData.publishedAt ? 'Published' : 'Draft',
|
|
601
|
+
})}
|
|
602
|
+
</Typography>
|
|
603
|
+
</Status>
|
|
604
|
+
</Td>
|
|
605
|
+
);
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
if (hasReviewWorkflows && name === 'strapi_stage') {
|
|
609
|
+
return (
|
|
610
|
+
<Td key={key}>
|
|
611
|
+
{rowData.strapi_stage ? (
|
|
612
|
+
<ReviewWorkflowsStage
|
|
613
|
+
color={
|
|
614
|
+
rowData.strapi_stage.color ?? lightTheme.colors.primary600
|
|
615
|
+
}
|
|
616
|
+
name={rowData.strapi_stage.name}
|
|
617
|
+
/>
|
|
618
|
+
) : (
|
|
619
|
+
<Typography textColor="neutral800">-</Typography>
|
|
620
|
+
)}
|
|
621
|
+
</Td>
|
|
622
|
+
);
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
return (
|
|
626
|
+
<Td key={key}>
|
|
627
|
+
<CellContent
|
|
628
|
+
content={rowData[name.split('.')[0]]}
|
|
629
|
+
name={name}
|
|
630
|
+
contentType={layout.contentType}
|
|
631
|
+
{...rest}
|
|
632
|
+
rowId={rowData.id}
|
|
633
|
+
/>
|
|
634
|
+
</Td>
|
|
635
|
+
);
|
|
636
|
+
})}
|
|
637
|
+
{/* Actions: edit, duplicate, delete */}
|
|
638
|
+
{(canDelete || canPublish) && isBulkable && (
|
|
639
|
+
<Body.EntityActionsDataCell
|
|
640
|
+
rowId={rowData.id}
|
|
641
|
+
index={index}
|
|
642
|
+
setIsConfirmDeleteRowOpen={setIsConfirmDeleteRowOpen}
|
|
643
|
+
canCreate={canCreate}
|
|
644
|
+
canDelete={canDelete}
|
|
645
|
+
handleCloneClick={handleCloneClick}
|
|
646
|
+
/>
|
|
647
|
+
)}
|
|
648
|
+
</Tr>
|
|
649
|
+
);
|
|
650
|
+
})}
|
|
651
|
+
</Body.Root>
|
|
652
|
+
</Table.Content>
|
|
653
|
+
</Table.Root>
|
|
595
654
|
<Flex alignItems="flex-end" justifyContent="space-between">
|
|
596
655
|
<PageSizeURLQuery trackedEvent="willChangeNumberOfEntriesPerPage" />
|
|
597
656
|
<PaginationURLQuery pagination={{ pageCount: pagination?.pageCount || 1 }} />
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useState, useEffect } from 'react';
|
|
1
|
+
import { useState, useEffect, useCallback } from 'react';
|
|
2
2
|
|
|
3
3
|
import { hasPermissions, useRBACProvider, useStrapiApp, useAppInfo } from '@strapi/helper-plugin';
|
|
4
4
|
import { useSelector } from 'react-redux';
|
|
@@ -19,25 +19,15 @@ const useSettingsMenu = () => {
|
|
|
19
19
|
const { shouldUpdateStrapi } = useAppInfo();
|
|
20
20
|
const { settings } = useStrapiApp();
|
|
21
21
|
const permissions = useSelector(selectAdminPermissions);
|
|
22
|
+
|
|
22
23
|
const { global: globalLinks, admin: adminLinks } = useEnterprise(
|
|
23
24
|
LINKS_CE,
|
|
24
25
|
async () => (await import('../../../../ee/admin/hooks/useSettingsMenu/constants')).LINKS_EE,
|
|
25
26
|
{
|
|
26
27
|
combine(ceLinks, eeLinks) {
|
|
27
|
-
function addPermissions(link) {
|
|
28
|
-
if (!link.id) {
|
|
29
|
-
throw new Error('The settings menu item must have an id attribute.');
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return {
|
|
33
|
-
...link,
|
|
34
|
-
permissions: permissions.settings?.[link.id]?.main,
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
28
|
return {
|
|
39
|
-
admin: [...eeLinks.admin, ...ceLinks.admin]
|
|
40
|
-
global: [...ceLinks.global, ...eeLinks.global]
|
|
29
|
+
admin: [...eeLinks.admin, ...ceLinks.admin],
|
|
30
|
+
global: [...ceLinks.global, ...eeLinks.global],
|
|
41
31
|
};
|
|
42
32
|
},
|
|
43
33
|
defaultValue: {
|
|
@@ -47,6 +37,20 @@ const useSettingsMenu = () => {
|
|
|
47
37
|
}
|
|
48
38
|
);
|
|
49
39
|
|
|
40
|
+
const addPermissions = useCallback(
|
|
41
|
+
(link) => {
|
|
42
|
+
if (!link.id) {
|
|
43
|
+
throw new Error('The settings menu item must have an id attribute.');
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return {
|
|
47
|
+
...link,
|
|
48
|
+
permissions: permissions.settings?.[link.id]?.main,
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
[permissions.settings]
|
|
52
|
+
);
|
|
53
|
+
|
|
50
54
|
useEffect(() => {
|
|
51
55
|
const getData = async () => {
|
|
52
56
|
const buildMenuPermissions = (sections) =>
|
|
@@ -86,26 +90,36 @@ const useSettingsMenu = () => {
|
|
|
86
90
|
};
|
|
87
91
|
|
|
88
92
|
const { global, ...otherSections } = settings;
|
|
93
|
+
|
|
89
94
|
const sections = formatLinks([
|
|
90
95
|
{
|
|
91
96
|
...settings.global,
|
|
92
|
-
links: sortLinks([...settings.global.links, ...globalLinks]).map(
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
97
|
+
links: sortLinks([...settings.global.links, ...globalLinks.map(addPermissions)]).map(
|
|
98
|
+
(link) => ({
|
|
99
|
+
...link,
|
|
100
|
+
hasNotification: link.id === '000-application-infos' && shouldUpdateStrapi,
|
|
101
|
+
})
|
|
102
|
+
),
|
|
96
103
|
},
|
|
97
104
|
{
|
|
98
105
|
id: 'permissions',
|
|
99
106
|
intlLabel: { id: 'Settings.permissions', defaultMessage: 'Administration Panel' },
|
|
100
|
-
links: adminLinks,
|
|
107
|
+
links: adminLinks.map(addPermissions),
|
|
101
108
|
},
|
|
102
109
|
...Object.values(otherSections),
|
|
103
110
|
]);
|
|
104
111
|
|
|
105
112
|
getData();
|
|
106
|
-
}, [adminLinks, globalLinks, userPermissions, settings, shouldUpdateStrapi]);
|
|
113
|
+
}, [adminLinks, globalLinks, userPermissions, settings, shouldUpdateStrapi, addPermissions]);
|
|
114
|
+
|
|
115
|
+
const filterMenu = (menuItem) => {
|
|
116
|
+
return {
|
|
117
|
+
...menuItem,
|
|
118
|
+
links: menuItem.links.filter((link) => link.isDisplayed),
|
|
119
|
+
};
|
|
120
|
+
};
|
|
107
121
|
|
|
108
|
-
return { isLoading, menu };
|
|
122
|
+
return { isLoading, menu: menu.map(filterMenu) };
|
|
109
123
|
};
|
|
110
124
|
|
|
111
125
|
export default useSettingsMenu;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { SingleSelect, SingleSelectOption } from '@strapi/design-system';
|
|
10
10
|
import { useIntl } from 'react-intl';
|
|
11
11
|
|
|
12
12
|
import useLocalesProvider from '../../../components/LocalesProvider/useLocalesProvider';
|
|
@@ -16,13 +16,13 @@ const LocaleToggle = () => {
|
|
|
16
16
|
const { locale } = useIntl();
|
|
17
17
|
|
|
18
18
|
return (
|
|
19
|
-
<
|
|
20
|
-
{Object.
|
|
21
|
-
<
|
|
22
|
-
{
|
|
23
|
-
</
|
|
19
|
+
<SingleSelect value={locale} onChange={(language) => changeLocale(language)}>
|
|
20
|
+
{Object.entries(localeNames).map(([language, name]) => (
|
|
21
|
+
<SingleSelectOption key={language} value={language}>
|
|
22
|
+
{name}
|
|
23
|
+
</SingleSelectOption>
|
|
24
24
|
))}
|
|
25
|
-
</
|
|
25
|
+
</SingleSelect>
|
|
26
26
|
);
|
|
27
27
|
};
|
|
28
28
|
|
|
@@ -6,7 +6,7 @@ import UnauthenticatedLayout from '../../../../layouts/UnauthenticatedLayout';
|
|
|
6
6
|
|
|
7
7
|
import BaseLogin from './BaseLogin';
|
|
8
8
|
|
|
9
|
-
const
|
|
9
|
+
export const LoginCE = (loginProps) => {
|
|
10
10
|
return (
|
|
11
11
|
<UnauthenticatedLayout>
|
|
12
12
|
<BaseLogin {...loginProps} />
|
|
@@ -14,12 +14,10 @@ const Login = (loginProps) => {
|
|
|
14
14
|
);
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
LoginCE.defaultProps = {
|
|
18
18
|
onSubmit: (e) => e.preventDefault(),
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
LoginCE.propTypes = {
|
|
22
22
|
onSubmit: PropTypes.func,
|
|
23
23
|
};
|
|
24
|
-
|
|
25
|
-
export default Login;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { translatedErrors } from '@strapi/helper-plugin';
|
|
2
|
-
import Login from 'ee_else_ce/pages/AuthPage/components/Login';
|
|
3
2
|
import * as yup from 'yup';
|
|
4
3
|
|
|
5
4
|
import ForgotPassword from './components/ForgotPassword';
|
|
@@ -27,8 +26,10 @@ export const FORMS = {
|
|
|
27
26
|
schema: null,
|
|
28
27
|
inputsPrefix: '',
|
|
29
28
|
},
|
|
29
|
+
|
|
30
|
+
// the `Component` attribute is set after all forms and CE/EE components are loaded, but since we
|
|
31
|
+
// are here outside of a React component we can not use the hook directly
|
|
30
32
|
login: {
|
|
31
|
-
Component: Login,
|
|
32
33
|
endPoint: 'login',
|
|
33
34
|
fieldsToDisable: [],
|
|
34
35
|
fieldsToOmit: ['rememberMe'],
|
|
@@ -13,6 +13,7 @@ import useLocalesProvider from '../../components/LocalesProvider/useLocalesProvi
|
|
|
13
13
|
import { useEnterprise } from '../../hooks/useEnterprise';
|
|
14
14
|
import formatAPIErrors from '../../utils/formatAPIErrors';
|
|
15
15
|
|
|
16
|
+
import { LoginCE } from './components/Login';
|
|
16
17
|
import { FORMS } from './constants';
|
|
17
18
|
import init from './init';
|
|
18
19
|
import { initialState, reducer } from './reducer';
|
|
@@ -29,6 +30,10 @@ const AuthPage = ({ hasAdmin, setHasAdmin }) => {
|
|
|
29
30
|
params: { authType },
|
|
30
31
|
} = useRouteMatch('/auth/:authType');
|
|
31
32
|
const query = useQuery();
|
|
33
|
+
const Login = useEnterprise(
|
|
34
|
+
LoginCE,
|
|
35
|
+
async () => (await import('../../../../ee/admin/pages/AuthPage/components/Login')).LoginEE
|
|
36
|
+
);
|
|
32
37
|
const forms = useEnterprise(
|
|
33
38
|
FORMS,
|
|
34
39
|
async () => (await import('../../../../ee/admin/pages/AuthPage/constants')).FORMS,
|
|
@@ -50,7 +55,7 @@ const AuthPage = ({ hasAdmin, setHasAdmin }) => {
|
|
|
50
55
|
);
|
|
51
56
|
const CancelToken = axios.CancelToken;
|
|
52
57
|
const source = CancelToken.source();
|
|
53
|
-
const {
|
|
58
|
+
const { endPoint, fieldsToDisable, fieldsToOmit, inputsPrefix, schema, ...rest } =
|
|
54
59
|
forms?.[authType] ?? {};
|
|
55
60
|
|
|
56
61
|
useEffect(() => {
|
|
@@ -274,6 +279,18 @@ const AuthPage = ({ hasAdmin, setHasAdmin }) => {
|
|
|
274
279
|
);
|
|
275
280
|
}
|
|
276
281
|
|
|
282
|
+
if (Login) {
|
|
283
|
+
// Assign the component to render for the login form
|
|
284
|
+
forms.login.Component = Login;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// block rendering until the Login EE component is fully loaded
|
|
288
|
+
if (!Login) {
|
|
289
|
+
return null;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
const { Component } = forms?.[authType] ?? {};
|
|
293
|
+
|
|
277
294
|
return (
|
|
278
295
|
<Component
|
|
279
296
|
{...rest}
|
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import React, {
|
|
6
|
+
import React, { useMemo } from 'react';
|
|
7
7
|
|
|
8
8
|
import { Box, Grid, GridItem, Layout, Main } from '@strapi/design-system';
|
|
9
9
|
import { LoadingIndicatorPage, useGuidedTour } from '@strapi/helper-plugin';
|
|
10
|
-
import useLicenseLimitNotification from 'ee_else_ce/hooks/useLicenseLimitNotification';
|
|
11
10
|
import { Helmet } from 'react-helmet';
|
|
12
11
|
import { FormattedMessage } from 'react-intl';
|
|
13
12
|
import { useHistory } from 'react-router-dom';
|
|
@@ -16,6 +15,7 @@ import styled from 'styled-components';
|
|
|
16
15
|
import GuidedTourHomepage from '../../components/GuidedTour/Homepage';
|
|
17
16
|
import isGuidedTourCompleted from '../../components/GuidedTour/utils/isGuidedTourCompleted';
|
|
18
17
|
import { useContentTypes } from '../../hooks/useContentTypes';
|
|
18
|
+
import { useEnterprise } from '../../hooks/useEnterprise';
|
|
19
19
|
|
|
20
20
|
import cornerOrnamentPath from './assets/corner-ornament.svg';
|
|
21
21
|
import ContentBlocks from './ContentBlocks';
|
|
@@ -32,15 +32,12 @@ const LogoContainer = styled(Box)`
|
|
|
32
32
|
}
|
|
33
33
|
`;
|
|
34
34
|
|
|
35
|
-
const
|
|
35
|
+
export const HomePageCE = () => {
|
|
36
36
|
// Temporary until we develop the menu API
|
|
37
37
|
const { collectionTypes, singleTypes, isLoading: isLoadingForModels } = useContentTypes();
|
|
38
38
|
const { guidedTourState, isGuidedTourVisible, isSkipped } = useGuidedTour();
|
|
39
|
-
useLicenseLimitNotification();
|
|
40
|
-
|
|
41
39
|
const showGuidedTour =
|
|
42
40
|
!isGuidedTourCompleted(guidedTourState) && isGuidedTourVisible && !isSkipped;
|
|
43
|
-
|
|
44
41
|
const { push } = useHistory();
|
|
45
42
|
const handleClick = (e) => {
|
|
46
43
|
e.preventDefault();
|
|
@@ -92,4 +89,19 @@ const HomePage = () => {
|
|
|
92
89
|
);
|
|
93
90
|
};
|
|
94
91
|
|
|
95
|
-
|
|
92
|
+
function HomePageSwitch() {
|
|
93
|
+
const HomePage = useEnterprise(
|
|
94
|
+
HomePageCE,
|
|
95
|
+
// eslint-disable-next-line import/no-cycle
|
|
96
|
+
async () => (await import('../../../../ee/admin/pages/HomePage')).HomePageEE
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
// block rendering until the EE component is fully loaded
|
|
100
|
+
if (!HomePage) {
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return <HomePage />;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export default HomePageSwitch;
|