Yaniv Bronhaim has uploaded a new change for review. Change subject: ui: Adding fields validation in addHost form ......................................................................
ui: Adding fields validation in addHost form 1. For root password during provisioning host 2. For empty compute resources and host group lists, when discovered host is added. Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1127606 Change-Id: Icfc3e500ad06728fc8c410baa13405633fc90da2 Signed-off-by: Yaniv Bronhaim <[email protected]> --- M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostModel.java 1 file changed, 18 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/93/33093/1 diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostModel.java index 58ad2c1..ca7186a 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostModel.java @@ -1008,7 +1008,9 @@ getProviderSearchFilterLabel().setIsAvailable(false); setExternalDiscoveredHosts(new ListModel()); setExternalHostGroups(new ListModel()); + getExternalHostGroups().setIsChangable(true); setExternalComputeResource(new ListModel()); + getExternalComputeResource().setIsChangable(true); getUpdateHostsCommand().setIsExecutionAllowed(false); // Initialize primary PM fields. @@ -1679,6 +1681,19 @@ new LengthValidation(255), new HostAddressValidation() }); + if (Boolean.TRUE.equals(getIsDiscoveredHosts().getEntity())) { + getUserPassword().validateEntity(new IValidation[] { + new NotEmptyValidation(), + new LengthValidation(255) + }); + getExternalComputeResource().setIsValid(getExternalComputeResource().getSelectedItem() != null); + getExternalHostGroups().setIsValid(getExternalHostGroups().getSelectedItem() != null); + } + else { + getExternalComputeResource().setIsValid(true); + getExternalHostGroups().setIsValid(true); + } + getAuthSshPort().validateEntity(new IValidation[] {new NotEmptyValidation(), new IntegerValidation(1, 65535)}); if (getConsoleAddressEnabled().getEntity()) { @@ -1721,6 +1736,9 @@ && getHost().getIsValid() && getAuthSshPort().getIsValid() && getCluster().getIsValid() + && getExternalHostGroups().getIsValid() + && getExternalComputeResource().getIsValid() + && getUserPassword().getIsValid() ); setIsPowerManagementTabValid(getManagementIp().getIsValid() -- To view, visit http://gerrit.ovirt.org/33093 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icfc3e500ad06728fc8c410baa13405633fc90da2 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.5 Gerrit-Owner: Yaniv Bronhaim <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
