[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:
parent
403348b388
commit
07add3b9b6
|
@ -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>
|
||||
);
|
||||
});
|
||||
};
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue