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

feat: add chart description in info tooltip #17207

Merged
merged 5 commits into from
Jan 19, 2022
Merged
Changes from 3 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
30 changes: 26 additions & 4 deletions superset-frontend/src/views/CRUD/chart/ChartList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,25 @@ import { Tooltip } from 'src/components/Tooltip';
import Icons from 'src/components/Icons';
import { nativeFilterGate } from 'src/dashboard/components/nativeFilters/utils';
import setupPlugins from 'src/setup/setupPlugins';
import InfoTooltip from 'src/components/InfoTooltip';
import ChartCard from './ChartCard';

const FlexRowContainer = styled.div`
align-items: center;
display: flex;

a {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
line-height: 1.2;
}

svg {
margin-right: ${({ theme }) => theme.gridUnit}px;
}
`;

const PAGE_SIZE = 25;
const PASSWORDS_NEEDED_MESSAGE = t(
'The passwords for the databases below are needed in order to ' +
Expand Down Expand Up @@ -237,12 +254,17 @@ function ChartList(props: ChartListProps) {
{
Cell: ({
row: {
original: { url, slice_name: sliceName },
original: { url, slice_name: sliceName, description },
},
}: any) => (
<a href={url} data-test={`${sliceName}-list-chart-title`}>
{sliceName}
</a>
<FlexRowContainer>
<a href={url} data-test={`${sliceName}-list-chart-title`}>
{sliceName}
</a>
{description && (
<InfoTooltip tooltip={description} viewBox="0 -1 24 24" />
)}
</FlexRowContainer>
),
Header: t('Chart'),
accessor: 'slice_name',
Expand Down