diff --git a/src/applications/differential/constants/action/DifferentialAction.php b/src/applications/differential/constants/action/DifferentialAction.php index 9d71fff450..49633d60e9 100644 --- a/src/applications/differential/constants/action/DifferentialAction.php +++ b/src/applications/differential/constants/action/DifferentialAction.php @@ -22,6 +22,7 @@ final class DifferentialAction { const ACTION_COMMENT = 'none'; const ACTION_ACCEPT = 'accept'; const ACTION_REJECT = 'reject'; + const ACTION_RETHINK = 'rethink'; const ACTION_ABANDON = 'abandon'; const ACTION_REQUEST = 'request_review'; const ACTION_RECLAIM = 'reclaim'; @@ -37,6 +38,7 @@ final class DifferentialAction { self::ACTION_COMMENT => 'commented on', self::ACTION_ACCEPT => 'accepted', self::ACTION_REJECT => 'requested changes to', + self::ACTION_RETHINK => 'planned changes to', self::ACTION_ABANDON => 'abandoned', self::ACTION_COMMIT => 'committed', self::ACTION_REQUEST => 'requested a review of', @@ -61,6 +63,7 @@ final class DifferentialAction { self::ACTION_COMMENT => 'Comment', self::ACTION_ACCEPT => "Accept Revision \xE2\x9C\x94", self::ACTION_REJECT => "Request Changes \xE2\x9C\x98", + self::ACTION_RETHINK => "Plan Changes \xE2\x9C\x98", self::ACTION_ABANDON => 'Abandon Revision', self::ACTION_REQUEST => 'Request Review', self::ACTION_RECLAIM => 'Reclaim Revision', diff --git a/src/applications/differential/controller/revisionview/DifferentialRevisionViewController.php b/src/applications/differential/controller/revisionview/DifferentialRevisionViewController.php index 7c1a338088..1075c35b15 100644 --- a/src/applications/differential/controller/revisionview/DifferentialRevisionViewController.php +++ b/src/applications/differential/controller/revisionview/DifferentialRevisionViewController.php @@ -467,11 +467,16 @@ class DifferentialRevisionViewController extends DifferentialController { switch ($revision->getStatus()) { case DifferentialRevisionStatus::NEEDS_REVIEW: $actions[DifferentialAction::ACTION_ABANDON] = true; + $actions[DifferentialAction::ACTION_RETHINK] = true; break; case DifferentialRevisionStatus::NEEDS_REVISION: + $actions[DifferentialAction::ACTION_ABANDON] = true; + $actions[DifferentialAction::ACTION_REQUEST] = true; + break; case DifferentialRevisionStatus::ACCEPTED: $actions[DifferentialAction::ACTION_ABANDON] = true; $actions[DifferentialAction::ACTION_REQUEST] = true; + $actions[DifferentialAction::ACTION_RETHINK] = true; break; case DifferentialRevisionStatus::COMMITTED: break; diff --git a/src/applications/differential/editor/comment/DifferentialCommentEditor.php b/src/applications/differential/editor/comment/DifferentialCommentEditor.php index 4f7baa813d..51281885e4 100644 --- a/src/applications/differential/editor/comment/DifferentialCommentEditor.php +++ b/src/applications/differential/editor/comment/DifferentialCommentEditor.php @@ -183,6 +183,22 @@ class DifferentialCommentEditor { ->save(); break; + case DifferentialAction::ACTION_RETHINK: + if (!$actor_is_author) { + throw new Exception( + "You can not plan changes to somebody else's revision"); + } + if (($revision_status != DifferentialRevisionStatus::NEEDS_REVIEW) && + ($revision_status != DifferentialRevisionStatus::ACCEPTED)) { + $action = DifferentialAction::ACTION_COMMENT; + break; + } + + $revision + ->setStatus(DifferentialRevisionStatus::NEEDS_REVISION) + ->save(); + break; + case DifferentialAction::ACTION_RECLAIM: if (!$actor_is_author) { throw new Exception('You can not reclaim a revision you do not own.'); diff --git a/webroot/rsrc/css/application/differential/revision-comment.css b/webroot/rsrc/css/application/differential/revision-comment.css index 488249700f..fb8b5f169e 100644 --- a/webroot/rsrc/css/application/differential/revision-comment.css +++ b/webroot/rsrc/css/application/differential/revision-comment.css @@ -72,6 +72,11 @@ background: #fff3f3; } +.differential-comment-action-rethink .differential-comment-content { + border-color: #aa0000; + background: #fff3f3; +} + .differential-comment-action-commit .differential-comment-content { border-color: #006699; background: #f3f3ff;