Skip to content

Commit

Permalink
Adding data platform entity def
Browse files Browse the repository at this point in the history
  • Loading branch information
jjoyce0510 committed Sep 26, 2022
1 parent de21818 commit 241cba9
Showing 1 changed file with 71 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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<DataPlatform> {
type: EntityType = EntityType.DataPlatform;

icon = (fontSize: number, _: IconStyleType) => {
return (
<DatabaseOutlined
style={{
fontSize,
color: '#BFBFBF',
}}
/>
);
};

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([]);
};
}

0 comments on commit 241cba9

Please sign in to comment.