fix(ui): Fix compact view styling; fix context path link overflow; standardize type icons in context path (#14284)

This commit is contained in:
Andrew Sikowitz 2025-08-04 10:18:26 -07:00 committed by GitHub
parent b6437b6c95
commit 1e765cb7f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
32 changed files with 49 additions and 141 deletions

View File

@ -32,10 +32,7 @@ export class RoleEntity implements Entity<Role> {
return ( return (
<TagOutlined <TagOutlined
className={TYPE_ICON_CLASS_NAME} className={TYPE_ICON_CLASS_NAME}
style={{ style={{ fontSize: fontSize || 'inherit', color: color || 'inherit' }}
fontSize,
color: color || '#BFBFBF',
}}
/> />
); );
}; };

View File

@ -57,10 +57,7 @@ export class ApplicationEntity implements Entity<Application> {
return ( return (
<AppWindow <AppWindow
className={TYPE_ICON_CLASS_NAME} className={TYPE_ICON_CLASS_NAME}
style={{ style={{ fontSize: fontSize || 'inherit', color: color || 'inherit' }}
fontSize,
color: color || '#BFBFBF',
}}
/> />
); );
}; };

View File

@ -41,14 +41,7 @@ export class BusinessAttributeEntity implements Entity<BusinessAttribute> {
); );
} }
return ( return <GlobalOutlined style={{ fontSize: fontSize || 'inherit', color: color || 'inherit' }} />;
<GlobalOutlined
style={{
fontSize,
color: color || '#BFBFBF',
}}
/>
);
}; };
displayName = (data: BusinessAttribute) => { displayName = (data: BusinessAttribute) => {

View File

@ -94,10 +94,7 @@ export class ChartEntity implements Entity<Chart> {
return ( return (
<LineChartOutlined <LineChartOutlined
className={TYPE_ICON_CLASS_NAME} className={TYPE_ICON_CLASS_NAME}
style={{ style={{ fontSize: fontSize || 'inherit', color: color || 'inherit' }}
fontSize,
color: color || '#BFBFBF',
}}
/> />
); );
}; };

View File

@ -59,10 +59,7 @@ export class ContainerEntity implements Entity<Container> {
return ( return (
<FolderOutlined <FolderOutlined
className={TYPE_ICON_CLASS_NAME} className={TYPE_ICON_CLASS_NAME}
style={{ style={{ fontSize: fontSize || 'inherit', color: color || 'inherit' }}
fontSize,
color: color || '#BFBFBF',
}}
/> />
); );
}; };

View File

@ -93,14 +93,7 @@ export class DashboardEntity implements Entity<Dashboard> {
); );
} }
return ( return <DashboardOutlined style={{ fontSize: fontSize || 'inherit', color: color || 'inherit' }} />;
<DashboardOutlined
style={{
fontSize,
color: color || '#BFBFBF',
}}
/>
);
}; };
isSearchEnabled = () => true; isSearchEnabled = () => true;

View File

@ -24,10 +24,7 @@ export class DataContractEntity implements Entity<DataContract> {
return ( return (
<FileOutlined <FileOutlined
className={TYPE_ICON_CLASS_NAME} className={TYPE_ICON_CLASS_NAME}
style={{ style={{ fontSize: fontSize || 'inherit', color: color || 'inherit' }}
fontSize,
color: color || '#BFBFBF',
}}
/> />
); );
}; };

View File

@ -58,10 +58,7 @@ export class DataFlowEntity implements Entity<DataFlow> {
return ( return (
<ShareAltOutlined <ShareAltOutlined
className={TYPE_ICON_CLASS_NAME} className={TYPE_ICON_CLASS_NAME}
style={{ style={{ fontSize: fontSize || 'inherit', color: color || 'inherit' }}
fontSize,
color: color || '#BFBFBF',
}}
/> />
); );
}; };

View File

@ -73,10 +73,7 @@ export class DataJobEntity implements Entity<DataJob> {
return ( return (
<ConsoleSqlOutlined <ConsoleSqlOutlined
className={TYPE_ICON_CLASS_NAME} className={TYPE_ICON_CLASS_NAME}
style={{ style={{ fontSize: fontSize || 'inherit', color: color || 'inherit' }}
fontSize,
color: color || '#BFBFBF',
}}
/> />
); );
}; };

View File

@ -21,10 +21,7 @@ export class DataPlatformEntity implements Entity<DataPlatform> {
return ( return (
<DatabaseOutlined <DatabaseOutlined
className={TYPE_ICON_CLASS_NAME} className={TYPE_ICON_CLASS_NAME}
style={{ style={{ fontSize: fontSize || 'inherit', color: color || 'inherit' }}
fontSize,
color: color || '#BFBFBF',
}}
/> />
); );
}; };

View File

@ -46,14 +46,7 @@ export class DataProcessInstanceEntity implements Entity<DataProcessInstance> {
return <ArrowsClockwise style={{ fontSize, color: color || '#B37FEB' }} />; return <ArrowsClockwise style={{ fontSize, color: color || '#B37FEB' }} />;
} }
return ( return <ArrowsClockwise style={{ fontSize: fontSize || 'inherit', color: color || 'inherit' }} />;
<ArrowsClockwise
style={{
fontSize,
color: color || '#BFBFBF',
}}
/>
);
}; };
isSearchEnabled = () => false; isSearchEnabled = () => false;

View File

@ -69,10 +69,7 @@ export class DataProductEntity implements Entity<DataProduct> {
return ( return (
<FileDoneOutlined <FileDoneOutlined
className={TYPE_ICON_CLASS_NAME} className={TYPE_ICON_CLASS_NAME}
style={{ style={{ fontSize: fontSize || 'inherit', color: color || 'inherit' }}
fontSize,
color: color || '#BFBFBF',
}}
/> />
); );
}; };

View File

@ -112,10 +112,7 @@ export class DatasetEntity implements Entity<Dataset> {
return ( return (
<ViewComfyOutlinedIcon <ViewComfyOutlinedIcon
className={TYPE_ICON_CLASS_NAME} className={TYPE_ICON_CLASS_NAME}
style={{ style={{ fontSize: fontSize || 'inherit', color: color || 'inherit' }}
fontSize,
color: color || '#BFBFBF',
}}
/> />
); );
}; };

View File

@ -60,14 +60,7 @@ export class DomainEntity implements Entity<Domain> {
); );
} }
return ( return <DomainIcon style={{ fontSize: fontSize || 'inherit', color: color || 'inherit' }} />;
<DomainIcon
style={{
fontSize,
color: color || '#BFBFBF',
}}
/>
);
}; };
isSearchEnabled = () => true; isSearchEnabled = () => true;

View File

@ -56,10 +56,7 @@ class GlossaryNodeEntity implements Entity<GlossaryNode> {
return ( return (
<BookmarksSimple <BookmarksSimple
className={TYPE_ICON_CLASS_NAME} className={TYPE_ICON_CLASS_NAME}
style={{ style={{ fontSize: fontSize || 'inherit', color: color || 'inherit' }}
fontSize,
color: color || '#BFBFBF',
}}
/> />
); );
}; };

View File

@ -68,10 +68,7 @@ export class GlossaryTermEntity implements Entity<GlossaryTerm> {
return ( return (
<BookmarkSimple <BookmarkSimple
className={TYPE_ICON_CLASS_NAME} className={TYPE_ICON_CLASS_NAME}
style={{ style={{ fontSize: fontSize || 'inherit', color: color || 'inherit' }}
fontSize,
color: color || '#BFBFBF',
}}
/> />
); );
}; };

View File

@ -28,10 +28,7 @@ export class GroupEntity implements Entity<CorpGroup> {
return ( return (
<TeamOutlined <TeamOutlined
className={TYPE_ICON_CLASS_NAME} className={TYPE_ICON_CLASS_NAME}
style={{ style={{ fontSize: fontSize || 'inherit', color: color || 'inherit' }}
fontSize,
color: color || '#BFBFBF',
}}
/> />
); );
}; };

View File

@ -59,10 +59,7 @@ export class MLFeatureEntity implements Entity<MlFeature> {
return ( return (
<ChartScatter <ChartScatter
className={TYPE_ICON_CLASS_NAME} className={TYPE_ICON_CLASS_NAME}
style={{ style={{ fontSize: fontSize || 'inherit', color: color || 'inherit' }}
fontSize,
color: color || '#BFBFBF',
}}
weight="regular" weight="regular"
/> />
); );

View File

@ -55,10 +55,7 @@ export class MLFeatureTableEntity implements Entity<MlFeatureTable> {
return ( return (
<ChartScatter <ChartScatter
className={TYPE_ICON_CLASS_NAME} className={TYPE_ICON_CLASS_NAME}
style={{ style={{ fontSize: fontSize || 'inherit', color: color || 'inherit' }}
fontSize,
color: color || '#BFBFBF',
}}
weight="regular" weight="regular"
/> />
); );

View File

@ -61,10 +61,7 @@ export class MLModelEntity implements Entity<MlModel> {
return ( return (
<CodeSandboxOutlined <CodeSandboxOutlined
className={TYPE_ICON_CLASS_NAME} className={TYPE_ICON_CLASS_NAME}
style={{ style={{ fontSize: fontSize || 'inherit', color: color || 'inherit' }}
fontSize,
color: color || '#BFBFBF',
}}
/> />
); );
}; };

View File

@ -56,10 +56,7 @@ export class MLModelGroupEntity implements Entity<MlModelGroup> {
return ( return (
<CodeSandboxOutlined <CodeSandboxOutlined
className={TYPE_ICON_CLASS_NAME} className={TYPE_ICON_CLASS_NAME}
style={{ style={{ fontSize: fontSize || 'inherit', color: color || 'inherit' }}
fontSize,
color: color || '#BFBFBF',
}}
/> />
); );
}; };

View File

@ -45,10 +45,7 @@ export class MLPrimaryKeyEntity implements Entity<MlPrimaryKey> {
return ( return (
<DotChartOutlined <DotChartOutlined
className={TYPE_ICON_CLASS_NAME} className={TYPE_ICON_CLASS_NAME}
style={{ style={{ fontSize: fontSize || 'inherit', color: color || 'inherit' }}
fontSize,
color: color || '#BFBFBF',
}}
/> />
); );
}; };

View File

@ -27,10 +27,7 @@ export class QueryEntity implements Entity<Query> {
return ( return (
<ConsoleSqlOutlined <ConsoleSqlOutlined
className={TYPE_ICON_CLASS_NAME} className={TYPE_ICON_CLASS_NAME}
style={{ style={{ fontSize: fontSize || 'inherit', color: color || 'inherit' }}
fontSize,
color: color || '#BFBFBF',
}}
/> />
); );
}; };

View File

@ -28,7 +28,7 @@ export class SchemaFieldEntity implements Entity<SchemaField> {
type: EntityType = EntityType.SchemaField; type: EntityType = EntityType.SchemaField;
icon = (fontSize?: number, styleType?: IconStyleType, color = 'inherit') => ( icon = (fontSize?: number, styleType?: IconStyleType, color = 'inherit') => (
<PicCenterOutlined style={{ fontSize, color }} /> <PicCenterOutlined style={{ fontSize: fontSize || 'inherit', color: color || 'inherit' }} />
); );
isSearchEnabled = () => true; isSearchEnabled = () => true;

View File

@ -5,7 +5,6 @@ import Icon, {
FilterOutlined, FilterOutlined,
LineChartOutlined, LineChartOutlined,
} from '@ant-design/icons'; } from '@ant-design/icons';
import ViewComfyOutlinedIcon from '@mui/icons-material/ViewComfyOutlined';
import React from 'react'; import React from 'react';
import TableauEmbeddedDataSourceLogo from '@images/tableau-embedded-data-source.svg?react'; import TableauEmbeddedDataSourceLogo from '@images/tableau-embedded-data-source.svg?react';
@ -47,9 +46,6 @@ export function getSubTypeIcon(subType?: string): JSX.Element | undefined {
if (lowerSubType === SubType.Project.toLowerCase()) { if (lowerSubType === SubType.Project.toLowerCase()) {
return <DeploymentUnitOutlined className={TYPE_ICON_CLASS_NAME} />; return <DeploymentUnitOutlined className={TYPE_ICON_CLASS_NAME} />;
} }
if (lowerSubType === SubType.Table.toLowerCase()) {
return <ViewComfyOutlinedIcon fontSize="inherit" className={TYPE_ICON_CLASS_NAME} />;
}
if (lowerSubType === SubType.View.toLowerCase()) { if (lowerSubType === SubType.View.toLowerCase()) {
return <FilterOutlined className={TYPE_ICON_CLASS_NAME} />; return <FilterOutlined className={TYPE_ICON_CLASS_NAME} />;
} }

View File

@ -32,10 +32,7 @@ export class StructuredPropertyEntity implements Entity<StructuredProperty> {
return ( return (
<TableIcon <TableIcon
className={TYPE_ICON_CLASS_NAME} className={TYPE_ICON_CLASS_NAME}
style={{ style={{ fontSize: fontSize || 'inherit', color: color || 'inherit' }}
fontSize,
color: color || '#BFBFBF',
}}
/> />
); );
}; };

View File

@ -33,10 +33,7 @@ export class TagEntity implements Entity<Tag> {
return ( return (
<TagOutlined <TagOutlined
className={TYPE_ICON_CLASS_NAME} className={TYPE_ICON_CLASS_NAME}
style={{ style={{ fontSize: fontSize || 'inherit', color: color || 'inherit' }}
fontSize,
color: color || '#BFBFBF',
}}
/> />
); );
}; };

View File

@ -27,10 +27,7 @@ export class UserEntity implements Entity<CorpUser> {
return ( return (
<UserOutlined <UserOutlined
className={TYPE_ICON_CLASS_NAME} className={TYPE_ICON_CLASS_NAME}
style={{ style={{ fontSize: fontSize || 'inherit', color: color || 'inherit' }}
fontSize,
color: color || '#BFBFBF',
}}
/> />
); );
}; };

View File

@ -32,6 +32,7 @@ interface Props {
icon?: React.ReactNode; icon?: React.ReactNode;
backgroundSize?: number; backgroundSize?: number;
imgSize?: number; imgSize?: number;
className?: string;
} }
export default function ColoredBackgroundPlatformIconGroup(props: Props) { export default function ColoredBackgroundPlatformIconGroup(props: Props) {
@ -45,6 +46,7 @@ export default function ColoredBackgroundPlatformIconGroup(props: Props) {
icon, icon,
imgSize = 18, imgSize = 18,
backgroundSize = 32, backgroundSize = 32,
className,
} = props; } = props;
const shouldShowSeparateSiblings = useIsShowSeparateSiblingsEnabled(); const shouldShowSeparateSiblings = useIsShowSeparateSiblingsEnabled();
@ -97,5 +99,5 @@ export default function ColoredBackgroundPlatformIconGroup(props: Props) {
); );
}; };
return <PlatformContentWrapper>{renderLogoIcon()}</PlatformContentWrapper>; return <PlatformContentWrapper className={className}>{renderLogoIcon()}</PlatformContentWrapper>;
} }

View File

@ -7,7 +7,6 @@ import { GenericEntityProperties } from '@app/entity/shared/types';
import { EntityMenuActions } from '@app/entityV2/Entity'; import { EntityMenuActions } from '@app/entityV2/Entity';
import { EntityMenuItems } from '@app/entityV2/shared/EntityDropdown/EntityMenuActions'; import { EntityMenuItems } from '@app/entityV2/shared/EntityDropdown/EntityMenuActions';
import MoreOptionsMenuAction from '@app/entityV2/shared/EntityDropdown/MoreOptionsMenuAction'; import MoreOptionsMenuAction from '@app/entityV2/shared/EntityDropdown/MoreOptionsMenuAction';
import { REDESIGN_COLORS } from '@app/entityV2/shared/constants';
import ViewInPlatform from '@app/entityV2/shared/externalUrl/ViewInPlatform'; import ViewInPlatform from '@app/entityV2/shared/externalUrl/ViewInPlatform';
import ColoredBackgroundPlatformIconGroup, { import ColoredBackgroundPlatformIconGroup, {
PlatformContentWrapper, PlatformContentWrapper,
@ -32,18 +31,20 @@ const RowContainer = styled.div`
} }
`; `;
const StyledPlatformIconGroup = styled(ColoredBackgroundPlatformIconGroup)`
margin: 0;
`;
const ContextPathRowContainer = styled(RowContainer)`
align-items: center;
justify-content: start;
`;
const CompactActionsAndStatusSection = styled(ActionsAndStatusSection)` const CompactActionsAndStatusSection = styled(ActionsAndStatusSection)`
justify-content: end; justify-content: end;
margin-right: -0.3rem; margin-right: -0.3rem;
`; `;
const PlatformDivider = styled.div`
font-size: 16px;
margin-right: 0.5rem;
margin-top: -3px;
color: ${REDESIGN_COLORS.TEXT_GREY};
`;
interface Props { interface Props {
name: string; name: string;
urn: string; urn: string;
@ -132,10 +133,10 @@ export const CompactView = ({
)} )}
</CompactActionsAndStatusSection> </CompactActionsAndStatusSection>
</RowContainer> </RowContainer>
<RowContainer> <ContextPathRowContainer>
{isIconPresent ? ( {isIconPresent ? (
<div style={{ display: 'flex', alignItems: 'center' }}> <div style={{ display: 'flex', alignItems: 'center' }}>
<ColoredBackgroundPlatformIconGroup <StyledPlatformIconGroup
platformName={platform} platformName={platform}
platformLogoUrl={logoUrl} platformLogoUrl={logoUrl}
platformNames={platforms} platformNames={platforms}
@ -145,7 +146,6 @@ export const CompactView = ({
imgSize={10} imgSize={10}
backgroundSize={20} backgroundSize={20}
/> />
<PlatformDivider> | </PlatformDivider>
</div> </div>
) : ( ) : (
<div /> <div />
@ -158,7 +158,7 @@ export const CompactView = ({
entityTitleWidth={previewType === PreviewType.HOVER_CARD ? 150 : 200} entityTitleWidth={previewType === PreviewType.HOVER_CARD ? 150 : 200}
isCompactView isCompactView
/> />
</RowContainer> </ContextPathRowContainer>
</> </>
); );
}; };

View File

@ -92,7 +92,7 @@ export default function ContextPath(props: Props) {
const entityRegistry = useEntityRegistryV2(); const entityRegistry = useEntityRegistryV2();
const entityTypeIcon = const entityTypeIcon =
getSubTypeIcon(displayedEntityType) || entityRegistry.getIcon(entityType, 16, IconStyleType.ACCENT, '#8d95b1'); getSubTypeIcon(displayedEntityType) || entityRegistry.getIcon(entityType, undefined, IconStyleType.ACCENT);
const hasBrowsePath = !!browsePaths?.path?.length && !isDefaultBrowsePath(browsePaths); const hasBrowsePath = !!browsePaths?.path?.length && !isDefaultBrowsePath(browsePaths);
const hasParentEntities = !!parentEntities?.length; const hasParentEntities = !!parentEntities?.length;

View File

@ -49,6 +49,10 @@ const Contents = styled.div<{ $disabled?: boolean }>`
} }
`; `;
const StyledLink = styled(Link)`
overflow: hidden;
`;
interface Props { interface Props {
name?: string; name?: string;
linkUrl?: string; linkUrl?: string;
@ -93,9 +97,9 @@ function ContextPathEntry(props: Props) {
return ( return (
<Path isLast={isLast} className={className}> <Path isLast={isLast} className={className}>
{showLink ? ( {showLink ? (
<Link to={linkUrl} data-testid="container" {...linkProps}> <StyledLink to={linkUrl} data-testid="container" {...linkProps}>
{contents} {contents}
</Link> </StyledLink>
) : ( ) : (
contents contents
)} )}