Gilad Chaplik has uploaded a new change for review. Change subject: webadmin,userportal: hourglass in login (#849537) ......................................................................
webadmin,userportal: hourglass in login (#849537) https://bugzilla.redhat.com/849537 on login, disabled the login button and added wait cursor Change-Id: Ic4a4f4a8b20943e8fcfc37c076d7c8ad71e1d04a Signed-off-by: Gilad Chaplik <[email protected]> --- M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/presenter/AbstractLoginPopupPresenterWidget.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/LoginModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalLoginModel.java M frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/section/login/view/LoginPopupView.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/login/view/LoginPopupView.java 5 files changed, 50 insertions(+), 4 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/76/7376/1 diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/presenter/AbstractLoginPopupPresenterWidget.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/presenter/AbstractLoginPopupPresenterWidget.java index f8ab634..3b8fd3e 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/presenter/AbstractLoginPopupPresenterWidget.java +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/presenter/AbstractLoginPopupPresenterWidget.java @@ -18,6 +18,8 @@ import com.google.gwt.event.dom.client.HasClickHandlers; import com.google.gwt.event.dom.client.KeyCodes; import com.google.gwt.event.shared.EventBus; +import com.google.gwt.user.client.DOM; +import com.google.gwt.user.client.ui.RootPanel; import com.gwtplatform.mvp.client.PopupView; import com.gwtplatform.mvp.client.PresenterWidget; @@ -42,6 +44,8 @@ HasClickHandlers getLoginButton(); void setPopupKeyPressHandler(PopupNativeKeyPressHandler keyPressHandler); + + void setLoginButtonEnabled(boolean isEnabled); } @@ -115,6 +119,33 @@ } } }); + + // Add "Progress" property change handler to Window model + loginModel.getPropertyChangedEvent().addListener(new IEventListener() { + @Override + public void eventRaised(Event ev, Object sender, EventArgs args) { + PropertyChangedEventArgs pcArgs = (PropertyChangedEventArgs) args; + + if ("Progress".equals(pcArgs.PropertyName)) { //$NON-NLS-1$ + if (loginModel.getProgress() != null) { + DOM.setStyleAttribute(RootPanel.getBodyElement(), "cursor", "wait"); //$NON-NLS-1$ //$NON-NLS-2$ + } else { + DOM.setStyleAttribute(RootPanel.getBodyElement(), "cursor", "default"); //$NON-NLS-1$ //$NON-NLS-2$ + } + } + } + }); + + loginModel.getLoginCommand().getPropertyChangedEvent().addListener(new IEventListener() { + + @Override + public void eventRaised(Event ev, Object sender, EventArgs args) { + PropertyChangedEventArgs pcArgs = (PropertyChangedEventArgs) args; + if ("IsExecutionAllowed".equals(pcArgs.PropertyName)) { //$NON-NLS-1$ + getView().setLoginButtonEnabled(loginModel.getLoginCommand().getIsExecutionAllowed()); + } + } + }); } /** diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/LoginModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/LoginModel.java index 46dd7c4..eb61673 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/LoginModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/LoginModel.java @@ -1,5 +1,7 @@ package org.ovirt.engine.ui.uicommonweb.models; +import java.util.List; + import org.ovirt.engine.core.common.action.VdcReturnValueBase; import org.ovirt.engine.core.common.users.VdcUser; import org.ovirt.engine.core.compat.Event; @@ -18,8 +20,6 @@ import org.ovirt.engine.ui.uicommonweb.validation.IValidation; import org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation; import org.ovirt.engine.ui.uicompat.ConstantsManager; - -import java.util.List; public class LoginModel extends Model { @@ -263,8 +263,10 @@ public void Login() { + StartProgress(null); if (!Validate()) { + StopProgress(); return; } @@ -309,6 +311,7 @@ { loginModel.getLoggedInEvent().raise(this, EventArgs.Empty); } + StopProgress(); } } }; @@ -391,6 +394,7 @@ getDomain().setIsChangable(true); getLoginCommand().setIsExecutionAllowed(true); loggingInAutomatically = false; + StopProgress(); } } diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalLoginModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalLoginModel.java index 32b1def..c36e688 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalLoginModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalLoginModel.java @@ -175,9 +175,10 @@ public void Login() { // Completely override the base class functionality. - + StartProgress(null); if (!Validate()) { + StopProgress(); return; } @@ -221,7 +222,7 @@ getIsAutoConnect().setIsChangable(true); model.getLoginFailedEvent().raise(this, EventArgs.Empty); } - + StopProgress(); } }, this); diff --git a/frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/section/login/view/LoginPopupView.java b/frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/section/login/view/LoginPopupView.java index ba6574f..ed3ab6c 100644 --- a/frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/section/login/view/LoginPopupView.java +++ b/frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/section/login/view/LoginPopupView.java @@ -163,4 +163,9 @@ popup.setKeyPressHandler(keyPressHandler); } + @Override + public void setLoginButtonEnabled(boolean isEnabled) { + loginButton.setEnabled(isEnabled); + } + } diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/login/view/LoginPopupView.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/login/view/LoginPopupView.java index 0b163fa..e6ac010 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/login/view/LoginPopupView.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/login/view/LoginPopupView.java @@ -160,4 +160,9 @@ public void setPopupKeyPressHandler(PopupNativeKeyPressHandler keyPressHandler) { popup.setKeyPressHandler(keyPressHandler); } + + @Override + public void setLoginButtonEnabled(boolean isEnabled) { + loginButton.setEnabled(isEnabled); + } } -- To view, visit http://gerrit.ovirt.org/7376 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic4a4f4a8b20943e8fcfc37c076d7c8ad71e1d04a Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Gilad Chaplik <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
