From a101c273886d0bb5142c991b67f363573421b11a Mon Sep 17 00:00:00 2001 From: Saketh Varma Date: Thu, 6 Mar 2025 19:01:04 -0300 Subject: [PATCH] fix(UI): Showing platform instances only once (#12806) --- datahub-web-react/src/app/previewV2/BrowsePaths.tsx | 6 +++++- datahub-web-react/src/app/previewV2/ContextPath.tsx | 12 ++---------- .../src/app/previewV2/ContextPathEntityLink.tsx | 2 +- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/datahub-web-react/src/app/previewV2/BrowsePaths.tsx b/datahub-web-react/src/app/previewV2/BrowsePaths.tsx index 32ce1cb780..e35c6eae6a 100644 --- a/datahub-web-react/src/app/previewV2/BrowsePaths.tsx +++ b/datahub-web-react/src/app/previewV2/BrowsePaths.tsx @@ -71,12 +71,16 @@ const BrowsePathSection = ({ path, linksDisabled }: { path: BrowsePathEntry } & if (!path.entity) { return {path.name}; } + + // Till we have a DataPlatform instance page + const hasDataPlatformInstance = path.name?.includes('dataPlatformInstance'); + return ( ); }; diff --git a/datahub-web-react/src/app/previewV2/ContextPath.tsx b/datahub-web-react/src/app/previewV2/ContextPath.tsx index b957ee50b3..85ddb3549c 100644 --- a/datahub-web-react/src/app/previewV2/ContextPath.tsx +++ b/datahub-web-react/src/app/previewV2/ContextPath.tsx @@ -82,6 +82,7 @@ const PlatFormTitle = styled.span` interface Props { // eslint-disable-next-line react/no-unused-prop-types entityLogoComponent?: JSX.Element; + // eslint-disable-next-line react/no-unused-prop-types instanceId?: string; // eslint-disable-next-line react/no-unused-prop-types typeIcon?: JSX.Element; @@ -103,7 +104,6 @@ function ContextPath(props: Props) { entityType, parentEntities, browsePaths, - instanceId, entityTitleWidth = 200, previewType, isCompactView, @@ -118,12 +118,10 @@ function ContextPath(props: Props) { const divider = |; - const hasPlatformInstance = !!instanceId; const hasBrowsePath = !!browsePaths?.path?.length && !isDefaultBrowsePath(browsePaths); const hasParentEntities = !!parentEntities?.length; - const showInstanceIdDivider = hasBrowsePath || hasParentEntities; - const showEntityTypeDivider = hasPlatformInstance || hasBrowsePath || hasParentEntities; + const showEntityTypeDivider = hasBrowsePath || hasParentEntities; return ( @@ -136,12 +134,6 @@ function ContextPath(props: Props) { {capitalizeFirstLetterOnly(type)} {showEntityTypeDivider && divider} - {instanceId && ( - - {instanceId} - {showInstanceIdDivider && divider} - - )} {hasBrowsePath ? ( ` :hover { color: ${({ $disabled }) => ($disabled ? REDESIGN_COLORS.LINK_GREY : colors.violet[500])}; - + cursor: ${({ $disabled }) => ($disabled ? 'default' : 'pointer')}; && svg { color: ${({ $disabled }) => ($disabled ? REDESIGN_COLORS.LINK_GREY : colors.violet[500])}; }