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
This commit is contained in:
@@ -63,6 +63,11 @@ final class DifferentialRevisionRequiredActionResultBucket
|
|||||||
->setNoDataString(pht('No revisions are waiting on author action.'))
|
->setNoDataString(pht('No revisions are waiting on author action.'))
|
||||||
->setObjects($this->filterWaitingOnAuthors($phids));
|
->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
|
// 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 have been closed, add an "Other" bucket if we still have stuff
|
||||||
// that didn't get filtered into any of the previous buckets.
|
// that didn't get filtered into any of the previous buckets.
|
||||||
@@ -203,4 +208,25 @@ final class DifferentialRevisionRequiredActionResultBucket
|
|||||||
return $results;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user