Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: 2 additions & 10 deletions datahub-web-react/src/app/previewV2/ContextPath.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const PlatFormTitle = styled.span`
interface Props {
// eslint-disable-next-line react/no-unused-prop-types
entityLogoComponent?: JSX.Element;
// eslint-disable-next-line react/no-unused-prop-types
instanceId?: string;
// eslint-disable-next-line react/no-unused-prop-types
typeIcon?: JSX.Element;
Expand All @@ -103,7 +104,6 @@ function ContextPath(props: Props) {
entityType,
parentEntities,
browsePaths,
instanceId,
entityTitleWidth = 200,
previewType,
isCompactView,
Expand All @@ -118,12 +118,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 +134,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
Loading