From 343d3f8f7a3bfb083164fba6afce40daec26fcaa Mon Sep 17 00:00:00 2001 From: Erik Ritter Date: Thu, 13 Jan 2022 10:11:18 -0800 Subject: [PATCH] fix: Disable filtering on wide result sets (#18021) --- .../src/SqlLab/components/ResultSet/index.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/superset-frontend/src/SqlLab/components/ResultSet/index.tsx b/superset-frontend/src/SqlLab/components/ResultSet/index.tsx index fde7f19c1a460..a341e82e9f33a 100644 --- a/superset-frontend/src/SqlLab/components/ResultSet/index.tsx +++ b/superset-frontend/src/SqlLab/components/ResultSet/index.tsx @@ -37,7 +37,9 @@ import { SaveDatasetModal } from 'src/SqlLab/components/SaveDatasetModal'; import { UserWithPermissionsAndRoles } from 'src/types/bootstrapTypes'; import ProgressBar from 'src/components/ProgressBar'; import Loading from 'src/components/Loading'; -import FilterableTable from 'src/components/FilterableTable/FilterableTable'; +import FilterableTable, { + MAX_COLUMNS_FOR_TABLE, +} from 'src/components/FilterableTable/FilterableTable'; import CopyToClipboard from 'src/components/CopyToClipboard'; import { prepareCopyToClipboardTabularData } from 'src/utils/common'; import { exploreChart } from 'src/explore/exploreUtils'; @@ -560,7 +562,12 @@ export default class ResultSet extends React.PureComponent< onChange={this.changeSearch} value={this.state.searchText} className="form-control input-sm" - placeholder={t('Filter results')} + disabled={columns.length > MAX_COLUMNS_FOR_TABLE} + placeholder={ + columns.length > MAX_COLUMNS_FOR_TABLE + ? t('Too many columns to filter') + : t('Filter results') + } /> )}