Differential D18625 Diff 44719 src/applications/differential/query/DifferentialRevisionRequiredActionResultBucket.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/query/DifferentialRevisionRequiredActionResultBucket.php
| Show All 31 Lines | protected function buildResultGroups( | ||||
| // Before continuing, throw away any revisions which responsible users | // Before continuing, throw away any revisions which responsible users | ||||
| // have explicitly resigned from. | // have explicitly resigned from. | ||||
| // The goal is to allow users to resign from revisions they don't want to | // The goal is to allow users to resign from revisions they don't want to | ||||
| // review to get these revisions off their dashboard, even if there are | // review to get these revisions off their dashboard, even if there are | ||||
| // other project or package reviewers which they have authority over. | // other project or package reviewers which they have authority over. | ||||
| $this->filterResigned($phids); | $this->filterResigned($phids); | ||||
| // We also throw away draft revisions which you aren't the author of. | |||||
| $this->filterOtherDrafts($phids); | |||||
| $groups = array(); | $groups = array(); | ||||
| $groups[] = $this->newGroup() | $groups[] = $this->newGroup() | ||||
| ->setName(pht('Must Review')) | ->setName(pht('Must Review')) | ||||
| ->setKey(self::KEY_MUSTREVIEW) | ->setKey(self::KEY_MUSTREVIEW) | ||||
| ->setNoDataString(pht('No revisions are blocked on your review.')) | ->setNoDataString(pht('No revisions are blocked on your review.')) | ||||
| ->setObjects($this->filterMustReview($phids)); | ->setObjects($this->filterMustReview($phids)); | ||||
| Show All 9 Lines | $groups[] = $this->newGroup() | ||||
| ->setObjects($this->filterShouldLand($phids)); | ->setObjects($this->filterShouldLand($phids)); | ||||
| $groups[] = $this->newGroup() | $groups[] = $this->newGroup() | ||||
| ->setName(pht('Ready to Update')) | ->setName(pht('Ready to Update')) | ||||
| ->setNoDataString(pht('No revisions are waiting for updates.')) | ->setNoDataString(pht('No revisions are waiting for updates.')) | ||||
| ->setObjects($this->filterShouldUpdate($phids)); | ->setObjects($this->filterShouldUpdate($phids)); | ||||
| $groups[] = $this->newGroup() | $groups[] = $this->newGroup() | ||||
| ->setName(pht('Drafts')) | |||||
| ->setNoDataString(pht('You have no draft revisions.')) | |||||
| ->setObjects($this->filterDrafts($phids)); | |||||
| $groups[] = $this->newGroup() | |||||
| ->setName(pht('Waiting on Review')) | ->setName(pht('Waiting on Review')) | ||||
| ->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)); | ||||
| ▲ Show 20 Lines • Show All 169 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 filterOtherDrafts(array $phids) { | |||||
| $objects = $this->getRevisionsNotAuthored($this->objects, $phids); | |||||
| $results = array(); | |||||
| foreach ($objects as $key => $object) { | |||||
| if (!$object->isDraft()) { | |||||
| continue; | |||||
| } | |||||
| $results[$key] = $object; | |||||
| unset($this->objects[$key]); | |||||
| } | |||||
| return $results; | |||||
| } | |||||
| private function filterDrafts(array $phids) { | |||||
| $objects = $this->getRevisionsAuthored($this->objects, $phids); | |||||
| $results = array(); | |||||
| foreach ($objects as $key => $object) { | |||||
| if (!$object->isDraft()) { | |||||
| continue; | |||||
| } | |||||
| $results[$key] = $object; | |||||
| unset($this->objects[$key]); | |||||
| } | |||||
| return $results; | |||||
| } | |||||
| } | } | ||||