Skip to content

Commit

Permalink
fix: Metric is truncated in tooltip (apache#24555)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-s-molina authored Jun 30, 2023
1 parent c238d97 commit 5bdb774
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
`}
`;

Expand Down
7 changes: 7 additions & 0 deletions superset-frontend/src/components/Tooltip/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 5bdb774

Please sign in to comment.