diff --git a/datahub-web-react/src/app/entity/Access/RoleEntity.tsx b/datahub-web-react/src/app/entity/Access/RoleEntity.tsx index ab609b04f104ac..58a1ba8dd793b8 100644 --- a/datahub-web-react/src/app/entity/Access/RoleEntity.tsx +++ b/datahub-web-react/src/app/entity/Access/RoleEntity.tsx @@ -88,4 +88,8 @@ export class RoleEntity implements Entity { supportedCapabilities = () => { return new Set([EntityCapabilityType.OWNERS]); }; + + getGraphName = () => { + return 'roleEntity'; + }; } diff --git a/datahub-web-react/src/app/entity/Entity.tsx b/datahub-web-react/src/app/entity/Entity.tsx index 490f23330c5945..c56c97454a1d57 100644 --- a/datahub-web-react/src/app/entity/Entity.tsx +++ b/datahub-web-react/src/app/entity/Entity.tsx @@ -172,6 +172,11 @@ export interface Entity { */ getGenericEntityProperties: (data: T) => GenericEntityProperties | null; + /** + * Returns the graph name of the entity, as it appears in the GMS entity registry + */ + getGraphName: () => string; + /** * Returns the supported features for the entity */ diff --git a/datahub-web-react/src/app/entity/EntityRegistry.tsx b/datahub-web-react/src/app/entity/EntityRegistry.tsx index 00e7385ff5784b..0f65390f959df2 100644 --- a/datahub-web-react/src/app/entity/EntityRegistry.tsx +++ b/datahub-web-react/src/app/entity/EntityRegistry.tsx @@ -241,4 +241,8 @@ export default class EntityRegistry { const entity = validatedGet(type, this.entityTypeToEntity); return entity.getCustomCardUrlPath?.(); } + + getGraphNameFromType(type: EntityType): string { + return validatedGet(type, this.entityTypeToEntity).getGraphName(); + } } diff --git a/datahub-web-react/src/app/entity/businessAttribute/BusinessAttributeEntity.tsx b/datahub-web-react/src/app/entity/businessAttribute/BusinessAttributeEntity.tsx index b827a3c37d6a5c..442aaf735575ab 100644 --- a/datahub-web-react/src/app/entity/businessAttribute/BusinessAttributeEntity.tsx +++ b/datahub-web-react/src/app/entity/businessAttribute/BusinessAttributeEntity.tsx @@ -59,6 +59,8 @@ export class BusinessAttributeEntity implements Entity { getCollectionName = () => 'Business Attributes'; + getGraphName = () => 'businessAttribute'; + getCustomCardUrlPath = () => PageRoutes.BUSINESS_ATTRIBUTE; isBrowseEnabled = () => false; diff --git a/datahub-web-react/src/app/entity/chart/ChartEntity.tsx b/datahub-web-react/src/app/entity/chart/ChartEntity.tsx index 913d502972fe14..8a62a9018661e1 100644 --- a/datahub-web-react/src/app/entity/chart/ChartEntity.tsx +++ b/datahub-web-react/src/app/entity/chart/ChartEntity.tsx @@ -69,6 +69,8 @@ export class ChartEntity implements Entity { getAutoCompleteFieldName = () => 'title'; + getGraphName = () => 'chart'; + getPathName = () => 'chart'; getEntityName = () => 'Chart'; diff --git a/datahub-web-react/src/app/entity/container/ContainerEntity.tsx b/datahub-web-react/src/app/entity/container/ContainerEntity.tsx index 89f9122c6287f8..941e7fc3f552da 100644 --- a/datahub-web-react/src/app/entity/container/ContainerEntity.tsx +++ b/datahub-web-react/src/app/entity/container/ContainerEntity.tsx @@ -59,6 +59,8 @@ export class ContainerEntity implements Entity { getAutoCompleteFieldName = () => 'name'; + getGraphName = () => 'container'; + getPathName = () => 'container'; getEntityName = () => 'Container'; diff --git a/datahub-web-react/src/app/entity/dashboard/DashboardEntity.tsx b/datahub-web-react/src/app/entity/dashboard/DashboardEntity.tsx index 9564cbc18198e4..95d4431d591790 100644 --- a/datahub-web-react/src/app/entity/dashboard/DashboardEntity.tsx +++ b/datahub-web-react/src/app/entity/dashboard/DashboardEntity.tsx @@ -291,6 +291,8 @@ export class DashboardEntity implements Entity { ]); }; + getGraphName = () => this.getPathName(); + renderEmbeddedProfile = (urn: string) => ( { getAutoCompleteFieldName = () => 'name'; + getGraphName = () => 'dataFlow'; + getPathName = () => 'pipelines'; getEntityName = () => 'Pipeline'; diff --git a/datahub-web-react/src/app/entity/dataJob/DataJobEntity.tsx b/datahub-web-react/src/app/entity/dataJob/DataJobEntity.tsx index fe1a906371e9d0..6bf95482269190 100644 --- a/datahub-web-react/src/app/entity/dataJob/DataJobEntity.tsx +++ b/datahub-web-react/src/app/entity/dataJob/DataJobEntity.tsx @@ -64,6 +64,8 @@ export class DataJobEntity implements Entity { getAutoCompleteFieldName = () => 'name'; + getGraphName = () => 'dataJob'; + getPathName = () => 'tasks'; getEntityName = () => 'Task'; diff --git a/datahub-web-react/src/app/entity/dataPlatform/DataPlatformEntity.tsx b/datahub-web-react/src/app/entity/dataPlatform/DataPlatformEntity.tsx index 6687ec9f914c1b..89cbaf3cbeaa12 100644 --- a/datahub-web-react/src/app/entity/dataPlatform/DataPlatformEntity.tsx +++ b/datahub-web-react/src/app/entity/dataPlatform/DataPlatformEntity.tsx @@ -71,4 +71,8 @@ export class DataPlatformEntity implements Entity { supportedCapabilities = () => { return new Set([]); }; + + getGraphName = () => { + return 'dataPlatform'; + }; } diff --git a/datahub-web-react/src/app/entity/dataPlatformInstance/DataPlatformInstanceEntity.tsx b/datahub-web-react/src/app/entity/dataPlatformInstance/DataPlatformInstanceEntity.tsx index a542e1b52f510d..d0db687ffed929 100644 --- a/datahub-web-react/src/app/entity/dataPlatformInstance/DataPlatformInstanceEntity.tsx +++ b/datahub-web-react/src/app/entity/dataPlatformInstance/DataPlatformInstanceEntity.tsx @@ -58,4 +58,8 @@ export class DataPlatformInstanceEntity implements Entity supportedCapabilities = () => { return new Set([]); }; + + getGraphName = () => { + return 'dataPlatformInstance'; + }; } diff --git a/datahub-web-react/src/app/entity/dataProduct/DataProductEntity.tsx b/datahub-web-react/src/app/entity/dataProduct/DataProductEntity.tsx index 6b31de84f85bb1..90c1127d9a5fcd 100644 --- a/datahub-web-react/src/app/entity/dataProduct/DataProductEntity.tsx +++ b/datahub-web-react/src/app/entity/dataProduct/DataProductEntity.tsx @@ -191,4 +191,8 @@ export class DataProductEntity implements Entity { EntityCapabilityType.DOMAINS, ]); }; + + getGraphName = () => { + return 'dataProduct'; + }; } diff --git a/datahub-web-react/src/app/entity/dataset/DatasetEntity.tsx b/datahub-web-react/src/app/entity/dataset/DatasetEntity.tsx index 21ae085832cb3f..07ab27a38f8893 100644 --- a/datahub-web-react/src/app/entity/dataset/DatasetEntity.tsx +++ b/datahub-web-react/src/app/entity/dataset/DatasetEntity.tsx @@ -85,6 +85,8 @@ export class DatasetEntity implements Entity { getPathName = () => 'dataset'; + getGraphName = () => 'dataset'; + getEntityName = () => 'Dataset'; getCollectionName = () => 'Datasets'; diff --git a/datahub-web-react/src/app/entity/domain/DomainEntity.tsx b/datahub-web-react/src/app/entity/domain/DomainEntity.tsx index 2b67c88a6ff235..81d245c230843f 100644 --- a/datahub-web-react/src/app/entity/domain/DomainEntity.tsx +++ b/datahub-web-react/src/app/entity/domain/DomainEntity.tsx @@ -60,6 +60,8 @@ export class DomainEntity implements Entity { getAutoCompleteFieldName = () => 'name'; + getGraphName = () => 'domain'; + getPathName = () => 'domain'; getEntityName = () => 'Domain'; diff --git a/datahub-web-react/src/app/entity/ermodelrelationships/ERModelRelationshipEntity.tsx b/datahub-web-react/src/app/entity/ermodelrelationships/ERModelRelationshipEntity.tsx index aece3db1312afb..3eb950cb0e7ac5 100644 --- a/datahub-web-react/src/app/entity/ermodelrelationships/ERModelRelationshipEntity.tsx +++ b/datahub-web-react/src/app/entity/ermodelrelationships/ERModelRelationshipEntity.tsx @@ -58,6 +58,8 @@ export class ERModelRelationshipEntity implements Entity { getEntityName = () => 'ER-Model-Relationship'; + getGraphName = () => 'erModelRelationship'; + renderProfile = (urn: string) => ( { EntityCapabilityType.SOFT_DELETE, ]); }; + + getGraphName = () => this.getPathName(); } export default GlossaryNodeEntity; diff --git a/datahub-web-react/src/app/entity/glossaryTerm/GlossaryTermEntity.tsx b/datahub-web-react/src/app/entity/glossaryTerm/GlossaryTermEntity.tsx index 8bbc0a693b2231..73c5a8e12122d3 100644 --- a/datahub-web-react/src/app/entity/glossaryTerm/GlossaryTermEntity.tsx +++ b/datahub-web-react/src/app/entity/glossaryTerm/GlossaryTermEntity.tsx @@ -179,4 +179,6 @@ export class GlossaryTermEntity implements Entity { EntityCapabilityType.SOFT_DELETE, ]); }; + + getGraphName = () => this.getPathName(); } diff --git a/datahub-web-react/src/app/entity/group/Group.tsx b/datahub-web-react/src/app/entity/group/Group.tsx index cd9cf1ca6eec44..763db856f33ac6 100644 --- a/datahub-web-react/src/app/entity/group/Group.tsx +++ b/datahub-web-react/src/app/entity/group/Group.tsx @@ -40,6 +40,8 @@ export class GroupEntity implements Entity { getAutoCompleteFieldName = () => 'name'; + getGraphName: () => string = () => 'corpGroup'; + getPathName: () => string = () => 'group'; getEntityName = () => 'Group'; diff --git a/datahub-web-react/src/app/entity/mlFeature/MLFeatureEntity.tsx b/datahub-web-react/src/app/entity/mlFeature/MLFeatureEntity.tsx index 2f2786b1c0d960..eecffdb2f38430 100644 --- a/datahub-web-react/src/app/entity/mlFeature/MLFeatureEntity.tsx +++ b/datahub-web-react/src/app/entity/mlFeature/MLFeatureEntity.tsx @@ -52,6 +52,8 @@ export class MLFeatureEntity implements Entity { getAutoCompleteFieldName = () => 'name'; + getGraphName = () => 'mlFeature'; + getPathName = () => 'features'; getEntityName = () => 'Feature'; diff --git a/datahub-web-react/src/app/entity/mlFeatureTable/MLFeatureTableEntity.tsx b/datahub-web-react/src/app/entity/mlFeatureTable/MLFeatureTableEntity.tsx index 595c73fbc3cb67..8aa0c056b716fc 100644 --- a/datahub-web-react/src/app/entity/mlFeatureTable/MLFeatureTableEntity.tsx +++ b/datahub-web-react/src/app/entity/mlFeatureTable/MLFeatureTableEntity.tsx @@ -53,6 +53,8 @@ export class MLFeatureTableEntity implements Entity { getAutoCompleteFieldName = () => 'name'; + getGraphName = () => 'mlFeatureTable'; + getPathName = () => 'featureTables'; getEntityName = () => 'Feature Table'; diff --git a/datahub-web-react/src/app/entity/mlModel/MLModelEntity.tsx b/datahub-web-react/src/app/entity/mlModel/MLModelEntity.tsx index d4d0b37da9ec96..92f03aaef7a175 100644 --- a/datahub-web-react/src/app/entity/mlModel/MLModelEntity.tsx +++ b/datahub-web-react/src/app/entity/mlModel/MLModelEntity.tsx @@ -52,6 +52,8 @@ export class MLModelEntity implements Entity { getAutoCompleteFieldName = () => 'name'; + getGraphName = () => 'mlModel'; + getPathName = () => 'mlModels'; getEntityName = () => 'ML Model'; diff --git a/datahub-web-react/src/app/entity/mlModelGroup/MLModelGroupEntity.tsx b/datahub-web-react/src/app/entity/mlModelGroup/MLModelGroupEntity.tsx index 5896c1864cc435..b5d32275f97bfd 100644 --- a/datahub-web-react/src/app/entity/mlModelGroup/MLModelGroupEntity.tsx +++ b/datahub-web-react/src/app/entity/mlModelGroup/MLModelGroupEntity.tsx @@ -50,6 +50,8 @@ export class MLModelGroupEntity implements Entity { getAutoCompleteFieldName = () => 'name'; + getGraphName = () => 'mlModelGroup'; + getPathName = () => 'mlModelGroup'; getEntityName = () => 'ML Group'; diff --git a/datahub-web-react/src/app/entity/mlPrimaryKey/MLPrimaryKeyEntity.tsx b/datahub-web-react/src/app/entity/mlPrimaryKey/MLPrimaryKeyEntity.tsx index 60c7531a4f57cc..119a566b04f135 100644 --- a/datahub-web-react/src/app/entity/mlPrimaryKey/MLPrimaryKeyEntity.tsx +++ b/datahub-web-react/src/app/entity/mlPrimaryKey/MLPrimaryKeyEntity.tsx @@ -51,6 +51,8 @@ export class MLPrimaryKeyEntity implements Entity { getAutoCompleteFieldName = () => 'name'; + getGraphName = () => 'mlPrimaryKey'; + getPathName = () => 'mlPrimaryKeys'; getEntityName = () => 'ML Primary Key'; diff --git a/datahub-web-react/src/app/entity/schemaField/SchemaFieldPropertiesEntity.tsx b/datahub-web-react/src/app/entity/schemaField/SchemaFieldPropertiesEntity.tsx index 88743012ddbc8a..2c59c476195d0b 100644 --- a/datahub-web-react/src/app/entity/schemaField/SchemaFieldPropertiesEntity.tsx +++ b/datahub-web-react/src/app/entity/schemaField/SchemaFieldPropertiesEntity.tsx @@ -44,6 +44,8 @@ export class SchemaFieldPropertiesEntity implements Entity { // Currently unused. renderProfile = (_: string) => <>; + getGraphName = () => 'schemaField'; + renderPreview = (previewType: PreviewType, data: SchemaFieldEntity) => { const parent = data.parent as Dataset; return ( diff --git a/datahub-web-react/src/app/entity/shared/tabs/Properties/useStructuredProperties.tsx b/datahub-web-react/src/app/entity/shared/tabs/Properties/useStructuredProperties.tsx index 86365b8232905c..4635486c24d1d6 100644 --- a/datahub-web-react/src/app/entity/shared/tabs/Properties/useStructuredProperties.tsx +++ b/datahub-web-react/src/app/entity/shared/tabs/Properties/useStructuredProperties.tsx @@ -23,6 +23,25 @@ export function mapStructuredPropertyValues(structuredPropertiesEntry: Structure })); } +export function mapStructuredPropertyToPropertyRow(structuredPropertiesEntry: StructuredPropertiesEntry) { + const { displayName, qualifiedName } = structuredPropertiesEntry.structuredProperty.definition; + return { + displayName: displayName || qualifiedName, + qualifiedName, + values: mapStructuredPropertyValues(structuredPropertiesEntry), + dataType: structuredPropertiesEntry.structuredProperty.definition.valueType, + structuredProperty: structuredPropertiesEntry.structuredProperty, + type: + structuredPropertiesEntry.values[0] && structuredPropertiesEntry.values[0].__typename + ? { + type: typeNameToType[structuredPropertiesEntry.values[0].__typename].type, + nativeDataType: typeNameToType[structuredPropertiesEntry.values[0].__typename].nativeDataType, + } + : undefined, + associatedUrn: structuredPropertiesEntry.associatedUrn, + }; +} + // map the properties map into a list of PropertyRow objects to render in a table function getStructuredPropertyRows(entityData?: GenericEntityProperties | null) { const structuredPropertyRows: PropertyRow[] = []; diff --git a/datahub-web-react/src/app/entity/tag/Tag.tsx b/datahub-web-react/src/app/entity/tag/Tag.tsx index 6f0839e5f812be..d3c5b079660993 100644 --- a/datahub-web-react/src/app/entity/tag/Tag.tsx +++ b/datahub-web-react/src/app/entity/tag/Tag.tsx @@ -46,6 +46,8 @@ export class TagEntity implements Entity { getAutoCompleteFieldName = () => 'name'; + getGraphName = () => 'tag'; + getPathName: () => string = () => 'tag'; getCollectionName: () => string = () => 'Tags'; diff --git a/datahub-web-react/src/app/entity/user/User.tsx b/datahub-web-react/src/app/entity/user/User.tsx index ec1c5fbdc86980..058349f83eaecb 100644 --- a/datahub-web-react/src/app/entity/user/User.tsx +++ b/datahub-web-react/src/app/entity/user/User.tsx @@ -39,6 +39,8 @@ export class UserEntity implements Entity { getAutoCompleteFieldName = () => 'username'; + getGraphName: () => string = () => 'corpuser'; + getPathName: () => string = () => 'user'; getEntityName = () => 'Person'; diff --git a/datahub-web-react/src/app/govern/structuredProperties/AllowedValuesDrawer.tsx b/datahub-web-react/src/app/govern/structuredProperties/AllowedValuesDrawer.tsx index 5fb6faf17c7e3e..5399af79b1171c 100644 --- a/datahub-web-react/src/app/govern/structuredProperties/AllowedValuesDrawer.tsx +++ b/datahub-web-react/src/app/govern/structuredProperties/AllowedValuesDrawer.tsx @@ -1,5 +1,4 @@ -import { colors, Icon, Input, Text, TextArea } from '@src/alchemy-components'; -import { StyledButton } from '@src/app/shared/share/v2/styledComponents'; +import { Button, Icon, Input, Text, TextArea } from '@src/alchemy-components'; import { AllowedValue } from '@src/types.generated'; import { Form, FormInstance } from 'antd'; import { Tooltip } from '@components'; @@ -122,15 +121,15 @@ const AllowedValuesDrawer = ({ - { add(); setTimeout(() => scrollToBottom(), 0); }} - $color={colors.violet[500]} + color={'violet'} > Add - + diff --git a/datahub-web-react/src/app/govern/structuredProperties/DisplayPreferences.tsx b/datahub-web-react/src/app/govern/structuredProperties/DisplayPreferences.tsx index 70166747504853..260c91ef93207c 100644 --- a/datahub-web-react/src/app/govern/structuredProperties/DisplayPreferences.tsx +++ b/datahub-web-react/src/app/govern/structuredProperties/DisplayPreferences.tsx @@ -1,6 +1,6 @@ import { Icon, Pill, Switch, Text } from '@src/alchemy-components'; import { ConfirmationModal } from '@src/app/sharedV2/modals/ConfirmationModal'; -import { AllowedValue, StructuredPropertyEntity, StructuredPropertyFilterStatus } from '@src/types.generated'; +import { AllowedValue, StructuredPropertyEntity } from '@src/types.generated'; import { Collapse } from 'antd'; import React, { useState } from 'react'; import { useUpdateStructuredPropertyMutation } from '@src/graphql/structuredProperties.generated'; @@ -81,10 +81,7 @@ const DisplayPreferences = ({ handleDisplaySettingChange('showInSearchFilters', e.target.checked)} isDisabled={formValues?.settings?.isHidden} labelHoverText="If enabled, this property will appear in search filters" diff --git a/datahub-web-react/src/app/govern/structuredProperties/StructuredPropsDrawer.tsx b/datahub-web-react/src/app/govern/structuredProperties/StructuredPropsDrawer.tsx index e5ae41e11a6cc5..4b2bbaaf96826b 100644 --- a/datahub-web-react/src/app/govern/structuredProperties/StructuredPropsDrawer.tsx +++ b/datahub-web-react/src/app/govern/structuredProperties/StructuredPropsDrawer.tsx @@ -15,7 +15,6 @@ import { SearchResult, SearchResults, StructuredPropertyEntity, - StructuredPropertyFilterStatus, UpdateStructuredPropertyInput, } from '@src/types.generated'; import { Form } from 'antd'; @@ -126,11 +125,6 @@ const StructuredPropsDrawer = ({ allowedValues, }; - let filterStatus: StructuredPropertyFilterStatus | null = null; - if (updateValues.settings?.showInSearchFilters === false) { - filterStatus = StructuredPropertyFilterStatus.Disabled; - } - const editInput: UpdateStructuredPropertyInput = { urn: selectedProperty.entity.urn, displayName: updateValues.displayName, @@ -150,7 +144,6 @@ const StructuredPropsDrawer = ({ updateValues, ), setCardinalityAsMultiple: cardinality === PropertyCardinality.Multiple, - filterStatus: filterStatus ?? undefined, settings: { isHidden: updateValues.settings?.isHidden ?? false, showInSearchFilters: updateValues.settings?.showInSearchFilters ?? false, @@ -268,7 +261,6 @@ const StructuredPropsDrawer = ({ }, immutable: entity.definition.immutable, settings: entity.settings, - filterStatus: entity.definition.filterStatus, }; setFormValues(values); diff --git a/datahub-web-react/src/app/govern/structuredProperties/StructuredPropsTable.tsx b/datahub-web-react/src/app/govern/structuredProperties/StructuredPropsTable.tsx index 25ccf27450558c..10c42c0925eeac 100644 --- a/datahub-web-react/src/app/govern/structuredProperties/StructuredPropsTable.tsx +++ b/datahub-web-react/src/app/govern/structuredProperties/StructuredPropsTable.tsx @@ -27,6 +27,7 @@ import { Link } from 'react-router-dom'; import { removeFromPropertiesList } from './cacheUtils'; import EmptyStructuredProperties from './EmptyStructuredProperties'; import { + CardIcons, CreatedByContainer, DataContainer, IconContainer, @@ -234,7 +235,7 @@ const StructuredPropsTable = ({ return ( <> {createdByUser && ( - + { diff --git a/datahub-web-react/src/app/govern/structuredProperties/ViewStructuredPropsDrawer.tsx b/datahub-web-react/src/app/govern/structuredProperties/ViewStructuredPropsDrawer.tsx index 07b86641fc9ba6..2fd36a29c8e760 100644 --- a/datahub-web-react/src/app/govern/structuredProperties/ViewStructuredPropsDrawer.tsx +++ b/datahub-web-react/src/app/govern/structuredProperties/ViewStructuredPropsDrawer.tsx @@ -1,5 +1,5 @@ import { Text } from '@components'; -import { useEntityRegistryV2 } from '@src/app/useEntityRegistry'; +import { useEntityRegistry } from '@src/app/useEntityRegistry'; import { PropertyCardinality, SearchResult, StructuredPropertyEntity } from '@src/types.generated'; import React from 'react'; import { @@ -31,7 +31,7 @@ const ViewStructuredPropsDrawer = ({ selectedProperty, setSelectedProperty, }: Props) => { - const entityRegistry = useEntityRegistryV2(); + const entityRegistry = useEntityRegistry(); const handleClose = () => { setIsViewDrawerOpen(false); diff --git a/datahub-web-react/src/app/govern/structuredProperties/styledComponents.ts b/datahub-web-react/src/app/govern/structuredProperties/styledComponents.ts index 27274b7a391688..211b4cdab6638c 100644 --- a/datahub-web-react/src/app/govern/structuredProperties/styledComponents.ts +++ b/datahub-web-react/src/app/govern/structuredProperties/styledComponents.ts @@ -453,3 +453,21 @@ export const EmptyContainer = styled.div` height: 160px; } `; + +export const CardIcons = styled.div` + display: flex; + justify-content: end; + gap: 12px; + + div { + border: 1px solid $E9EAEE; + border-radius: 20px; + width: 28px; + height: 28px; + padding: 4px; + color: #8088a3; + :hover { + cursor: pointer; + } + } +`; diff --git a/datahub-web-react/src/app/govern/structuredProperties/useStructuredProp.ts b/datahub-web-react/src/app/govern/structuredProperties/useStructuredProp.ts index 3f83d8f07ef14c..6de195c1cd4241 100644 --- a/datahub-web-react/src/app/govern/structuredProperties/useStructuredProp.ts +++ b/datahub-web-react/src/app/govern/structuredProperties/useStructuredProp.ts @@ -1,4 +1,4 @@ -import { useEntityRegistryV2 } from '@src/app/useEntityRegistry'; +import { useEntityRegistry } from '@src/app/useEntityRegistry'; import { EntityType, PropertyCardinality, SearchResult, StructuredPropertyEntity } from '@src/types.generated'; import { FormInstance } from 'antd'; import { useMemo } from 'react'; @@ -19,7 +19,7 @@ export default function useStructuredProp({ setCardinality, setSelectedValueType, }: Props) { - const entityRegistry = useEntityRegistryV2(); + const entityRegistry = useEntityRegistry(); const getEntitiesListOptions = (entitiesList: EntityType[]) => { const listOptions: { label: string; value: string }[] = []; diff --git a/datahub-web-react/src/app/govern/structuredProperties/utils.ts b/datahub-web-react/src/app/govern/structuredProperties/utils.ts index a86540f817d96f..744ce20cf45732 100644 --- a/datahub-web-react/src/app/govern/structuredProperties/utils.ts +++ b/datahub-web-react/src/app/govern/structuredProperties/utils.ts @@ -1,12 +1,11 @@ import EntityRegistry from '@src/app/entity/EntityRegistry'; -import EntityRegistryV2 from '@src/app/entityV2/EntityRegistry'; -import { mapStructuredPropertyToPropertyRow } from '@src/app/entityV2/shared/tabs/Properties/useStructuredProperties'; +import { mapStructuredPropertyToPropertyRow } from '@src/app/entity/shared/tabs/Properties/useStructuredProperties'; import { ENTITY_TYPES_FILTER_NAME, IS_HIDDEN_PROPERTY_FILTER_NAME, SHOW_IN_ASSET_SUMMARY_PROPERTY_FILTER_NAME, SHOW_IN_COLUMNS_TABLE_PROPERTY_FILTER_NAME, -} from '@src/app/searchV2/utils/constants'; +} from '@src/app/search/utils/constants'; import { AllowedValue, EntityType, @@ -16,7 +15,6 @@ import { SearchResult, StructuredProperties, StructuredPropertyEntity, - StructuredPropertyFilterStatus, StructuredPropertySettings, } from '@src/types.generated'; @@ -33,7 +31,6 @@ export type StructuredProp = { immutable?: boolean; allowedValues?: AllowedValue[]; settings?: StructuredPropertySettings | null; - filterStatus?: StructuredPropertyFilterStatus; // deprecated, need to support for backwards compatibility }; export const valueTypes = [ @@ -136,7 +133,7 @@ export const APPLIES_TO_ENTITIES = [ EntityType.SchemaField, ]; -export const getEntityTypeUrn = (entityRegistry: EntityRegistry | EntityRegistryV2, entityType: EntityType) => { +export const getEntityTypeUrn = (entityRegistry: EntityRegistry, entityType: EntityType) => { return `urn:li:entityType:datahub.${entityRegistry.getGraphNameFromType(entityType)}`; }; @@ -238,7 +235,7 @@ export const getShowInAssetSummaryPropertyFilter = () => { }; export const getEntityTypesPropertyFilter = ( - entityRegistry: EntityRegistry | EntityRegistryV2, + entityRegistry: EntityRegistry, isSchemaField: boolean, entityType?: EntityType, ) => { diff --git a/datahub-web-react/src/app/search/utils/constants.ts b/datahub-web-react/src/app/search/utils/constants.ts index 8616f67ac2b6a3..a791bceec44d72 100644 --- a/datahub-web-react/src/app/search/utils/constants.ts +++ b/datahub-web-react/src/app/search/utils/constants.ts @@ -25,6 +25,10 @@ export const REMOVED_FILTER_NAME = 'removed'; export const ORIGIN_FILTER_NAME = 'origin'; export const DEGREE_FILTER_NAME = 'degree'; export const BROWSE_PATH_V2_FILTER_NAME = 'browsePathV2'; +export const ENTITY_TYPES_FILTER_NAME = 'entityTypes'; +export const IS_HIDDEN_PROPERTY_FILTER_NAME = 'isHidden'; +export const SHOW_IN_COLUMNS_TABLE_PROPERTY_FILTER_NAME = 'showInColumnsTable'; +export const SHOW_IN_ASSET_SUMMARY_PROPERTY_FILTER_NAME = 'showInAssetSummary'; export const LEGACY_ENTITY_FILTER_FIELDS = [ENTITY_FILTER_NAME, LEGACY_ENTITY_FILTER_NAME]; diff --git a/datahub-web-react/src/graphql/fragments.graphql b/datahub-web-react/src/graphql/fragments.graphql index 19dc79130807e1..788c68349b4268 100644 --- a/datahub-web-react/src/graphql/fragments.graphql +++ b/datahub-web-react/src/graphql/fragments.graphql @@ -1240,6 +1240,12 @@ fragment entityDisplayNameFields on Entity { ... on DataPlatformInstance { instanceId } + ... on StructuredPropertyEntity { + definition { + displayName + qualifiedName + } + } } fragment ermodelrelationPropertiesFields on ERModelRelationshipProperties { @@ -1293,12 +1299,16 @@ fragment structuredPropertyFields on StructuredPropertyEntity { cardinality immutable valueType { + urn + type info { type displayName } } entityTypes { + urn + type info { type } @@ -1325,6 +1335,35 @@ fragment structuredPropertyFields on StructuredPropertyEntity { } description } + created { + time + actor { + urn + editableProperties { + displayName + pictureLink + } + ...entityDisplayNameFields + } + } + lastModified { + time + actor { + urn + editableProperties { + displayName + pictureLink + } + ...entityDisplayNameFields + } + } + } + settings { + isHidden + showInSearchFilters + showAsAssetBadge + showInAssetSummary + showInColumnsTable } } diff --git a/datahub-web-react/src/graphql/search.graphql b/datahub-web-react/src/graphql/search.graphql index 7630e13a9c85dc..e6938a3d4fb30b 100644 --- a/datahub-web-react/src/graphql/search.graphql +++ b/datahub-web-react/src/graphql/search.graphql @@ -930,6 +930,9 @@ fragment searchResultsWithoutSchemaField on Entity { ... on BusinessAttribute { ...businessAttributeFields } + ... on StructuredPropertyEntity { + ...structuredPropertyFields + } } fragment searchResultFields on Entity {