Most implement cursor paging in Maniphest
Summary: Ref T2625. Depends on D6971. Maniphest is complicated to implement cursor paging for. Builds on D6971 to do so. This is //almost// complete. Paging on projects and authors doesn't quite work, I'll clean that up shortly. Left some TODOs. Test Plan: Set page size to `3`, paged forward and backward in a bunch of group/order modes. Results seemed to be as expected. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T2625 Differential Revision: https://secure.phabricator.com/D6972
This commit is contained in:
@@ -114,13 +114,15 @@ abstract class PhabricatorCursorPagedPolicyAwareQuery
|
||||
|
||||
$sliced_results = $pager->sliceResults($results);
|
||||
|
||||
if ($pager->getBeforeID() || (count($results) > $pager->getPageSize())) {
|
||||
$pager->setNextPageID($this->getPagingValue(last($sliced_results)));
|
||||
}
|
||||
if ($sliced_results) {
|
||||
if ($pager->getBeforeID() || (count($results) > $pager->getPageSize())) {
|
||||
$pager->setNextPageID($this->getPagingValue(last($sliced_results)));
|
||||
}
|
||||
|
||||
if ($pager->getAfterID() ||
|
||||
($pager->getBeforeID() && (count($results) > $pager->getPageSize()))) {
|
||||
$pager->setPrevPageID($this->getPagingValue(head($sliced_results)));
|
||||
if ($pager->getAfterID() ||
|
||||
($pager->getBeforeID() && (count($results) > $pager->getPageSize()))) {
|
||||
$pager->setPrevPageID($this->getPagingValue(head($sliced_results)));
|
||||
}
|
||||
}
|
||||
|
||||
return $sliced_results;
|
||||
|
||||
Reference in New Issue
Block a user