Yaniv Bronhaim has uploaded a new change for review.

Change subject: ui: fixing addHost form issues when playing with using host 
provider
......................................................................

ui: fixing addHost form issues when playing with using host provider

Apparently hiding the host provider form was buggy. In this patch we fix
the fields cleaning and the visibility of the provider parameters.

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1165670
Change-Id: I700ec281a1bd1617d0168d59c8daef5b5bcf4f6b
Signed-off-by: Yaniv Bronhaim <ybron...@redhat.com>
---
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostModel.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/NewHostModel.java
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostPopupView.java
3 files changed, 12 insertions(+), 18 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/85/35385/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 5121163..51a6a28 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
@@ -1886,15 +1886,6 @@
         getHost().setEntity(constants.empty());
         getUserPassword().setEntity(constants.empty());
         getFetchSshFingerprint().setEntity(constants.empty());
-        getExternalHostName().setItems(null);
-        getExternalHostName().setIsChangable(false);
-        getExternalDiscoveredHosts().setItems(null);
-        getExternalDiscoveredHosts().setIsChangable(false);
-        getExternalHostGroups().setItems(null);
-        getExternalHostGroups().setIsChangable(false);
-        getExternalComputeResource().setItems(null);
-        getExternalComputeResource().setIsChangable(false);
-
     }
 
     protected abstract boolean showInstallationProperties();
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/NewHostModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/NewHostModel.java
index 76557a1..394c195 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/NewHostModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/NewHostModel.java
@@ -70,7 +70,6 @@
             vds = new VDS();
         }
         updateModelFromVds(vds, null, false, null);
-        getHost().setIsChangable(false);
     }
 
     private void discoverHostName_SelectedItemChanged() {
@@ -81,7 +80,6 @@
             vds.setHostName(dhost.getIp());
         }
         updateModelFromVds(vds, null, false, null);
-        getName().setIsChangable(true);
     }
 
     private void providers_SelectedItemChanged() {
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostPopupView.java
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostPopupView.java
index 8616a01..f2509cc 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostPopupView.java
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostPopupView.java
@@ -749,8 +749,13 @@
             public void eventRaised(Event ev, Object sender, EventArgs args) {
                 boolean showForemanProviders = 
object.getExternalHostProviderEnabled().getEntity();
                 providersEditor.setVisible(showForemanProviders);
+
+                // showing or hiding radio buttons
                 provisionedHostSection.setVisible(showForemanProviders);
                 discoveredHostSection.setVisible(showForemanProviders);
+
+                // disabling ip and name textbox when using provisioned hosts
+                hostAddressEditor.setEnabled(!showForemanProviders);
 
                 if (showForemanProviders) {
                     object.updateHosts();
@@ -767,9 +772,11 @@
                 if 
(Boolean.TRUE.equals(object.getIsDiscoveredHosts().getEntity())) {
                     rbDiscoveredHost.setValue(true);
                     showDiscoveredHostsWidgets(true);
-                } else {
+                    object.cleanHostParametersFields();
+                } else if 
(Boolean.FALSE.equals(object.getIsDiscoveredHosts().getEntity())) {
                     rbProvisionedHost.setValue(true);
                     showProvisionedHostsWidgets(true);
+                    object.cleanHostParametersFields();
                 }
             }
         });
@@ -917,11 +924,11 @@
     }
 
     private void hideProviderWidgets(final HostModel object) {
+        rbProvisionedHost.setValue(false);
+        rbDiscoveredHost.setValue(false);
         usualFormToDiscover(false);
         showExternalDiscoveredHost(false);
         showExternalProvisionedHosts(false);
-        rbProvisionedHost.setValue(false);
-        rbDiscoveredHost.setValue(false);
         object.getIsDiscoveredHosts().setEntity(null);
     }
 
@@ -932,8 +939,8 @@
         provisionedHostSection.setVisible(false);
         discoveredHostSection.setVisible(false);
         providersEditor.setVisible(false);
-        discoveredHostsPanel.setVisible(false);
-        searchProviderPanel.setVisible(false);
+        showExternalDiscoveredHost(false);
+        showExternalProvisionedHosts(false);
     }
 
     private void displayPassPkWindow(boolean isPasswordVisible) {
@@ -966,8 +973,6 @@
     private void usualFormToDiscover(boolean isDiscovered) {
         if (isDiscovered) {
             authLabel.setText(constants.hostPopupAuthLabelForExternalHost());
-            hostAddressEditor.setEnabled(true);
-            hostAddressEditor.setVisible(true);
         } else {
             authLabel.setText(constants.hostPopupAuthLabel());
             displayPassPkWindow(true);


-- 
To view, visit http://gerrit.ovirt.org/35385
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I700ec281a1bd1617d0168d59c8daef5b5bcf4f6b
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.5
Gerrit-Owner: Yaniv Bronhaim <ybron...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to