From d0e7f98f97b359a652949ea80c886f0bd843d11d Mon Sep 17 00:00:00 2001 From: Marta Bondyra Date: Thu, 2 Apr 2020 11:15:49 +0200 Subject: [PATCH] [HomeApp] Set breadcrumbs when coming back from add data dir (#62186) --- src/plugins/home/public/application/components/home.js | 4 ++++ src/plugins/home/public/application/components/home.test.js | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/plugins/home/public/application/components/home.js b/src/plugins/home/public/application/components/home.js index 6d00b1c6a5d14..77cde6a574aec 100644 --- a/src/plugins/home/public/application/components/home.js +++ b/src/plugins/home/public/application/components/home.js @@ -36,6 +36,7 @@ import { EuiPageBody, EuiScreenReaderOnly, } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; import { Welcome } from './welcome'; import { getServices } from '../kibana_services'; @@ -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 () => { diff --git a/src/plugins/home/public/application/components/home.test.js b/src/plugins/home/public/application/components/home.test.js index ca8297800b53e..99722df18e069 100644 --- a/src/plugins/home/public/application/components/home.test.js +++ b/src/plugins/home/public/application/components/home.test.js @@ -29,6 +29,9 @@ jest.mock('../kibana_services', () => ({ getBasePath: () => 'path', tutorialVariables: () => ({}), homeConfig: { disableWelcomeScreen: false }, + chrome: { + setBreadcrumbs: () => {}, + }, }), }));