This commit is contained in:
vera-liu 2017-02-28 14:34:09 -08:00 committed by GitHub
parent dd9f431b6f
commit fc64a75fbd

View File

@ -97,8 +97,12 @@ export default class Filter extends React.Component {
this.fetchFilterValues(filter.col);
}
}
// switching filter value between array/string when needed
if (strFilterOps.indexOf(filter.op) !== -1) {
// druid having filter or regex/==/!= filters
if (typeof filter.val !== 'string') {
this.props.changeFilter('val', filter.val.length > 0 ? filter.val[0] : '');
}
return (
<input
type="text"
@ -109,6 +113,9 @@ export default class Filter extends React.Component {
/>
);
}
if (typeof filter.val === 'string') {
this.props.changeFilter('val', filter.val === '' ? [] : [filter.val]);
}
return (
<SelectControl
multi