@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.

Maniphest Tasks + Project Boards - some polish

Summary:
Fixes T4550 by changing supportsFeed to shouldPublishFeedStory, so things can be more granular like that are with mail. Attempts to fix things generally too, filtering out xactions that have no business in feed, etc.

Also return an updated Task HTML representation on drag and drop moves, etc. This is important so if the priority changes you can see it reflected in the UI.

Test Plan: dragged tasks around. observed no feed stories on subpriority drags. observed feed stories and updated color bars on stories that changed priority

Reviewers: epriestley, chad

Reviewed By: epriestley

CC: Korvin, epriestley, aran

Maniphest Tasks: T4550

Differential Revision: https://secure.phabricator.com/D8399

+62 -34
+3 -1
src/applications/conpherence/editor/ConpherenceEditor.php
··· 400 400 return PhabricatorEnv::getEnvConfig('metamta.conpherence.subject-prefix'); 401 401 } 402 402 403 - protected function supportsFeed() { 403 + protected function shouldPublishFeedStory( 404 + PhabricatorLiskDAO $object, 405 + array $xactions) { 404 406 return false; 405 407 } 406 408
+3 -1
src/applications/differential/editor/DifferentialTransactionEditor.php
··· 785 785 return parent::requireCapabilities($object, $xaction); 786 786 } 787 787 788 - protected function supportsFeed() { 788 + protected function shouldPublishFeedStory( 789 + PhabricatorLiskDAO $object, 790 + array $xactions) { 789 791 return true; 790 792 } 791 793
+3 -1
src/applications/files/editor/PhabricatorFileEditor.php
··· 80 80 return $body; 81 81 } 82 82 83 - protected function supportsFeed() { 83 + protected function shouldPublishFeedStory( 84 + PhabricatorLiskDAO $object, 85 + array $xactions) { 84 86 return true; 85 87 } 86 88
+3 -1
src/applications/legalpad/editor/LegalpadDocumentEditor.php
··· 183 183 } 184 184 185 185 186 - protected function supportsFeed() { 186 + protected function shouldPublishFeedStory( 187 + PhabricatorLiskDAO $object, 188 + array $xactions) { 187 189 return false; 188 190 } 189 191
+3 -1
src/applications/macro/editor/PhabricatorMacroEditor.php
··· 156 156 return PhabricatorEnv::getEnvConfig('metamta.macro.subject-prefix'); 157 157 } 158 158 159 - protected function supportsFeed() { 159 + protected function shouldPublishFeedStory( 160 + PhabricatorLiskDAO $object, 161 + array $xactions) { 160 162 return true; 161 163 } 162 164 }
+6 -15
src/applications/maniphest/editor/ManiphestTransactionEditor.php
··· 251 251 PhabricatorLiskDAO $object, 252 252 array $xactions) { 253 253 254 - $should_mail = true; 255 - if (count($xactions) == 1) { 256 - $xaction = head($xactions); 257 - switch ($xaction->getTransactionType()) { 258 - case ManiphestTransaction::TYPE_SUBPRIORITY: 259 - $should_mail = false; 260 - break; 261 - default: 262 - $should_mail = true; 263 - break; 264 - } 265 - } 266 - return $should_mail; 254 + $xactions = mfilter($xactions, 'shouldHide', true); 255 + return $xactions; 267 256 } 268 257 269 258 protected function getMailSubjectPrefix() { ··· 318 307 return $body; 319 308 } 320 309 321 - protected function supportsFeed() { 322 - return true; 310 + protected function shouldPublishFeedStory( 311 + PhabricatorLiskDAO $object, 312 + array $xactions) { 313 + return $this->shouldSendMail($object, $xactions); 323 314 } 324 315 325 316 protected function supportsSearch() {
+1 -1
src/applications/maniphest/storage/ManiphestTransaction.php
··· 109 109 return true; 110 110 } 111 111 112 - return false; 112 + return parent::shouldHide(); 113 113 } 114 114 115 115 public function getActionStrength() {
+3 -1
src/applications/paste/editor/PhabricatorPasteEditor.php
··· 157 157 ->addHeader('Thread-Topic', "P{$id}"); 158 158 } 159 159 160 - protected function supportsFeed() { 160 + protected function shouldPublishFeedStory( 161 + PhabricatorLiskDAO $object, 162 + array $xactions) { 161 163 return true; 162 164 } 163 165
+3 -1
src/applications/pholio/editor/PholioMockEditor.php
··· 402 402 return PhabricatorEnv::getEnvConfig('metamta.pholio.subject-prefix'); 403 403 } 404 404 405 - protected function supportsFeed() { 405 + protected function shouldPublishFeedStory( 406 + PhabricatorLiskDAO $object, 407 + array $xactions) { 406 408 return true; 407 409 } 408 410
+3 -1
src/applications/ponder/editor/PonderEditor.php
··· 3 3 abstract class PonderEditor 4 4 extends PhabricatorApplicationTransactionEditor { 5 5 6 - protected function supportsFeed() { 6 + protected function shouldPublishFeedStory( 7 + PhabricatorLiskDAO $object, 8 + array $xactions) { 7 9 return true; 8 10 } 9 11
+17 -2
src/applications/project/controller/PhabricatorProjectMoveController.php
··· 105 105 106 106 $editor->applyTransactions($object, $xactions); 107 107 108 - return id(new AphrontAjaxResponse())->setContent(array()); 109 - } 108 + $owner = null; 109 + if ($object->getOwnerPHID()) { 110 + $owner = id(new PhabricatorHandleQuery()) 111 + ->setViewer($viewer) 112 + ->withPHIDs(array($object->getOwnerPHID())) 113 + ->executeOne(); 114 + } 115 + $card = id(new ProjectBoardTaskCard()) 116 + ->setViewer($viewer) 117 + ->setTask($object) 118 + ->setOwner($owner) 119 + ->setCanEdit(true) 120 + ->getItem(); 121 + 122 + return id(new AphrontAjaxResponse())->setContent( 123 + array('task' => $card)); 124 + } 110 125 111 126 }
+5 -2
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
··· 597 597 ->queueDocumentForIndexing($object->getPHID()); 598 598 } 599 599 600 - if ($this->supportsFeed()) { 600 + if ($this->shouldPublishFeedStory($object, $xactions)) { 601 601 $mailed = array(); 602 602 if ($mail) { 603 603 $mailed = $mail->buildRecipientList(); ··· 1664 1664 /** 1665 1665 * @task feed 1666 1666 */ 1667 - protected function supportsFeed() { 1667 + protected function shouldPublishFeedStory( 1668 + PhabricatorLiskDAO $object, 1669 + array $xactions) { 1668 1670 return false; 1669 1671 } 1670 1672 ··· 1729 1731 array $xactions, 1730 1732 array $mailed_phids) { 1731 1733 1734 + $xactions = mfilter($xactions, 'shouldHideForFeed', true); 1732 1735 $related_phids = $this->getFeedRelatedPHIDs($object, $xactions); 1733 1736 $subscribed_phids = $this->getFeedNotifyPHIDs($object, $xactions); 1734 1737
+4
src/applications/transactions/storage/PhabricatorApplicationTransaction.php
··· 354 354 return $this->shouldHide(); 355 355 } 356 356 357 + public function shouldHideForFeed() { 358 + return $this->shouldHide(); 359 + } 360 + 357 361 public function getTitleForMail() { 358 362 return id(clone $this)->setRenderingTarget('text')->getTitle(); 359 363 }
+5 -6
webroot/rsrc/js/application/projects/behavior-project-boards.js
··· 18 18 JX.DOM.alterClass(node, 'project-column-empty', !this.findItems().length); 19 19 } 20 20 21 - function onresponse(response) { 22 - 21 + function onresponse(response, item, list) { 22 + list.unlock(); 23 + JX.DOM.alterClass(item, 'drag-sending', false); 24 + JX.DOM.replace(item, JX.$H(response.task)); 23 25 } 24 26 25 27 function ondrop(list, item, after, from) { ··· 37 39 38 40 var workflow = new JX.Workflow(config.moveURI, data) 39 41 .setHandler(function(response) { 40 - onresponse(response); 41 - list.unlock(); 42 - 43 - JX.DOM.alterClass(item, 'drag-sending', false); 42 + onresponse(response, item, list); 44 43 }); 45 44 46 45 workflow.start();