fix: null schema issue in saved queries (#18849)

This commit is contained in:
Smart-Codi 2022-02-25 15:07:46 +00:00 committed by GitHub
parent fd4bd1edbc
commit 79633ce673
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,7 +39,7 @@ interface actionsTypes {
addTable: (queryEditor: any, value: any, schema: any) => void;
setDatabases: (arg0: any) => {};
addDangerToast: (msg: string) => void;
queryEditorSetSchema: (schema?: string) => void;
queryEditorSetSchema: (queryEditor: QueryEditor, schema?: string) => void;
queryEditorSetSchemaOptions: () => void;
queryEditorSetTableOptions: (options: Array<any>) => void;
resetState: () => void;
@ -132,6 +132,10 @@ export default function SqlEditorLeftBar({
const shouldShowReset = window.location.search === '?reset=1';
const tableMetaDataHeight = height - 130; // 130 is the height of the selects above
const onSchemaChange = (schema: string) => {
actions.queryEditorSetSchema(queryEditor, schema);
};
return (
<div className="SqlEditorLeftBar">
<TableSelector
@ -139,7 +143,7 @@ export default function SqlEditorLeftBar({
getDbList={actions.setDatabases}
handleError={actions.addDangerToast}
onDbChange={onDbChange}
onSchemaChange={actions.queryEditorSetSchema}
onSchemaChange={onSchemaChange}
onSchemasLoad={actions.queryEditorSetSchemaOptions}
onTableChange={onTableChange}
onTablesLoad={actions.queryEditorSetTableOptions}