Skip to content

Commit

Permalink
fix: Disable filtering on wide result sets (apache#18021)
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Ritter authored and shcoderAlex committed Feb 7, 2022
1 parent 8cea254 commit f3d4e6b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions superset-frontend/src/SqlLab/components/ResultSet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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')
}
/>
)}
</ResultSetControls>
Expand Down

0 comments on commit f3d4e6b

Please sign in to comment.