Add doc titles to ES UI apps (#71045)

* Add doc titles to CCR, ILM, Index Management, Ingest Node Pipelines, License Management, Remote Clusters, Rollup Jobs, Watcher, and Upgrade Assistant. Clear doc title when leaving Dev Tools.
* Refactor Watcher boot file to follow index-oriented pattern of other plugins.
This commit is contained in:
CJ Cenizal 2020-07-21 07:04:40 -07:00 committed by GitHub
parent 1cde692ab7
commit a540cafb85
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 151 additions and 42 deletions

View file

@ -7,6 +7,7 @@
import { i18n } from '@kbn/i18n';
import { CoreSetup, Plugin, CoreStart, PluginInitializerContext } from 'kibana/public';
import { PLUGIN } from '../common/constants';
import { init as initBreadcrumbs } from './application/services/breadcrumb';
import { init as initDocumentation } from './application/services/documentation';
import { init as initHttp } from './application/services/http';
@ -43,11 +44,14 @@ export class RemoteClustersUIPlugin
mount: async ({ element, setBreadcrumbs, history }) => {
const [core] = await getStartServices();
const {
chrome: { docTitle },
i18n: { Context: i18nContext },
docLinks,
fatalErrors,
} = core;
docTitle.change(PLUGIN.getI18nName());
// Initialize services
initBreadcrumbs(setBreadcrumbs);
initDocumentation(docLinks);
@ -58,7 +62,17 @@ export class RemoteClustersUIPlugin
const isCloudEnabled = Boolean(cloud?.isCloudEnabled);
const { renderApp } = await import('./application');
return renderApp(element, i18nContext, { isCloudEnabled }, history);
const unmountAppCallback = await renderApp(
element,
i18nContext,
{ isCloudEnabled },
history
);
return () => {
docTitle.reset();
unmountAppCallback();
};
},
});
}