2021-07-21 02:42:21 +08:00
|
|
|
import * as React from 'react';
|
|
|
|
|
import { DotChartOutlined } from '@ant-design/icons';
|
|
|
|
|
import { MlFeatureTable, EntityType, SearchResult } from '../../../types.generated';
|
|
|
|
|
import { Preview } from './preview/Preview';
|
|
|
|
|
import { MLFeatureTableProfile } from './profile/MLFeatureTableProfile';
|
|
|
|
|
import { Entity, IconStyleType, PreviewType } from '../Entity';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Definition of the DataHub MLFeatureTable entity.
|
|
|
|
|
*/
|
|
|
|
|
export class MLFeatureTableEntity implements Entity<MlFeatureTable> {
|
|
|
|
|
type: EntityType = EntityType.MlfeatureTable;
|
|
|
|
|
|
|
|
|
|
icon = (fontSize: number, styleType: IconStyleType) => {
|
|
|
|
|
if (styleType === IconStyleType.TAB_VIEW) {
|
|
|
|
|
return <DotChartOutlined style={{ fontSize }} />;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (styleType === IconStyleType.HIGHLIGHT) {
|
|
|
|
|
return <DotChartOutlined style={{ fontSize, color: '#9633b9' }} />;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<DotChartOutlined
|
|
|
|
|
style={{
|
|
|
|
|
fontSize,
|
|
|
|
|
color: '#BFBFBF',
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
isSearchEnabled = () => true;
|
|
|
|
|
|
|
|
|
|
isBrowseEnabled = () => true;
|
|
|
|
|
|
|
|
|
|
isLineageEnabled = () => true;
|
|
|
|
|
|
|
|
|
|
getAutoCompleteFieldName = () => 'name';
|
|
|
|
|
|
|
|
|
|
getPathName = () => 'featureTables';
|
|
|
|
|
|
|
|
|
|
getCollectionName = () => 'Feature tables';
|
|
|
|
|
|
|
|
|
|
renderProfile = (urn: string) => <MLFeatureTableProfile urn={urn} />;
|
|
|
|
|
|
|
|
|
|
renderPreview = (_: PreviewType, data: MlFeatureTable) => {
|
|
|
|
|
return (
|
|
|
|
|
<Preview
|
|
|
|
|
urn={data.urn}
|
|
|
|
|
name={data.name || ''}
|
|
|
|
|
description={data.description}
|
|
|
|
|
owners={data.ownership?.owners}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
renderSearch = (result: SearchResult) => {
|
|
|
|
|
const data = result.entity as MlFeatureTable;
|
|
|
|
|
return (
|
|
|
|
|
<Preview
|
|
|
|
|
urn={data.urn}
|
|
|
|
|
name={data.name || ''}
|
|
|
|
|
description={data.description || ''}
|
|
|
|
|
owners={data.ownership?.owners}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
};
|
2021-07-28 20:39:05 -07:00
|
|
|
|
|
|
|
|
getLineageVizConfig = (entity: MlFeatureTable) => {
|
|
|
|
|
return {
|
|
|
|
|
urn: entity.urn,
|
|
|
|
|
name: entity.name,
|
|
|
|
|
type: EntityType.MlfeatureTable,
|
|
|
|
|
upstreamChildren: [],
|
|
|
|
|
downstreamChildren: [],
|
|
|
|
|
icon: entity.platform.info?.logoUrl || undefined,
|
|
|
|
|
platform: entity.platform.name,
|
|
|
|
|
};
|
|
|
|
|
};
|
2021-09-02 19:05:13 -07:00
|
|
|
|
|
|
|
|
displayName = (data: MlFeatureTable) => {
|
|
|
|
|
return data.name;
|
|
|
|
|
};
|
2021-07-21 02:42:21 +08:00
|
|
|
}
|