@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+27 -8
+1
src/applications/dashboard/paneltype/PhabricatorDashboardPanelTypeQuery.php
··· 80 80 } 81 81 82 82 $engine->setViewer($viewer); 83 + $engine->setContext(PhabricatorApplicationSearchEngine::CONTEXT_PANEL); 83 84 84 85 $key = $panel->getProperty('key'); 85 86 if ($engine->isBuiltinQuery($key)) {
+13 -8
src/applications/maniphest/query/ManiphestTaskSearchEngine.php
··· 532 532 533 533 $viewer = $this->requireViewer(); 534 534 535 - $can_edit_priority = PhabricatorPolicyFilter::hasCapability( 536 - $viewer, 537 - $this->getApplication(), 538 - ManiphestCapabilityEditPriority::CAPABILITY); 535 + if ($this->isPanelContext()) { 536 + $can_edit_priority = false; 537 + $can_bulk_edit = false; 538 + } else { 539 + $can_edit_priority = PhabricatorPolicyFilter::hasCapability( 540 + $viewer, 541 + $this->getApplication(), 542 + ManiphestCapabilityEditPriority::CAPABILITY); 539 543 540 - $can_bulk_edit = PhabricatorPolicyFilter::hasCapability( 541 - $viewer, 542 - $this->getApplication(), 543 - ManiphestCapabilityBulkEdit::CAPABILITY); 544 + $can_bulk_edit = PhabricatorPolicyFilter::hasCapability( 545 + $viewer, 546 + $this->getApplication(), 547 + ManiphestCapabilityBulkEdit::CAPABILITY); 548 + } 544 549 545 550 return id(new ManiphestTaskResultListView()) 546 551 ->setUser($viewer)
+13
src/applications/search/engine/PhabricatorApplicationSearchEngine.php
··· 22 22 private $errors = array(); 23 23 private $customFields = false; 24 24 private $request; 25 + private $context; 26 + 27 + const CONTEXT_LIST = 'list'; 28 + const CONTEXT_PANEL = 'panel'; 25 29 26 30 public function setViewer(PhabricatorUser $viewer) { 27 31 $this->viewer = $viewer; ··· 33 37 throw new Exception('Call setViewer() before using an engine!'); 34 38 } 35 39 return $this->viewer; 40 + } 41 + 42 + public function setContext($context) { 43 + $this->context = $context; 44 + return $this; 45 + } 46 + 47 + public function isPanelContext() { 48 + return ($this->context == self::CONTEXT_PANEL); 36 49 } 37 50 38 51 public function saveQuery(PhabricatorSavedQuery $query) {