import { CoreSetup } from 'src/core/public' ; import { ManagementAppMountParams } from '../../../../../src/plugins/management/public/' ; import { Storage } from '../../../../../src/plugins/kibana_utils/public' ; import { PluginsDependencies } from '../plugin' ; import { getMlSharedImports } from '../shared_imports' ; import { AppDependencies } from './app_dependencies' ; import { breadcrumbService } from './services/navigation' ; import { docTitleService } from './services/navigation' ; import { textService } from './services/text' ; import { renderApp } from './app' ; const localStorage = new Storage ( window . localStorage ) ; export async function mountManagementSection ( coreSetup , params ) { const { element , setBreadcrumbs , history } = params ; const { http , notifications , getStartServices } = coreSetup ; const startServices = await getStartServices ( ) ; const [ core , plugins ] = startServices ; const { application , chrome , docLinks , i18n , overlays , theme , savedObjects , uiSettings } = core ; const { data , share , spaces , triggersActionsUi } = plugins ; const { docTitle } = chrome ; textService . init ( ) ; docTitleService . init ( docTitle . change ) ; breadcrumbService . setup ( setBreadcrumbs ) ; const appDependencies = { application , chrome , data , docLinks , http , i18n , notifications , overlays , theme , savedObjects , storage : localStorage , uiSettings , history , savedObjectsPlugin : plugins . savedObjects , share , spaces , ml : await getMlSharedImports ( ) , triggersActionsUi , } ; const unmountAppCallback = renderApp ( element , appDependencies ) ; return ( ) => { docTitle . reset ( ) ; unmountAppCallback ( ) ; } ; }