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

2704 add reset button to gallery page #3350

Merged
merged 10 commits into from
Sep 7, 2023

Conversation

tanayaxsharma
Copy link
Collaborator

Resolves #2704

Added a reset button to the gallery page that clears all filters by using the "unapply" methods from the SeverityBucket.js and ValidationBucket.js files and by implementing setToDefault() methods for ValidationBucket.js and labelTypeMenu.js.

Before/After screenshots

Before:
image

After:
(before resetting filters)
image

(after resetting filters)
image

When testing this, if you originally selected by a certain label type, the cards won't always visibly appear to have reset after clicking the button. However, if you flip through the pages, you will see that all label types are included.

@misaugstad
Copy link
Member

@tanayaxsharma this is what it looks like for me, the clear filters bit isn't showing up :'( I emptied cache and did a hard reload to see if it was something cached, but nothing changed. I'm using Google Chrome. But I did just pull in changes from develop, so it's possible that that could have caused an issue..? Could you test again and see if you see the same thing?

Screenshot from 2023-08-17 15-21-20

@misaugstad
Copy link
Member

So sorry, "label type" wasn't classified as a filter, which is why I wasn't seeing it. OOPS.

@misaugstad
Copy link
Member

Makes me wonder if the UI should be rearranged so that label type is listed as a filter. Maybe being able to select multiple label types..? Thoughts for the future! Will finish the review later!

@jonfroehlich
Copy link
Member

jonfroehlich commented Aug 17, 2023 via email

@misaugstad
Copy link
Member

@jonfroehlich thoughts on just removing the "Show" section, and moving the label type filter as the first thing in the "filter by" section? I figure that we can improve on that design going forward, but that might be good enough for now?

Screenshot from 2023-08-17 15-21-20

@jonfroehlich
Copy link
Member

jonfroehlich commented Aug 17, 2023 via email

@misaugstad
Copy link
Member

Cool. @tanayaxsharma can you actually do this and then include the label type as part of the "reset filters" button?

removing the "Show" section, and moving the label type filter as the first thing in the "filter by" section

@tanayaxsharma
Copy link
Collaborator Author

tanayaxsharma commented Aug 21, 2023

Forgot to comment! I pushed commits that combine the "Show" section with the "Filter by" and fixed the label type resetting.

Here are screenshots-
Before Resetting:
image

After Resetting:
image

Copy link
Member

@misaugstad misaugstad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that I like the horizontal bar above "Reset All", and I especially don't like it when there's nothing to reset.
Screenshot from 2023-08-21 16-08-28

I think I like it better without the line, maybe 5 px of margin above rather than 10 px, and I think we can change from "Reset All" to "Clear Filters". In #2704 we discussed using "Reset All" because label type wasn't being considered a filter, which is no longer an issue :)
Screenshot from 2023-08-21 16-11-13

Other than that, I added a few comments throughout the code, but I think that they are all pretty minor changes!

app/views/gallery.scala.html Outdated Show resolved Hide resolved
public/javascripts/Gallery/src/filter/CardFilter.js Outdated Show resolved Hide resolved
public/javascripts/Gallery/src/filter/CardFilter.js Outdated Show resolved Hide resolved
public/javascripts/Gallery/src/filter/LabelTypeMenu.js Outdated Show resolved Hide resolved
@tanayaxsharma
Copy link
Collaborator Author

I made updates to my code as per your comments! @misaugstad

Copy link
Member

@misaugstad misaugstad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@misaugstad misaugstad merged commit 58ff61c into develop Sep 7, 2023
@misaugstad misaugstad deleted the 2704-add-reset-button-to-gallery-page branch September 7, 2023 19:35
@misaugstad misaugstad mentioned this pull request Sep 29, 2023
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

Successfully merging this pull request may close these issues.

Add reset button (or similar UI) to reset controls on Gallery
3 participants