Fixing lineage (#3309)

This commit is contained in:
John Joyce 2021-09-29 10:48:19 -07:00 committed by GitHub
parent c742cbd62d
commit fb1ecca650
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,6 +8,7 @@ import {
import { Dashboard, EntityType, PlatformType, SearchResult } from '../../../types.generated';
import { Direction } from '../../lineage/types';
import { getLogoFromPlatform } from '../../shared/getLogoFromPlatform';
import getChildren from '../../lineage/utils/getChildren';
import { Entity, IconStyleType, PreviewType } from '../Entity';
import { EntityProfile } from '../shared/containers/profile/EntityProfile';
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 { 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.
*/
@ -162,8 +151,12 @@ export class DashboardEntity implements Entity<Dashboard> {
urn: entity.urn,
name: entity.info?.name || '',
type: EntityType.Dashboard,
upstreamChildren: getChildren(entity, Direction.Upstream),
downstreamChildren: getChildren(entity, Direction.Downstream),
upstreamChildren: getChildren({ entity, type: EntityType.Dashboard }, Direction.Upstream).map(
(child) => child.entity.urn,
),
downstreamChildren: getChildren({ entity, type: EntityType.Dashboard }, Direction.Downstream).map(
(child) => child.entity.urn,
),
icon: getLogoFromPlatform(entity.tool),
platform: entity.tool,
};