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

Improve strings for creating blocking subtasks

Summary:
Ref T6884. Ref T10004. For various reasons we previously didn't publish these transactions, but now do. This is probably a better behavior overall, but we didn't have reasonable strings for them.

Parent tasks now show "alice created blocking task Txxx.".

Feed now shows nothing, since "alice created task Txxx." is right next to any story we would show and showing them both seems silly.

Test Plan:
- Created subtasks.
- Viewed parent tasks.
- Viewed feed.
- Saw pretty reasonable strings/stories.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T6884, T10004

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

+27 -5
+6 -4
src/applications/maniphest/editor/ManiphestTransactionEditor.php
··· 371 371 $new = $unblock_xaction->getNewValue(); 372 372 373 373 foreach ($blocked_tasks as $blocked_task) { 374 - $unblock_xactions = array(); 375 - 376 - $unblock_xactions[] = id(new ManiphestTransaction()) 374 + $parent_xaction = id(new ManiphestTransaction()) 377 375 ->setTransactionType(ManiphestTransaction::TYPE_UNBLOCK) 378 376 ->setOldValue(array($object->getPHID() => $old)) 379 377 ->setNewValue(array($object->getPHID() => $new)); 380 378 379 + if ($this->getIsNewObject()) { 380 + $parent_xaction->setMetadataValue('blocker.new', true); 381 + } 382 + 381 383 id(new ManiphestTransactionEditor()) 382 384 ->setActor($this->getActor()) 383 385 ->setActingAsPHID($this->getActingAsPHID()) 384 386 ->setContentSource($this->getContentSource()) 385 387 ->setContinueOnNoEffect(true) 386 388 ->setContinueOnMissingFields(true) 387 - ->applyTransactions($blocked_task, $unblock_xactions); 389 + ->applyTransactions($blocked_task, array($parent_xaction)); 388 390 } 389 391 } 390 392 }
+21 -1
src/applications/maniphest/storage/ManiphestTransaction.php
··· 167 167 return parent::shouldHide(); 168 168 } 169 169 170 + public function shouldHideForFeed() { 171 + switch ($this->getTransactionType()) { 172 + case self::TYPE_UNBLOCK: 173 + // Hide "alice created X, a task blocking Y." from feed because it 174 + // will almost always appear adjacent to "alice created Y". 175 + $is_new = $this->getMetadataValue('blocker.new'); 176 + if ($is_new) { 177 + return true; 178 + } 179 + break; 180 + } 181 + 182 + return parent::shouldHideForFeed(); 183 + } 184 + 170 185 public function getActionStrength() { 171 186 switch ($this->getTransactionType()) { 172 187 case self::TYPE_TITLE: ··· 479 494 $old_name = ManiphestTaskStatus::getTaskStatusName($old_status); 480 495 $new_name = ManiphestTaskStatus::getTaskStatusName($new_status); 481 496 482 - if ($old_closed && !$new_closed) { 497 + if ($this->getMetadataValue('blocker.new')) { 498 + return pht( 499 + '%s created blocking task %s.', 500 + $this->renderHandleLink($author_phid), 501 + $this->renderHandleLink($blocker_phid)); 502 + } else if ($old_closed && !$new_closed) { 483 503 return pht( 484 504 '%s reopened blocking task %s as "%s".', 485 505 $this->renderHandleLink($author_phid),