Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui): Adding placeholder entity for DataPlatform #6045

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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([]);
};
}