Skip to content

Commit

Permalink
fix: Add back description column to saved queries #12431 (#28349)
Browse files Browse the repository at this point in the history
Co-authored-by: SRK <[email protected]>
Co-authored-by: ʈᵃᵢ <[email protected]>
  • Loading branch information
3 people committed May 17, 2024
1 parent c9aa4a1 commit c51ca98
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
13 changes: 12 additions & 1 deletion superset-frontend/src/components/ListView/Filters/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -43,7 +45,13 @@ const StyledInput = styled(AntdInput)`
`;

function SearchFilter(
{ Header, name, initialValue, onSubmit }: SearchHeaderProps,
{
Header,
name,
initialValue,
toolTipDescription,
onSubmit,
}: SearchHeaderProps,
ref: React.RefObject<FilterHandler>,
) {
const [value, setValue] = useState(initialValue || '');
Expand All @@ -69,6 +77,9 @@ function SearchFilter(
return (
<Container>
<FormLabel>{Header}</FormLabel>
{toolTipDescription && (
<InfoTooltip tooltip={toolTipDescription} viewBox="0 -7 28 28" />
)}
<StyledInput
allowClear
data-test="filters-search"
Expand Down
2 changes: 2 additions & 0 deletions superset-frontend/src/components/ListView/Filters/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ function UIFilters(
input,
paginate,
selects,
toolTipDescription,
onFilterUpdate,
},
index,
Expand Down Expand Up @@ -111,6 +112,7 @@ function UIFilters(
initialValue={initialValue}
key={key}
name={id}
toolTipDescription={toolTipDescription}
onSubmit={(value: string) => {
if (onFilterUpdate) {
onFilterUpdate(value);
Expand Down
1 change: 1 addition & 0 deletions superset-frontend/src/components/ListView/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export interface Filter {
Header: ReactNode;
key: string;
id: string;
toolTipDescription?: string;
urlDisplay?: string;
operator?: FilterOperator;
input?:
Expand Down
8 changes: 7 additions & 1 deletion superset-frontend/src/pages/SavedQueryList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,10 @@ function SavedQueryList({
accessor: 'label',
Header: t('Name'),
},
{
accessor: 'description',
Header: t('Description'),
},
{
accessor: 'database.database_name',
Header: t('Database'),
Expand Down Expand Up @@ -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'),
Expand Down

0 comments on commit c51ca98

Please sign in to comment.