mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-18 14:16:48 +00:00
feat(react): fix browse link of last breadcrumb linked to unknown page (#2391)
This commit is contained in:
parent
7c54004b93
commit
dfc99d6b6a
@ -22,7 +22,12 @@ export const BrowsableEntityPage = ({ urn: _urn, type: _type, children: _childre
|
|||||||
<SearchablePage>
|
<SearchablePage>
|
||||||
{data && data.browsePaths && data.browsePaths.length > 0 && (
|
{data && data.browsePaths && data.browsePaths.length > 0 && (
|
||||||
<Affix offsetTop={80}>
|
<Affix offsetTop={80}>
|
||||||
<BrowsePath type={_type} path={data.browsePaths[0].path} lineageSupported={lineageSupported} />
|
<BrowsePath
|
||||||
|
type={_type}
|
||||||
|
path={data.browsePaths[0].path}
|
||||||
|
lineageSupported={lineageSupported}
|
||||||
|
isProfilePage
|
||||||
|
/>
|
||||||
</Affix>
|
</Affix>
|
||||||
)}
|
)}
|
||||||
{_children}
|
{_children}
|
||||||
|
@ -16,6 +16,7 @@ interface Props {
|
|||||||
type: EntityType;
|
type: EntityType;
|
||||||
path: Array<string>;
|
path: Array<string>;
|
||||||
lineageSupported?: boolean;
|
lineageSupported?: boolean;
|
||||||
|
isProfilePage?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const LineageIconGroup = styled.div`
|
const LineageIconGroup = styled.div`
|
||||||
@ -56,7 +57,7 @@ const BrowseRow = styled(Row)`
|
|||||||
/**
|
/**
|
||||||
* Responsible for rendering a clickable browse path view.
|
* Responsible for rendering a clickable browse path view.
|
||||||
*/
|
*/
|
||||||
export const BrowsePath = ({ type, path, lineageSupported }: Props) => {
|
export const BrowsePath = ({ type, path, lineageSupported, isProfilePage }: Props) => {
|
||||||
const entityRegistry = useEntityRegistry();
|
const entityRegistry = useEntityRegistry();
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
@ -70,7 +71,15 @@ export const BrowsePath = ({ type, path, lineageSupported }: Props) => {
|
|||||||
|
|
||||||
const pathCrumbs = path.map((part, index) => (
|
const pathCrumbs = path.map((part, index) => (
|
||||||
<Breadcrumb.Item key={`${part || index}`}>
|
<Breadcrumb.Item key={`${part || index}`}>
|
||||||
<Link to={`${baseBrowsePath}/${createPartialPath(path.slice(0, index + 1))}`}>{part}</Link>
|
<Link
|
||||||
|
to={
|
||||||
|
isProfilePage && index === path.length - 1
|
||||||
|
? '#'
|
||||||
|
: `${baseBrowsePath}/${createPartialPath(path.slice(0, index + 1))}`
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{part}
|
||||||
|
</Link>
|
||||||
</Breadcrumb.Item>
|
</Breadcrumb.Item>
|
||||||
));
|
));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user