From 6c21646b5f33c7ccbed2858602463b05df10d2d0 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 27 Feb 2017 10:16:47 -0800 Subject: [PATCH] Put revisions waiting on other reviewers in their own bucket Summary: Fixes T12323. See that task for discussion. Test Plan: {F3424441} Reviewers: chad Reviewed By: chad Maniphest Tasks: T12323 Differential Revision: https://secure.phabricator.com/D17425 --- ...tialRevisionRequiredActionResultBucket.php | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/applications/differential/query/DifferentialRevisionRequiredActionResultBucket.php b/src/applications/differential/query/DifferentialRevisionRequiredActionResultBucket.php index 64570bf2cc..d37754227e 100644 --- a/src/applications/differential/query/DifferentialRevisionRequiredActionResultBucket.php +++ b/src/applications/differential/query/DifferentialRevisionRequiredActionResultBucket.php @@ -63,6 +63,11 @@ final class DifferentialRevisionRequiredActionResultBucket ->setNoDataString(pht('No revisions are waiting on author action.')) ->setObjects($this->filterWaitingOnAuthors($phids)); + $groups[] = $this->newGroup() + ->setName(pht('Waiting on Other Reviewers')) + ->setNoDataString(pht('No revisions are waiting for other reviewers.')) + ->setObjects($this->filterWaitingOnOtherReviewers($phids)); + // Because you can apply these buckets to queries which include revisions // that have been closed, add an "Other" bucket if we still have stuff // that didn't get filtered into any of the previous buckets. @@ -203,4 +208,25 @@ final class DifferentialRevisionRequiredActionResultBucket return $results; } + private function filterWaitingOnOtherReviewers(array $phids) { + $statuses = array( + ArcanistDifferentialRevisionStatus::NEEDS_REVIEW, + ); + $statuses = array_fuse($statuses); + + $objects = $this->getRevisionsNotAuthored($this->objects, $phids); + + $results = array(); + foreach ($objects as $key => $object) { + if (!isset($statuses[$object->getStatus()])) { + continue; + } + + $results[$key] = $object; + unset($this->objects[$key]); + } + + return $results; + } + }