diff --git a/x-pack/plugins/drilldowns/public/components/connected_flyout_manage_drilldowns/connected_flyout_manage_drilldowns.test.tsx b/x-pack/plugins/drilldowns/public/components/connected_flyout_manage_drilldowns/connected_flyout_manage_drilldowns.test.tsx index c115c18a4f3e8..60825f893903e 100644 --- a/x-pack/plugins/drilldowns/public/components/connected_flyout_manage_drilldowns/connected_flyout_manage_drilldowns.test.tsx +++ b/x-pack/plugins/drilldowns/public/components/connected_flyout_manage_drilldowns/connected_flyout_manage_drilldowns.test.tsx @@ -19,7 +19,7 @@ import { TEST_SUBJ_DRILLDOWN_ITEM } from '../list_manage_drilldowns'; import { WELCOME_MESSAGE_TEST_SUBJ } from '../drilldown_hello_bar'; import { coreMock } from '../../../../../../src/core/public/mocks'; import { NotificationsStart } from 'kibana/public'; -import { toastDrilldownsCRUDError, toastDrilldownsFetchError } from './i18n'; +import { toastDrilldownsCRUDError } from './i18n'; const storage = new Storage(new StubBrowserStorage()); const notifications = coreMock.createStart().notifications; diff --git a/x-pack/plugins/drilldowns/public/components/connected_flyout_manage_drilldowns/connected_flyout_manage_drilldowns.tsx b/x-pack/plugins/drilldowns/public/components/connected_flyout_manage_drilldowns/connected_flyout_manage_drilldowns.tsx index ee1afbeb2ed0c..a0f18589bc238 100644 --- a/x-pack/plugins/drilldowns/public/components/connected_flyout_manage_drilldowns/connected_flyout_manage_drilldowns.tsx +++ b/x-pack/plugins/drilldowns/public/components/connected_flyout_manage_drilldowns/connected_flyout_manage_drilldowns.tsx @@ -28,6 +28,7 @@ import { toastDrilldownsCRUDError, toastDrilldownsDeleted, } from './i18n'; +import { DrilldownFactoryContext } from '../../types'; interface ConnectedFlyoutManageDrilldownsProps { context: Context; @@ -65,9 +66,15 @@ export function createFlyoutManageDrilldowns({ return (props: ConnectedFlyoutManageDrilldownsProps) => { const isCreateOnly = props.viewMode === 'create'; + const factoryContext: DrilldownFactoryContext = { + place: '', + placeContext: props.context, + triggers: [], + }; + const actionFactories = useCompatibleActionFactoriesForCurrentContext( allActionFactories, - props.context + factoryContext ); const [route, setRoute] = useState( @@ -121,8 +128,8 @@ export function createFlyoutManageDrilldowns({ return { id: drilldown.eventId, drilldownName: drilldown.action.name, - actionName: actionFactory?.getDisplayName(props.context) ?? drilldown.action.factoryId, - icon: actionFactory?.getIconType(props.context), + actionName: actionFactory?.getDisplayName(factoryContext) ?? drilldown.action.factoryId, + icon: actionFactory?.getIconType(factoryContext), }; } @@ -168,7 +175,7 @@ export function createFlyoutManageDrilldowns({ setRoute(Routes.Manage); setCurrentEditId(null); }} - actionFactoryContext={props.context} + actionFactoryContext={factoryContext} initialDrilldownWizardConfig={resolveInitialDrilldownWizardConfig()} /> ); diff --git a/x-pack/plugins/drilldowns/public/types.ts b/x-pack/plugins/drilldowns/public/types.ts index 21e28d8a1e64f..f34aa89ddd211 100644 --- a/x-pack/plugins/drilldowns/public/types.ts +++ b/x-pack/plugins/drilldowns/public/types.ts @@ -108,9 +108,9 @@ export interface Drilldown< */ export interface DrilldownFactoryContext { /** - * List of places as configured in @type {Drilldown} interface. + * Place where factory is being rendered. */ - places?: string[]; + place?: string; /** * Context provided to the drilldown factory by the place where the UI is