@strapi/content-manager 0.0.0-experimental.e60ec1829240dae21c1e1d29076681c322288813 → 0.0.0-experimental.eba25ec571b091c6bde1104eb6c753debdf15462
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/LICENSE +18 -3
- package/dist/_chunks/{CardDragPreview-DSVYodBX.js → CardDragPreview-C0QyJgRA.js} +10 -14
- package/dist/_chunks/CardDragPreview-C0QyJgRA.js.map +1 -0
- package/dist/_chunks/{CardDragPreview-ikSG4M46.mjs → CardDragPreview-DOxamsuj.mjs} +7 -9
- package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +1 -0
- package/dist/_chunks/{ComponentConfigurationPage-BPvzFjM7.mjs → ComponentConfigurationPage-BaJMOQyq.mjs} +4 -4
- package/dist/_chunks/{ComponentConfigurationPage-BPvzFjM7.mjs.map → ComponentConfigurationPage-BaJMOQyq.mjs.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-DjWJdz6Y.js → ComponentConfigurationPage-N-CTtgQa.js} +4 -4
- package/dist/_chunks/{ComponentConfigurationPage-DjWJdz6Y.js.map → ComponentConfigurationPage-N-CTtgQa.js.map} +1 -1
- package/dist/_chunks/{ComponentIcon-BBQsYCVn.js → ComponentIcon-BXdiCGQp.js} +8 -2
- package/dist/_chunks/ComponentIcon-BXdiCGQp.js.map +1 -0
- package/dist/_chunks/{ComponentIcon-BOFnK76n.mjs → ComponentIcon-u4bIXTFY.mjs} +9 -3
- package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +1 -0
- package/dist/_chunks/{EditConfigurationPage-Dmv83RlS.js → EditConfigurationPage-BHkjAbxH.js} +4 -4
- package/dist/_chunks/{EditConfigurationPage-Dmv83RlS.js.map → EditConfigurationPage-BHkjAbxH.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-DacbqQ_f.mjs → EditConfigurationPage-CKK-5LfX.mjs} +4 -4
- package/dist/_chunks/{EditConfigurationPage-DacbqQ_f.mjs.map → EditConfigurationPage-CKK-5LfX.mjs.map} +1 -1
- package/dist/_chunks/EditViewPage-B11aeMcf.mjs +254 -0
- package/dist/_chunks/EditViewPage-B11aeMcf.mjs.map +1 -0
- package/dist/_chunks/{EditViewPage-DvNpQkam.js → EditViewPage-QPUftxUd.js} +101 -52
- package/dist/_chunks/EditViewPage-QPUftxUd.js.map +1 -0
- package/dist/_chunks/{Field-6gvGdPBV.mjs → Field-Bj_RgtGo.mjs} +1077 -814
- package/dist/_chunks/Field-Bj_RgtGo.mjs.map +1 -0
- package/dist/_chunks/{Field-DmVKIAOo.js → Field-DUK83cfh.js} +1121 -859
- package/dist/_chunks/Field-DUK83cfh.js.map +1 -0
- package/dist/_chunks/{Form-CPZC9vWa.js → Form-DHmBRlHd.js} +66 -46
- package/dist/_chunks/Form-DHmBRlHd.js.map +1 -0
- package/dist/_chunks/{Form-DW6K1IH-.mjs → Form-DLMSoXV7.mjs} +66 -45
- package/dist/_chunks/Form-DLMSoXV7.mjs.map +1 -0
- package/dist/_chunks/{History-Dmr9fmUA.mjs → History-CfCSNlG9.mjs} +181 -144
- package/dist/_chunks/History-CfCSNlG9.mjs.map +1 -0
- package/dist/_chunks/{History-DeAPlvtv.js → History-Di3zm4HT.js} +181 -145
- package/dist/_chunks/History-Di3zm4HT.js.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-DhwvYcNv.mjs → ListConfigurationPage-0mtv_iqk.mjs} +67 -56
- package/dist/_chunks/ListConfigurationPage-0mtv_iqk.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-DPCwW5Vr.js → ListConfigurationPage-Cq361KIt.js} +70 -60
- package/dist/_chunks/ListConfigurationPage-Cq361KIt.js.map +1 -0
- package/dist/_chunks/{ListViewPage-BtAwuYLE.mjs → ListViewPage-BxLVROX8.mjs} +175 -159
- package/dist/_chunks/ListViewPage-BxLVROX8.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-5ySZ-VUs.js → ListViewPage-DFDcG8gM.js} +178 -162
- package/dist/_chunks/ListViewPage-DFDcG8gM.js.map +1 -0
- package/dist/_chunks/{NoContentTypePage-DSPxnxxp.mjs → NoContentTypePage-BRfDd67_.mjs} +3 -3
- package/dist/_chunks/NoContentTypePage-BRfDd67_.mjs.map +1 -0
- package/dist/_chunks/{NoContentTypePage-DOC_yWOf.js → NoContentTypePage-BSyvnDZZ.js} +3 -3
- package/dist/_chunks/NoContentTypePage-BSyvnDZZ.js.map +1 -0
- package/dist/_chunks/{NoPermissionsPage-UWDC-1Tw.mjs → NoPermissionsPage-CV9V8KWa.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-UWDC-1Tw.mjs.map → NoPermissionsPage-CV9V8KWa.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-Dwu8rRJu.js → NoPermissionsPage-DyLphsn_.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-Dwu8rRJu.js.map → NoPermissionsPage-DyLphsn_.js.map} +1 -1
- package/dist/_chunks/Preview-C_B1nx3g.mjs +272 -0
- package/dist/_chunks/Preview-C_B1nx3g.mjs.map +1 -0
- package/dist/_chunks/Preview-D_3aO6Ly.js +291 -0
- package/dist/_chunks/Preview-D_3aO6Ly.js.map +1 -0
- package/dist/_chunks/{Relations-J8cscLlR.mjs → Relations-C6pwmDXh.mjs} +135 -89
- package/dist/_chunks/Relations-C6pwmDXh.mjs.map +1 -0
- package/dist/_chunks/{Relations-CgWtgnPe.js → Relations-Cne2AlrL.js} +138 -93
- package/dist/_chunks/Relations-Cne2AlrL.js.map +1 -0
- package/dist/_chunks/{en-MBPul9Su.mjs → en-DhFUjrNW.mjs} +37 -18
- package/dist/_chunks/{en-MBPul9Su.mjs.map → en-DhFUjrNW.mjs.map} +1 -1
- package/dist/_chunks/{en-C-V1_90f.js → en-Ic0kXjxB.js} +37 -18
- package/dist/_chunks/{en-C-V1_90f.js.map → en-Ic0kXjxB.js.map} +1 -1
- package/dist/_chunks/{es-EUonQTon.js → es-9K52xZIr.js} +2 -2
- package/dist/_chunks/{ja-CcFe8diO.js.map → es-9K52xZIr.js.map} +1 -1
- package/dist/_chunks/{es-CeXiYflN.mjs → es-D34tqjMw.mjs} +2 -2
- package/dist/_chunks/{es-CeXiYflN.mjs.map → es-D34tqjMw.mjs.map} +1 -1
- package/dist/_chunks/{fr-CD9VFbPM.mjs → fr--pg5jUbt.mjs} +13 -3
- package/dist/_chunks/{fr-CD9VFbPM.mjs.map → fr--pg5jUbt.mjs.map} +1 -1
- package/dist/_chunks/{fr-B7kGGg3E.js → fr-B2Kyv8Z9.js} +13 -3
- package/dist/_chunks/{fr-B7kGGg3E.js.map → fr-B2Kyv8Z9.js.map} +1 -1
- package/dist/_chunks/{index-CwRRo1V9.mjs → index-BpxR3En4.mjs} +1835 -824
- package/dist/_chunks/index-BpxR3En4.mjs.map +1 -0
- package/dist/_chunks/{index-C6AH2hEl.js → index-T-aWjbj2.js} +1788 -777
- package/dist/_chunks/index-T-aWjbj2.js.map +1 -0
- package/dist/_chunks/{ja-CcFe8diO.js → ja-7sfIbjxE.js} +2 -2
- package/dist/_chunks/{es-EUonQTon.js.map → ja-7sfIbjxE.js.map} +1 -1
- package/dist/_chunks/{ja-CtsUxOvk.mjs → ja-BHqhDq4V.mjs} +2 -2
- package/dist/_chunks/{ja-CtsUxOvk.mjs.map → ja-BHqhDq4V.mjs.map} +1 -1
- package/dist/_chunks/{layout-B_SXLhqf.js → layout-BEuNwv-F.js} +45 -29
- package/dist/_chunks/layout-BEuNwv-F.js.map +1 -0
- package/dist/_chunks/{layout-jIDzX0Fp.mjs → layout-DhMZ_lDx.mjs} +45 -27
- package/dist/_chunks/layout-DhMZ_lDx.mjs.map +1 -0
- package/dist/_chunks/{objects-gigeqt7s.js → objects-BcXOv6_9.js} +2 -4
- package/dist/_chunks/{objects-gigeqt7s.js.map → objects-BcXOv6_9.js.map} +1 -1
- package/dist/_chunks/{objects-mKMAmfec.mjs → objects-D6yBsdmx.mjs} +2 -4
- package/dist/_chunks/{objects-mKMAmfec.mjs.map → objects-D6yBsdmx.mjs.map} +1 -1
- package/dist/_chunks/{relations-CuvIgCqI.mjs → relations-BdnxoX6f.mjs} +6 -7
- package/dist/_chunks/relations-BdnxoX6f.mjs.map +1 -0
- package/dist/_chunks/{relations-iBMa_OFG.js → relations-kLcuobLk.js} +6 -7
- package/dist/_chunks/relations-kLcuobLk.js.map +1 -0
- package/dist/_chunks/useDebounce-CtcjDB3L.js +28 -0
- package/dist/_chunks/useDebounce-CtcjDB3L.js.map +1 -0
- package/dist/_chunks/useDebounce-DmuSJIF3.mjs +29 -0
- package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +1 -0
- package/dist/_chunks/useDragAndDrop-DdHgKsqq.mjs.map +1 -1
- package/dist/_chunks/useDragAndDrop-J0TUUbR6.js.map +1 -1
- package/dist/admin/index.js +3 -1
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +9 -7
- package/dist/admin/src/components/ComponentIcon.d.ts +6 -3
- package/dist/admin/src/content-manager.d.ts +3 -3
- package/dist/admin/src/exports.d.ts +2 -1
- package/dist/admin/src/history/components/VersionInputRenderer.d.ts +1 -1
- package/dist/admin/src/history/index.d.ts +3 -0
- package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
- package/dist/admin/src/hooks/useDocument.d.ts +37 -9
- package/dist/admin/src/hooks/useDocumentActions.d.ts +24 -3
- package/dist/admin/src/hooks/useDocumentLayout.d.ts +2 -2
- package/dist/admin/src/hooks/useDragAndDrop.d.ts +4 -4
- package/dist/admin/src/hooks/useKeyboardDragAndDrop.d.ts +1 -1
- package/dist/admin/src/index.d.ts +1 -0
- package/dist/admin/src/pages/EditView/EditViewPage.d.ts +9 -1
- package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +11 -4
- package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/BlocksInput.d.ts +3 -3
- package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +4 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/Component/Input.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/ComponentCategory.d.ts +3 -5
- package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/Field.d.ts +1 -1
- package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +30 -18
- package/dist/admin/src/pages/EditView/components/FormInputs/UID.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.d.ts +3 -49
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/Field.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +16 -53
- package/dist/admin/src/pages/EditView/components/Header.d.ts +11 -11
- package/dist/admin/src/pages/EditView/components/InputRenderer.d.ts +2 -10
- package/dist/admin/src/pages/ListView/components/BulkActions/Actions.d.ts +3 -30
- package/dist/admin/src/pages/ListView/components/BulkActions/ConfirmBulkActionDialog.d.ts +2 -2
- package/dist/admin/src/pages/ListView/components/BulkActions/PublishAction.d.ts +9 -26
- package/dist/admin/src/preview/components/PreviewContent.d.ts +2 -0
- package/dist/admin/src/preview/components/PreviewHeader.d.ts +2 -0
- package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
- package/dist/admin/src/preview/constants.d.ts +1 -0
- package/dist/admin/src/preview/index.d.ts +4 -0
- package/dist/admin/src/preview/pages/Preview.d.ts +11 -0
- package/dist/admin/src/preview/routes.d.ts +3 -0
- package/dist/admin/src/preview/services/preview.d.ts +3 -0
- package/dist/admin/src/router.d.ts +1 -1
- package/dist/admin/src/services/api.d.ts +2 -3
- package/dist/admin/src/services/components.d.ts +2 -2
- package/dist/admin/src/services/contentTypes.d.ts +5 -5
- package/dist/admin/src/services/documents.d.ts +31 -20
- package/dist/admin/src/services/init.d.ts +2 -2
- package/dist/admin/src/services/relations.d.ts +3 -3
- package/dist/admin/src/services/uid.d.ts +3 -3
- package/dist/admin/src/utils/api.d.ts +4 -18
- package/dist/admin/src/utils/validation.d.ts +5 -7
- package/dist/server/index.js +852 -436
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +859 -443
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/bootstrap.d.ts.map +1 -1
- package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
- package/dist/server/src/controllers/index.d.ts.map +1 -1
- package/dist/server/src/controllers/relations.d.ts.map +1 -1
- package/dist/server/src/controllers/single-types.d.ts.map +1 -1
- package/dist/server/src/controllers/uid.d.ts.map +1 -1
- package/dist/server/src/controllers/utils/metadata.d.ts +22 -0
- package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -0
- package/dist/server/src/controllers/validation/dimensions.d.ts +11 -0
- package/dist/server/src/controllers/validation/dimensions.d.ts.map +1 -0
- package/dist/server/src/controllers/validation/index.d.ts +1 -1
- package/dist/server/src/history/services/history.d.ts.map +1 -1
- package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
- package/dist/server/src/history/services/utils.d.ts +4 -4
- package/dist/server/src/history/services/utils.d.ts.map +1 -1
- package/dist/server/src/index.d.ts +21 -42
- package/dist/server/src/index.d.ts.map +1 -1
- package/dist/server/src/policies/hasPermissions.d.ts.map +1 -1
- package/dist/server/src/preview/constants.d.ts +2 -0
- package/dist/server/src/preview/constants.d.ts.map +1 -0
- package/dist/server/src/preview/controllers/index.d.ts +2 -0
- package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
- package/dist/server/src/preview/controllers/preview.d.ts +13 -0
- package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
- package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
- package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
- package/dist/server/src/preview/index.d.ts +4 -0
- package/dist/server/src/preview/index.d.ts.map +1 -0
- package/dist/server/src/preview/routes/index.d.ts +8 -0
- package/dist/server/src/preview/routes/index.d.ts.map +1 -0
- package/dist/server/src/preview/routes/preview.d.ts +4 -0
- package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
- package/dist/server/src/preview/services/index.d.ts +16 -0
- package/dist/server/src/preview/services/index.d.ts.map +1 -0
- package/dist/server/src/preview/services/preview-config.d.ts +32 -0
- package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
- package/dist/server/src/preview/services/preview.d.ts +12 -0
- package/dist/server/src/preview/services/preview.d.ts.map +1 -0
- package/dist/server/src/preview/utils.d.ts +19 -0
- package/dist/server/src/preview/utils.d.ts.map +1 -0
- package/dist/server/src/register.d.ts.map +1 -1
- package/dist/server/src/routes/index.d.ts.map +1 -1
- package/dist/server/src/services/document-manager.d.ts +13 -12
- package/dist/server/src/services/document-manager.d.ts.map +1 -1
- package/dist/server/src/services/document-metadata.d.ts +14 -35
- package/dist/server/src/services/document-metadata.d.ts.map +1 -1
- package/dist/server/src/services/index.d.ts +21 -42
- package/dist/server/src/services/index.d.ts.map +1 -1
- package/dist/server/src/services/permission-checker.d.ts.map +1 -1
- package/dist/server/src/services/utils/configuration/index.d.ts +2 -2
- package/dist/server/src/services/utils/configuration/layouts.d.ts +2 -2
- package/dist/server/src/services/utils/populate.d.ts +8 -1
- package/dist/server/src/services/utils/populate.d.ts.map +1 -1
- package/dist/server/src/utils/index.d.ts +2 -0
- package/dist/server/src/utils/index.d.ts.map +1 -1
- package/dist/shared/contracts/collection-types.d.ts +17 -7
- package/dist/shared/contracts/collection-types.d.ts.map +1 -1
- package/dist/shared/contracts/index.d.ts +1 -0
- package/dist/shared/contracts/index.d.ts.map +1 -1
- package/dist/shared/contracts/preview.d.ts +27 -0
- package/dist/shared/contracts/preview.d.ts.map +1 -0
- package/dist/shared/contracts/relations.d.ts +2 -2
- package/dist/shared/contracts/relations.d.ts.map +1 -1
- package/dist/shared/index.js +4 -0
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/index.mjs +4 -0
- package/dist/shared/index.mjs.map +1 -1
- package/package.json +19 -20
- package/dist/_chunks/CardDragPreview-DSVYodBX.js.map +0 -1
- package/dist/_chunks/CardDragPreview-ikSG4M46.mjs.map +0 -1
- package/dist/_chunks/ComponentIcon-BBQsYCVn.js.map +0 -1
- package/dist/_chunks/ComponentIcon-BOFnK76n.mjs.map +0 -1
- package/dist/_chunks/EditViewPage-DDS6H9HO.mjs +0 -203
- package/dist/_chunks/EditViewPage-DDS6H9HO.mjs.map +0 -1
- package/dist/_chunks/EditViewPage-DvNpQkam.js.map +0 -1
- package/dist/_chunks/Field-6gvGdPBV.mjs.map +0 -1
- package/dist/_chunks/Field-DmVKIAOo.js.map +0 -1
- package/dist/_chunks/Form-CPZC9vWa.js.map +0 -1
- package/dist/_chunks/Form-DW6K1IH-.mjs.map +0 -1
- package/dist/_chunks/History-DeAPlvtv.js.map +0 -1
- package/dist/_chunks/History-Dmr9fmUA.mjs.map +0 -1
- package/dist/_chunks/ListConfigurationPage-DPCwW5Vr.js.map +0 -1
- package/dist/_chunks/ListConfigurationPage-DhwvYcNv.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-5ySZ-VUs.js.map +0 -1
- package/dist/_chunks/ListViewPage-BtAwuYLE.mjs.map +0 -1
- package/dist/_chunks/NoContentTypePage-DOC_yWOf.js.map +0 -1
- package/dist/_chunks/NoContentTypePage-DSPxnxxp.mjs.map +0 -1
- package/dist/_chunks/Relations-CgWtgnPe.js.map +0 -1
- package/dist/_chunks/Relations-J8cscLlR.mjs.map +0 -1
- package/dist/_chunks/index-C6AH2hEl.js.map +0 -1
- package/dist/_chunks/index-CwRRo1V9.mjs.map +0 -1
- package/dist/_chunks/layout-B_SXLhqf.js.map +0 -1
- package/dist/_chunks/layout-jIDzX0Fp.mjs.map +0 -1
- package/dist/_chunks/relations-CuvIgCqI.mjs.map +0 -1
- package/dist/_chunks/relations-iBMa_OFG.js.map +0 -1
- package/dist/_chunks/urls-CbOsUOoW.mjs +0 -7
- package/dist/_chunks/urls-CbOsUOoW.mjs.map +0 -1
- package/dist/_chunks/urls-DzZya_gm.js +0 -6
- package/dist/_chunks/urls-DzZya_gm.js.map +0 -1
- package/dist/server/src/controllers/utils/dimensions.d.ts +0 -5
- package/dist/server/src/controllers/utils/dimensions.d.ts.map +0 -1
- package/strapi-server.js +0 -3
@@ -1,28 +1,20 @@
|
|
1
1
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
2
2
|
import * as React from "react";
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import { useCollator, Combobox, ComboboxOption, Typography, Menu, Tooltip, Badge, Avatar, Flex, AvatarGroup, useNotifyAT, Loader, IconButton, Popover, LinkButton, TextButton, BaseCheckbox, Button } from "@strapi/design-system";
|
3
|
+
import { useTracking, useAuth, useQueryParams, useAdminUsers, Filters, useField, useRBAC, Layouts, useNotification, useAPIErrorHandler, useStrapiApp, Page, BackButton, SearchInput, Table, Pagination, useTable } from "@strapi/admin/strapi-admin";
|
4
|
+
import { useCollator, Combobox, ComboboxOption, Tooltip, Typography, Menu, Badge, Avatar, Flex, useNotifyAT, Loader, Popover, IconButton, LinkButton, TextButton, Checkbox, Button } from "@strapi/design-system";
|
6
5
|
import { Cog, ListPlus, Plus } from "@strapi/icons";
|
7
6
|
import isEqual from "lodash/isEqual";
|
8
7
|
import { stringify } from "qs";
|
9
8
|
import { useIntl } from "react-intl";
|
10
9
|
import { NavLink, useNavigate, Link, useParams } from "react-router-dom";
|
11
|
-
import styled from "styled-components";
|
12
|
-
import {
|
10
|
+
import { styled } from "styled-components";
|
11
|
+
import { u as useContentTypeSchema, p as useGetContentTypeConfigurationQuery, q as CREATOR_FIELDS, r as getMainField, t as getDisplayName, c as useDoc, g as getTranslation, h as useDocumentLayout, v as checkIfAttributeIsDisplayable, d as buildValidParams, w as useGetAllDocumentsQuery, f as useDocumentRBAC, I as InjectionZone, D as DocumentStatus, T as TableActions, B as BulkActionsRenderer, k as PERMISSIONS, l as DocumentRBAC, H as HOOKS, x as convertListLayoutToFieldLayouts } from "./index-BpxR3En4.mjs";
|
12
|
+
import { a as useDebounce, p as prefixFileUrlWithBackendUrl, u as usePrev } from "./useDebounce-DmuSJIF3.mjs";
|
13
13
|
import isEmpty from "lodash/isEmpty";
|
14
14
|
import parseISO from "date-fns/parseISO";
|
15
15
|
import toString from "lodash/toString";
|
16
|
-
import {
|
17
|
-
import { g as getRelationLabel, u as useGetRelationsQuery } from "./relations-CuvIgCqI.mjs";
|
16
|
+
import { g as getRelationLabel, u as useGetRelationsQuery } from "./relations-BdnxoX6f.mjs";
|
18
17
|
import { u as useTypedSelector } from "./hooks-E5u1mcgM.mjs";
|
19
|
-
const usePrev = (value) => {
|
20
|
-
const ref = useRef();
|
21
|
-
useEffect(() => {
|
22
|
-
ref.current = value;
|
23
|
-
}, [value]);
|
24
|
-
return ref.current;
|
25
|
-
};
|
26
18
|
const NOT_ALLOWED_FILTERS = [
|
27
19
|
"json",
|
28
20
|
"component",
|
@@ -129,6 +121,15 @@ const FiltersImpl = ({ disabled, schema }) => {
|
|
129
121
|
}
|
130
122
|
};
|
131
123
|
}
|
124
|
+
if (attribute.type === "enumeration") {
|
125
|
+
filter = {
|
126
|
+
...filter,
|
127
|
+
options: attribute.enum.map((value) => ({
|
128
|
+
label: value,
|
129
|
+
value
|
130
|
+
}))
|
131
|
+
};
|
132
|
+
}
|
132
133
|
return filter;
|
133
134
|
}).filter(Boolean).toSorted((a, b) => formatter.compare(a.label, b.label));
|
134
135
|
}, [
|
@@ -171,18 +172,22 @@ const FiltersImpl = ({ disabled, schema }) => {
|
|
171
172
|
);
|
172
173
|
};
|
173
174
|
const AdminUsersFilter = ({ name }) => {
|
174
|
-
const [
|
175
|
+
const [pageSize, setPageSize] = React.useState(10);
|
176
|
+
const [search, setSearch] = React.useState("");
|
175
177
|
const { formatMessage } = useIntl();
|
178
|
+
const debouncedSearch = useDebounce(search, 300);
|
176
179
|
const { data, isLoading } = useAdminUsers({
|
177
|
-
|
180
|
+
pageSize,
|
181
|
+
_q: debouncedSearch
|
178
182
|
});
|
179
183
|
const field = useField(name);
|
180
184
|
const handleOpenChange = (isOpen) => {
|
181
185
|
if (!isOpen) {
|
182
|
-
|
186
|
+
setPageSize(10);
|
183
187
|
}
|
184
188
|
};
|
185
|
-
const users = data
|
189
|
+
const { users = [], pagination } = data ?? {};
|
190
|
+
const { pageCount = 1, page = 1 } = pagination ?? {};
|
186
191
|
return /* @__PURE__ */ jsx(
|
187
192
|
Combobox,
|
188
193
|
{
|
@@ -194,7 +199,11 @@ const AdminUsersFilter = ({ name }) => {
|
|
194
199
|
onOpenChange: handleOpenChange,
|
195
200
|
onChange: (value) => field.onChange(name, value),
|
196
201
|
loading: isLoading,
|
197
|
-
onLoadMore: () =>
|
202
|
+
onLoadMore: () => setPageSize(pageSize + 10),
|
203
|
+
hasMoreItems: page < pageCount,
|
204
|
+
onInputChange: (e) => {
|
205
|
+
setSearch(e.currentTarget.value);
|
206
|
+
},
|
198
207
|
children: users.map((user) => {
|
199
208
|
return /* @__PURE__ */ jsx(ComboboxOption, { value: user.id.toString(), children: getDisplayName(user) }, user.id);
|
200
209
|
})
|
@@ -236,20 +245,16 @@ const SingleComponent = ({ content, mainField }) => {
|
|
236
245
|
if (!mainField) {
|
237
246
|
return null;
|
238
247
|
}
|
239
|
-
return /* @__PURE__ */ jsx(Tooltip, { label: content[mainField.name], children: /* @__PURE__ */ jsx(
|
248
|
+
return /* @__PURE__ */ jsx(Tooltip, { label: content[mainField.name], children: /* @__PURE__ */ jsx(Typography, { maxWidth: "25rem", textColor: "neutral800", ellipsis: true, children: /* @__PURE__ */ jsx(CellValue, { type: mainField.type, value: content[mainField.name] }) }) });
|
240
249
|
};
|
241
|
-
const SingleComponentTypography = styled(Typography)`
|
242
|
-
max-width: 250px;
|
243
|
-
`;
|
244
250
|
const RepeatableComponent = ({ content, mainField }) => {
|
245
251
|
const { formatMessage } = useIntl();
|
246
252
|
if (!mainField) {
|
247
253
|
return null;
|
248
254
|
}
|
249
255
|
return /* @__PURE__ */ jsxs(Menu.Root, { children: [
|
250
|
-
/* @__PURE__ */ jsxs(
|
256
|
+
/* @__PURE__ */ jsxs(Menu.Trigger, { onClick: (e) => e.stopPropagation(), children: [
|
251
257
|
/* @__PURE__ */ jsx(Badge, { children: content.length }),
|
252
|
-
" ",
|
253
258
|
formatMessage(
|
254
259
|
{
|
255
260
|
id: "content-manager.containers.list.items",
|
@@ -258,25 +263,24 @@ const RepeatableComponent = ({ content, mainField }) => {
|
|
258
263
|
{ number: content.length }
|
259
264
|
)
|
260
265
|
] }),
|
261
|
-
/* @__PURE__ */ jsx(Menu.Content, { children: content.map((item) => /* @__PURE__ */ jsx(Menu.Item, { disabled: true, children: /* @__PURE__ */ jsx(
|
266
|
+
/* @__PURE__ */ jsx(Menu.Content, { children: content.map((item) => /* @__PURE__ */ jsx(Menu.Item, { disabled: true, children: /* @__PURE__ */ jsx(Typography, { maxWidth: "50rem", ellipsis: true, children: /* @__PURE__ */ jsx(CellValue, { type: mainField.type, value: item[mainField.name] }) }) }, item.id)) })
|
262
267
|
] });
|
263
268
|
};
|
264
|
-
const RepeatableComponentTypography = styled(Typography)`
|
265
|
-
max-width: 500px;
|
266
|
-
`;
|
267
|
-
const MenuTrigger$1 = styled(Menu.Trigger)`
|
268
|
-
svg {
|
269
|
-
width: 0.6rem;
|
270
|
-
height: 0.4rem;
|
271
|
-
}
|
272
|
-
`;
|
273
269
|
const getFileExtension = (ext) => ext && ext[0] === "." ? ext.substring(1) : ext;
|
274
270
|
const MediaSingle = ({ url, mime, alternativeText, name, ext, formats }) => {
|
275
271
|
const fileURL = prefixFileUrlWithBackendUrl(url);
|
276
272
|
if (mime.includes("image")) {
|
277
273
|
const thumbnail = formats?.thumbnail?.url;
|
278
274
|
const mediaURL = prefixFileUrlWithBackendUrl(thumbnail) || fileURL;
|
279
|
-
return /* @__PURE__ */ jsx(
|
275
|
+
return /* @__PURE__ */ jsx(
|
276
|
+
Avatar.Item,
|
277
|
+
{
|
278
|
+
src: mediaURL,
|
279
|
+
alt: alternativeText || name,
|
280
|
+
fallback: alternativeText || name,
|
281
|
+
preview: true
|
282
|
+
}
|
283
|
+
);
|
280
284
|
}
|
281
285
|
const fileExtension = getFileExtension(ext);
|
282
286
|
const fileName = name.length > 100 ? `${name.substring(0, 100)}...` : name;
|
@@ -286,7 +290,7 @@ const FileWrapper = ({ children }) => {
|
|
286
290
|
return /* @__PURE__ */ jsx(
|
287
291
|
Flex,
|
288
292
|
{
|
289
|
-
|
293
|
+
tag: "span",
|
290
294
|
position: "relative",
|
291
295
|
borderRadius: "50%",
|
292
296
|
width: "26px",
|
@@ -305,7 +309,7 @@ const FileTypography = styled(Typography)`
|
|
305
309
|
line-height: 0.9rem;
|
306
310
|
`;
|
307
311
|
const MediaMultiple = ({ content }) => {
|
308
|
-
return /* @__PURE__ */ jsx(
|
312
|
+
return /* @__PURE__ */ jsx(Avatar.Group, { children: content.map((file, index) => {
|
309
313
|
const key = `${file.id}${index}`;
|
310
314
|
if (index === 3) {
|
311
315
|
const remainingFiles = `+${content.length - 3}`;
|
@@ -318,11 +322,8 @@ const MediaMultiple = ({ content }) => {
|
|
318
322
|
}) });
|
319
323
|
};
|
320
324
|
const RelationSingle = ({ mainField, content }) => {
|
321
|
-
return /* @__PURE__ */ jsx(
|
325
|
+
return /* @__PURE__ */ jsx(Typography, { maxWidth: "50rem", textColor: "neutral800", ellipsis: true, children: getRelationLabel(content, mainField) });
|
322
326
|
};
|
323
|
-
const TypographyMaxWidth$1 = styled(Typography)`
|
324
|
-
max-width: 500px;
|
325
|
-
`;
|
326
327
|
const RelationMultiple = ({ mainField, content, rowId, name }) => {
|
327
328
|
const { model } = useDoc();
|
328
329
|
const { formatMessage } = useIntl();
|
@@ -340,6 +341,7 @@ const RelationMultiple = ({ mainField, content, rowId, name }) => {
|
|
340
341
|
refetchOnMountOrArgChange: true
|
341
342
|
}
|
342
343
|
);
|
344
|
+
const contentCount = Array.isArray(content) ? content.length : content.count;
|
343
345
|
React.useEffect(() => {
|
344
346
|
if (data) {
|
345
347
|
notifyStatus(
|
@@ -351,23 +353,20 @@ const RelationMultiple = ({ mainField, content, rowId, name }) => {
|
|
351
353
|
}
|
352
354
|
}, [data, formatMessage, notifyStatus]);
|
353
355
|
return /* @__PURE__ */ jsxs(Menu.Root, { onOpenChange: (isOpen2) => setIsOpen(isOpen2), children: [
|
354
|
-
/* @__PURE__ */ jsx(
|
355
|
-
|
356
|
-
|
357
|
-
{
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
{ number: content.count }
|
362
|
-
)
|
363
|
-
] }) }),
|
356
|
+
/* @__PURE__ */ jsx(Menu.Trigger, { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsx(Typography, { style: { cursor: "pointer" }, textColor: "neutral800", fontWeight: "regular", children: contentCount > 0 ? formatMessage(
|
357
|
+
{
|
358
|
+
id: "content-manager.containers.list.items",
|
359
|
+
defaultMessage: "{number} {number, plural, =0 {items} one {item} other {items}}"
|
360
|
+
},
|
361
|
+
{ number: contentCount }
|
362
|
+
) : "-" }) }),
|
364
363
|
/* @__PURE__ */ jsxs(Menu.Content, { children: [
|
365
364
|
isLoading && /* @__PURE__ */ jsx(Menu.Item, { disabled: true, children: /* @__PURE__ */ jsx(Loader, { small: true, children: formatMessage({
|
366
365
|
id: getTranslation("ListViewTable.relation-loading"),
|
367
366
|
defaultMessage: "Relations are loading"
|
368
367
|
}) }) }),
|
369
368
|
data?.results && /* @__PURE__ */ jsxs(Fragment, { children: [
|
370
|
-
data.results.map((entry) => /* @__PURE__ */ jsx(Menu.Item, { disabled: true, children: /* @__PURE__ */ jsx(
|
369
|
+
data.results.map((entry) => /* @__PURE__ */ jsx(Menu.Item, { disabled: true, children: /* @__PURE__ */ jsx(Typography, { maxWidth: "50rem", ellipsis: true, children: getRelationLabel(entry, mainField) }) }, entry.documentId)),
|
371
370
|
data?.pagination && data?.pagination.total > 10 && /* @__PURE__ */ jsx(
|
372
371
|
Menu.Item,
|
373
372
|
{
|
@@ -383,15 +382,17 @@ const RelationMultiple = ({ mainField, content, rowId, name }) => {
|
|
383
382
|
] })
|
384
383
|
] });
|
385
384
|
};
|
386
|
-
const MenuTrigger = styled(Menu.Trigger)`
|
387
|
-
svg {
|
388
|
-
width: 0.6rem;
|
389
|
-
height: 0.4rem;
|
390
|
-
}
|
391
|
-
`;
|
392
385
|
const CellContent = ({ content, mainField, attribute, rowId, name }) => {
|
393
386
|
if (!hasContent(content, mainField, attribute)) {
|
394
|
-
return /* @__PURE__ */ jsx(
|
387
|
+
return /* @__PURE__ */ jsx(
|
388
|
+
Typography,
|
389
|
+
{
|
390
|
+
textColor: "neutral800",
|
391
|
+
paddingLeft: attribute.type === "relation" ? "1.6rem" : 0,
|
392
|
+
paddingRight: attribute.type === "relation" ? "1.6rem" : 0,
|
393
|
+
children: "-"
|
394
|
+
}
|
395
|
+
);
|
395
396
|
}
|
396
397
|
switch (attribute.type) {
|
397
398
|
case "media":
|
@@ -411,14 +412,11 @@ const CellContent = ({ content, mainField, attribute, rowId, name }) => {
|
|
411
412
|
}
|
412
413
|
return /* @__PURE__ */ jsx(SingleComponent, { mainField, content });
|
413
414
|
case "string":
|
414
|
-
return /* @__PURE__ */ jsx(Tooltip, { description: content, children: /* @__PURE__ */ jsx(
|
415
|
+
return /* @__PURE__ */ jsx(Tooltip, { description: content, children: /* @__PURE__ */ jsx(Typography, { maxWidth: "30rem", ellipsis: true, textColor: "neutral800", children: /* @__PURE__ */ jsx(CellValue, { type: attribute.type, value: content }) }) });
|
415
416
|
default:
|
416
|
-
return /* @__PURE__ */ jsx(
|
417
|
+
return /* @__PURE__ */ jsx(Typography, { maxWidth: "30rem", ellipsis: true, textColor: "neutral800", children: /* @__PURE__ */ jsx(CellValue, { type: attribute.type, value: content }) });
|
417
418
|
}
|
418
419
|
};
|
419
|
-
const TypographyMaxWidth = styled(Typography)`
|
420
|
-
max-width: 300px;
|
421
|
-
`;
|
422
420
|
const hasContent = (content, mainField, attribute) => {
|
423
421
|
if (attribute.type === "component") {
|
424
422
|
if (attribute.repeatable || !mainField) {
|
@@ -434,6 +432,9 @@ const hasContent = (content, mainField, attribute) => {
|
|
434
432
|
if (isSingleRelation(attribute.relation)) {
|
435
433
|
return !isEmpty(content);
|
436
434
|
}
|
435
|
+
if (Array.isArray(content)) {
|
436
|
+
return content.length > 0;
|
437
|
+
}
|
437
438
|
return content?.count > 0;
|
438
439
|
}
|
439
440
|
if (["integer", "decimal", "float", "number"].includes(attribute.type)) {
|
@@ -446,8 +447,6 @@ const hasContent = (content, mainField, attribute) => {
|
|
446
447
|
};
|
447
448
|
const isSingleRelation = (type) => ["oneToOne", "manyToOne", "oneToOneMorph"].includes(type);
|
448
449
|
const ViewSettingsMenu = (props) => {
|
449
|
-
const [isVisible, setIsVisible] = React.useState(false);
|
450
|
-
const cogButtonRef = React.useRef(null);
|
451
450
|
const permissions = useTypedSelector(
|
452
451
|
(state) => state.admin_app.permissions.contentManager?.collectionTypesConfigurations ?? []
|
453
452
|
);
|
@@ -456,52 +455,37 @@ const ViewSettingsMenu = (props) => {
|
|
456
455
|
const {
|
457
456
|
allowedActions: { canConfigureView }
|
458
457
|
} = useRBAC(permissions);
|
459
|
-
|
460
|
-
|
461
|
-
};
|
462
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
463
|
-
/* @__PURE__ */ jsx(
|
458
|
+
return /* @__PURE__ */ jsxs(Popover.Root, { children: [
|
459
|
+
/* @__PURE__ */ jsx(Popover.Trigger, { children: /* @__PURE__ */ jsx(
|
464
460
|
IconButton,
|
465
461
|
{
|
466
|
-
icon: /* @__PURE__ */ jsx(Cog, {}),
|
467
462
|
label: formatMessage({
|
468
463
|
id: "components.ViewSettings.tooltip",
|
469
464
|
defaultMessage: "View Settings"
|
470
465
|
}),
|
471
|
-
|
472
|
-
onClick: handleToggle
|
466
|
+
children: /* @__PURE__ */ jsx(Cog, {})
|
473
467
|
}
|
474
|
-
),
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
children: formatMessage({
|
496
|
-
id: "app.links.configure-view",
|
497
|
-
defaultMessage: "Configure the view"
|
498
|
-
})
|
499
|
-
}
|
500
|
-
) : null,
|
501
|
-
/* @__PURE__ */ jsx(FieldPicker, { ...props })
|
502
|
-
] })
|
503
|
-
}
|
504
|
-
)
|
468
|
+
) }),
|
469
|
+
/* @__PURE__ */ jsx(Popover.Content, { side: "bottom", align: "end", sideOffset: 4, children: /* @__PURE__ */ jsxs(Flex, { alignItems: "stretch", direction: "column", padding: 3, gap: 3, children: [
|
470
|
+
canConfigureView ? /* @__PURE__ */ jsx(
|
471
|
+
LinkButton,
|
472
|
+
{
|
473
|
+
size: "S",
|
474
|
+
startIcon: /* @__PURE__ */ jsx(ListPlus, {}),
|
475
|
+
variant: "secondary",
|
476
|
+
tag: NavLink,
|
477
|
+
to: {
|
478
|
+
pathname: "configurations/list",
|
479
|
+
search: query.plugins ? stringify({ plugins: query.plugins }, { encode: false }) : ""
|
480
|
+
},
|
481
|
+
children: formatMessage({
|
482
|
+
id: "app.links.configure-view",
|
483
|
+
defaultMessage: "Configure the view"
|
484
|
+
})
|
485
|
+
}
|
486
|
+
) : null,
|
487
|
+
/* @__PURE__ */ jsx(FieldPicker, { ...props })
|
488
|
+
] }) })
|
505
489
|
] });
|
506
490
|
};
|
507
491
|
const FieldPicker = ({ headers = [], resetHeaders, setHeaders }) => {
|
@@ -525,51 +509,58 @@ const FieldPicker = ({ headers = [], resetHeaders, setHeaders }) => {
|
|
525
509
|
const handleReset = () => {
|
526
510
|
resetHeaders();
|
527
511
|
};
|
528
|
-
return /* @__PURE__ */ jsxs(
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
512
|
+
return /* @__PURE__ */ jsxs(
|
513
|
+
Flex,
|
514
|
+
{
|
515
|
+
tag: "fieldset",
|
516
|
+
direction: "column",
|
517
|
+
alignItems: "stretch",
|
518
|
+
gap: 3,
|
519
|
+
borderWidth: 0,
|
520
|
+
maxHeight: "240px",
|
521
|
+
overflow: "scroll",
|
522
|
+
children: [
|
523
|
+
/* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", children: [
|
524
|
+
/* @__PURE__ */ jsx(Typography, { tag: "legend", variant: "pi", fontWeight: "bold", children: formatMessage({
|
525
|
+
id: "containers.list.displayedFields",
|
526
|
+
defaultMessage: "Displayed fields"
|
527
|
+
}) }),
|
528
|
+
/* @__PURE__ */ jsx(TextButton, { onClick: handleReset, children: formatMessage({
|
529
|
+
id: "app.components.Button.reset",
|
530
|
+
defaultMessage: "Reset"
|
531
|
+
}) })
|
532
|
+
] }),
|
533
|
+
/* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", children: columns.map((header) => {
|
534
|
+
const isActive = headers.includes(header.name);
|
535
|
+
return /* @__PURE__ */ jsx(
|
536
|
+
Flex,
|
537
|
+
{
|
538
|
+
wrap: "wrap",
|
539
|
+
gap: 2,
|
540
|
+
background: isActive ? "primary100" : "transparent",
|
541
|
+
hasRadius: true,
|
542
|
+
padding: 2,
|
543
|
+
children: /* @__PURE__ */ jsx(
|
544
|
+
Checkbox,
|
545
|
+
{
|
546
|
+
onCheckedChange: () => handleChange(header.name),
|
547
|
+
checked: isActive,
|
548
|
+
name: header.name,
|
549
|
+
children: /* @__PURE__ */ jsx(Typography, { fontSize: 1, children: header.label })
|
550
|
+
}
|
551
|
+
)
|
552
|
+
},
|
553
|
+
header.name
|
554
|
+
);
|
555
|
+
}) })
|
556
|
+
]
|
557
|
+
}
|
558
|
+
);
|
566
559
|
};
|
567
|
-
const ChackboxWrapper = styled(Flex)`
|
568
|
-
:hover {
|
569
|
-
background-color: ${(props) => props.theme.colors.primary100};
|
570
|
-
}
|
571
|
-
`;
|
572
560
|
const { INJECT_COLUMN_IN_TABLE } = HOOKS;
|
561
|
+
const LayoutsHeaderCustom = styled(Layouts.Header)`
|
562
|
+
overflow-wrap: anywhere;
|
563
|
+
`;
|
573
564
|
const ListViewPage = () => {
|
574
565
|
const { trackUsage } = useTracking();
|
575
566
|
const navigate = useNavigate();
|
@@ -596,7 +587,7 @@ const ListViewPage = () => {
|
|
596
587
|
sort: list.settings.defaultSortBy ? `${list.settings.defaultSortBy}:${list.settings.defaultSortOrder}` : ""
|
597
588
|
});
|
598
589
|
const params = React.useMemo(() => buildValidParams(query), [query]);
|
599
|
-
const { data, error,
|
590
|
+
const { data, error, isFetching } = useGetAllDocumentsQuery({
|
600
591
|
model,
|
601
592
|
params
|
602
593
|
});
|
@@ -632,10 +623,14 @@ const ListViewPage = () => {
|
|
632
623
|
layout: list
|
633
624
|
});
|
634
625
|
const formattedHeaders = headers.displayedHeaders.map((header) => {
|
626
|
+
const translation = typeof header.label === "string" ? {
|
627
|
+
id: `content-manager.content-types.${model}.${header.name}`,
|
628
|
+
defaultMessage: header.label
|
629
|
+
} : header.label;
|
635
630
|
return {
|
636
631
|
...header,
|
637
|
-
label:
|
638
|
-
name: `${header.name}${header.mainField ? `.${header.mainField}` : ""}`
|
632
|
+
label: formatMessage(translation),
|
633
|
+
name: `${header.name}${header.mainField?.name ? `.${header.mainField.name}` : ""}`
|
639
634
|
};
|
640
635
|
});
|
641
636
|
if (schema?.options?.draftAndPublish) {
|
@@ -653,8 +648,15 @@ const ListViewPage = () => {
|
|
653
648
|
});
|
654
649
|
}
|
655
650
|
return formattedHeaders;
|
656
|
-
}, [
|
657
|
-
|
651
|
+
}, [
|
652
|
+
displayedHeaders,
|
653
|
+
formatMessage,
|
654
|
+
list,
|
655
|
+
runHookWaterfall,
|
656
|
+
schema?.options?.draftAndPublish,
|
657
|
+
model
|
658
|
+
]);
|
659
|
+
if (isFetching) {
|
658
660
|
return /* @__PURE__ */ jsx(Page.Loading, {});
|
659
661
|
}
|
660
662
|
if (error) {
|
@@ -671,7 +673,7 @@ const ListViewPage = () => {
|
|
671
673
|
return /* @__PURE__ */ jsxs(Page.Main, { children: [
|
672
674
|
/* @__PURE__ */ jsx(Page.Title, { children: `${contentTypeTitle}` }),
|
673
675
|
/* @__PURE__ */ jsx(
|
674
|
-
|
676
|
+
LayoutsHeaderCustom,
|
675
677
|
{
|
676
678
|
primaryAction: canCreate ? /* @__PURE__ */ jsx(CreateButton, {}) : null,
|
677
679
|
subtitle: formatMessage(
|
@@ -720,8 +722,8 @@ const ListViewPage = () => {
|
|
720
722
|
}
|
721
723
|
),
|
722
724
|
/* @__PURE__ */ jsx(Layouts.Content, { children: /* @__PURE__ */ jsxs(Flex, { gap: 4, direction: "column", alignItems: "stretch", children: [
|
723
|
-
/* @__PURE__ */ jsxs(Table.Root, { rows: results, headers: tableHeaders, isLoading, children: [
|
724
|
-
/* @__PURE__ */ jsx(
|
725
|
+
/* @__PURE__ */ jsxs(Table.Root, { rows: results, headers: tableHeaders, isLoading: isFetching, children: [
|
726
|
+
/* @__PURE__ */ jsx(TableActionsBar, {}),
|
725
727
|
/* @__PURE__ */ jsxs(Table.Content, { children: [
|
726
728
|
/* @__PURE__ */ jsxs(Table.Head, { children: [
|
727
729
|
/* @__PURE__ */ jsx(Table.HeaderCheckboxCell, {}),
|
@@ -783,6 +785,18 @@ const ActionsCell = styled(Table.Cell)`
|
|
783
785
|
display: flex;
|
784
786
|
justify-content: flex-end;
|
785
787
|
`;
|
788
|
+
const TableActionsBar = () => {
|
789
|
+
const selectRow = useTable("TableActionsBar", (state) => state.selectRow);
|
790
|
+
const [{ query }] = useQueryParams();
|
791
|
+
const locale = query?.plugins?.i18n?.locale;
|
792
|
+
const prevLocale = usePrev(locale);
|
793
|
+
React.useEffect(() => {
|
794
|
+
if (prevLocale !== locale) {
|
795
|
+
selectRow([]);
|
796
|
+
}
|
797
|
+
}, [selectRow, prevLocale, locale]);
|
798
|
+
return /* @__PURE__ */ jsx(Table.ActionBar, { children: /* @__PURE__ */ jsx(BulkActionsRenderer, {}) });
|
799
|
+
};
|
786
800
|
const CreateButton = ({ variant }) => {
|
787
801
|
const { formatMessage } = useIntl();
|
788
802
|
const { trackUsage } = useTracking();
|
@@ -791,7 +805,7 @@ const CreateButton = ({ variant }) => {
|
|
791
805
|
Button,
|
792
806
|
{
|
793
807
|
variant,
|
794
|
-
|
808
|
+
tag: Link,
|
795
809
|
onClick: () => {
|
796
810
|
trackUsage("willCreateEntry", { status: "draft" });
|
797
811
|
},
|
@@ -801,6 +815,8 @@ const CreateButton = ({ variant }) => {
|
|
801
815
|
pathname: "create",
|
802
816
|
search: stringify({ plugins: query.plugins })
|
803
817
|
},
|
818
|
+
minWidth: "max-content",
|
819
|
+
marginLeft: 2,
|
804
820
|
children: formatMessage({
|
805
821
|
id: getTranslation("HeaderLayout.button.label-add-entry"),
|
806
822
|
defaultMessage: "Create new entry"
|
@@ -832,4 +848,4 @@ export {
|
|
832
848
|
ListViewPage,
|
833
849
|
ProtectedListViewPage
|
834
850
|
};
|
835
|
-
//# sourceMappingURL=ListViewPage-
|
851
|
+
//# sourceMappingURL=ListViewPage-BxLVROX8.mjs.map
|