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

Align most revision actions to the new "Draft" state

Summary:
Ref T2543. Most actions are not available for drafts.

Authors can "Request Review" (move out of draft to become a normal revision) or "Abandon".

Non-authors can't do anything (maybe we'll let them do something later -- like "Commandeer"? -- if there's a good reason).

Test Plan: Viewed a draft revision as an author and non-author, saw fewer actions available.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T2543

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

+48 -13
+2 -1
src/applications/differential/xaction/DifferentialRevisionAbandonTransaction.php
··· 10 10 return pht('Abandon Revision'); 11 11 } 12 12 13 - protected function getRevisionActionDescription() { 13 + protected function getRevisionActionDescription( 14 + DifferentialRevision $revision) { 14 15 return pht('This revision will be abandoned and closed.'); 15 16 } 16 17
+2 -1
src/applications/differential/xaction/DifferentialRevisionAcceptTransaction.php
··· 10 10 return pht("Accept Revision \xE2\x9C\x94"); 11 11 } 12 12 13 - protected function getRevisionActionDescription() { 13 + protected function getRevisionActionDescription( 14 + DifferentialRevision $revision) { 14 15 return pht('These changes will be approved.'); 15 16 } 16 17
+3 -2
src/applications/differential/xaction/DifferentialRevisionActionTransaction.php
··· 52 52 return DifferentialRevisionEditEngine::ACTIONGROUP_REVISION; 53 53 } 54 54 55 - protected function getRevisionActionDescription() { 55 + protected function getRevisionActionDescription( 56 + DifferentialRevision $revision) { 56 57 return null; 57 58 } 58 59 ··· 103 104 if ($label !== null) { 104 105 $field->setCommentActionLabel($label); 105 106 106 - $description = $this->getRevisionActionDescription(); 107 + $description = $this->getRevisionActionDescription($revision); 107 108 $field->setActionDescription($description); 108 109 109 110 $group_key = $this->getRevisionActionGroupKey();
+2 -1
src/applications/differential/xaction/DifferentialRevisionCloseTransaction.php
··· 10 10 return pht('Close Revision'); 11 11 } 12 12 13 - protected function getRevisionActionDescription() { 13 + protected function getRevisionActionDescription( 14 + DifferentialRevision $revision) { 14 15 return pht('This revision will be closed.'); 15 16 } 16 17
+7 -1
src/applications/differential/xaction/DifferentialRevisionCommandeerTransaction.php
··· 10 10 return pht('Commandeer Revision'); 11 11 } 12 12 13 - protected function getRevisionActionDescription() { 13 + protected function getRevisionActionDescription( 14 + DifferentialRevision $revision) { 14 15 return pht('You will take control of this revision and become its author.'); 15 16 } 16 17 ··· 63 64 pht( 64 65 'You can not commandeer this revision because it has already '. 65 66 'been closed. You can only commandeer open revisions.')); 67 + } 68 + 69 + if ($object->isDraft()) { 70 + throw new Exception( 71 + pht('You can not commandeer a draft revision.')); 66 72 } 67 73 68 74 if ($this->isViewerRevisionAuthor($object, $viewer)) {
+7 -1
src/applications/differential/xaction/DifferentialRevisionPlanChangesTransaction.php
··· 10 10 return pht('Plan Changes'); 11 11 } 12 12 13 - protected function getRevisionActionDescription() { 13 + protected function getRevisionActionDescription( 14 + DifferentialRevision $revision) { 14 15 return pht( 15 16 'This revision will be removed from review queues until it is revised.'); 16 17 } ··· 55 56 } 56 57 57 58 protected function validateAction($object, PhabricatorUser $viewer) { 59 + if ($object->isDraft()) { 60 + throw new Exception( 61 + pht('You can not plan changes to a draft revision.')); 62 + } 63 + 58 64 if ($object->isChangePlanned()) { 59 65 throw new Exception( 60 66 pht(
+2 -1
src/applications/differential/xaction/DifferentialRevisionReclaimTransaction.php
··· 10 10 return pht('Reclaim Revision'); 11 11 } 12 12 13 - protected function getRevisionActionDescription() { 13 + protected function getRevisionActionDescription( 14 + DifferentialRevision $revision) { 14 15 return pht('This revision will be reclaimed and reopened.'); 15 16 } 16 17
+7 -1
src/applications/differential/xaction/DifferentialRevisionRejectTransaction.php
··· 10 10 return pht("Request Changes \xE2\x9C\x98"); 11 11 } 12 12 13 - protected function getRevisionActionDescription() { 13 + protected function getRevisionActionDescription( 14 + DifferentialRevision $revision) { 14 15 return pht('This revision will be returned to the author for updates.'); 15 16 } 16 17 ··· 70 71 'You can not request changes to this revision because you are the '. 71 72 'revision author. You can only request changes to revisions you do '. 72 73 'not own.')); 74 + } 75 + 76 + if ($object->isDraft()) { 77 + throw new Exception( 78 + pht('You can not request changes to a draft revision.')); 73 79 } 74 80 75 81 if ($this->isViewerFullyRejected($object, $viewer)) {
+2 -1
src/applications/differential/xaction/DifferentialRevisionReopenTransaction.php
··· 10 10 return pht('Reopen Revision'); 11 11 } 12 12 13 - protected function getRevisionActionDescription() { 13 + protected function getRevisionActionDescription( 14 + DifferentialRevision $revision) { 14 15 return pht('This revision will be reopened for review.'); 15 16 } 16 17
+7 -2
src/applications/differential/xaction/DifferentialRevisionRequestReviewTransaction.php
··· 10 10 return pht('Request Review'); 11 11 } 12 12 13 - protected function getRevisionActionDescription() { 14 - return pht('This revision will be returned to reviewers for feedback.'); 13 + protected function getRevisionActionDescription( 14 + DifferentialRevision $revision) { 15 + if ($revision->isDraft()) { 16 + return pht('This revision will be submitted to reviewers for feedback.'); 17 + } else { 18 + return pht('This revision will be returned to reviewers for feedback.'); 19 + } 15 20 } 16 21 17 22 public function getColor() {
+7 -1
src/applications/differential/xaction/DifferentialRevisionResignTransaction.php
··· 10 10 return pht('Resign as Reviewer'); 11 11 } 12 12 13 - protected function getRevisionActionDescription() { 13 + protected function getRevisionActionDescription( 14 + DifferentialRevision $revision) { 14 15 return pht('You will resign as a reviewer for this change.'); 15 16 } 16 17 ··· 61 62 pht( 62 63 'You can not resign from this revision because it has already '. 63 64 'been closed. You can only resign from open revisions.')); 65 + } 66 + 67 + if ($object->isDraft()) { 68 + throw new Exception( 69 + pht('You can not resign from a draft revision.')); 64 70 } 65 71 66 72 $resigned = DifferentialReviewerStatus::STATUS_RESIGNED;