mirror of
https://github.com/apache/superset.git
synced 2026-04-17 15:15:20 +00:00
Vliu put datasource in store (#1610)
* Move datasource from global store object to form_data * Moved datasource_id and datasource_name to form_data * Refetch defaultFormData when switching datasource * Fixed js tests
This commit is contained in:
@@ -31,7 +31,11 @@ export default class SelectField extends React.Component {
|
||||
if (this.props.multi) {
|
||||
optionValue = opt ? opt.map((o) => o.value) : null;
|
||||
}
|
||||
this.props.onChange(this.props.name, optionValue);
|
||||
if (this.props.name === 'datasource' && optionValue !== null) {
|
||||
this.props.onChange(this.props.name, optionValue, opt.label);
|
||||
} else {
|
||||
this.props.onChange(this.props.name, optionValue);
|
||||
}
|
||||
}
|
||||
render() {
|
||||
const options = this.props.choices.map((c) => ({ value: c[0], label: c[1] }));
|
||||
|
||||
Reference in New Issue
Block a user