Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14029881
D11782.id28403.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.id28403.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,7 @@
PhabricatorSavedQuery $saved_query) {
$status = $saved_query->getParameter('status', '');
+ $paneltype = $saved_query->getParameter('paneltype', '');
$form
->appendChild(
@@ -52,6 +59,18 @@
'' => pht('(All Panels)'),
'active' => pht('Active Panels'),
'archived' => pht('Archived Panels'),
+ )))
+ ->appendChild(
+ id(new AphrontFormSelectControl())
+ ->setLabel(pht('Panel Type'))
+ ->setName('paneltype')
+ ->setValue($paneltype)
+ ->setOptions(
+ array(
+ '' => pht('(All Types)'),
+ 'query' => pht('Query Panel'),
+ 'text' => pht('Text Panel'),
+ 'tab' => pht('Tab Panel'),
)));
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 9, 10:16 PM (4 d, 5 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6763505
Default Alt Text
D11782.id28403.diff (2 KB)
Attached To
Mode
D11782: Add ability to query dashboard panels by paneltype
Attached
Detach File
Event Timeline
Log In to Comment