diff --git a/src/applications/dashboard/paneltype/PhabricatorDashboardPanelTypeQuery.php b/src/applications/dashboard/paneltype/PhabricatorDashboardPanelTypeQuery.php --- a/src/applications/dashboard/paneltype/PhabricatorDashboardPanelTypeQuery.php +++ b/src/applications/dashboard/paneltype/PhabricatorDashboardPanelTypeQuery.php @@ -27,6 +27,11 @@ 'name' => pht('ApplicationSearch Key'), 'type' => 'text', ), + 'limit' => array( + 'name' => pht('Maximum Number of Items'), + 'caption' => pht('Leave this blank for the default number of items'), + 'type' => 'text', + ), ); } @@ -68,6 +73,14 @@ $query = $engine->buildQueryFromSavedQuery($saved); $pager = $engine->newPagerForSavedQuery($saved); + + if ($panel->getProperty('limit')) { + $limit = (int)$panel->getProperty('limit'); + if ($pager->getPageSize() !== 0xFFFF) { + $pager->setPageSize($limit); + } + } + $results = $engine->executeQuery($query, $pager); return $engine->renderResults($results, $saved);