mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-26 01:18:20 +00:00
fix(ui) Fix broken dataPlatformInstance references in browseV2 (#8485)
This commit is contained in:
parent
2495b50f8c
commit
4f961dab2a
@ -34,6 +34,7 @@ import { ContainerEntity } from './app/entity/container/ContainerEntity';
|
||||
import GlossaryNodeEntity from './app/entity/glossaryNode/GlossaryNodeEntity';
|
||||
import { DataPlatformEntity } from './app/entity/dataPlatform/DataPlatformEntity';
|
||||
import { DataProductEntity } from './app/entity/dataProduct/DataProductEntity';
|
||||
import { DataPlatformInstanceEntity } from './app/entity/dataPlatformInstance/DataPlatformInstanceEntity';
|
||||
|
||||
/*
|
||||
Construct Apollo Client
|
||||
@ -116,6 +117,7 @@ const App: React.VFC = () => {
|
||||
register.register(new GlossaryNodeEntity());
|
||||
register.register(new DataPlatformEntity());
|
||||
register.register(new DataProductEntity());
|
||||
register.register(new DataPlatformInstanceEntity());
|
||||
return register;
|
||||
}, []);
|
||||
|
||||
|
||||
@ -0,0 +1,61 @@
|
||||
import * as React from 'react';
|
||||
import { DataPlatformInstance, EntityType } from '../../../types.generated';
|
||||
import { Entity } from '../Entity';
|
||||
import { GenericEntityProperties } from '../shared/types';
|
||||
import { getDataForEntityType } from '../shared/containers/profile/utils';
|
||||
|
||||
/**
|
||||
* Definition of the DataHub DataPlatformInstance entity.
|
||||
* Most of this still needs to be filled out.
|
||||
*/
|
||||
export class DataPlatformInstanceEntity implements Entity<DataPlatformInstance> {
|
||||
type: EntityType = EntityType.DataPlatformInstance;
|
||||
|
||||
icon = () => {
|
||||
return <></>;
|
||||
};
|
||||
|
||||
isSearchEnabled = () => false;
|
||||
|
||||
isBrowseEnabled = () => false;
|
||||
|
||||
isLineageEnabled = () => false;
|
||||
|
||||
getAutoCompleteFieldName = () => 'name';
|
||||
|
||||
getPathName = () => 'dataPlatformInstance';
|
||||
|
||||
getEntityName = () => 'Data Platform Instance';
|
||||
|
||||
getCollectionName = () => 'Data Platform Instances';
|
||||
|
||||
renderProfile = () => <></>;
|
||||
|
||||
getOverridePropertiesFromEntity = (): GenericEntityProperties => {
|
||||
return {};
|
||||
};
|
||||
|
||||
renderPreview = () => {
|
||||
return <></>;
|
||||
};
|
||||
|
||||
renderSearch = () => {
|
||||
return <></>;
|
||||
};
|
||||
|
||||
displayName = (data: DataPlatformInstance) => {
|
||||
return data?.instanceId || data.urn;
|
||||
};
|
||||
|
||||
getGenericEntityProperties = (data: DataPlatformInstance) => {
|
||||
return getDataForEntityType({
|
||||
data,
|
||||
entityType: this.type,
|
||||
getOverrideProperties: this.getOverridePropertiesFromEntity,
|
||||
});
|
||||
};
|
||||
|
||||
supportedCapabilities = () => {
|
||||
return new Set([]);
|
||||
};
|
||||
}
|
||||
@ -21,6 +21,7 @@ import {
|
||||
} from './BrowseContext';
|
||||
import useSidebarAnalytics from './useSidebarAnalytics';
|
||||
import EntityLink from './EntityLink';
|
||||
import { EntityType } from '../../../types.generated';
|
||||
|
||||
const FolderStyled = styled(FolderOutlined)`
|
||||
font-size: 16px;
|
||||
@ -42,7 +43,7 @@ const BrowseNode = () => {
|
||||
const platformAggregation = usePlatformAggregation();
|
||||
const browseResultGroup = useBrowseResultGroup();
|
||||
const { count, entity } = browseResultGroup;
|
||||
const hasEntityLink = !!entity;
|
||||
const hasEntityLink = !!entity && entity.type !== EntityType.DataPlatformInstance;
|
||||
const displayName = useBrowseDisplayName();
|
||||
const { trackSelectNodeEvent, trackToggleNodeEvent } = useSidebarAnalytics();
|
||||
|
||||
|
||||
@ -1112,4 +1112,7 @@ fragment entityDisplayNameFields on Entity {
|
||||
name
|
||||
}
|
||||
}
|
||||
... on DataPlatformInstance {
|
||||
instanceId
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user