diff --git a/packages/core/admin/admin/src/content-manager/pages/ListView/components/BulkActions/Actions.tsx b/packages/core/admin/admin/src/content-manager/pages/ListView/components/BulkActions/Actions.tsx index 6c6f2acdcb..d512f6264a 100644 --- a/packages/core/admin/admin/src/content-manager/pages/ListView/components/BulkActions/Actions.tsx +++ b/packages/core/admin/admin/src/content-manager/pages/ListView/components/BulkActions/Actions.tsx @@ -14,16 +14,16 @@ import { Typography, } from '@strapi/design-system'; import { Check, ExclamationMarkCircle, Trash } from '@strapi/icons'; -import { Contracts } from '@strapi/plugin-content-manager/_internal/shared'; import { AxiosError, AxiosResponse } from 'axios'; import { useIntl } from 'react-intl'; import { useQueryClient } from 'react-query'; import { useParams } from 'react-router-dom'; -import { NotificationConfig, useNotification, useTracking } from '../../../../..'; import { DescriptionComponentRenderer } from '../../../../../components/DescriptionComponentRenderer'; import { useTypedSelector } from '../../../../../core/store/hooks'; +import { NotificationConfig, useNotification } from '../../../../../features/Notifications'; import { useStrapiApp } from '../../../../../features/StrapiApp'; +import { useTracking } from '../../../../../features/Tracking'; import { useDoc } from '../../../../hooks/useDocument'; import { getTranslation } from '../../../../utils/translations'; // import { useAllowedActions } from '../../hooks/useAllowedActions'; @@ -34,6 +34,7 @@ import type { BulkActionComponent, ContentManagerPlugin, } from '../../../../../core/apis/content-manager'; +import type { Contracts } from '@strapi/plugin-content-manager/_internal/shared'; interface BulkActionDescription { dialog?: DialogOptions | NotificationOptions | ModalOptions; diff --git a/packages/core/admin/admin/src/core/apis/content-manager.ts b/packages/core/admin/admin/src/core/apis/content-manager.ts index abb86b596e..0800d721e7 100644 --- a/packages/core/admin/admin/src/core/apis/content-manager.ts +++ b/packages/core/admin/admin/src/core/apis/content-manager.ts @@ -186,7 +186,7 @@ class ContentManagerPlugin { this.headerActions = actions(this.headerActions); } else { throw new Error( - `Expected the \`actions\` passed to \`addBulkAction\` to be an array or a function, but received ${getPrintableType( + `Expected the \`actions\` passed to \`addDocumentHeaderAction\` to be an array or a function, but received ${getPrintableType( actions )}` ); diff --git a/packages/core/admin/admin/src/core/apis/tests/content-manager.test.ts b/packages/core/admin/admin/src/core/apis/tests/content-manager.test.ts index 10f305a84c..1ba19bd53f 100644 --- a/packages/core/admin/admin/src/core/apis/tests/content-manager.test.ts +++ b/packages/core/admin/admin/src/core/apis/tests/content-manager.test.ts @@ -35,6 +35,10 @@ jest.mock('../../../content-manager/pages/ListView/components/TableActions', () DEFAULT_TABLE_ROW_ACTIONS: [], })); +jest.mock('../../../content-manager/pages/ListView/components/BulkActions/Actions', () => ({ + DEFAULT_BULK_ACTIONS: [], +})); + describe('content-manager', () => { describe('config', () => { it("should export the a config shape to pretend it's a plugin", () => { @@ -43,9 +47,11 @@ describe('content-manager', () => { expect(plugin.config).toMatchInlineSnapshot(` { "apis": { + "addBulkAction": [Function], "addDocumentAction": [Function], "addDocumentHeaderAction": [Function], "addEditViewSidePanel": [Function], + "getBulkActions": [Function], "getDocumentActions": [Function], "getEditViewSidePanels": [Function], "getHeaderActions": [Function], @@ -71,6 +77,8 @@ describe('content-manager', () => { "getDocumentActions", "getHeaderActions", "getEditViewSidePanels", + "addBulkAction", + "getBulkActions", ] `); });