diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 5d42e72e39..e8a88298c7 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1479,7 +1479,7 @@ phutil_register_library_map(array( 'LiskIsolationTestCase' => 'PhabricatorTestCase', 'LiskIsolationTestDAO' => 'LiskDAO', 'LiskIsolationTestDAOException' => 'Exception', - 'ManiphestAction' => 'ManiphestConstants', + 'ManiphestAction' => 'PhrictionConstants', 'ManiphestAuxiliaryFieldDefaultSpecification' => 'ManiphestAuxiliaryFieldSpecification', 'ManiphestAuxiliaryFieldTypeException' => 'Exception', 'ManiphestAuxiliaryFieldValidationException' => 'Exception', diff --git a/src/applications/feed/story/PhabricatorFeedStoryManiphest.php b/src/applications/feed/story/PhabricatorFeedStoryManiphest.php index aedeaf9bad..bba3fae0e9 100644 --- a/src/applications/feed/story/PhabricatorFeedStoryManiphest.php +++ b/src/applications/feed/story/PhabricatorFeedStoryManiphest.php @@ -95,18 +95,31 @@ final class PhabricatorFeedStoryManiphest $actor_link = $this->linkTo($actor_phid); $task_link = $this->linkTo($task_phid); $owner_link = $this->linkTo($owner_phid); + $verb = ManiphestAction::getActionPastTenseVerb($action); + if (($action == ManiphestAction::ACTION_ASSIGN + || $action == ManiphestAction::ACTION_REASSIGN) + && !$owner_phid) { + //double assignment since the action is diff in this case + $verb = $action = 'placed up for grabs'; + } $one_line = "{$actor_link} {$verb} {$task_link}"; switch ($action) { case ManiphestAction::ACTION_ASSIGN: + case ManiphestAction::ACTION_REASSIGN: $one_line .= " to {$owner_link}"; break; - default: + case ManiphestAction::ACTION_DESCRIPTION: + $one_line .= " to {$description}"; break; } + if ($comments) { + $one_line .= " \"{$comments}\""; + } + return $one_line; } } diff --git a/src/applications/maniphest/constants/ManiphestAction.php b/src/applications/maniphest/constants/ManiphestAction.php index 8926db9c4d..366b7dadd1 100644 --- a/src/applications/maniphest/constants/ManiphestAction.php +++ b/src/applications/maniphest/constants/ManiphestAction.php @@ -19,19 +19,41 @@ /** * @group maniphest */ -final class ManiphestAction extends ManiphestConstants { +final class ManiphestAction extends PhrictionConstants { + /* These actions must be determined when the story + is generated and thus are new */ + const ACTION_CREATE = 'create'; + const ACTION_REOPEN = 'reopen'; + const ACTION_CLOSE = 'close'; + const ACTION_UPDATE = 'update'; + const ACTION_ASSIGN = 'assign'; - const ACTION_CREATE = 'create'; - const ACTION_CLOSE = 'close'; - const ACTION_UPDATE = 'update'; - const ACTION_ASSIGN = 'assign'; + /* these actions are determined sufficiently by the transaction + type and thus we use them here*/ + const ACTION_COMMENT = ManiphestTransactionType::TYPE_NONE; + const ACTION_CC = ManiphestTransactionType::TYPE_CCS; + const ACTION_PRIORITY = ManiphestTransactionType::TYPE_PRIORITY; + const ACTION_PROJECT = ManiphestTransactionType::TYPE_PROJECTS; + const ACTION_TITLE = ManiphestTransactionType::TYPE_TITLE; + const ACTION_DESCRIPTION = ManiphestTransactionType::TYPE_DESCRIPTION; + const ACTION_REASSIGN = ManiphestTransactionType::TYPE_OWNER; + const ACTION_ATTACH = ManiphestTransactionType::TYPE_ATTACH; public static function getActionPastTenseVerb($action) { static $map = array( - self::ACTION_CREATE => 'created', - self::ACTION_CLOSE => 'closed', - self::ACTION_UPDATE => 'updated', - self::ACTION_ASSIGN => 'assigned', + self::ACTION_CREATE => 'created', + self::ACTION_CLOSE => 'closed', + self::ACTION_UPDATE => 'updated', + self::ACTION_ASSIGN => 'assigned', + self::ACTION_REASSIGN => 'reassigned', + self::ACTION_COMMENT => 'commented on', + self::ACTION_CC => 'updated cc\'s of', + self::ACTION_PRIORITY => 'changed the priority of', + self::ACTION_PROJECT => 'modified projects of', + self::ACTION_TITLE => 'updated title of', + self::ACTION_DESCRIPTION => 'updated description of', + self::ACTION_ATTACH => 'attached something to', + self::ACTION_REOPEN => 'reopened', ); return idx($map, $action, "brazenly {$action}'d"); @@ -45,10 +67,19 @@ final class ManiphestAction extends ManiphestConstants { */ public static function selectStrongestAction(array $actions) { static $strengths = array( - self::ACTION_UPDATE => 0, - self::ACTION_ASSIGN => 1, - self::ACTION_CREATE => 2, - self::ACTION_CLOSE => 3, + self::ACTION_UPDATE => 0, + self::ACTION_CC => 1, + self::ACTION_PROJECT => 2, + self::ACTION_DESCRIPTION => 3, + self::ACTION_TITLE => 4, + self::ACTION_ATTACH => 5, + self::ACTION_COMMENT => 6, + self::ACTION_PRIORITY => 7, + self::ACTION_REASSIGN => 8, + self::ACTION_ASSIGN => 9, + self::ACTION_REOPEN => 10, + self::ACTION_CREATE => 11, + self::ACTION_CLOSE => 12, ); $strongest = null; diff --git a/src/applications/maniphest/editor/ManiphestTransactionEditor.php b/src/applications/maniphest/editor/ManiphestTransactionEditor.php index 751fa00859..3e2a80a080 100644 --- a/src/applications/maniphest/editor/ManiphestTransactionEditor.php +++ b/src/applications/maniphest/editor/ManiphestTransactionEditor.php @@ -329,6 +329,7 @@ final class ManiphestTransactionEditor { } break; default: + $actions[] = $type; break; } }