-
Notifications
You must be signed in to change notification settings - Fork 67
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
#4081 reviewers from past review rounds are now valid review assignment choices. #4101
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic fix is working but the display is still a bit confusing, because the table is missing a few cells on the empty row:
I got it to load properly by adding two tds:
diff --git a/src/templates/admin/review/add_review_assignment.html b/src/templates/admin/review/add_review_assignment.html
index 01652349..82d38cd4 100644
--- a/src/templates/admin/review/add_review_assignment.html
+++ b/src/templates/admin/review/add_review_assignment.html
@@ -75,6 +75,8 @@
<td></td>
<td></td>
<td></td>
+ <td></td>
+ <td></td>
</tr>
{% endfor %}
</tbody>
But this still is still not quite accurate because the "empty" notice is displaying when the options are not empty. Can the set of reviewers be fixed a bit more comprehensively in the view using querysets and copied querysets if needed, so the template doesn't have to do so much logic? You could use queryset annotation to create the variables needed in the template that indicate whether the reviewer is suggested or past.
I've moved the setting of is_past_reviewer and is_suggested_reviewer over to optional annotations on the func that gets reviewer candidates. I resolved the colspan issue by setting the colspan to 10, this ensures that if the table is 6, 7 or 8 cols wide the empty message will span all of the columns (this is supported cross browser so long as we don't set the table layout to fixed). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some questions/comments inline, but certainly much (c)leaner than it was!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! Added one last comment I think would be good to make the logic even simpler and also reduce config bloat
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a comment with an intended typo, but otherwise good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a thing of beauty! I tested it out and everything is working perfectly. The extra help text is nice too. The only thing I'd tweak are two comma splices:
...this process is silent, so they will not...
...will appear at the top of this list. They will show with...
This PR tweaks the logic by no longer excluding the
past_reviewers
when callingget_reviewer_candidates
. They are instead filtered out at the end when settingreviewers
in thecontext
argument. This means that past_reviewers remain valid reviewers but don't display twice in the review list.Closes #4081