From a2c6d2a4d636bc334333b7befdc0166a38f98ad7 Mon Sep 17 00:00:00 2001 From: kentyman23 <33491334+kentyman23@users.noreply.github.com> Date: Mon, 29 Jan 2024 15:07:28 -0600 Subject: [PATCH] Don't show Last Reviewer for Optional/Declined PRs (#167) (#232) --- src/azdo-pr-dashboard.user.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/azdo-pr-dashboard.user.js b/src/azdo-pr-dashboard.user.js index c6e9eda..36ec556 100644 --- a/src/azdo-pr-dashboard.user.js +++ b/src/azdo-pr-dashboard.user.js @@ -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 @@ -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!'); } @@ -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;