Feature/translate new nav bar breadcrumb state (#24327)
Translate new_nav_bar breadcrumbState
This commit is contained in:
parent
fb7dbaeb6a
commit
d7da13bb63
4 changed files with 31 additions and 5 deletions
|
@ -56,6 +56,7 @@ import { timefilter } from 'ui/timefilter';
|
|||
import { getUnhashableStatesProvider } from 'ui/state_management/state_hashing';
|
||||
|
||||
import { DashboardViewportProvider } from './viewport/dashboard_viewport_provider';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
const app = uiModules.get('app/dashboard', [
|
||||
'elasticsearch',
|
||||
|
@ -182,7 +183,12 @@ app.directive('dashboardApp', function ($injector) {
|
|||
// Push breadcrumbs to new header navigation
|
||||
const updateBreadcrumbs = () => {
|
||||
breadcrumbState.set([
|
||||
{ text: 'Dashboard', href: $scope.landingPageUrl() },
|
||||
{
|
||||
text: i18n.translate('kbn.dashboard.dashboardAppBreadcrumbsTitle', {
|
||||
defaultMessage: 'Dashboard',
|
||||
}),
|
||||
href: $scope.landingPageUrl()
|
||||
},
|
||||
{ text: $scope.getDashTitle() }
|
||||
]);
|
||||
};
|
||||
|
|
|
@ -34,6 +34,7 @@ import { recentlyAccessed } from 'ui/persisted_log';
|
|||
import { SavedObjectRegistryProvider } from 'ui/saved_objects/saved_object_registry';
|
||||
import { DashboardListing, EMPTY_FILTER } from './listing/dashboard_listing';
|
||||
import { uiModules } from 'ui/modules';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
const app = uiModules.get('app/dashboard', [
|
||||
'ngRoute',
|
||||
|
@ -63,7 +64,11 @@ uiRoutes
|
|||
};
|
||||
$scope.hideWriteControls = dashboardConfig.getHideWriteControls();
|
||||
$scope.initialFilter = ($location.search()).filter || EMPTY_FILTER;
|
||||
breadcrumbState.set([{ text: 'Dashboards' }]);
|
||||
breadcrumbState.set([{
|
||||
text: i18n.translate('kbn.dashboard.dashboardBreadcrumbsTitle', {
|
||||
defaultMessage: 'Dashboards',
|
||||
}),
|
||||
}]);
|
||||
},
|
||||
resolve: {
|
||||
dash: function ($route, Private, redirectWhenMissing, kbnUrl) {
|
||||
|
|
|
@ -63,6 +63,7 @@ import { showOpenSearchPanel } from '../top_nav/show_open_search_panel';
|
|||
import { tabifyAggResponse } from 'ui/agg_response/tabify';
|
||||
import { showSaveModal } from 'ui/saved_objects/show_saved_object_save_modal';
|
||||
import { SavedObjectSaveModal } from 'ui/saved_objects/components/saved_object_save_modal';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
const app = uiModules.get('apps/discover', [
|
||||
'kibana/notify',
|
||||
|
@ -295,10 +296,19 @@ function discoverController(
|
|||
const pageTitleSuffix = savedSearch.id && savedSearch.title ? `: ${savedSearch.title}` : '';
|
||||
docTitle.change(`Discover${pageTitleSuffix}`);
|
||||
|
||||
const discoverBreadcrumbsTitle = i18n.translate('kbn.discover.discoverBreadcrumbsTitle', {
|
||||
defaultMessage: 'Discover',
|
||||
});
|
||||
|
||||
if (savedSearch.id && savedSearch.title) {
|
||||
breadcrumbState.set([{ text: 'Discover', href: '#/discover' }, { text: savedSearch.title }]);
|
||||
breadcrumbState.set([{
|
||||
text: discoverBreadcrumbsTitle,
|
||||
href: '#/discover'
|
||||
}, { text: savedSearch.title }]);
|
||||
} else {
|
||||
breadcrumbState.set([{ text: 'Discover' }]);
|
||||
breadcrumbState.set([{
|
||||
text: discoverBreadcrumbsTitle,
|
||||
}]);
|
||||
}
|
||||
|
||||
let stateMonitor;
|
||||
|
|
|
@ -22,6 +22,7 @@ import 'ui/pager_control';
|
|||
import 'ui/pager';
|
||||
import { uiModules } from 'ui/modules';
|
||||
import { timefilter } from 'ui/timefilter';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import { VisualizeListingTable } from './visualize_listing_table';
|
||||
|
||||
|
@ -60,6 +61,10 @@ export function VisualizeListingController($injector) {
|
|||
.catch(error => notify.error(error));
|
||||
};
|
||||
|
||||
breadcrumbState.set([{ text: 'Visualize' }]);
|
||||
breadcrumbState.set([{
|
||||
text: i18n.translate('kbn.visualize.visualizeListingBreadcrumbsTitle', {
|
||||
defaultMessage: 'Visualize',
|
||||
})
|
||||
}]);
|
||||
config.watch('k7design', (val) => this.showPluginBreadcrumbs = !val);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue