mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-03 11:21:01 +01:00
Implemented "Plan Changes" action for differential.
Summary: Old differential allowed users to plan changes for their own revisions. This feature is now available in Phabricator version of differential. Test Plan: Tested by selecting "Plan Changes" for one of my own aceepted revisions. Reviewed By: epriestley Reviewers: epriestley CC: jungejason, epriestley Differential Revision: 130
This commit is contained in:
parent
ef5456b15f
commit
2bd51fd125
4 changed files with 29 additions and 0 deletions
|
@ -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',
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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.');
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue