mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-21 04:50:55 +01:00
Disable Maniphest task list grips in panel rendering contexts
Summary: Fixes T5467. - Let search engines figure out if they're rendering for a panel or not. - If Maniphest is rendering a panel, turn off the grips and batch selection. Test Plan: - Viewed task panels (no grips). - Viewed non-panel query results (grips). Reviewers: chad Reviewed By: chad Subscribers: epriestley Maniphest Tasks: T5467 Differential Revision: https://secure.phabricator.com/D9714
This commit is contained in:
parent
454b773f78
commit
e6190ffc67
3 changed files with 27 additions and 8 deletions
|
@ -80,6 +80,7 @@ final class PhabricatorDashboardPanelTypeQuery
|
||||||
}
|
}
|
||||||
|
|
||||||
$engine->setViewer($viewer);
|
$engine->setViewer($viewer);
|
||||||
|
$engine->setContext(PhabricatorApplicationSearchEngine::CONTEXT_PANEL);
|
||||||
|
|
||||||
$key = $panel->getProperty('key');
|
$key = $panel->getProperty('key');
|
||||||
if ($engine->isBuiltinQuery($key)) {
|
if ($engine->isBuiltinQuery($key)) {
|
||||||
|
|
|
@ -532,15 +532,20 @@ final class ManiphestTaskSearchEngine
|
||||||
|
|
||||||
$viewer = $this->requireViewer();
|
$viewer = $this->requireViewer();
|
||||||
|
|
||||||
$can_edit_priority = PhabricatorPolicyFilter::hasCapability(
|
if ($this->isPanelContext()) {
|
||||||
$viewer,
|
$can_edit_priority = false;
|
||||||
$this->getApplication(),
|
$can_bulk_edit = false;
|
||||||
ManiphestCapabilityEditPriority::CAPABILITY);
|
} else {
|
||||||
|
$can_edit_priority = PhabricatorPolicyFilter::hasCapability(
|
||||||
|
$viewer,
|
||||||
|
$this->getApplication(),
|
||||||
|
ManiphestCapabilityEditPriority::CAPABILITY);
|
||||||
|
|
||||||
$can_bulk_edit = PhabricatorPolicyFilter::hasCapability(
|
$can_bulk_edit = PhabricatorPolicyFilter::hasCapability(
|
||||||
$viewer,
|
$viewer,
|
||||||
$this->getApplication(),
|
$this->getApplication(),
|
||||||
ManiphestCapabilityBulkEdit::CAPABILITY);
|
ManiphestCapabilityBulkEdit::CAPABILITY);
|
||||||
|
}
|
||||||
|
|
||||||
return id(new ManiphestTaskResultListView())
|
return id(new ManiphestTaskResultListView())
|
||||||
->setUser($viewer)
|
->setUser($viewer)
|
||||||
|
|
|
@ -22,6 +22,10 @@ abstract class PhabricatorApplicationSearchEngine {
|
||||||
private $errors = array();
|
private $errors = array();
|
||||||
private $customFields = false;
|
private $customFields = false;
|
||||||
private $request;
|
private $request;
|
||||||
|
private $context;
|
||||||
|
|
||||||
|
const CONTEXT_LIST = 'list';
|
||||||
|
const CONTEXT_PANEL = 'panel';
|
||||||
|
|
||||||
public function setViewer(PhabricatorUser $viewer) {
|
public function setViewer(PhabricatorUser $viewer) {
|
||||||
$this->viewer = $viewer;
|
$this->viewer = $viewer;
|
||||||
|
@ -35,6 +39,15 @@ abstract class PhabricatorApplicationSearchEngine {
|
||||||
return $this->viewer;
|
return $this->viewer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setContext($context) {
|
||||||
|
$this->context = $context;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function isPanelContext() {
|
||||||
|
return ($this->context == self::CONTEXT_PANEL);
|
||||||
|
}
|
||||||
|
|
||||||
public function saveQuery(PhabricatorSavedQuery $query) {
|
public function saveQuery(PhabricatorSavedQuery $query) {
|
||||||
$query->setEngineClassName(get_class($this));
|
$query->setEngineClassName(get_class($this));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue