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

chore: migrate QueryTable component from jsx to tsx #17944

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
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ import QueryTable from 'src/SqlLab/components/QueryTable';

interface QueryHistoryProps {
queries: Query[];
actions: Record<string, unknown>;
actions: {
queryEditorSetSql: Function;
cloneQueryToNewTab: Function;
fetchQueryResults: Function;
clearQueryResults: Function;
removeQuery: Function;
};
displayLimit: number;
}

Expand Down
5 changes: 5 additions & 0 deletions superset-frontend/src/SqlLab/components/QuerySearch/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ interface QuerySearchProps {
actions: {
addDangerToast: (msg: string) => void;
setDatabases: (data: Record<string, any>) => Record<string, any>;
queryEditorSetSql: Function;
cloneQueryToNewTab: Function;
fetchQueryResults: Function;
clearQueryResults: Function;
removeQuery: Function;
};
displayLimit: number;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ import TableView from 'src/components/TableView';
import TableCollection from 'src/components/TableCollection';
import { Provider } from 'react-redux';
import { queries, user } from 'src/SqlLab/fixtures';
import * as actions from 'src/SqlLab/actions/sqlLab';

describe('QueryTable', () => {
const mockedProps = {
queries,
displayLimit: 100,
actions,
};
it('is valid', () => {
expect(React.isValidElement(<QueryTable displayLimit={100} />)).toBe(true);
Expand Down
Loading