From 6388dce1d86b7fb88c5791f7cdbd1836a459ce61 Mon Sep 17 00:00:00 2001 From: Stephen Liu <750188453@qq.com> Date: Wed, 19 Jan 2022 21:24:17 +0800 Subject: [PATCH] feat: add chart description in info tooltip (#17207) * feat: add chart list description * fix: text overflow * fix: text-overflow with line-height --- .../src/views/CRUD/chart/ChartList.tsx | 43 ++++++++++++++----- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/superset-frontend/src/views/CRUD/chart/ChartList.tsx b/superset-frontend/src/views/CRUD/chart/ChartList.tsx index 1de33088dfe11..cd3051444fa78 100644 --- a/superset-frontend/src/views/CRUD/chart/ChartList.tsx +++ b/superset-frontend/src/views/CRUD/chart/ChartList.tsx @@ -58,9 +58,26 @@ 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 CertifiedBadge from 'src/components/CertifiedBadge'; 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 ' + @@ -246,20 +263,26 @@ function ChartList(props: ChartListProps) { slice_name: sliceName, certified_by: certifiedBy, certification_details: certificationDetails, + description, }, }, }: any) => ( - - {certifiedBy && ( - <> - {' '} - + + + {certifiedBy && ( + <> + {' '} + + )} + {sliceName} + + {description && ( + )} - {sliceName} - + ), Header: t('Chart'), accessor: 'slice_name',