@@ -30,20 +30,31 @@ export class WatcherUIPlugin implements Plugin<void, void, Dependencies, any> {
3030 ) {
3131 const esSection = management . sections . section . insightsAndAlerting ;
3232
33+ const pluginName = i18n . translate (
34+ 'xpack.watcher.sections.watchList.managementSection.watcherDisplayName' ,
35+ { defaultMessage : 'Watcher' }
36+ ) ;
37+
3338 const watcherESApp = esSection . registerApp ( {
3439 id : 'watcher' ,
35- title : i18n . translate (
36- 'xpack.watcher.sections.watchList.managementSection.watcherDisplayName' ,
37- { defaultMessage : 'Watcher' }
38- ) ,
40+ title : pluginName ,
3941 order : 3 ,
4042 mount : async ( { element, setBreadcrumbs, history } ) => {
41- const [ core ] = await getStartServices ( ) ;
42- const { i18n : i18nDep , docLinks, savedObjects, application } = core ;
43- const { boot } = await import ( './application/boot' ) ;
43+ const [ coreStart ] = await getStartServices ( ) ;
44+ const {
45+ chrome : { docTitle } ,
46+ i18n : i18nDep ,
47+ docLinks,
48+ savedObjects,
49+ application,
50+ } = coreStart ;
51+
52+ docTitle . change ( pluginName ) ;
53+
54+ const { renderApp } = await import ( './application' ) ;
4455 const { TimeBuckets } = await import ( './legacy' ) ;
4556
46- return boot ( {
57+ const unmountAppCallback = renderApp ( {
4758 // Skip the first license status, because that's already been used to determine
4859 // whether to include Watcher.
4960 licenseStatus$ : licensing . license$ . pipe ( skip ( 1 ) , map ( licenseToLicenseStatus ) ) ,
@@ -60,6 +71,11 @@ export class WatcherUIPlugin implements Plugin<void, void, Dependencies, any> {
6071 history,
6172 getUrlForApp : application . getUrlForApp ,
6273 } ) ;
74+
75+ return ( ) => {
76+ docTitle . reset ( ) ;
77+ unmountAppCallback ( ) ;
78+ } ;
6379 } ,
6480 } ) ;
6581
0 commit comments