Closed Bug 1053384 Opened 10 years ago Closed 9 years ago

can't clear filters when there are no results

Categories

(Input Graveyard :: Dashboard, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: willkg, Assigned: lgp171188, Mentored)

Details

(Whiteboard: u=user c=dashboard p= s=input.2015q1)

If you do a search that doesn't bring up any results, then there's no facet data. Because we tie the filter ui with facet data, if there's no facet data, then there's no way to clear a filter without futzing with the querystring.

Cheng's STR:

1. go to https://input.mozilla.org/
2. click on "Firefox" product
3. click on "OSX" platform
4. search for something that doesn't bring up results

Outcome: The facets on the left side are all blank, so you can't uncheck a filter you have enabled.

Expected: Need a way to be able to clear filters when you've drilled down to a state where there are no results.


This affects both the public and analyzer's search dashboards.
This is annoying, but it's not something that *has* to get fixed soon. I'm going to stick it in this quarter in case I have time for it.
Priority: -- → P3
Whiteboard: u=user c=dashboard p= s=input.2014q3
Possible solutions off the top of my head while I'm thinking about this before I stop thinking about this to work on EU stuff again:

1. Make sure the selected filters show up in the bar with 0 values so they can be unchecked.

2. Add a "Clear filter" thing for each section.
Whiteboard: u=user c=dashboard p= s=input.2014q3 → u=user c=dashboard p= s=input.2014q4
I thought about this some more and I think the user experience and flow works better with option 1.

So I think the way we should fix this is to make sure that a selected filter shows up in the bar even if it has 0 count.

https://github.com/mozilla/fjord/blob/master/fjord/analytics/views.py#L351

"filter_data" is the data structure that we generate the facet filter sidebar from. It gets populated with transformations of data in "counts". I think the easy way to fix this is to add some code that runs just before we build "filter_data", makes sure the value being filtered is in "counts" and if not, adds it with a value of 0. If we do that, I think then the rest of the code runs and it'll all just work out magically.

This is all in Python land.

You probably want to see what "counts" looks like when the dashboard view runs first and then figure out how to insert the things that need to be in there.

We'll also want to have a test to make sure when the filter value is zero, a filter entry in the sidebar still shows up.

The tests for the dashboard view are in:

https://github.com/mozilla/fjord/blob/master/fjord/analytics/tests/test_views.py

You'll want to use PyQuery to help you figure out if the filter that you want to be there is there and has a value of 0.
Bumping this to 2015q1 because we're out of time for this quarter.
Whiteboard: u=user c=dashboard p= s=input.2014q4 → u=user c=dashboard p= s=input.2015q1
The description and comments should cover the problem and what needs to be done to fix it.

Marking this as a mentored bug. If you're interested in working on it, please read through our "Join this project" guide [1], complete the list of things you need to do before contributing and then add a comment to this bug asking to have it assigned to you.

If you have any questions, please ask in the bug comments, on the mailing list or in the #input channel on irc.mozilla.org.

[1] http://fjord.readthedocs.org/en/latest/welcome.html
Mentor: willkg
Whiteboard: u=user c=dashboard p= s=input.2015q1 → u=user c=dashboard p= s=
In a PR: https://github.com/mozilla/fjord/pull/481

Landed in master: https://github.com/mozilla/fjord/commit/39f3d25ce333cb0e01646ac951a21c9131353055

I'll push this out on Monday.
Assignee: nobody → lgp171188
Status: NEW → ASSIGNED
Whiteboard: u=user c=dashboard p= s= → u=user c=dashboard p= s=input.2015q1
Pushed to prod just now. Thank you!
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Reopening because lguruprasad found an issue with the happy/sad filter:

<guruprasad> the fix of mine regarding filters that you deployed today
<guruprasad> it has a minor issue
<guruprasad> it looks like when filtering on happy/sad and using a search term that yields 0 results
<guruprasad> the correct filter is not being set in the sidebar.
<guruprasad> So can you please reopen the bug?
<guruprasad> I will work on it and fix it
<guruprasad> From my testing, it works fine for other types of filters
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
In a pull request - https://github.com/mozilla/fjord/pull/486
Pushed the last bit to prod just now. Marking as FIXED.
Status: REOPENED → RESOLVED
Closed: 9 years ago9 years ago
Resolution: --- → FIXED
Product: Input → Input Graveyard
You need to log in before you can comment on or make changes to this bug.