Skip to content

Commit

Permalink
[Page Header]consume new breadcrumb components from oui (#7843)
Browse files Browse the repository at this point in the history
(cherry picked from commit 4ff6c6b)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Aug 29, 2024
1 parent 3c5a506 commit 2004dae
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 60 deletions.
27 changes: 16 additions & 11 deletions src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 0 additions & 35 deletions src/core/public/chrome/ui/header/header_breadcrumbs.scss

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ describe('HeaderBreadcrumbs', () => {
/>
);
expect(wrapper.find('.euiBreadcrumb')).toMatchSnapshot();
expect(wrapper.find('.headerBreadcrumbs').exists()).toBeTruthy();
expect(wrapper.find('[data-test-subj="breadcrumb first"]').exists()).toBeFalsy();

act(() => breadcrumbs$.next([{ text: 'First' }, { text: 'Second' }]));
Expand Down
4 changes: 1 addition & 3 deletions src/core/public/chrome/ui/header/header_breadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import React, { useEffect, useState } from 'react';
import useObservable from 'react-use/lib/useObservable';
import { Observable } from 'rxjs';
import { ChromeBreadcrumb, ChromeBreadcrumbEnricher } from '../../chrome_service';
import './header_breadcrumbs.scss';

interface Props {
appTitle$: Observable<string>;
Expand Down Expand Up @@ -85,14 +84,13 @@ export function HeaderBreadcrumbs({
}));

const remainingCrumbs = useUpdatedHeader ? crumbs.slice(0, -1) : crumbs;
const className = useUpdatedHeader ? 'headerBreadcrumbs' : '';

return (
<EuiHeaderBreadcrumbs
breadcrumbs={renderFullLength ? crumbs : remainingCrumbs}
max={10}
data-test-subj="breadcrumbs"
className={className}
simplify={!!useUpdatedHeader}
/>
);
}

0 comments on commit 2004dae

Please sign in to comment.