addons-server
addons-server copied to clipboard
Show all possible reasons for NeedsHumanReview in review queue filter UI
Fixes https://github.com/mozilla/addons/issues/15148
Description
Expand the review queue filtering UI to show all possible reasons for needing human review, with select all/none links.
Context
Filtering by reason depends on an annotation that is set by the main queryset by re-using all possible reasons exposed by get_due_date_reason_q_objects(), which itself depends on NeedsHumanReview's REASONS. So this patch does a few things:
- Expand the choice class for
REASONSto expose anannotationproperty containing the name of the annotation corresponding to the reason, which is built using the constant name - Loop over all possible reasons in
get_due_date_reason_q_objects(). This method serves two purposes, setting due date if necessary, and exposing the reasons as keys in the returned dict. Previously we used to hardcode which reasons we cared about and have a special "other" that excluded all the others, that is not necessary any more since we are going through all possible choices. As before, special care was taken to deal with reasons fromABUSE_OR_APPEAL_RELATEDas well asDEVELOPER_REPLYas they behave slightly differently (they are always applied regardless of the state of the version) - this is irrelevant for this change, but matters for setting the due date so this had to keep working as before. - Remove the hardcoded reasons in
VIEW_FLAGS, we dynamically build the expected flags and their labels from theREASONS - Remove the usage of
VIEW_FLAGSinReviewQueueFilterand directly useREASONS - Add a
select allandselect noneto the filtering UI - Adjust the class names for the flags in the CSS to match the dynamically generated annotation names
- Add a couple new flags to the sprite (scanner action, growth threshold, abuse report threshold), remove some blank space in the sprite and fix coordinates accordingly in the CSS
Testing
TBD