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: Disable filtering on wide result sets #18021

Merged
Merged
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
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