Frank Kobzik has uploaded a new change for review.

Change subject: engine: User Portal - auto-connect selected only works once per 
browser session
......................................................................

engine: User Portal - auto-connect selected only works once per browser session

1. Go to the user portal, where the user only has one VM that is up, have the
   Connect Automatically checkbox selected, and login.
2. Logout and repeat.

The console doesn't pop up. The problem was caused by the alreadyOpened
property of the ConnectAutomaticallyManager, which is set to true after the
console is brought up for the first time. This value is not reset after the
user logs out. Fixed by resetting the value on user's logout.

Change-Id: If59f9874d1804e17788f8ef0dc82e4e786f55870
Signed-off-by: Frantisek Kobzik <fkob...@redhat.com>
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=867134
---
M 
frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/section/main/presenter/HeaderPresenterWidget.java
M 
frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/utils/ConnectAutomaticallyManager.java
2 files changed, 15 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/51/8851/1

diff --git 
a/frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/section/main/presenter/HeaderPresenterWidget.java
 
b/frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/section/main/presenter/HeaderPresenterWidget.java
index 45bddb4..8d7ba6b 100644
--- 
a/frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/section/main/presenter/HeaderPresenterWidget.java
+++ 
b/frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/section/main/presenter/HeaderPresenterWidget.java
@@ -6,6 +6,7 @@
 import org.ovirt.engine.ui.userportal.ApplicationConstants;
 import org.ovirt.engine.ui.userportal.auth.CurrentUserRole;
 import org.ovirt.engine.ui.userportal.uicommon.UserPortalConfigurator;
+import org.ovirt.engine.ui.userportal.utils.ConnectAutomaticallyManager;
 
 import com.google.gwt.event.dom.client.ClickEvent;
 import com.google.gwt.event.dom.client.ClickHandler;
@@ -27,15 +28,18 @@
 
     private final CurrentUserRole userRole;
     private final AboutPopupPresenterWidget aboutPopup;
+    private final ConnectAutomaticallyManager connectAutomaticallyManager;
 
     @Inject
     public HeaderPresenterWidget(EventBus eventBus, ViewDef view, CurrentUser 
user,
             CurrentUserRole userRole, AboutPopupPresenterWidget aboutPopup,
+            ConnectAutomaticallyManager connectAutomaticallyManager,
             ApplicationConstants constants) {
         super(eventBus, view, user,
                 UserPortalConfigurator.DOCUMENTATION_GUIDE_PATH, 
constants.userPortalDoc());
         this.userRole = userRole;
         this.aboutPopup = aboutPopup;
+        this.connectAutomaticallyManager = connectAutomaticallyManager;
     }
 
     @Override
@@ -58,6 +62,13 @@
                 RevealRootPopupContentEvent.fire(HeaderPresenterWidget.this, 
aboutPopup);
             }
         }));
+
+        registerHandler(getView().getLogoutLink().addClickHandler(new 
ClickHandler() {
+            @Override
+            public void onClick(ClickEvent event) {
+                connectAutomaticallyManager.setAlreadyOpened(false);
+            }
+        }));
     }
 
     @Override
diff --git 
a/frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/utils/ConnectAutomaticallyManager.java
 
b/frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/utils/ConnectAutomaticallyManager.java
index fa95f12..c14f018 100644
--- 
a/frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/utils/ConnectAutomaticallyManager.java
+++ 
b/frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/utils/ConnectAutomaticallyManager.java
@@ -34,6 +34,10 @@
         this.connectAutomatically = connectAutomatically;
     }
 
+    public void setAlreadyOpened(boolean alreadyOpened) {
+        this.alreadyOpened = alreadyOpened;
+    }
+
     public void unregisterModels() {
         if (listeners == null) {
             return;


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

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

Reply via email to