fix(ui) Fix broken dataPlatformInstance references in browseV2 (#8485)

This commit is contained in:
Chris Collins 2023-07-26 10:56:07 -04:00 committed by GitHub
parent 2495b50f8c
commit 4f961dab2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 68 additions and 1 deletions

View File

@ -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;
}, []);

View File

@ -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([]);
};
}

View File

@ -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();

View File

@ -1112,4 +1112,7 @@ fragment entityDisplayNameFields on Entity {
name
}
}
... on DataPlatformInstance {
instanceId
}
}