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

fix: Add back description column to saved queries #12431 #28349

Merged
merged 7 commits into from
May 17, 2024
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
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',
imancrsrk marked this conversation as resolved.
Show resolved Hide resolved
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
Loading