From 6683cf0cbc33e6507fa4644842566cfd1fd6406c Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Wed, 19 Jun 2019 10:33:02 +0300 Subject: [PATCH 1/2] Submit: Do not ignore problems for the change itself It is useful for the user to have an early indication of a disabled button with a tooltip, instead of letting the user click the button and confirm, and only then discover that it fails. Change-Id: Ibf4540ac07d3f4521a7233fef0e875119399ab5b --- java/com/google/gerrit/server/restapi/change/Submit.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/java/com/google/gerrit/server/restapi/change/Submit.java b/java/com/google/gerrit/server/restapi/change/Submit.java index 773d12d463..518e221fb5 100644 --- a/java/com/google/gerrit/server/restapi/change/Submit.java +++ b/java/com/google/gerrit/server/restapi/change/Submit.java @@ -254,11 +254,6 @@ public class Submit return BLOCKED_HIDDEN_SUBMIT_TOOLTIP; } for (ChangeData c : cs.changes()) { - if (cd.getId().equals(c.getId())) { - // We ignore the change about to be submitted, as these checks are already done in the - // #apply and #getDescription methods. - continue; - } Set can = permissionBackend .user(user) From fc623bd65279b8643eda759f6e6ec0e96303c62d Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Sun, 12 Nov 2017 15:53:20 +0200 Subject: [PATCH 2/2] Submit: Show submit with tooltip when unauthorized/WIP If the change is submittable, but the user is not authorized to submit, there is no indication at all. Show the Submit button on this case, with an appropriate tooltip. Change-Id: Ibdcfa4f1e545fcca8723c19ae343b45183388180 --- java/com/google/gerrit/server/restapi/change/Submit.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/java/com/google/gerrit/server/restapi/change/Submit.java b/java/com/google/gerrit/server/restapi/change/Submit.java index 518e221fb5..7c1011744d 100644 --- a/java/com/google/gerrit/server/restapi/change/Submit.java +++ b/java/com/google/gerrit/server/restapi/change/Submit.java @@ -302,10 +302,7 @@ public class Submit @Override public UiAction.Description getDescription(RevisionResource resource) { Change change = resource.getChange(); - if (!change.getStatus().isOpen() - || change.isWorkInProgress() - || !resource.isCurrent() - || !resource.permissions().testOrFalse(ChangePermission.SUBMIT)) { + if (!change.getStatus().isOpen() || !resource.isCurrent()) { return null; // submit not visible }