Skip to content

Commit

Permalink
chore: Displays the dataset description in a tooltip in the datasets …
Browse files Browse the repository at this point in the history
…list (apache#16392)
  • Loading branch information
michael-s-molina authored and Emmanuel Bavoux committed Nov 14, 2021
1 parent bfb85c0 commit 05d276d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
10 changes: 9 additions & 1 deletion superset-frontend/src/components/InfoTooltip/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ const StyledTooltip = styled(Tooltip)`
}
`;

const StyledTooltipTitle = styled.span`
display: -webkit-box;
-webkit-line-clamp: 20;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
`;

const defaultOverlayStyle = {
fontSize: '12px',
lineHeight: '16px',
Expand All @@ -69,7 +77,7 @@ export default function InfoTooltip({
}: InfoTooltipProps) {
return (
<StyledTooltip
title={tooltip}
title={<StyledTooltipTitle>{tooltip}</StyledTooltipTitle>}
placement={placement}
trigger={trigger}
overlayStyle={overlayStyle}
Expand Down
5 changes: 5 additions & 0 deletions superset-frontend/src/views/CRUD/data/dataset/DatasetList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import { Tooltip } from 'src/components/Tooltip';
import Icons from 'src/components/Icons';
import FacePile from 'src/components/FacePile';
import CertifiedIcon from 'src/components/CertifiedIcon';
import InfoTooltip from 'src/components/InfoTooltip';
import ImportModelsModal from 'src/components/ImportModal/index';
import { isFeatureEnabled, FeatureFlag } from 'src/featureFlags';
import WarningIconWithTooltip from 'src/components/WarningIconWithTooltip';
Expand Down Expand Up @@ -228,6 +229,7 @@ const DatasetList: FunctionComponent<DatasetListProps> = ({
original: {
extra,
table_name: datasetTitle,
description,
explore_url: exploreURL,
},
},
Expand All @@ -249,6 +251,9 @@ const DatasetList: FunctionComponent<DatasetListProps> = ({
/>
)}
{titleLink}
{description && (
<InfoTooltip tooltip={description} viewBox="0 -1 24 24" />
)}
</FlexRowContainer>
);
} catch {
Expand Down

0 comments on commit 05d276d

Please sign in to comment.