44 * you may not use this file except in compliance with the Elastic License.
55 */
66
7- import { CoreSetup , CoreStart , Plugin } from 'src/core/public' ;
7+ import React from 'react' ;
8+ import { CoreSetup , CoreStart , Plugin , PluginInitializerContext } from 'src/core/public' ;
89import { DataPublicPluginSetup , DataPublicPluginStart } from '../../../../src/plugins/data/public' ;
10+
911import { setAutocompleteService } from './services' ;
1012import { setupKqlQuerySuggestionProvider , KUERY_LANGUAGE_NAME } from './autocomplete' ;
11-
1213import { EnhancedSearchInterceptor } from './search/search_interceptor' ;
14+ import { toMountPoint } from '../../../../src/plugins/kibana_react/public' ;
15+ import { createConnectedBackgroundSessionIndicator } from './search' ;
16+ import { ConfigSchema } from '../config' ;
1317
1418export interface DataEnhancedSetupDependencies {
1519 data : DataPublicPluginSetup ;
@@ -25,6 +29,8 @@ export class DataEnhancedPlugin
2529 implements Plugin < void , void , DataEnhancedSetupDependencies , DataEnhancedStartDependencies > {
2630 private enhancedSearchInterceptor ! : EnhancedSearchInterceptor ;
2731
32+ constructor ( private initializerContext : PluginInitializerContext < ConfigSchema > ) { }
33+
2834 public setup (
2935 core : CoreSetup < DataEnhancedStartDependencies > ,
3036 { data } : DataEnhancedSetupDependencies
@@ -52,6 +58,18 @@ export class DataEnhancedPlugin
5258
5359 public start ( core : CoreStart , plugins : DataEnhancedStartDependencies ) {
5460 setAutocompleteService ( plugins . data . autocomplete ) ;
61+
62+ if ( this . initializerContext . config . get ( ) . search . sendToBackground . enabled ) {
63+ core . chrome . setBreadcrumbsAppendExtension ( {
64+ content : toMountPoint (
65+ React . createElement (
66+ createConnectedBackgroundSessionIndicator ( {
67+ sessionService : plugins . data . search . session ,
68+ } )
69+ )
70+ ) ,
71+ } ) ;
72+ }
5573 }
5674
5775 public stop ( ) {
0 commit comments