Skip to content

Commit

Permalink
Showing platfrom intances only once
Browse files Browse the repository at this point in the history
  • Loading branch information
sakethvarma397 committed Mar 6, 2025
1 parent fcabe88 commit 29b44f2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
6 changes: 5 additions & 1 deletion datahub-web-react/src/app/previewV2/BrowsePaths.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,16 @@ const BrowsePathSection = ({ path, linksDisabled }: { path: BrowsePathEntry } &
if (!path.entity) {
return <PlatFormTitle>{path.name}</PlatFormTitle>;
}

// Till we have a DataPlatform instance page
const hasDataPlatformInstance = path.name?.includes('dataPlatformInstance');

return (
<ContextPathEntityLink
key={path?.entity?.urn}
entity={path?.entity}
style={{ fontSize: '12px' }}
linkDisabled={linksDisabled}
linkDisabled={linksDisabled || hasDataPlatformInstance}
/>
);
};
Expand Down
12 changes: 1 addition & 11 deletions datahub-web-react/src/app/previewV2/ContextPath.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ const PlatFormTitle = styled.span`
interface Props {
// eslint-disable-next-line react/no-unused-prop-types
entityLogoComponent?: JSX.Element;
instanceId?: string;
// eslint-disable-next-line react/no-unused-prop-types
typeIcon?: JSX.Element;
type?: string;
Expand All @@ -103,7 +102,6 @@ function ContextPath(props: Props) {
entityType,
parentEntities,
browsePaths,
instanceId,
entityTitleWidth = 200,
previewType,
isCompactView,
Expand All @@ -118,12 +116,10 @@ function ContextPath(props: Props) {

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

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 (
<PlatformContentWrapper>
Expand All @@ -136,12 +132,6 @@ function ContextPath(props: Props) {
<PlatFormTitle>{capitalizeFirstLetterOnly(type)}</PlatFormTitle>
{showEntityTypeDivider && divider}
</PlatformText>
{instanceId && (
<PlatformText>
{instanceId}
{showInstanceIdDivider && divider}
</PlatformText>
)}
{hasBrowsePath ? (
<BrowsePaths
browsePaths={browsePaths}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const StyledLink = styled(Link)<{ $disabled?: boolean }>`
: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])};
}
Expand Down

0 comments on commit 29b44f2

Please sign in to comment.