Skip to content

Commit

Permalink
feat(ui): Adding placeholder entity for DataPlatform (#6045)
Browse files Browse the repository at this point in the history
  • Loading branch information
jjoyce0510 authored Sep 26, 2022
1 parent 611c053 commit ec5aeef
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
2 changes: 2 additions & 0 deletions datahub-web-react/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { MLModelGroupEntity } from './app/entity/mlModelGroup/MLModelGroupEntity
import { DomainEntity } from './app/entity/domain/DomainEntity';
import { ContainerEntity } from './app/entity/container/ContainerEntity';
import GlossaryNodeEntity from './app/entity/glossaryNode/GlossaryNodeEntity';
import { DataPlatformEntity } from './app/entity/dataPlatform/DataPlatformEntity';

/*
Construct Apollo Client
Expand Down Expand Up @@ -99,6 +100,7 @@ const App: React.VFC = () => {
register.register(new DomainEntity());
register.register(new ContainerEntity());
register.register(new GlossaryNodeEntity());
register.register(new DataPlatformEntity());
return register;
}, []);

Expand Down
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 ec5aeef

Please sign in to comment.