addons-server icon indicating copy to clipboard operation
addons-server copied to clipboard

Show all possible reasons for NeedsHumanReview in review queue filter UI

Open diox opened this issue 9 months ago • 0 comments

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 REASONS to expose an annotation property 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 from ABUSE_OR_APPEAL_RELATED as well as DEVELOPER_REPLY as 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 the REASONS
  • Remove the usage of VIEW_FLAGS in ReviewQueueFilter and directly use REASONS
  • Add a select all and select none to 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

diox avatar Mar 28 '25 11:03 diox