superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maximebeauche...@apache.org
Subject [incubator-superset] branch master updated: Translate string to array for multi fields in getControlsState (#5057)
Date Thu, 24 May 2018 05:30:49 GMT
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 1aaa73b  Translate string to array for multi fields in getControlsState (#5057)
1aaa73b is described below

commit 1aaa73b54803094eba73d29800c06d56708e1966
Author: michellethomas <michelle.q.thomas@gmail.com>
AuthorDate: Wed May 23 22:30:44 2018 -0700

    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
---
 superset/assets/src/explore/store.js | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/superset/assets/src/explore/store.js b/superset/assets/src/explore/store.js
index 4f1e7b5..32c132f 100644
--- a/superset/assets/src/explore/store.js
+++ b/superset/assets/src/explore/store.js
@@ -56,6 +56,9 @@ export function getControlsState(state, form_data) {
       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 (control.type === 'SelectControl' && control.choices && k !== 'datasource'
&& formData[k]) {
       const choiceValues = control.choices.map(c => c[0]);

-- 
To stop receiving notification emails like this one, please contact
maximebeauchemin@apache.org.

Mime
View raw message