mirror of
https://github.com/datahub-project/datahub.git
synced 2025-10-04 13:36:46 +00:00
fix(UI): Showing platform instances only once (#12806)
This commit is contained in:
parent
a6461853dc
commit
a101c27388
@ -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}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -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}
|
||||||
|
@ -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])};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user