Transactions - add pagination to application transactions
Summary: Ref T4712. This adds pagination. Future diffs will need to deploy `buildTransactionTimeline` everywhere and massage this stuff as necessary if we hit any special cases. Test Plan: Set page size to "5" to make it need to paginate often. Verified proper transactions loaded in and the javascript actions worked. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T4712 Differential Revision: https://secure.phabricator.com/D10887
This commit is contained in:
@@ -535,11 +535,18 @@ abstract class PhabricatorController extends AphrontController {
|
||||
$xaction = $object->getApplicationTransactionTemplate();
|
||||
$view = $xaction->getApplicationTransactionViewObject();
|
||||
|
||||
$pager = id(new AphrontCursorPagerView())
|
||||
->readFromRequest($this->getRequest())
|
||||
->setURI(new PhutilURI(
|
||||
'/transactions/showolder/'.$object->getPHID().'/'));
|
||||
|
||||
$xactions = $query
|
||||
->setViewer($viewer)
|
||||
->withObjectPHIDs(array($object->getPHID()))
|
||||
->needComments(true)
|
||||
->execute();
|
||||
->setReversePaging(false)
|
||||
->executeWithCursorPager($pager);
|
||||
$xactions = array_reverse($xactions);
|
||||
|
||||
if ($engine) {
|
||||
foreach ($xactions as $xaction) {
|
||||
@@ -556,7 +563,8 @@ abstract class PhabricatorController extends AphrontController {
|
||||
$timeline = $view
|
||||
->setUser($viewer)
|
||||
->setObjectPHID($object->getPHID())
|
||||
->setTransactions($xactions);
|
||||
->setTransactions($xactions)
|
||||
->setPager($pager);
|
||||
|
||||
return $timeline;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user