1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-26 23:40:57 +01:00

In Differential, prevent "Accept" and "Reject" from "Plan Changes + Draft"

Summary:
Ref T13130. See PHI483. Currently, "Plan Changes + Draft" uses rules like "Plan Changes", not rules like "Draft", and allows "Accept".

This isn't consistent with how "Draft" and "Accept" work in other cases. Make "Plan Changes + Draft" more like "Draft" for consistency.

Also fix a string that didn't have a natural English version.

Test Plan:
  - Added a failing build plan.
  - Created a revision.
  - Loaded the revision before builds completed, saw a nicer piece of text about "waiting for builds" instead of "waiting for 2 build(s)".
  - Builds failed, which automatically demoted the reivsion to "Changes Planned + Draft".
  - As the author and as a reviewer, verified all the actions available to me made sense (particularly, no "Accept").
  - Abandoned the revision to test "Abandoned + Draft".
  - As the author and as a reviewer, verified all the actions available to me made sense.
  - Reclaimed the revision, then used "Request Review" to send it to "Needs Review". Verified that actions made sense and, e.g., reviewers could now "Accept" normally.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13130

Differential Revision: https://secure.phabricator.com/D19398
This commit is contained in:
epriestley 2018-04-21 13:00:54 -07:00
parent 15e6e2adea
commit 16af0d35e5
3 changed files with 10 additions and 2 deletions

View file

@ -162,7 +162,7 @@ final class DifferentialRevisionAcceptTransaction
'closed. Only open revisions can be accepted.'));
}
if ($object->isDraft()) {
if ($object->isDraft() || !$object->getShouldBroadcast()) {
throw new Exception(
pht('You can not accept a draft revision.'));
}

View file

@ -73,7 +73,7 @@ final class DifferentialRevisionRejectTransaction
'not own.'));
}
if ($object->isDraft()) {
if ($object->isDraft() || !$object->getShouldBroadcast()) {
throw new Exception(
pht('You can not request changes to a draft revision.'));
}

View file

@ -1659,6 +1659,14 @@ final class PhabricatorUSEnglishTranslation
'you can no longer see were discarded.',
),
'This draft revision will be sent for review once %s '.
'build(s) pass: %s.' => array(
'This draft revision will be sent for review once this build '.
'passes: %2$s.',
'This draft revision will be sent for review once these builds '.
'pass: %2$s.',
),
);
}