mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
fix: Allow users to update database in Dataset Edit Modal (#17265)
* add condition to fix save * remove console.log
This commit is contained in:
parent
b7bda7031e
commit
d0bad96b1a
@ -471,7 +471,6 @@ class DatasourceEditor extends React.PureComponent {
|
|||||||
const { datasourceType, datasource } = this.state;
|
const { datasourceType, datasource } = this.state;
|
||||||
const sql =
|
const sql =
|
||||||
datasourceType === DATASOURCE_TYPES.physical.key ? '' : datasource.sql;
|
datasourceType === DATASOURCE_TYPES.physical.key ? '' : datasource.sql;
|
||||||
|
|
||||||
const newDatasource = {
|
const newDatasource = {
|
||||||
...this.state.datasource,
|
...this.state.datasource,
|
||||||
sql,
|
sql,
|
||||||
@ -489,6 +488,7 @@ class DatasourceEditor extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onDatasourcePropChange(attr, value) {
|
onDatasourcePropChange(attr, value) {
|
||||||
|
if (value === undefined) return; // if value is undefined do not update state
|
||||||
const datasource = { ...this.state.datasource, [attr]: value };
|
const datasource = { ...this.state.datasource, [attr]: value };
|
||||||
this.setState(
|
this.setState(
|
||||||
prevState => ({
|
prevState => ({
|
||||||
|
Loading…
Reference in New Issue
Block a user