Page MenuHomePhabricator

D9235.diff
No OneTemporary

D9235.diff

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);

File Metadata

Mime Type
text/plain
Expires
Mon, Mar 17, 12:40 PM (5 d, 13 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7309382
Default Alt Text
D9235.diff (1 KB)

Event Timeline