This is an automated email from the ASF dual-hosted git repository.

erikrit 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 4e71491  fix: FilterBox JS when no results (#10143)
4e71491 is described below

commit 4e71491d869066061e02571dba060dbc3550eac0
Author: Jesse Yang <jesse.y...@airbnb.com>
AuthorDate: Wed Jun 24 08:09:14 2020 -0700

    fix: FilterBox JS when no results (#10143)
---
 superset-frontend/src/visualizations/FilterBox/FilterBox.jsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/superset-frontend/src/visualizations/FilterBox/FilterBox.jsx 
b/superset-frontend/src/visualizations/FilterBox/FilterBox.jsx
index 0b6d784a..7a9aa7a 100644
--- a/superset-frontend/src/visualizations/FilterBox/FilterBox.jsx
+++ b/superset-frontend/src/visualizations/FilterBox/FilterBox.jsx
@@ -143,7 +143,7 @@ class FilterBox extends React.Component {
     let vals = null;
     if (options !== null) {
       if (Array.isArray(options)) {
-        vals = options.map(opt => opt.value);
+        vals = options.map(opt => (typeof opt === 'string' ? opt : opt.value));
       } else if (options.value) {
         vals = options.value;
       } else {
@@ -254,7 +254,7 @@ class FilterBox extends React.Component {
           });
       });
     const { key, label } = filterConfig;
-    const data = this.props.filtersChoices[key];
+    const data = filtersChoices[key] || [];
     const max = Math.max(...data.map(d => d.metric));
     let value = selectedValues[key] || null;
 

Reply via email to