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: Remove dependency warnings from SqlEditorLeftBar/index.tsx #22975

Merged
merged 1 commit into from
Feb 15, 2023
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
59 changes: 37 additions & 22 deletions superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,35 +210,50 @@ const SqlEditorLeftBar = ({
const shouldShowReset = window.location.search === '?reset=1';
const tableMetaDataHeight = height - 130; // 130 is the height of the selects above

const handleSchemaChange = useCallback((schema: string) => {
if (queryEditor) {
dispatch(queryEditorSetSchema(queryEditor, schema));
}
}, []);
const handleSchemaChange = useCallback(
(schema: string) => {
if (queryEditor) {
dispatch(queryEditorSetSchema(queryEditor, schema));
}
},
[dispatch, queryEditor],
);

const handleTablesLoad = useCallback((options: Array<any>) => {
if (queryEditor) {
dispatch(queryEditorSetTableOptions(queryEditor, options));
}
}, []);
const handleTablesLoad = useCallback(
(options: Array<any>) => {
if (queryEditor) {
dispatch(queryEditorSetTableOptions(queryEditor, options));
}
},
[dispatch, queryEditor],
);

const handleSchemasLoad = useCallback((options: Array<any>) => {
if (queryEditor) {
dispatch(queryEditorSetSchemaOptions(queryEditor, options));
}
}, []);
const handleSchemasLoad = useCallback(
(options: Array<any>) => {
if (queryEditor) {
dispatch(queryEditorSetSchemaOptions(queryEditor, options));
}
},
[dispatch, queryEditor],
);

const handleDbList = useCallback((result: DatabaseObject) => {
dispatch(setDatabases(result));
}, []);
const handleDbList = useCallback(
(result: DatabaseObject) => {
dispatch(setDatabases(result));
},
[dispatch],
);

const handleError = useCallback((message: string) => {
dispatch(addDangerToast(message));
}, []);
const handleError = useCallback(
(message: string) => {
dispatch(addDangerToast(message));
},
[dispatch],
);

const handleResetState = useCallback(() => {
dispatch(resetState());
}, []);
}, [dispatch]);

return (
<LeftBarStyles data-test="sql-editor-left-bar">
Expand Down