mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-02 02:40:58 +01:00
Fix pager for tokens given
Summary: Several small bugs here, I just never tested this properly. Test Plan: Set page size to 2, paged through tokens given. Reviewers: blc, btrahan, chad Reviewed By: chad CC: aran Differential Revision: https://secure.phabricator.com/D5500
This commit is contained in:
parent
5e57ac0e9f
commit
52de3c9cf7
2 changed files with 4 additions and 3 deletions
|
@ -7,11 +7,10 @@ final class PhabricatorTokenGivenController extends PhabricatorTokenController {
|
||||||
$user = $request->getUser();
|
$user = $request->getUser();
|
||||||
|
|
||||||
$pager = id(new AphrontCursorPagerView())
|
$pager = id(new AphrontCursorPagerView())
|
||||||
->setURI(new PhutilURI($this->getApplicationURI('/given/')));
|
->readFromRequest($request);
|
||||||
|
|
||||||
$tokens_given = id(new PhabricatorTokenGivenQuery())
|
$tokens_given = id(new PhabricatorTokenGivenQuery())
|
||||||
->setViewer($user)
|
->setViewer($user)
|
||||||
->setLimit(100)
|
|
||||||
->executeWithCursorPager($pager);
|
->executeWithCursorPager($pager);
|
||||||
|
|
||||||
$handles = array();
|
$handles = array();
|
||||||
|
@ -53,6 +52,7 @@ final class PhabricatorTokenGivenController extends PhabricatorTokenController {
|
||||||
|
|
||||||
$list->addItem($item);
|
$list->addItem($item);
|
||||||
}
|
}
|
||||||
|
$list->setPager($pager);
|
||||||
|
|
||||||
$title = pht('Tokens Given');
|
$title = pht('Tokens Given');
|
||||||
|
|
||||||
|
@ -65,7 +65,6 @@ final class PhabricatorTokenGivenController extends PhabricatorTokenController {
|
||||||
$nav->selectFilter('given/');
|
$nav->selectFilter('given/');
|
||||||
|
|
||||||
$nav->appendChild($list);
|
$nav->appendChild($list);
|
||||||
$nav->appendChild($pager);
|
|
||||||
|
|
||||||
return $this->buildApplicationPage(
|
return $this->buildApplicationPage(
|
||||||
$nav,
|
$nav,
|
||||||
|
|
|
@ -61,6 +61,8 @@ final class PhabricatorTokenGivenQuery
|
||||||
$this->tokenPHIDs);
|
$this->tokenPHIDs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$where[] = $this->buildPagingClause($conn_r);
|
||||||
|
|
||||||
return $this->formatWhereClause($where);
|
return $this->formatWhereClause($where);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue