fix: Metric is truncated in tooltip (#24555)

This commit is contained in:
Michael S. Molina 2023-06-30 08:18:47 -03:00 committed by GitHub
parent c238d9733a
commit 5bdb774504
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 2 deletions

View File

@ -31,6 +31,13 @@ const TooltipSectionWrapper = styled.div`
&:not(:last-of-type) { &:not(:last-of-type) {
margin-bottom: ${theme.gridUnit * 2}px; margin-bottom: ${theme.gridUnit * 2}px;
} }
&:last-of-type {
display: -webkit-box;
-webkit-line-clamp: 40;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
`} `}
`; `;

View File

@ -45,6 +45,13 @@ export const Tooltip = (props: TooltipProps) => {
/> />
<AntdTooltip <AntdTooltip
overlayStyle={{ fontSize: theme.typography.sizes.s, lineHeight: '1.6' }} overlayStyle={{ fontSize: theme.typography.sizes.s, lineHeight: '1.6' }}
overlayInnerStyle={{
display: '-webkit-box',
overflow: 'hidden',
WebkitLineClamp: 40,
WebkitBoxOrient: 'vertical',
textOverflow: 'ellipsis',
}}
color={`${theme.colors.grayscale.dark2}e6`} color={`${theme.colors.grayscale.dark2}e6`}
{...props} {...props}
/> />

View File

@ -89,8 +89,7 @@ export default class AdhocMetric {
} }
getDefaultLabel() { getDefaultLabel() {
const label = this.translateToSql({ useVerboseName: true }); return this.translateToSql({ useVerboseName: true });
return label.length < 43 ? label : `${label.substring(0, 40)}...`;
} }
translateToSql( translateToSql(