From 79633ce673dd1cf62b6a5004be1b5bceeddd7597 Mon Sep 17 00:00:00 2001 From: Smart-Codi Date: Fri, 25 Feb 2022 15:07:46 +0000 Subject: [PATCH] fix: null schema issue in saved queries (#18849) --- .../src/SqlLab/components/SqlEditorLeftBar/index.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx b/superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx index 4ea89ad477..7bbdfcf634 100644 --- a/superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx +++ b/superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx @@ -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) => 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 (