Skip to content

Commit

Permalink
[HomeApp] Set breadcrumbs when coming back from add data dir (elastic…
Browse files Browse the repository at this point in the history
  • Loading branch information
mbondyra authored Apr 2, 2020
1 parent ee3f530 commit d0e7f98
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/plugins/home/public/application/components/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import {
EuiPageBody,
EuiScreenReaderOnly,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';

import { Welcome } from './welcome';
import { getServices } from '../kibana_services';
Expand Down Expand Up @@ -69,6 +70,9 @@ export class Home extends Component {
componentDidMount() {
this._isMounted = true;
this.fetchIsNewKibanaInstance();

const homeTitle = i18n.translate('home.breadcrumbs.homeTitle', { defaultMessage: 'Home' });
getServices().chrome.setBreadcrumbs([{ text: homeTitle }]);
}

fetchIsNewKibanaInstance = async () => {
Expand Down
3 changes: 3 additions & 0 deletions src/plugins/home/public/application/components/home.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ jest.mock('../kibana_services', () => ({
getBasePath: () => 'path',
tutorialVariables: () => ({}),
homeConfig: { disableWelcomeScreen: false },
chrome: {
setBreadcrumbs: () => {},
},
}),
}));

Expand Down

0 comments on commit d0e7f98

Please sign in to comment.