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

Add more detailed story actions for maniphest.

Summary:
TransactionType gives us more information than
update, open, close, assign. We can display those in feed/notifications along with and comments on the actions.

Test Plan: did on local machine tested out.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: ddfisher, keebuhm, aran, Korvin

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

authored by

John-Ashton Allen and committed by
epriestley
ec37ce3d e962ad97

+60 -15
+1 -1
src/__phutil_library_map__.php
··· 1479 1479 'LiskIsolationTestCase' => 'PhabricatorTestCase', 1480 1480 'LiskIsolationTestDAO' => 'LiskDAO', 1481 1481 'LiskIsolationTestDAOException' => 'Exception', 1482 - 'ManiphestAction' => 'ManiphestConstants', 1482 + 'ManiphestAction' => 'PhrictionConstants', 1483 1483 'ManiphestAuxiliaryFieldDefaultSpecification' => 'ManiphestAuxiliaryFieldSpecification', 1484 1484 'ManiphestAuxiliaryFieldTypeException' => 'Exception', 1485 1485 'ManiphestAuxiliaryFieldValidationException' => 'Exception',
+14 -1
src/applications/feed/story/PhabricatorFeedStoryManiphest.php
··· 95 95 $actor_link = $this->linkTo($actor_phid); 96 96 $task_link = $this->linkTo($task_phid); 97 97 $owner_link = $this->linkTo($owner_phid); 98 + 98 99 $verb = ManiphestAction::getActionPastTenseVerb($action); 99 100 101 + if (($action == ManiphestAction::ACTION_ASSIGN 102 + || $action == ManiphestAction::ACTION_REASSIGN) 103 + && !$owner_phid) { 104 + //double assignment since the action is diff in this case 105 + $verb = $action = 'placed up for grabs'; 106 + } 100 107 $one_line = "{$actor_link} {$verb} {$task_link}"; 101 108 102 109 switch ($action) { 103 110 case ManiphestAction::ACTION_ASSIGN: 111 + case ManiphestAction::ACTION_REASSIGN: 104 112 $one_line .= " to {$owner_link}"; 105 113 break; 106 - default: 114 + case ManiphestAction::ACTION_DESCRIPTION: 115 + $one_line .= " to {$description}"; 107 116 break; 117 + } 118 + 119 + if ($comments) { 120 + $one_line .= " \"{$comments}\""; 108 121 } 109 122 110 123 return $one_line;
+44 -13
src/applications/maniphest/constants/ManiphestAction.php
··· 19 19 /** 20 20 * @group maniphest 21 21 */ 22 - final class ManiphestAction extends ManiphestConstants { 22 + final class ManiphestAction extends PhrictionConstants { 23 + /* These actions must be determined when the story 24 + is generated and thus are new */ 25 + const ACTION_CREATE = 'create'; 26 + const ACTION_REOPEN = 'reopen'; 27 + const ACTION_CLOSE = 'close'; 28 + const ACTION_UPDATE = 'update'; 29 + const ACTION_ASSIGN = 'assign'; 23 30 24 - const ACTION_CREATE = 'create'; 25 - const ACTION_CLOSE = 'close'; 26 - const ACTION_UPDATE = 'update'; 27 - const ACTION_ASSIGN = 'assign'; 31 + /* these actions are determined sufficiently by the transaction 32 + type and thus we use them here*/ 33 + const ACTION_COMMENT = ManiphestTransactionType::TYPE_NONE; 34 + const ACTION_CC = ManiphestTransactionType::TYPE_CCS; 35 + const ACTION_PRIORITY = ManiphestTransactionType::TYPE_PRIORITY; 36 + const ACTION_PROJECT = ManiphestTransactionType::TYPE_PROJECTS; 37 + const ACTION_TITLE = ManiphestTransactionType::TYPE_TITLE; 38 + const ACTION_DESCRIPTION = ManiphestTransactionType::TYPE_DESCRIPTION; 39 + const ACTION_REASSIGN = ManiphestTransactionType::TYPE_OWNER; 40 + const ACTION_ATTACH = ManiphestTransactionType::TYPE_ATTACH; 28 41 29 42 public static function getActionPastTenseVerb($action) { 30 43 static $map = array( 31 - self::ACTION_CREATE => 'created', 32 - self::ACTION_CLOSE => 'closed', 33 - self::ACTION_UPDATE => 'updated', 34 - self::ACTION_ASSIGN => 'assigned', 44 + self::ACTION_CREATE => 'created', 45 + self::ACTION_CLOSE => 'closed', 46 + self::ACTION_UPDATE => 'updated', 47 + self::ACTION_ASSIGN => 'assigned', 48 + self::ACTION_REASSIGN => 'reassigned', 49 + self::ACTION_COMMENT => 'commented on', 50 + self::ACTION_CC => 'updated cc\'s of', 51 + self::ACTION_PRIORITY => 'changed the priority of', 52 + self::ACTION_PROJECT => 'modified projects of', 53 + self::ACTION_TITLE => 'updated title of', 54 + self::ACTION_DESCRIPTION => 'updated description of', 55 + self::ACTION_ATTACH => 'attached something to', 56 + self::ACTION_REOPEN => 'reopened', 35 57 ); 36 58 37 59 return idx($map, $action, "brazenly {$action}'d"); ··· 45 67 */ 46 68 public static function selectStrongestAction(array $actions) { 47 69 static $strengths = array( 48 - self::ACTION_UPDATE => 0, 49 - self::ACTION_ASSIGN => 1, 50 - self::ACTION_CREATE => 2, 51 - self::ACTION_CLOSE => 3, 70 + self::ACTION_UPDATE => 0, 71 + self::ACTION_CC => 1, 72 + self::ACTION_PROJECT => 2, 73 + self::ACTION_DESCRIPTION => 3, 74 + self::ACTION_TITLE => 4, 75 + self::ACTION_ATTACH => 5, 76 + self::ACTION_COMMENT => 6, 77 + self::ACTION_PRIORITY => 7, 78 + self::ACTION_REASSIGN => 8, 79 + self::ACTION_ASSIGN => 9, 80 + self::ACTION_REOPEN => 10, 81 + self::ACTION_CREATE => 11, 82 + self::ACTION_CLOSE => 12, 52 83 ); 53 84 54 85 $strongest = null;
+1
src/applications/maniphest/editor/ManiphestTransactionEditor.php
··· 329 329 } 330 330 break; 331 331 default: 332 + $actions[] = $type; 332 333 break; 333 334 } 334 335 }