Skip to content

Commit

Permalink
[Infra UI] Remove infrastructure breadcrumb from logs page (elastic#2…
Browse files Browse the repository at this point in the history
…9954)

This removes the Infrastructure breadcrumb prefix from the Logs page.

fixes elastic#29472
  • Loading branch information
weltenwort authored Feb 5, 2019
1 parent 403348b commit 07add3b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 18 deletions.
21 changes: 4 additions & 17 deletions x-pack/plugins/infra/public/components/header/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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>
);
});
};
9 changes: 9 additions & 0 deletions x-pack/plugins/infra/public/pages/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
11 changes: 10 additions & 1 deletion x-pack/plugins/infra/public/pages/metrics/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 07add3b

Please sign in to comment.