From c51ca98e142e951414c0ca6c0693c0a3624b5382 Mon Sep 17 00:00:00 2001 From: Sivaramakrishnan Vaidyanathan Date: Fri, 17 May 2024 12:18:14 -0700 Subject: [PATCH] fix: Add back description column to saved queries #12431 (#28349) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: SRK Co-authored-by: ʈᵃᵢ --- .../src/components/ListView/Filters/Search.tsx | 13 ++++++++++++- .../src/components/ListView/Filters/index.tsx | 2 ++ superset-frontend/src/components/ListView/types.ts | 1 + .../src/pages/SavedQueryList/index.tsx | 8 +++++++- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/superset-frontend/src/components/ListView/Filters/Search.tsx b/superset-frontend/src/components/ListView/Filters/Search.tsx index 60cfe41bac070..9fd864c44a41f 100644 --- a/superset-frontend/src/components/ListView/Filters/Search.tsx +++ b/superset-frontend/src/components/ListView/Filters/Search.tsx @@ -22,12 +22,14 @@ import Icons from 'src/components/Icons'; import { AntdInput } from 'src/components'; import { SELECT_WIDTH } from 'src/components/ListView/utils'; import { FormLabel } from 'src/components/Form'; +import InfoTooltip from 'src/components/InfoTooltip'; import { BaseFilter, FilterHandler } from './Base'; interface SearchHeaderProps extends BaseFilter { Header: string; onSubmit: (val: string) => void; name: string; + toolTipDescription: string | undefined; } const Container = styled.div` @@ -43,7 +45,13 @@ const StyledInput = styled(AntdInput)` `; function SearchFilter( - { Header, name, initialValue, onSubmit }: SearchHeaderProps, + { + Header, + name, + initialValue, + toolTipDescription, + onSubmit, + }: SearchHeaderProps, ref: React.RefObject, ) { const [value, setValue] = useState(initialValue || ''); @@ -69,6 +77,9 @@ function SearchFilter( return ( {Header} + {toolTipDescription && ( + + )} { if (onFilterUpdate) { onFilterUpdate(value); diff --git a/superset-frontend/src/components/ListView/types.ts b/superset-frontend/src/components/ListView/types.ts index 1082c764f58ee..ca3a8b3c70923 100644 --- a/superset-frontend/src/components/ListView/types.ts +++ b/superset-frontend/src/components/ListView/types.ts @@ -39,6 +39,7 @@ export interface Filter { Header: ReactNode; key: string; id: string; + toolTipDescription?: string; urlDisplay?: string; operator?: FilterOperator; input?: diff --git a/superset-frontend/src/pages/SavedQueryList/index.tsx b/superset-frontend/src/pages/SavedQueryList/index.tsx index bbad3c89fb884..136f708122f82 100644 --- a/superset-frontend/src/pages/SavedQueryList/index.tsx +++ b/superset-frontend/src/pages/SavedQueryList/index.tsx @@ -297,6 +297,10 @@ function SavedQueryList({ accessor: 'label', Header: t('Name'), }, + { + accessor: 'description', + Header: t('Description'), + }, { accessor: 'database.database_name', Header: t('Database'), @@ -443,11 +447,13 @@ function SavedQueryList({ const filters: Filters = useMemo( () => [ { - Header: t('Name'), + Header: t('Search'), id: 'label', key: 'search', input: 'search', operator: FilterOperator.AllText, + toolTipDescription: + 'Searches all text fields: Name, Description, Database & Schema', }, { Header: t('Database'),