Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Displays the dataset description in a tooltip in the datasets list #16392

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
kgabryje marked this conversation as resolved.
Show resolved Hide resolved
-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