From eeecd59c9d8156f2883ace2a8aa8c833a483fefe Mon Sep 17 00:00:00 2001 From: Sam Firke Date: Wed, 30 Aug 2023 17:34:03 -0400 Subject: [PATCH] refactor(frontend): make "Search" box the first filter for charts and datasets (#25129) --- superset-frontend/src/pages/ChartList/index.tsx | 14 +++++++------- superset-frontend/src/pages/DatasetList/index.tsx | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/superset-frontend/src/pages/ChartList/index.tsx b/superset-frontend/src/pages/ChartList/index.tsx index e94dc426b1..e47f479811 100644 --- a/superset-frontend/src/pages/ChartList/index.tsx +++ b/superset-frontend/src/pages/ChartList/index.tsx @@ -589,6 +589,13 @@ function ChartList(props: ChartListProps) { const filters: Filters = useMemo(() => { const filters_list = [ + { + Header: t('Search'), + key: 'search', + id: 'slice_name', + input: 'search', + operator: FilterOperator.chartAllText, + }, { Header: t('Owner'), key: 'owner', @@ -705,13 +712,6 @@ function ChartList(props: ChartListProps) { fetchSelects: loadTags, }); } - filters_list.push({ - Header: t('Search'), - key: 'search', - id: 'slice_name', - input: 'search', - operator: FilterOperator.chartAllText, - }); return filters_list; }, [addDangerToast, favoritesFilter, props.user]); diff --git a/superset-frontend/src/pages/DatasetList/index.tsx b/superset-frontend/src/pages/DatasetList/index.tsx index 0f3fb84ab1..76d96757c0 100644 --- a/superset-frontend/src/pages/DatasetList/index.tsx +++ b/superset-frontend/src/pages/DatasetList/index.tsx @@ -521,6 +521,13 @@ const DatasetList: FunctionComponent = ({ const filterTypes: Filters = useMemo( () => [ + { + Header: t('Search'), + key: 'search', + id: 'table_name', + input: 'search', + operator: FilterOperator.contains, + }, { Header: t('Owner'), key: 'owner', @@ -598,13 +605,6 @@ const DatasetList: FunctionComponent = ({ { label: t('No'), value: false }, ], }, - { - Header: t('Search'), - key: 'search', - id: 'table_name', - input: 'search', - operator: FilterOperator.contains, - }, ], [user], );