fix(UI): Showing platform instances only once (#12806)

This commit is contained in:
Saketh Varma 2025-03-06 19:01:04 -03:00 committed by GitHub
parent a6461853dc
commit a101c27388
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 12 deletions

View File

@ -71,12 +71,16 @@ const BrowsePathSection = ({ path, linksDisabled }: { path: BrowsePathEntry } &
if (!path.entity) { if (!path.entity) {
return <PlatFormTitle>{path.name}</PlatFormTitle>; return <PlatFormTitle>{path.name}</PlatFormTitle>;
} }
// Till we have a DataPlatform instance page
const hasDataPlatformInstance = path.name?.includes('dataPlatformInstance');
return ( return (
<ContextPathEntityLink <ContextPathEntityLink
key={path?.entity?.urn} key={path?.entity?.urn}
entity={path?.entity} entity={path?.entity}
style={{ fontSize: '12px' }} style={{ fontSize: '12px' }}
linkDisabled={linksDisabled} linkDisabled={linksDisabled || hasDataPlatformInstance}
/> />
); );
}; };

View File

@ -82,6 +82,7 @@ const PlatFormTitle = styled.span`
interface Props { interface Props {
// eslint-disable-next-line react/no-unused-prop-types // eslint-disable-next-line react/no-unused-prop-types
entityLogoComponent?: JSX.Element; entityLogoComponent?: JSX.Element;
// eslint-disable-next-line react/no-unused-prop-types
instanceId?: string; instanceId?: string;
// eslint-disable-next-line react/no-unused-prop-types // eslint-disable-next-line react/no-unused-prop-types
typeIcon?: JSX.Element; typeIcon?: JSX.Element;
@ -103,7 +104,6 @@ function ContextPath(props: Props) {
entityType, entityType,
parentEntities, parentEntities,
browsePaths, browsePaths,
instanceId,
entityTitleWidth = 200, entityTitleWidth = 200,
previewType, previewType,
isCompactView, isCompactView,
@ -118,12 +118,10 @@ function ContextPath(props: Props) {
const divider = <PlatformDivider>|</PlatformDivider>; const divider = <PlatformDivider>|</PlatformDivider>;
const hasPlatformInstance = !!instanceId;
const hasBrowsePath = !!browsePaths?.path?.length && !isDefaultBrowsePath(browsePaths); const hasBrowsePath = !!browsePaths?.path?.length && !isDefaultBrowsePath(browsePaths);
const hasParentEntities = !!parentEntities?.length; const hasParentEntities = !!parentEntities?.length;
const showInstanceIdDivider = hasBrowsePath || hasParentEntities; const showEntityTypeDivider = hasBrowsePath || hasParentEntities;
const showEntityTypeDivider = hasPlatformInstance || hasBrowsePath || hasParentEntities;
return ( return (
<PlatformContentWrapper> <PlatformContentWrapper>
@ -136,12 +134,6 @@ function ContextPath(props: Props) {
<PlatFormTitle>{capitalizeFirstLetterOnly(type)}</PlatFormTitle> <PlatFormTitle>{capitalizeFirstLetterOnly(type)}</PlatFormTitle>
{showEntityTypeDivider && divider} {showEntityTypeDivider && divider}
</PlatformText> </PlatformText>
{instanceId && (
<PlatformText>
{instanceId}
{showInstanceIdDivider && divider}
</PlatformText>
)}
{hasBrowsePath ? ( {hasBrowsePath ? (
<BrowsePaths <BrowsePaths
browsePaths={browsePaths} browsePaths={browsePaths}

View File

@ -45,7 +45,7 @@ const StyledLink = styled(Link)<{ $disabled?: boolean }>`
:hover { :hover {
color: ${({ $disabled }) => ($disabled ? REDESIGN_COLORS.LINK_GREY : colors.violet[500])}; color: ${({ $disabled }) => ($disabled ? REDESIGN_COLORS.LINK_GREY : colors.violet[500])};
cursor: ${({ $disabled }) => ($disabled ? 'default' : 'pointer')};
&& svg { && svg {
color: ${({ $disabled }) => ($disabled ? REDESIGN_COLORS.LINK_GREY : colors.violet[500])}; color: ${({ $disabled }) => ($disabled ? REDESIGN_COLORS.LINK_GREY : colors.violet[500])};
} }