Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting filters clears all following filters #3429

Closed
3 tasks done
joshwalters opened this issue Sep 7, 2017 · 4 comments
Closed
3 tasks done

Deleting filters clears all following filters #3429

joshwalters opened this issue Sep 7, 2017 · 4 comments

Comments

@joshwalters
Copy link
Contributor

  • I have checked the superset logs for python stacktraces and included it here as text if any
  • I have reproduced the issue with at least the latest released version of superset
  • I have checked the issue tracker for the same issue and I haven't found one similar

Superset version

0.19.1

Expected results

If there are 2 or more filters in a slice, removing a single filter should leave the other filters unaffected.

Actual results

If a user deletes (clicks on the "-" button) a filter, all the filters below will go empty.

Steps to reproduce

Make a slice with a 3+ filters on different columns. Remove the top filter. You should see that the following filters are now empty.

@Mogball
Copy link
Contributor

Mogball commented Sep 13, 2017

The bug seems to be the result of how the UI widgets are handled.

Clicking the remove button will modify the prop value of FilterControl but the Filter components are not updating the choices for their value selection boxes. The filters appear cleared on the UI (but are actually still in effect) because the value selection box will not display the selected values if they conflict with the available choices.

Triggering a refresh, e.g. by selecting a column in the filter, will properly display the widget.

I've managed to solve this issue by storing the selection choices for each filter in FilterControl instead of Filter, making AJAX calls only when a filter column changes or when adding a new filter, and passing these choices as props.

@xrmx
Copy link
Contributor

xrmx commented Sep 13, 2017

@Mogball PR welcome!

@joshwalters
Copy link
Contributor Author

Merging #3458 fixed this issue.

@xrmx
Copy link
Contributor

xrmx commented Sep 15, 2017

Thanks for the heads up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants