mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-07-25 18:30:00 +00:00
fix: add lineage breadcrumbs (#12578)
This commit is contained in:
parent
c86bda9d94
commit
83a1920e81
@ -16,6 +16,7 @@ import { EntityLineageNodeType } from 'enums/entity.enum';
|
|||||||
import { get } from 'lodash';
|
import { get } from 'lodash';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { getBreadcrumbsFromFqn } from 'utils/EntityUtils';
|
||||||
import { EntityReference } from '../../generated/type/entityReference';
|
import { EntityReference } from '../../generated/type/entityReference';
|
||||||
import { getEntityIcon } from '../../utils/TableUtils';
|
import { getEntityIcon } from '../../utils/TableUtils';
|
||||||
import './lineage-node-label.less';
|
import './lineage-node-label.less';
|
||||||
@ -65,10 +66,29 @@ const EntityLabel = ({ node }: Pick<LineageNodeLabelProps, 'node'>) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const LineageNodeLabelV1 = ({ node }: { node: EntityReference }) => {
|
const LineageNodeLabelV1 = ({ node }: { node: EntityReference }) => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const breadcrumbs = getBreadcrumbsFromFqn(node.fullyQualifiedName ?? '');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="d-flex w-72">
|
<div className="w-72">
|
||||||
<div className="flex items-center m-0 p-md">
|
<div className="m-0 p-x-md p-y-xs">
|
||||||
<EntityLabel node={node} />
|
<Space wrap align="start" className="m-b-xs w-full" size={4}>
|
||||||
|
{breadcrumbs.map((breadcrumb, index) => (
|
||||||
|
<React.Fragment key={index}>
|
||||||
|
<Typography.Text className="text-grey-muted">
|
||||||
|
{breadcrumb.name}
|
||||||
|
</Typography.Text>
|
||||||
|
{index !== breadcrumbs.length - 1 && (
|
||||||
|
<Typography.Text className="text-xss">
|
||||||
|
{t('label.slash-symbol')}
|
||||||
|
</Typography.Text>
|
||||||
|
)}
|
||||||
|
</React.Fragment>
|
||||||
|
))}
|
||||||
|
</Space>
|
||||||
|
<div className="flex items-center">
|
||||||
|
<EntityLabel node={node} />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -125,6 +125,7 @@
|
|||||||
|
|
||||||
.react-flow .lineage-node-handle {
|
.react-flow .lineage-node-handle {
|
||||||
width: 20px;
|
width: 20px;
|
||||||
|
min-width: 20px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
border-color: @lineage-border;
|
border-color: @lineage-border;
|
||||||
|
@ -1251,6 +1251,20 @@ export const getEntityBreadcrumbs = (
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getBreadcrumbsFromFqn = (fqn: string, includeCurrent = false) => {
|
||||||
|
const fqnList = Fqn.split(fqn);
|
||||||
|
if (!includeCurrent) {
|
||||||
|
fqnList.pop();
|
||||||
|
}
|
||||||
|
|
||||||
|
return [
|
||||||
|
...fqnList.map((fqn) => ({
|
||||||
|
name: fqn,
|
||||||
|
url: '',
|
||||||
|
})),
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
export const getEntityThreadLink = (
|
export const getEntityThreadLink = (
|
||||||
entityFieldThreadCount: EntityFieldThreadCount[]
|
entityFieldThreadCount: EntityFieldThreadCount[]
|
||||||
) => {
|
) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user