mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 00:42:41 +01:00
Allow Maniphest queries to have configurable page sizes
Summary: Current page size is `1000`. This is nice to have in some cases, but makes pages slower than necessary in others. Task lists are generally dominated by rendering costs. For example, my default is "recent tasks", which just lists all tasks ordered by date created. Showing 100 tasks here instead of 1000 makes this several times faster without compromising utility. I don't want to force the default to 100, though, since sometimes listing everything is quite useful and I think an advantage of Maniphest is that it generally deals reasonably well with large task sets. (This `limit` property is actually read by the default implementation of `getPageSize()` in the parent class.) Test Plan: Made queries with page sizes 1, 100, 12, 9, 3000, etc. Reviewers: btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D6976
This commit is contained in:
parent
62e66e3cf6
commit
a82c3a8914
1 changed files with 12 additions and 0 deletions
|
@ -57,6 +57,11 @@ final class ManiphestTaskSearchEngine
|
|||
$saved->setParameter('createdStart', $request->getStr('createdStart'));
|
||||
$saved->setParameter('createdEnd', $request->getStr('createdEnd'));
|
||||
|
||||
$limit = $request->getInt('limit');
|
||||
if ($limit > 0) {
|
||||
$saved->setParameter('limit', $limit);
|
||||
}
|
||||
|
||||
return $saved;
|
||||
}
|
||||
|
||||
|
@ -310,6 +315,13 @@ final class ManiphestTaskSearchEngine
|
|||
pht('Created After'),
|
||||
'createdEnd',
|
||||
pht('Created Before'));
|
||||
|
||||
$form
|
||||
->appendChild(
|
||||
id(new AphrontFormTextControl())
|
||||
->setName('limit')
|
||||
->setLabel(pht('Page Size'))
|
||||
->setValue($saved->getParameter('limit', 100)));
|
||||
}
|
||||
|
||||
protected function getURI($path) {
|
||||
|
|
Loading…
Reference in a new issue