Differential D17425 Diff 41903 src/applications/differential/query/DifferentialRevisionRequiredActionResultBucket.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/query/DifferentialRevisionRequiredActionResultBucket.php
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | $groups[] = $this->newGroup() | ||||
->setNoDataString(pht('None of your revisions are waiting on review.')) | ->setNoDataString(pht('None of your revisions are waiting on review.')) | ||||
->setObjects($this->filterWaitingForReview($phids)); | ->setObjects($this->filterWaitingForReview($phids)); | ||||
$groups[] = $this->newGroup() | $groups[] = $this->newGroup() | ||||
->setName(pht('Waiting on Authors')) | ->setName(pht('Waiting on Authors')) | ||||
->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. | ||||
if ($this->objects) { | if ($this->objects) { | ||||
$groups[] = $this->newGroup() | $groups[] = $this->newGroup() | ||||
->setName(pht('Other Revisions')) | ->setName(pht('Other Revisions')) | ||||
->setObjects($this->objects); | ->setObjects($this->objects); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 124 Lines • ▼ Show 20 Lines | foreach ($objects as $key => $object) { | ||||
$results[$key] = $object; | $results[$key] = $object; | ||||
unset($this->objects[$key]); | unset($this->objects[$key]); | ||||
} | } | ||||
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; | |||||
} | |||||
} | } |