ChangeScreen: Don't show "Merge Conflict" for submittable WIP change

If a change had all the necessary labels to allow submit, but is still
in the WIP state, the status showed as "Merge Conflict (WorkInProgress")
on the change screen.

The reason is that the "mergeable" flag is not set in the change info
when a change is WIP.

Add a condition to prevent setting "Merge Conflict" if a change is WIP.

Now it says: "Review in Progress (WorkInProgress)".

Bug: Issue 8643
Change-Id: Ia2960e8824e8d6f975adb545a73dd2a7accf0469
This commit is contained in:
David Pursehouse
2018-04-25 12:17:35 +09:00
parent dcb0d67c93
commit 41703dc9ff

View File

@@ -1232,7 +1232,7 @@ public class ChangeScreen extends Screen {
}
private void renderSubmitType(Change.Status status, boolean canSubmit, SubmitType submitType) {
if (canSubmit && status == Change.Status.NEW) {
if (canSubmit && status == Change.Status.NEW && !changeInfo.isWorkInProgress()) {
statusText.setInnerText(
changeInfo.mergeable() ? Util.C.readyToSubmit() : Util.C.mergeConflict());
}