Lior Vernia has uploaded a new change for review.

Change subject: webadmin: Changed URL behaviour in Provider popup
......................................................................

webadmin: Changed URL behaviour in Provider popup

Removed the confusing auto-addition of the "http://"; prefix when the
scheme was missing, instead added the prefix as default when adding a
new provider.

Change-Id: I54c660b32dd307a4a70272c2ad8cea63087103b9
Signed-off-by: Lior Vernia <lver...@redhat.com>
---
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Uri.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/providers/AddProviderModel.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/providers/ProviderModel.java
3 files changed, 9 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/49/15649/1

diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Uri.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Uri.java
index f6ed40e..22ccf20 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Uri.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Uri.java
@@ -35,6 +35,10 @@
         }
     }
 
+    public Uri() {
+        this(null);
+    }
+
     public String getStringRepresentation() {
         if (!valid) {
             return null;
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/providers/AddProviderModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/providers/AddProviderModel.java
index 4dfa72b..8d9f3de 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/providers/AddProviderModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/providers/AddProviderModel.java
@@ -2,6 +2,7 @@
 
 import org.ovirt.engine.core.common.action.VdcActionType;
 import org.ovirt.engine.core.common.businessentities.Provider;
+import org.ovirt.engine.ui.uicommonweb.Uri;
 import org.ovirt.engine.ui.uicompat.ConstantsManager;
 
 public class AddProviderModel extends ProviderModel {
@@ -10,6 +11,10 @@
         super(sourceListModel, VdcActionType.AddProvider, new Provider());
         
setTitle(ConstantsManager.getInstance().getConstants().addProviderTitle());
         setHashName("add_provider"); //$NON-NLS-1$
+
+        Uri url = new Uri();
+        url.setScheme(Uri.SCHEME_HTTP);
+        getUrl().setEntity(url.getStringRepresentation());
     }
 
 }
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/providers/ProviderModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/providers/ProviderModel.java
index 6a7a923..a6fa456 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/providers/ProviderModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/providers/ProviderModel.java
@@ -172,12 +172,6 @@
         getType().validateSelectedItem(new IValidation[] { new 
NotEmptyValidation() });
         getUsername().validateEntity(new IValidation[] { new 
NotEmptyValidation() });
         getPassword().validateEntity(new IValidation[] { new 
NotEmptyValidation() });
-
-        Uri url = new Uri((String) getUrl().getEntity());
-        if (url.getScheme().isEmpty()) {
-            url.setScheme(Uri.SCHEME_HTTP);
-            getUrl().setEntity(url.getStringRepresentation());
-        }
         getUrl().validateEntity(new IValidation[] { new NotEmptyValidation(),
                 new UrlValidation(Uri.SCHEME_HTTP, Uri.SCHEME_HTTPS) });
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I54c660b32dd307a4a70272c2ad8cea63087103b9
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Lior Vernia <lver...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to