import { CoreSetup } from 'src/core/public' ; import { SetupDependencies , StartDependencies } from '../../plugin' ; import { CONTEXT_MENU_TRIGGER } from '../../../../../../src/plugins/embeddable/public' ; import { FlyoutCreateDrilldownAction , FlyoutEditDrilldownAction } from './actions' ; import { EmbeddableToDashboardDrilldown } from './embeddable_to_dashboard_drilldown' ; import { createStartServicesGetter } from '../../../../../../src/plugins/kibana_utils/public' ; interface BootstrapParams { enableDrilldowns : boolean ; } export class DashboardDrilldownsService { bootstrap ( core , plugins , { enableDrilldowns } ) { if ( enableDrilldowns ) { this . setupDrilldowns ( core , plugins ) ; } } setupDrilldowns ( core , { uiActionsEnhanced : uiActions } ) { const start = createStartServicesGetter ( core . getStartServices ) ; const actionFlyoutCreateDrilldown = new FlyoutCreateDrilldownAction ( { start } ) ; uiActions . addTriggerAction ( CONTEXT_MENU_TRIGGER , actionFlyoutCreateDrilldown ) ; const actionFlyoutEditDrilldown = new FlyoutEditDrilldownAction ( { start } ) ; uiActions . addTriggerAction ( CONTEXT_MENU_TRIGGER , actionFlyoutEditDrilldown ) ; const dashboardToDashboardDrilldown = new EmbeddableToDashboardDrilldown ( { start } ) ; uiActions . registerDrilldown ( dashboardToDashboardDrilldown ) ; } }