Skip to content

Commit a101c27

Browse files
fix(UI): Showing platform instances only once (#12806)
1 parent a646185 commit a101c27

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,16 @@ const BrowsePathSection = ({ path, linksDisabled }: { path: BrowsePathEntry } &
7171
if (!path.entity) {
7272
return <PlatFormTitle>{path.name}</PlatFormTitle>;
7373
}
74+
75+
// Till we have a DataPlatform instance page
76+
const hasDataPlatformInstance = path.name?.includes('dataPlatformInstance');
77+
7478
return (
7579
<ContextPathEntityLink
7680
key={path?.entity?.urn}
7781
entity={path?.entity}
7882
style={{ fontSize: '12px' }}
79-
linkDisabled={linksDisabled}
83+
linkDisabled={linksDisabled || hasDataPlatformInstance}
8084
/>
8185
);
8286
};

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

+2-10
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ const PlatFormTitle = styled.span`
8282
interface Props {
8383
// eslint-disable-next-line react/no-unused-prop-types
8484
entityLogoComponent?: JSX.Element;
85+
// eslint-disable-next-line react/no-unused-prop-types
8586
instanceId?: string;
8687
// eslint-disable-next-line react/no-unused-prop-types
8788
typeIcon?: JSX.Element;
@@ -103,7 +104,6 @@ function ContextPath(props: Props) {
103104
entityType,
104105
parentEntities,
105106
browsePaths,
106-
instanceId,
107107
entityTitleWidth = 200,
108108
previewType,
109109
isCompactView,
@@ -118,12 +118,10 @@ function ContextPath(props: Props) {
118118

119119
const divider = <PlatformDivider>|</PlatformDivider>;
120120

121-
const hasPlatformInstance = !!instanceId;
122121
const hasBrowsePath = !!browsePaths?.path?.length && !isDefaultBrowsePath(browsePaths);
123122
const hasParentEntities = !!parentEntities?.length;
124123

125-
const showInstanceIdDivider = hasBrowsePath || hasParentEntities;
126-
const showEntityTypeDivider = hasPlatformInstance || hasBrowsePath || hasParentEntities;
124+
const showEntityTypeDivider = hasBrowsePath || hasParentEntities;
127125

128126
return (
129127
<PlatformContentWrapper>
@@ -136,12 +134,6 @@ function ContextPath(props: Props) {
136134
<PlatFormTitle>{capitalizeFirstLetterOnly(type)}</PlatFormTitle>
137135
{showEntityTypeDivider && divider}
138136
</PlatformText>
139-
{instanceId && (
140-
<PlatformText>
141-
{instanceId}
142-
{showInstanceIdDivider && divider}
143-
</PlatformText>
144-
)}
145137
{hasBrowsePath ? (
146138
<BrowsePaths
147139
browsePaths={browsePaths}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const StyledLink = styled(Link)<{ $disabled?: boolean }>`
4545
4646
:hover {
4747
color: ${({ $disabled }) => ($disabled ? REDESIGN_COLORS.LINK_GREY : colors.violet[500])};
48-
48+
cursor: ${({ $disabled }) => ($disabled ? 'default' : 'pointer')};
4949
&& svg {
5050
color: ${({ $disabled }) => ($disabled ? REDESIGN_COLORS.LINK_GREY : colors.violet[500])};
5151
}

0 commit comments

Comments
 (0)