mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-05 12:21:02 +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_COMMENT = 'none';
|
||||||
const ACTION_ACCEPT = 'accept';
|
const ACTION_ACCEPT = 'accept';
|
||||||
const ACTION_REJECT = 'reject';
|
const ACTION_REJECT = 'reject';
|
||||||
|
const ACTION_RETHINK = 'rethink';
|
||||||
const ACTION_ABANDON = 'abandon';
|
const ACTION_ABANDON = 'abandon';
|
||||||
const ACTION_REQUEST = 'request_review';
|
const ACTION_REQUEST = 'request_review';
|
||||||
const ACTION_RECLAIM = 'reclaim';
|
const ACTION_RECLAIM = 'reclaim';
|
||||||
|
@ -37,6 +38,7 @@ final class DifferentialAction {
|
||||||
self::ACTION_COMMENT => 'commented on',
|
self::ACTION_COMMENT => 'commented on',
|
||||||
self::ACTION_ACCEPT => 'accepted',
|
self::ACTION_ACCEPT => 'accepted',
|
||||||
self::ACTION_REJECT => 'requested changes to',
|
self::ACTION_REJECT => 'requested changes to',
|
||||||
|
self::ACTION_RETHINK => 'planned changes to',
|
||||||
self::ACTION_ABANDON => 'abandoned',
|
self::ACTION_ABANDON => 'abandoned',
|
||||||
self::ACTION_COMMIT => 'committed',
|
self::ACTION_COMMIT => 'committed',
|
||||||
self::ACTION_REQUEST => 'requested a review of',
|
self::ACTION_REQUEST => 'requested a review of',
|
||||||
|
@ -61,6 +63,7 @@ final class DifferentialAction {
|
||||||
self::ACTION_COMMENT => 'Comment',
|
self::ACTION_COMMENT => 'Comment',
|
||||||
self::ACTION_ACCEPT => "Accept Revision \xE2\x9C\x94",
|
self::ACTION_ACCEPT => "Accept Revision \xE2\x9C\x94",
|
||||||
self::ACTION_REJECT => "Request Changes \xE2\x9C\x98",
|
self::ACTION_REJECT => "Request Changes \xE2\x9C\x98",
|
||||||
|
self::ACTION_RETHINK => "Plan Changes \xE2\x9C\x98",
|
||||||
self::ACTION_ABANDON => 'Abandon Revision',
|
self::ACTION_ABANDON => 'Abandon Revision',
|
||||||
self::ACTION_REQUEST => 'Request Review',
|
self::ACTION_REQUEST => 'Request Review',
|
||||||
self::ACTION_RECLAIM => 'Reclaim Revision',
|
self::ACTION_RECLAIM => 'Reclaim Revision',
|
||||||
|
|
|
@ -467,11 +467,16 @@ class DifferentialRevisionViewController extends DifferentialController {
|
||||||
switch ($revision->getStatus()) {
|
switch ($revision->getStatus()) {
|
||||||
case DifferentialRevisionStatus::NEEDS_REVIEW:
|
case DifferentialRevisionStatus::NEEDS_REVIEW:
|
||||||
$actions[DifferentialAction::ACTION_ABANDON] = true;
|
$actions[DifferentialAction::ACTION_ABANDON] = true;
|
||||||
|
$actions[DifferentialAction::ACTION_RETHINK] = true;
|
||||||
break;
|
break;
|
||||||
case DifferentialRevisionStatus::NEEDS_REVISION:
|
case DifferentialRevisionStatus::NEEDS_REVISION:
|
||||||
|
$actions[DifferentialAction::ACTION_ABANDON] = true;
|
||||||
|
$actions[DifferentialAction::ACTION_REQUEST] = true;
|
||||||
|
break;
|
||||||
case DifferentialRevisionStatus::ACCEPTED:
|
case DifferentialRevisionStatus::ACCEPTED:
|
||||||
$actions[DifferentialAction::ACTION_ABANDON] = true;
|
$actions[DifferentialAction::ACTION_ABANDON] = true;
|
||||||
$actions[DifferentialAction::ACTION_REQUEST] = true;
|
$actions[DifferentialAction::ACTION_REQUEST] = true;
|
||||||
|
$actions[DifferentialAction::ACTION_RETHINK] = true;
|
||||||
break;
|
break;
|
||||||
case DifferentialRevisionStatus::COMMITTED:
|
case DifferentialRevisionStatus::COMMITTED:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -183,6 +183,22 @@ class DifferentialCommentEditor {
|
||||||
->save();
|
->save();
|
||||||
break;
|
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:
|
case DifferentialAction::ACTION_RECLAIM:
|
||||||
if (!$actor_is_author) {
|
if (!$actor_is_author) {
|
||||||
throw new Exception('You can not reclaim a revision you do not own.');
|
throw new Exception('You can not reclaim a revision you do not own.');
|
||||||
|
|
|
@ -72,6 +72,11 @@
|
||||||
background: #fff3f3;
|
background: #fff3f3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.differential-comment-action-rethink .differential-comment-content {
|
||||||
|
border-color: #aa0000;
|
||||||
|
background: #fff3f3;
|
||||||
|
}
|
||||||
|
|
||||||
.differential-comment-action-commit .differential-comment-content {
|
.differential-comment-action-commit .differential-comment-content {
|
||||||
border-color: #006699;
|
border-color: #006699;
|
||||||
background: #f3f3ff;
|
background: #f3f3ff;
|
||||||
|
|
Loading…
Reference in a new issue