Skip to content

Commit

Permalink
Feature/translate new nav bar breadcrumb state (#24327)
Browse files Browse the repository at this point in the history
Translate new_nav_bar breadcrumbState
  • Loading branch information
Nox911 authored and pavel06081991 committed Oct 30, 2018
1 parent fb7dbae commit d7da13b
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 5 deletions.
8 changes: 7 additions & 1 deletion src/core_plugins/kibana/public/dashboard/dashboard_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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() }
]);
};
Expand Down
7 changes: 6 additions & 1 deletion src/core_plugins/kibana/public/dashboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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) {
Expand Down
14 changes: 12 additions & 2 deletions src/core_plugins/kibana/public/discover/controllers/discover.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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);
}

0 comments on commit d7da13b

Please sign in to comment.