From 241cba9383f1b9b90c83cbf84fb6ac8831b144d1 Mon Sep 17 00:00:00 2001 From: John Joyce Date: Sun, 25 Sep 2022 17:15:22 -0700 Subject: [PATCH] Adding data platform entity def --- .../dataPlatform/DataPlatformEntity.tsx | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 datahub-web-react/src/app/entity/dataPlatform/DataPlatformEntity.tsx diff --git a/datahub-web-react/src/app/entity/dataPlatform/DataPlatformEntity.tsx b/datahub-web-react/src/app/entity/dataPlatform/DataPlatformEntity.tsx new file mode 100644 index 00000000000000..9d5d15946b3fa1 --- /dev/null +++ b/datahub-web-react/src/app/entity/dataPlatform/DataPlatformEntity.tsx @@ -0,0 +1,71 @@ +import * as React from 'react'; +import { DatabaseOutlined } from '@ant-design/icons'; +import { DataPlatform, EntityType, SearchResult } from '../../../types.generated'; +import { Entity, IconStyleType, PreviewType } from '../Entity'; +import { GenericEntityProperties } from '../shared/types'; + +const getDisplayName = (data?: DataPlatform): string => { + return data?.properties?.displayName || data?.name || ''; +}; + +/** + * Definition of the DataHub DataJob entity. + */ +export class DataPlatformEntity implements Entity { + type: EntityType = EntityType.DataPlatform; + + icon = (fontSize: number, _: IconStyleType) => { + return ( + + ); + }; + + isSearchEnabled = () => false; + + isBrowseEnabled = () => false; + + isLineageEnabled = () => false; + + // Currently unused. + getAutoCompleteFieldName = () => 'name'; + + // Currently unused. + getPathName = () => 'platform'; + + // Currently unused. + getEntityName = () => 'Data Platform'; + + // Currently unused. + getCollectionName = () => 'Data Platforms'; + + // Currently unused. + renderProfile = (_: string) => <>; + + // Currently unused. + renderPreview = (_: PreviewType, _1: DataPlatform) => <>; + + // Currently unused. + renderSearch = (_: SearchResult) => <>; + + displayName = (data: DataPlatform) => { + return getDisplayName(data); + }; + + getGenericEntityProperties = (data: DataPlatform) => { + return { + ...data, + entityType: this.type, + name: getDisplayName(data), + platform: data, + } as GenericEntityProperties; + }; + + supportedCapabilities = () => { + return new Set([]); + }; +}