* Final phase before the complete cutover * NP migration * lint fix * More NP stuff * Moved Stack Monitoring client plugin outside legacy and fixed all tests * ... * Removed unused files * Fix for main links * Fixed more tests * Fixed redirect when clicking on SM icon again * Code review feedback * Addressed code review feedback * Fixed return value
25 lines
877 B
JavaScript
25 lines
877 B
JavaScript
/*
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
* or more contributor license agreements. Licensed under the Elastic License;
|
|
* you may not use this file except in compliance with the Elastic License.
|
|
*/
|
|
|
|
import _ from 'lodash';
|
|
import { i18n } from '@kbn/i18n';
|
|
import { Legacy } from '../legacy_shims';
|
|
|
|
export function titleProvider($rootScope) {
|
|
return function changeTitle(cluster, suffix) {
|
|
let clusterName = _.get(cluster, 'cluster_name');
|
|
clusterName = clusterName ? `- ${clusterName}` : '';
|
|
suffix = suffix ? `- ${suffix}` : '';
|
|
$rootScope.$applyAsync(() => {
|
|
Legacy.shims.docTitle.change(
|
|
i18n.translate('xpack.monitoring.stackMonitoringDocTitle', {
|
|
defaultMessage: 'Stack Monitoring {clusterName} {suffix}',
|
|
values: { clusterName, suffix },
|
|
})
|
|
);
|
|
});
|
|
};
|
|
}
|