You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by el...@apache.org on 2021/11/22 19:54:59 UTC
[superset] 02/03: fix: Allow users to update database in Dataset Edit Modal (#17265)
This is an automated email from the ASF dual-hosted git repository.
elizabeth pushed a commit to branch 1.4
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 30c6ec07ef8f9b4601981cabb2e74dc6d0131b2a
Author: Hugh A. Miles II <hu...@gmail.com>
AuthorDate: Fri Oct 29 17:19:37 2021 -0400
fix: Allow users to update database in Dataset Edit Modal (#17265)
* add condition to fix save
* remove console.log
(cherry picked from commit d0bad96b1ab9065a5e1d313793da35089ee1f07c)
---
superset-frontend/src/datasource/DatasourceEditor.jsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/superset-frontend/src/datasource/DatasourceEditor.jsx b/superset-frontend/src/datasource/DatasourceEditor.jsx
index e80e402..8150971 100644
--- a/superset-frontend/src/datasource/DatasourceEditor.jsx
+++ b/superset-frontend/src/datasource/DatasourceEditor.jsx
@@ -471,7 +471,6 @@ class DatasourceEditor extends React.PureComponent {
const { datasourceType, datasource } = this.state;
const sql =
datasourceType === DATASOURCE_TYPES.physical.key ? '' : datasource.sql;
-
const newDatasource = {
...this.state.datasource,
sql,
@@ -489,6 +488,7 @@ class DatasourceEditor extends React.PureComponent {
}
onDatasourcePropChange(attr, value) {
+ if (value === undefined) return; // if value is undefined do not update state
const datasource = { ...this.state.datasource, [attr]: value };
this.setState(
prevState => ({