Page MenuHomePhabricator

D14849.id35897.diff
No OneTemporary

D14849.id35897.diff

diff --git a/src/applications/maniphest/editor/ManiphestTransactionEditor.php b/src/applications/maniphest/editor/ManiphestTransactionEditor.php
--- a/src/applications/maniphest/editor/ManiphestTransactionEditor.php
+++ b/src/applications/maniphest/editor/ManiphestTransactionEditor.php
@@ -371,20 +371,22 @@
$new = $unblock_xaction->getNewValue();
foreach ($blocked_tasks as $blocked_task) {
- $unblock_xactions = array();
-
- $unblock_xactions[] = id(new ManiphestTransaction())
+ $parent_xaction = id(new ManiphestTransaction())
->setTransactionType(ManiphestTransaction::TYPE_UNBLOCK)
->setOldValue(array($object->getPHID() => $old))
->setNewValue(array($object->getPHID() => $new));
+ if ($this->getIsNewObject()) {
+ $parent_xaction->setMetadataValue('blocker.new', true);
+ }
+
id(new ManiphestTransactionEditor())
->setActor($this->getActor())
->setActingAsPHID($this->getActingAsPHID())
->setContentSource($this->getContentSource())
->setContinueOnNoEffect(true)
->setContinueOnMissingFields(true)
- ->applyTransactions($blocked_task, $unblock_xactions);
+ ->applyTransactions($blocked_task, array($parent_xaction));
}
}
}
diff --git a/src/applications/maniphest/storage/ManiphestTransaction.php b/src/applications/maniphest/storage/ManiphestTransaction.php
--- a/src/applications/maniphest/storage/ManiphestTransaction.php
+++ b/src/applications/maniphest/storage/ManiphestTransaction.php
@@ -167,6 +167,21 @@
return parent::shouldHide();
}
+ public function shouldHideForFeed() {
+ switch ($this->getTransactionType()) {
+ case self::TYPE_UNBLOCK:
+ // Hide "alice created X, a task blocking Y." from feed because it
+ // will almost always appear adjacent to "alice created Y".
+ $is_new = $this->getMetadataValue('blocker.new');
+ if ($is_new) {
+ return true;
+ }
+ break;
+ }
+
+ return parent::shouldHideForFeed();
+ }
+
public function getActionStrength() {
switch ($this->getTransactionType()) {
case self::TYPE_TITLE:
@@ -479,7 +494,12 @@
$old_name = ManiphestTaskStatus::getTaskStatusName($old_status);
$new_name = ManiphestTaskStatus::getTaskStatusName($new_status);
- if ($old_closed && !$new_closed) {
+ if ($this->getMetadataValue('blocker.new')) {
+ return pht(
+ '%s created blocking task %s.',
+ $this->renderHandleLink($author_phid),
+ $this->renderHandleLink($blocker_phid));
+ } else if ($old_closed && !$new_closed) {
return pht(
'%s reopened blocking task %s as "%s".',
$this->renderHandleLink($author_phid),

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 11, 9:13 PM (1 w, 11 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6742127
Default Alt Text
D14849.id35897.diff (2 KB)

Event Timeline