mirror of https://github.com/apache/superset.git
Translate string to array for multi fields in getControlsState (#5057)
* Translate string to array for multi fields in getControlsState * Updating format to fit on one line
This commit is contained in:
parent
05061a73ce
commit
1aaa73b548
|
@ -56,6 +56,9 @@ export function getControlsState(state, form_data) {
|
||||||
delete control.mapStateToProps;
|
delete control.mapStateToProps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
formData[k] = (control.multi && formData[k] && !Array.isArray(formData[k])) ? [formData[k]]
|
||||||
|
: formData[k];
|
||||||
|
|
||||||
// If the value is not valid anymore based on choices, clear it
|
// If the value is not valid anymore based on choices, clear it
|
||||||
if (control.type === 'SelectControl' && control.choices && k !== 'datasource' && formData[k]) {
|
if (control.type === 'SelectControl' && control.choices && k !== 'datasource' && formData[k]) {
|
||||||
const choiceValues = control.choices.map(c => c[0]);
|
const choiceValues = control.choices.map(c => c[0]);
|
||||||
|
|
Loading…
Reference in New Issue