Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13961922
D11782.id28446.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D11782.id28446.diff
View Options
diff --git a/src/applications/dashboard/query/PhabricatorDashboardPanelQuery.php b/src/applications/dashboard/query/PhabricatorDashboardPanelQuery.php
--- a/src/applications/dashboard/query/PhabricatorDashboardPanelQuery.php
+++ b/src/applications/dashboard/query/PhabricatorDashboardPanelQuery.php
@@ -6,6 +6,7 @@
private $ids;
private $phids;
private $archived;
+ private $panelTypes;
public function withIDs(array $ids) {
$this->ids = $ids;
@@ -22,6 +23,11 @@
return $this;
}
+ public function withPanelTypes(array $types) {
+ $this->panelTypes = $types;
+ return $this;
+ }
+
protected function loadPage() {
$table = new PhabricatorDashboardPanel();
$conn_r = $table->establishConnection('r');
@@ -61,6 +67,13 @@
(int)$this->archived);
}
+ if ($this->panelTypes !== null) {
+ $where[] = qsprintf(
+ $conn_r,
+ 'panelType IN (%Ls)',
+ $this->panelTypes);
+ }
+
$where[] = $this->buildPagingClause($conn_r);
return $this->formatWhereClause($where);
diff --git a/src/applications/dashboard/query/PhabricatorDashboardPanelSearchEngine.php b/src/applications/dashboard/query/PhabricatorDashboardPanelSearchEngine.php
--- a/src/applications/dashboard/query/PhabricatorDashboardPanelSearchEngine.php
+++ b/src/applications/dashboard/query/PhabricatorDashboardPanelSearchEngine.php
@@ -14,6 +14,7 @@
public function buildSavedQueryFromRequest(AphrontRequest $request) {
$saved = new PhabricatorSavedQuery();
$saved->setParameter('status', $request->getStr('status'));
+ $saved->setParameter('paneltype', $request->getStr('paneltype'));
return $saved;
}
@@ -32,6 +33,11 @@
break;
}
+ $paneltype = $saved->getParameter('paneltype');
+ if ($paneltype) {
+ $query->withPanelTypes(array($paneltype));
+ }
+
return $query;
}
@@ -40,6 +46,12 @@
PhabricatorSavedQuery $saved_query) {
$status = $saved_query->getParameter('status', '');
+ $paneltype = $saved_query->getParameter('paneltype', '');
+
+ $panel_types = PhabricatorDashboardPanelType::getAllPanelTypes();
+ $panel_types = mpull($panel_types, 'getPanelTypeName', 'getPanelTypeKey');
+ asort($panel_types);
+ $panel_types = (array('' => pht('(All Types)')) + $panel_types);
$form
->appendChild(
@@ -52,7 +64,13 @@
'' => pht('(All Panels)'),
'active' => pht('Active Panels'),
'archived' => pht('Archived Panels'),
- )));
+ )))
+ ->appendChild(
+ id(new AphrontFormSelectControl())
+ ->setLabel(pht('Panel Type'))
+ ->setName('paneltype')
+ ->setValue($paneltype)
+ ->setOptions($panel_types));
}
protected function getURI($path) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Oct 16, 7:03 AM (4 w, 20 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6716497
Default Alt Text
D11782.id28446.diff (2 KB)
Attached To
Mode
D11782: Add ability to query dashboard panels by paneltype
Attached
Detach File
Event Timeline
Log In to Comment