Lior Vernia has uploaded a new change for review. Change subject: webadmin: Added host interface label character validation ......................................................................
webadmin: Added host interface label character validation Previously the characters input into a newly-assigned label were only validated by the backend, now the dialog checks that no illegal characters were entered as well. Change-Id: I25bef382cb658e6e78bf5e2e0cfd1a273280d953 Bug-Url: https://bugzilla.redhat.com/1063846 Signed-off-by: Lior Vernia <[email protected]> --- M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/NicLabelModel.java 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/49/25549/1 diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/NicLabelModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/NicLabelModel.java index ee1b98d..4e952e9 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/NicLabelModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/NicLabelModel.java @@ -9,6 +9,8 @@ import org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface; import org.ovirt.engine.ui.uicommonweb.models.ListModel; +import org.ovirt.engine.ui.uicommonweb.validation.AsciiNameValidation; +import org.ovirt.engine.ui.uicommonweb.validation.IValidation; import org.ovirt.engine.ui.uicompat.ConstantsManager; public class NicLabelModel extends ListModel<ListModel<String>> { @@ -57,6 +59,8 @@ public boolean validate() { boolean res = true; for (ListModel<String> labelModel : getItems()) { + labelModel.validateSelectedItem(new IValidation[] { new AsciiNameValidation() }); + String label = labelModel.getSelectedItem(); String usingIface = labelToIface.get(label); if (usingIface != null && !containedIfaces.contains(usingIface)) { @@ -64,8 +68,8 @@ .getMessages() .labelInUse(label, usingIface)); labelModel.setIsValid(false); - res = false; } + res &= labelModel.getIsValid(); } return res; } -- To view, visit http://gerrit.ovirt.org/25549 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I25bef382cb658e6e78bf5e2e0cfd1a273280d953 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.4 Gerrit-Owner: Lior Vernia <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
