Skip to content

Commit 97acaac

Browse files
committed
remove link
1 parent d63cb09 commit 97acaac

File tree

5 files changed

+32
-12
lines changed

5 files changed

+32
-12
lines changed

datahub-web-react/src/app/entityV2/shared/EntitySearchInput/EntitySearchInputResultV2.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export default function EntitySearchInputResultV2({ entity }: Props) {
5454
}
5555
contentRef={contentRef}
5656
isContentTruncated={isContentTruncated}
57+
linksDisabled
5758
/>
5859
</TextWrapper>
5960
</Wrapper>

datahub-web-react/src/app/previewV2/BrowsePaths.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,25 @@ interface Props {
6464
browsePaths?: Maybe<BrowsePathV2> | undefined;
6565
contentRef: React.RefObject<HTMLDivElement>;
6666
isContentTruncated: boolean;
67+
linksDisabled?: boolean;
6768
}
6869

69-
const BrowsePathSection = ({ path }: { path: BrowsePathEntry }) => {
70+
const BrowsePathSection = ({ path, linksDisabled }: { path: BrowsePathEntry } & Pick<Props, 'linksDisabled'>) => {
7071
if (!path.entity) {
7172
return <PlatFormTitle>{path.name}</PlatFormTitle>;
7273
}
73-
return <ContextPathEntityLink key={path?.entity?.urn} entity={path?.entity} style={{ fontSize: '12px' }} />;
74+
return (
75+
<ContextPathEntityLink
76+
key={path?.entity?.urn}
77+
entity={path?.entity}
78+
style={{ fontSize: '12px' }}
79+
linkDisabled={linksDisabled}
80+
/>
81+
);
7482
};
7583

7684
function BrowsePaths(props: Props) {
77-
const { previewType, browsePaths, contentRef, isContentTruncated } = props;
85+
const { previewType, browsePaths, contentRef, isContentTruncated, linksDisabled } = props;
7886

7987
const parentPath = browsePaths?.path?.[0];
8088
const remainingParentPaths = browsePaths?.path && browsePaths.path.slice(1, browsePaths.path.length);
@@ -91,15 +99,15 @@ function BrowsePaths(props: Props) {
9199
<ParentNodesWrapper ref={contentRef}>
92100
{parentPath && (
93101
<PlatformText>
94-
<BrowsePathSection path={parentPath} />
102+
<BrowsePathSection path={parentPath} linksDisabled={linksDisabled} />
95103
{remainingParentPaths && remainingParentPaths?.length > 0 && <ContextPathSeparator />}
96104
</PlatformText>
97105
)}
98106
{remainingParentPaths &&
99107
remainingParentPaths.map((container, index) => {
100108
return (
101109
<PlatformText>
102-
<BrowsePathSection path={container} />
110+
<BrowsePathSection path={container} linksDisabled={linksDisabled} />
103111
{index < remainingParentPaths.length - 1 && <ContextPathSeparator />}
104112
</PlatformText>
105113
);

datahub-web-react/src/app/previewV2/ContextPath.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ interface Props {
9494
browsePaths?: Maybe<BrowsePathV2> | undefined;
9595
contentRef: React.RefObject<HTMLDivElement>;
9696
isContentTruncated?: boolean;
97+
linksDisabled?: boolean;
9798
}
9899

99100
function ContextPath(props: Props) {
@@ -108,6 +109,7 @@ function ContextPath(props: Props) {
108109
isCompactView,
109110
contentRef,
110111
isContentTruncated = false,
112+
linksDisabled,
111113
} = props;
112114

113115
const entityRegistry = useEntityRegistryV2();
@@ -146,9 +148,10 @@ function ContextPath(props: Props) {
146148
previewType={previewType}
147149
contentRef={contentRef}
148150
isContentTruncated={isContentTruncated}
151+
linksDisabled={linksDisabled}
149152
/>
150153
) : (
151-
<ParentEntities parentEntities={parentEntities || []} numVisible={3} />
154+
<ParentEntities parentEntities={parentEntities || []} numVisible={3} linksDisabled={linksDisabled} />
152155
)}
153156
</PlatformContentWrapper>
154157
);

datahub-web-react/src/app/previewV2/ContextPathEntityLink.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const ContainerText = styled.span`
2828
max-width: 150px; // TODO: Remove in favor of smart truncation
2929
`;
3030

31-
const StyledLink = styled(Link)`
31+
const StyledLink = styled(Link)<{ $disabled?: boolean }>`
3232
white-space: nowrap;
3333
border-radius: 4px;
3434
overflow: hidden;
@@ -44,21 +44,22 @@ const StyledLink = styled(Link)`
4444
}
4545
4646
:hover {
47-
color: ${colors.violet[500]};
47+
color: ${({ $disabled }) => ($disabled ? REDESIGN_COLORS.LINK_GREY : colors.violet[500])};
4848
4949
&& svg {
50-
color: ${colors.violet[500]};
50+
color: ${({ $disabled }) => ($disabled ? REDESIGN_COLORS.LINK_GREY : colors.violet[500])};
5151
}
5252
}
5353
`;
5454

5555
interface Props {
5656
entity: Maybe<Entity>;
57+
linkDisabled?: boolean;
5758
style?: React.CSSProperties;
5859
}
5960

6061
function ContextPathEntityLink(props: Props) {
61-
const { entity, style } = props;
62+
const { entity, linkDisabled, style } = props;
6263
const entityRegistry = useEntityRegistry();
6364
const linkProps = useEmbeddedProfileLinkProps();
6465

@@ -69,7 +70,12 @@ function ContextPathEntityLink(props: Props) {
6970

7071
return (
7172
<Path style={style}>
72-
<StyledLink to={containerUrl} data-testid="container" {...linkProps}>
73+
<StyledLink
74+
to={linkDisabled ? null : containerUrl}
75+
data-testid="container"
76+
$disabled={linkDisabled}
77+
{...linkProps}
78+
>
7379
<ContextPathEntityIcon entity={entity} />
7480
<ContainerText title={containerName}>{containerName}</ContainerText>
7581
</StyledLink>

datahub-web-react/src/app/searchV2/filters/ParentEntities.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ const DEFAULT_NUM_VISIBLE = 2;
2828
interface Props {
2929
parentEntities: Entity[];
3030
numVisible?: number;
31+
linksDisabled?: boolean; // don't allow links to parent entities
3132
}
3233

33-
export default function ParentEntities({ parentEntities, numVisible = DEFAULT_NUM_VISIBLE }: Props) {
34+
export default function ParentEntities({ parentEntities, numVisible = DEFAULT_NUM_VISIBLE, linksDisabled }: Props) {
3435
const entityRegistry = useEntityRegistry();
3536

3637
// parent nodes/domains are returned with direct parent first
@@ -72,6 +73,7 @@ export default function ParentEntities({ parentEntities, numVisible = DEFAULT_NU
7273
<ContextPathEntityLink
7374
key={parentEntity.urn}
7475
entity={parentEntity}
76+
linkDisabled={linksDisabled}
7577
style={{ fontSize: '12px' }}
7678
/>
7779
{index !== visibleNodes.length - 1 && <ContextPathSeparator />}

0 commit comments

Comments
 (0)