Skip to content

Commit

Permalink
When removing filter values for an IN type, make sure to remove the f…
Browse files Browse the repository at this point in the history
…ilter if there are no filtering values. (apache#2)
  • Loading branch information
Greg Hulands authored and cesardelgado committed Sep 19, 2017
1 parent c5252d0 commit 336311c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion superset/assets/javascripts/dashboard/Dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,14 @@ export function dashboardContainer(dashboard, datasources, userid) {
this.filters[sliceId] = {};
}
if (!(col in this.filters[sliceId]) || !merge) {
this.filters[sliceId][col] = vals;
if (vals.length == 0) {
delete this.filters[sliceId][col];
if (Object.keys(this.filters[sliceId]).length === 0 && this.filters[sliceId].constructor === Object) {
this.clearFilters(sliceId);
}
} else {
this.filters[sliceId][col] = vals;
}

// d3.merge pass in array of arrays while some value form filter components
// from and to filter box require string to be process and return
Expand Down

0 comments on commit 336311c

Please sign in to comment.