From 97acaac874ffe13d52e99ba80d7b3abf638d1ba9 Mon Sep 17 00:00:00 2001 From: Andrew Sikowitz Date: Mon, 3 Feb 2025 18:21:17 -0800 Subject: [PATCH] remove link --- .../EntitySearchInputResultV2.tsx | 1 + .../src/app/previewV2/BrowsePaths.tsx | 18 +++++++++++++----- .../src/app/previewV2/ContextPath.tsx | 5 ++++- .../app/previewV2/ContextPathEntityLink.tsx | 16 +++++++++++----- .../app/searchV2/filters/ParentEntities.tsx | 4 +++- 5 files changed, 32 insertions(+), 12 deletions(-) diff --git a/datahub-web-react/src/app/entityV2/shared/EntitySearchInput/EntitySearchInputResultV2.tsx b/datahub-web-react/src/app/entityV2/shared/EntitySearchInput/EntitySearchInputResultV2.tsx index 6079a537a95575..03534433adb147 100644 --- a/datahub-web-react/src/app/entityV2/shared/EntitySearchInput/EntitySearchInputResultV2.tsx +++ b/datahub-web-react/src/app/entityV2/shared/EntitySearchInput/EntitySearchInputResultV2.tsx @@ -54,6 +54,7 @@ export default function EntitySearchInputResultV2({ entity }: Props) { } contentRef={contentRef} isContentTruncated={isContentTruncated} + linksDisabled /> diff --git a/datahub-web-react/src/app/previewV2/BrowsePaths.tsx b/datahub-web-react/src/app/previewV2/BrowsePaths.tsx index 81de58c403d77f..32ce1cb7806643 100644 --- a/datahub-web-react/src/app/previewV2/BrowsePaths.tsx +++ b/datahub-web-react/src/app/previewV2/BrowsePaths.tsx @@ -64,17 +64,25 @@ interface Props { browsePaths?: Maybe | undefined; contentRef: React.RefObject; isContentTruncated: boolean; + linksDisabled?: boolean; } -const BrowsePathSection = ({ path }: { path: BrowsePathEntry }) => { +const BrowsePathSection = ({ path, linksDisabled }: { path: BrowsePathEntry } & Pick) => { if (!path.entity) { return {path.name}; } - return ; + return ( + + ); }; function BrowsePaths(props: Props) { - const { previewType, browsePaths, contentRef, isContentTruncated } = props; + const { previewType, browsePaths, contentRef, isContentTruncated, linksDisabled } = props; const parentPath = browsePaths?.path?.[0]; const remainingParentPaths = browsePaths?.path && browsePaths.path.slice(1, browsePaths.path.length); @@ -91,7 +99,7 @@ function BrowsePaths(props: Props) { {parentPath && ( - + {remainingParentPaths && remainingParentPaths?.length > 0 && } )} @@ -99,7 +107,7 @@ function BrowsePaths(props: Props) { remainingParentPaths.map((container, index) => { return ( - + {index < remainingParentPaths.length - 1 && } ); diff --git a/datahub-web-react/src/app/previewV2/ContextPath.tsx b/datahub-web-react/src/app/previewV2/ContextPath.tsx index 65c31a0100c315..b957ee50b3a746 100644 --- a/datahub-web-react/src/app/previewV2/ContextPath.tsx +++ b/datahub-web-react/src/app/previewV2/ContextPath.tsx @@ -94,6 +94,7 @@ interface Props { browsePaths?: Maybe | undefined; contentRef: React.RefObject; isContentTruncated?: boolean; + linksDisabled?: boolean; } function ContextPath(props: Props) { @@ -108,6 +109,7 @@ function ContextPath(props: Props) { isCompactView, contentRef, isContentTruncated = false, + linksDisabled, } = props; const entityRegistry = useEntityRegistryV2(); @@ -146,9 +148,10 @@ function ContextPath(props: Props) { previewType={previewType} contentRef={contentRef} isContentTruncated={isContentTruncated} + linksDisabled={linksDisabled} /> ) : ( - + )} ); diff --git a/datahub-web-react/src/app/previewV2/ContextPathEntityLink.tsx b/datahub-web-react/src/app/previewV2/ContextPathEntityLink.tsx index 3dce233504dfba..14f3498d26dba6 100644 --- a/datahub-web-react/src/app/previewV2/ContextPathEntityLink.tsx +++ b/datahub-web-react/src/app/previewV2/ContextPathEntityLink.tsx @@ -28,7 +28,7 @@ const ContainerText = styled.span` max-width: 150px; // TODO: Remove in favor of smart truncation `; -const StyledLink = styled(Link)` +const StyledLink = styled(Link)<{ $disabled?: boolean }>` white-space: nowrap; border-radius: 4px; overflow: hidden; @@ -44,21 +44,22 @@ const StyledLink = styled(Link)` } :hover { - color: ${colors.violet[500]}; + color: ${({ $disabled }) => ($disabled ? REDESIGN_COLORS.LINK_GREY : colors.violet[500])}; && svg { - color: ${colors.violet[500]}; + color: ${({ $disabled }) => ($disabled ? REDESIGN_COLORS.LINK_GREY : colors.violet[500])}; } } `; interface Props { entity: Maybe; + linkDisabled?: boolean; style?: React.CSSProperties; } function ContextPathEntityLink(props: Props) { - const { entity, style } = props; + const { entity, linkDisabled, style } = props; const entityRegistry = useEntityRegistry(); const linkProps = useEmbeddedProfileLinkProps(); @@ -69,7 +70,12 @@ function ContextPathEntityLink(props: Props) { return ( - + {containerName} diff --git a/datahub-web-react/src/app/searchV2/filters/ParentEntities.tsx b/datahub-web-react/src/app/searchV2/filters/ParentEntities.tsx index 1803ca044c874e..b7b0530da50fa1 100644 --- a/datahub-web-react/src/app/searchV2/filters/ParentEntities.tsx +++ b/datahub-web-react/src/app/searchV2/filters/ParentEntities.tsx @@ -28,9 +28,10 @@ const DEFAULT_NUM_VISIBLE = 2; interface Props { parentEntities: Entity[]; numVisible?: number; + linksDisabled?: boolean; // don't allow links to parent entities } -export default function ParentEntities({ parentEntities, numVisible = DEFAULT_NUM_VISIBLE }: Props) { +export default function ParentEntities({ parentEntities, numVisible = DEFAULT_NUM_VISIBLE, linksDisabled }: Props) { const entityRegistry = useEntityRegistry(); // parent nodes/domains are returned with direct parent first @@ -72,6 +73,7 @@ export default function ParentEntities({ parentEntities, numVisible = DEFAULT_NU {index !== visibleNodes.length - 1 && }