mirror of https://github.com/apache/superset.git
fix: Metric is truncated in tooltip (#24555)
This commit is contained in:
parent
c238d9733a
commit
5bdb774504
|
@ -31,6 +31,13 @@ const TooltipSectionWrapper = styled.div`
|
|||
&:not(:last-of-type) {
|
||||
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;
|
||||
}
|
||||
`}
|
||||
`;
|
||||
|
||||
|
|
|
@ -45,6 +45,13 @@ export const Tooltip = (props: TooltipProps) => {
|
|||
/>
|
||||
<AntdTooltip
|
||||
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`}
|
||||
{...props}
|
||||
/>
|
||||
|
|
|
@ -89,8 +89,7 @@ export default class AdhocMetric {
|
|||
}
|
||||
|
||||
getDefaultLabel() {
|
||||
const label = this.translateToSql({ useVerboseName: true });
|
||||
return label.length < 43 ? label : `${label.substring(0, 40)}...`;
|
||||
return this.translateToSql({ useVerboseName: true });
|
||||
}
|
||||
|
||||
translateToSql(
|
||||
|
|
Loading…
Reference in New Issue