-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): Adding placeholder entity for DataPlatform (#6045)
- Loading branch information
1 parent
611c053
commit ec5aeef
Showing
2 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
datahub-web-react/src/app/entity/dataPlatform/DataPlatformEntity.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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([]); | ||
}; | ||
} |