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
This commit is contained in:
Orgad Shaneh
2017-11-12 15:53:20 +02:00
parent 6683cf0cbc
commit fc623bd652

View File

@@ -302,10 +302,7 @@ public class Submit
@Override @Override
public UiAction.Description getDescription(RevisionResource resource) { public UiAction.Description getDescription(RevisionResource resource) {
Change change = resource.getChange(); Change change = resource.getChange();
if (!change.getStatus().isOpen() if (!change.getStatus().isOpen() || !resource.isCurrent()) {
|| change.isWorkInProgress()
|| !resource.isCurrent()
|| !resource.permissions().testOrFalse(ChangePermission.SUBMIT)) {
return null; // submit not visible return null; // submit not visible
} }