@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
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Allow a limit to be set on the number of results in a query panel

Summary: This allows a maximum number of items to be set in a query panel. Mostly useful when you have a query panel on the feed search and you don't want 4 billion results cluttering your dashboard.

Test Plan: Created a query panel with a maximum and it worked. Left it blank and got the default results.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T4980

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

authored by

James Rhodes and committed by
epriestley
49c15a6d eba11238

+13
+13
src/applications/dashboard/paneltype/PhabricatorDashboardPanelTypeQuery.php
··· 27 27 'name' => pht('ApplicationSearch Key'), 28 28 'type' => 'text', 29 29 ), 30 + 'limit' => array( 31 + 'name' => pht('Maximum Number of Items'), 32 + 'caption' => pht('Leave this blank for the default number of items'), 33 + 'type' => 'text', 34 + ), 30 35 ); 31 36 } 32 37 ··· 68 73 69 74 $query = $engine->buildQueryFromSavedQuery($saved); 70 75 $pager = $engine->newPagerForSavedQuery($saved); 76 + 77 + if ($panel->getProperty('limit')) { 78 + $limit = (int)$panel->getProperty('limit'); 79 + if ($pager->getPageSize() !== 0xFFFF) { 80 + $pager->setPageSize($limit); 81 + } 82 + } 83 + 71 84 $results = $engine->executeQuery($query, $pager); 72 85 73 86 return $engine->renderResults($results, $saved);