mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-20 23:28:01 +00:00
Fixing lineage (#3309)
This commit is contained in:
parent
c742cbd62d
commit
fb1ecca650
@ -8,6 +8,7 @@ import {
|
|||||||
import { Dashboard, EntityType, PlatformType, SearchResult } from '../../../types.generated';
|
import { Dashboard, EntityType, PlatformType, SearchResult } from '../../../types.generated';
|
||||||
import { Direction } from '../../lineage/types';
|
import { Direction } from '../../lineage/types';
|
||||||
import { getLogoFromPlatform } from '../../shared/getLogoFromPlatform';
|
import { getLogoFromPlatform } from '../../shared/getLogoFromPlatform';
|
||||||
|
import getChildren from '../../lineage/utils/getChildren';
|
||||||
import { Entity, IconStyleType, PreviewType } from '../Entity';
|
import { Entity, IconStyleType, PreviewType } from '../Entity';
|
||||||
import { EntityProfile } from '../shared/containers/profile/EntityProfile';
|
import { EntityProfile } from '../shared/containers/profile/EntityProfile';
|
||||||
import { SidebarOwnerSection } from '../shared/containers/profile/sidebar/Ownership/SidebarOwnerSection';
|
import { SidebarOwnerSection } from '../shared/containers/profile/sidebar/Ownership/SidebarOwnerSection';
|
||||||
@ -19,18 +20,6 @@ import { PropertiesTab } from '../shared/tabs/Properties/PropertiesTab';
|
|||||||
import { GenericEntityProperties } from '../shared/types';
|
import { GenericEntityProperties } from '../shared/types';
|
||||||
import { DashboardPreview } from './preview/DashboardPreview';
|
import { DashboardPreview } from './preview/DashboardPreview';
|
||||||
|
|
||||||
export default function getChildren(entity: Dashboard, direction: Direction | null): Array<string> {
|
|
||||||
if (direction === Direction.Upstream) {
|
|
||||||
return entity.info?.charts.map((chart) => chart.urn) || [];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (direction === Direction.Downstream) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Definition of the DataHub Dashboard entity.
|
* Definition of the DataHub Dashboard entity.
|
||||||
*/
|
*/
|
||||||
@ -162,8 +151,12 @@ export class DashboardEntity implements Entity<Dashboard> {
|
|||||||
urn: entity.urn,
|
urn: entity.urn,
|
||||||
name: entity.info?.name || '',
|
name: entity.info?.name || '',
|
||||||
type: EntityType.Dashboard,
|
type: EntityType.Dashboard,
|
||||||
upstreamChildren: getChildren(entity, Direction.Upstream),
|
upstreamChildren: getChildren({ entity, type: EntityType.Dashboard }, Direction.Upstream).map(
|
||||||
downstreamChildren: getChildren(entity, Direction.Downstream),
|
(child) => child.entity.urn,
|
||||||
|
),
|
||||||
|
downstreamChildren: getChildren({ entity, type: EntityType.Dashboard }, Direction.Downstream).map(
|
||||||
|
(child) => child.entity.urn,
|
||||||
|
),
|
||||||
icon: getLogoFromPlatform(entity.tool),
|
icon: getLogoFromPlatform(entity.tool),
|
||||||
platform: entity.tool,
|
platform: entity.tool,
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user