@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator

Paginate token leader board.

Summary: Add pagination to leader board. Add key on token count in db.

Test Plan: Set page size to 1 and give tokens to two tasks.

Reviewers: epriestley, AnhNhan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5513

authored by

Bryan Cuccioli and committed by
epriestley
2334f63c cdcd49e4

+11 -3
+2
resources/sql/patches/20130321.token.sql
··· 1 + ALTER TABLE {$NAMESPACE}_token.token_count 2 + ADD KEY `key_count` (tokenCount);
+5 -3
src/applications/tokens/controller/PhabricatorTokenLeaderController.php
··· 6 6 public function processRequest() { 7 7 $request = $this->getRequest(); 8 8 $user = $request->getUser(); 9 - $pager = id(new AphrontCursorPagerView()) 10 - ->readFromRequest($request); 9 + 10 + $pager = new AphrontPagerView(); 11 + $pager->setURI($request->getRequestURI(), 'page'); 12 + $pager->setOffset($request->getInt('page')); 11 13 12 14 $query = id(new PhabricatorTokenReceiverQuery()); 13 - $objects = $query->setViewer($user)->execute(); 15 + $objects = $query->setViewer($user)->executeWithOffsetPager($pager); 14 16 $counts = $query->getTokenCounts(); 15 17 16 18 $handles = array();
+4
src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php
··· 1202 1202 'type' => 'sql', 1203 1203 'name' => $this->getPatchPath('20130317.phrictionedge.sql'), 1204 1204 ), 1205 + '20130321.token.sql' => array( 1206 + 'type' => 'sql', 1207 + 'name' => $this->getPatchPath('20130321.token.sql'), 1208 + ), 1205 1209 '20130310.xactionmeta.sql' => array( 1206 1210 'type' => 'sql', 1207 1211 'name' => $this->getPatchPath('20130310.xactionmeta.sql'),