Skip to content

Commit

Permalink
Don't show Last Reviewer for Optional/Declined PRs (#167) (#232)
Browse files Browse the repository at this point in the history
  • Loading branch information
kentyman23 authored Jan 29, 2024
1 parent 66c480b commit a2c6d2a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/azdo-pr-dashboard.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==

// @name More Awesome Azure DevOps (userscript)
// @version 3.7.0
// @version 3.7.1
// @author Alejandro Barreto (NI)
// @description Makes general improvements to the Azure DevOps experience, particularly around pull requests. Also contains workflow improvements for NI engineers.
// @license MIT
Expand Down Expand Up @@ -1469,7 +1469,7 @@
await annotateFileCountOnPullRequestRow(row, pr);
await annotateBuildStatusOnPullRequestRow(row, pr);

if (votes.userVote === 0 && votes.missingVotes === 1) {
if (votes.userVote === 0 && votes.missingVotes === 1 && votes.userIsRequired && !votes.userHasDeclined) {
annotatePullRequestTitle(row, 'repos-pr-list-late-review-pill', 'Last Reviewer', 'Everyone is waiting on you!');
}

Expand Down Expand Up @@ -1538,11 +1538,15 @@
missingVotes: 0,
waitingOrRejectedVotes: 0,
userVote: 0,
userIsRequired: true,
userHasDeclined: false,
};

for (const reviewer of pr.reviewers) {
if (reviewer.uniqueName === currentUser.uniqueName) {
votes.userVote = reviewer.vote;
votes.userIsRequired = reviewer.isRequired;
votes.userHasDeclined = reviewer.hasDeclined;
}
if (reviewer.vote === 0) {
votes.missingVotes += 1;
Expand Down

0 comments on commit a2c6d2a

Please sign in to comment.