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: Fixed creating new filter options in FilterBox (#3584)
Date Wed, 04 Oct 2017 05:20:12 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 efc6366  Fixed creating new filter options in FilterBox (#3584)
efc6366 is described below

commit efc63669a65fdf105e7acc0cdcc58c3bac11f082
Author: Jeff Niu <jeffniu22@gmail.com>
AuthorDate: Tue Oct 3 22:20:10 2017 -0700

    Fixed creating new filter options in FilterBox (#3584)
---
 superset/assets/visualizations/filter_box.jsx | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/superset/assets/visualizations/filter_box.jsx b/superset/assets/visualizations/filter_box.jsx
index 1bcaa52..e465af5 100644
--- a/superset/assets/visualizations/filter_box.jsx
+++ b/superset/assets/visualizations/filter_box.jsx
@@ -77,19 +77,20 @@ class FilterBox extends React.Component {
     }
     // Add created options to filtersChoices, even though it doesn't exist,
     // or these options will exist in query sql but invisible to end user.
-    if (this.state.selectedValues.hasOwnProperty()) {
-      for (const filterKey of this.state.selectedValues) {
-        const existValues = this.props.filtersChoices[filterKey].map(f => f.id);
-        for (const v of this.state.selectedValues[filterKey]) {
-          if (existValues.indexOf(v) === -1) {
-            const addChoice = {
-              filter: filterKey,
-              id: v,
-              text: v,
-              metric: 0,
-            };
-            this.props.filtersChoices[filterKey].push(addChoice);
-          }
+    for (const filterKey in this.state.selectedValues) {
+      if (!this.state.selectedValues.hasOwnProperty(filterKey)) {
+        continue;
+      }
+      const existValues = this.props.filtersChoices[filterKey].map(f => f.id);
+      for (const v of this.state.selectedValues[filterKey]) {
+        if (existValues.indexOf(v) === -1) {
+          const addChoice = {
+            filter: filterKey,
+            id: v,
+            text: v,
+            metric: 0,
+          };
+          this.props.filtersChoices[filterKey].push(addChoice);
         }
       }
     }

-- 
To stop receiving notification emails like this one, please contact
['"commits@superset.apache.org" <commits@superset.apache.org>'].

Mime
View raw message