From d3f930a5575f03bc5f4f468b8bf37e834bf2aa4d Mon Sep 17 00:00:00 2001 From: Phillip Kelley-Dotson Date: Fri, 28 Oct 2022 11:43:42 -0700 Subject: [PATCH] fix: add form data for empty state control to save dataset (#21944) --- .../src/SqlLab/components/SaveDatasetModal/index.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx b/superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx index 0bc9f574f098f..10c1aaf414832 100644 --- a/superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx +++ b/superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx @@ -66,6 +66,12 @@ export interface ISimpleColumn { is_dttm?: boolean | null; } +export type Database = { + backend: string; + id: number; + parameter: object; +}; + export interface ISaveableDatasource { columns: ISimpleColumn[]; name: string; @@ -73,6 +79,7 @@ export interface ISaveableDatasource { sql: string; templateParams?: string | object | null; schema?: string | null; + database?: Database; } interface SaveDatasetModalProps { @@ -283,7 +290,7 @@ export const SaveDatasetModal = ({ createDatasource({ schema: datasource.schema, sql: datasource.sql, - dbId: datasource.dbId, + dbId: datasource.dbId || datasource?.database?.id, templateParams, datasourceName: datasetName, columns: selectedColumns,