mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Dashboards - introduce ability to optionally allow SearchEngines to be used as dashboard panels
Summary: Ref T7234. Turns out some search engines are context specific such that they can't be bubbled up to a dashboard panel generically. The example in question is an Instance Members search, where the instance must be specified and is done so in normal codepaths but the dashboard panel stuff has no way of doing that. Ergo, just turn off these sorts of panels. Note this code just makes it so we can turn off these sorts of panels but does not do any of that. Test Plan: made sure all the queries still showed up otherwise, next diff Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T7234 Differential Revision: https://secure.phabricator.com/D11750
This commit is contained in:
parent
d4680a7e4e
commit
e23351ea36
2 changed files with 5 additions and 0 deletions
|
@ -16,6 +16,7 @@ final class PhabricatorDashboardPanelSearchQueryCustomField
|
|||
$engines = id(new PhutilSymbolLoader())
|
||||
->setAncestorClass('PhabricatorApplicationSearchEngine')
|
||||
->loadObjects();
|
||||
$engines = mfilter($engines, 'canUseInPanelContext');
|
||||
|
||||
$value = $this->getFieldValue();
|
||||
|
||||
|
|
|
@ -46,6 +46,10 @@ abstract class PhabricatorApplicationSearchEngine {
|
|||
return ($this->context == self::CONTEXT_PANEL);
|
||||
}
|
||||
|
||||
public function canUseInPanelContext() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function saveQuery(PhabricatorSavedQuery $query) {
|
||||
$query->setEngineClassName(get_class($this));
|
||||
|
||||
|
|
Loading…
Reference in a new issue