mirror of https://github.com/apache/superset.git
fix: FilterBox JS when no results (#10143)
This commit is contained in:
parent
763b38591c
commit
4e71491d86
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue