From f61da52c646adc85c01e9cb9317f8fa537ae60f7 Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Wed, 31 May 2017 22:16:58 +0200 Subject: [PATCH] GWT UI: Allow to set blocking label range rules The UI was never extended to apply blocking action to label range rules. Moreover, if the blocking label range rule is set by manipulation of project.config file on refs/meta/config branch, the UI is erroneously rendering this label range as ALLOW action (in fact, there is no action at all, so ALLOW action is implied), even though, in reality the blocking action was defined. Bug: Issue 6367 Change-Id: I1865ec5bc9410c42bd6d7244198a6b00143c6771 --- .../gerrit/client/admin/PermissionRuleEditor.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/PermissionRuleEditor.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/PermissionRuleEditor.java index 476404a6fe..16dd1679c3 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/PermissionRuleEditor.java +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/PermissionRuleEditor.java @@ -111,6 +111,12 @@ public class PermissionRuleEditor extends Composite min = minList; max = maxList; + action.setAcceptableValues( + Arrays.asList( + PermissionRule.Action.ALLOW, + PermissionRule.Action.DENY, + PermissionRule.Action.BLOCK)); + } else { min = new RangeBox.Box(); max = new RangeBox.Box(); @@ -144,15 +150,13 @@ public class PermissionRuleEditor extends Composite } force.setVisible(canForce); force.setEnabled(!readOnly); + action.getElement().setPropertyBoolean("disabled", readOnly); if (validRange != null) { min.setEnabled(!readOnly); max.setEnabled(!readOnly); - action.getElement().getStyle().setDisplay(Display.NONE); - } else { rangeEditor.getStyle().setDisplay(Display.NONE); - action.getElement().setPropertyBoolean("disabled", readOnly); } if (readOnly) {