[Infra UI] Remove infrastructure breadcrumb from logs page (#29954)

This removes the Infrastructure breadcrumb prefix from the Logs page.

fixes #29472
This commit is contained in:
Felix Stürmer 2019-02-05 12:03:24 +01:00 committed by GitHub
parent 403348b388
commit 07add3b9b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 18 deletions

View file

@ -6,7 +6,6 @@
import React from 'react';
import { InjectedIntl, injectI18n } from '@kbn/i18n/react';
import { Breadcrumb } from 'ui/chrome/api/breadcrumbs';
import { WithKibanaChrome } from '../../containers/with_kibana_chrome';
import { ExternalHeader } from './external_header';
@ -15,30 +14,18 @@ import { LegacyHeader } from './legacy_header';
interface HeaderProps {
breadcrumbs?: Breadcrumb[];
appendSections?: React.ReactNode;
intl: InjectedIntl;
}
export const Header = injectI18n(({ appendSections, breadcrumbs = [], intl }: HeaderProps) => {
const prefixedBreadcrumbs = [
{
href: '#/',
text: intl.formatMessage({
id: 'xpack.infra.header.infrastructureTitle',
defaultMessage: 'Infrastructure',
}),
},
...(breadcrumbs || []),
];
export const Header = ({ appendSections, breadcrumbs = [] }: HeaderProps) => {
return (
<WithKibanaChrome>
{({ setBreadcrumbs, uiSettings: { k7Design } }) =>
k7Design ? (
<ExternalHeader breadcrumbs={prefixedBreadcrumbs} setBreadcrumbs={setBreadcrumbs} />
<ExternalHeader breadcrumbs={breadcrumbs} setBreadcrumbs={setBreadcrumbs} />
) : (
<LegacyHeader appendSections={appendSections} breadcrumbs={prefixedBreadcrumbs} />
<LegacyHeader appendSections={appendSections} breadcrumbs={breadcrumbs} />
)
}
</WithKibanaChrome>
);
});
};

View file

@ -41,6 +41,15 @@ export const HomePage = injectI18n(
appendSections={
<InfraHeaderFeedbackLink url="https://discuss.elastic.co/c/infrastructure" />
}
breadcrumbs={[
{
href: '#/',
text: intl.formatMessage({
id: 'xpack.infra.header.infrastructureTitle',
defaultMessage: 'Infrastructure',
}),
},
]}
/>
<SourceConfigurationFlyout />
<WithSource>

View file

@ -101,7 +101,16 @@ export const MetricDetail = withTheme(
nodeId={nodeId}
>
{({ name, filteredLayouts, loading: metadataLoading }) => {
const breadcrumbs = [{ text: name }];
const breadcrumbs = [
{
href: '#/',
text: intl.formatMessage({
id: 'xpack.infra.header.infrastructureTitle',
defaultMessage: 'Infrastructure',
}),
},
{ text: name },
];
return (
<ColumnarPage>
<Header