mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-17 01:31:01 +00:00
LoginNagging tapping leads to loginplace, except one of the two anchors
is hit
This commit is contained in:
1 parent
815a318b5a
commit
effd58ceb1
6 files changed
+65
-33
No files matched your search
+1
-1
@@ -12,7 +12,7 @@ public class DesktopLoginHintPopup extends LoginHintPopup {
|
||||
private static final LocalCss LOCAL_CSS = UserManagementResources.INSTANCE.css();
|
||||
|
||||
public DesktopLoginHintPopup(AuthenticationManager authenticationManager, DesktopPlacesNavigator placesNavigator) {
|
||||
super(authenticationManager, () -> placesNavigator.goToPlace(placesNavigator.getMoreLoginInfo()));
|
||||
super(authenticationManager, () -> placesNavigator.goToPlace(placesNavigator.getMoreLoginInfo()), null);
|
||||
this.addStyleName(LOCAL_CSS.flyover_small_hidden());
|
||||
this.addStyleName(LOCAL_CSS.flyover_position_grid());
|
||||
}
|
||||
|
||||
+2
@@ -79,6 +79,8 @@ public class MobileApplicationClientFactory extends
|
||||
root.setSubHeaderContent(null);
|
||||
dismissCallback.run();
|
||||
navigator.goToPlace(navigator.getMoreLoginInfo());
|
||||
},() -> {
|
||||
navigator.goToPlace(navigator.getSignInNavigation());
|
||||
});
|
||||
root.setSubHeaderContent(content);
|
||||
});
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ import com.sap.sse.security.ui.authentication.login.LoginHintPopup;
|
||||
public class GenericLoginHintPopup extends LoginHintPopup {
|
||||
|
||||
public GenericLoginHintPopup(AuthenticationManager authenticationManager, GenericAuthenticationLinkFactory linkFactory) {
|
||||
super(authenticationManager, () -> Window.open(linkFactory.createMoreInfoAboutLoginLink(), "_blank", ""));
|
||||
super(authenticationManager, () -> Window.open(linkFactory.createMoreInfoAboutLoginLink(), "_blank", ""), null);
|
||||
this.addStyleName(SAPHeaderWithAuthenticationResources.INSTANCE.css().usermanagement_view());
|
||||
}
|
||||
}
|
||||
+23
-2
@@ -1,10 +1,14 @@
|
||||
package com.sap.sse.security.ui.authentication.login;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.dom.client.Element;
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.event.dom.client.ClickHandler;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.DOM;
|
||||
import com.google.gwt.user.client.Event;
|
||||
import com.google.gwt.user.client.EventListener;
|
||||
import com.google.gwt.user.client.ui.Anchor;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
@@ -19,7 +23,7 @@ import com.google.gwt.user.client.ui.Widget;
|
||||
* the concrete actions to be triggered when clicking the links need to be defined by the using context through the
|
||||
* {@link Runnable Runnables} given to the constructor.
|
||||
*/
|
||||
public class LoginHintContent extends Composite{
|
||||
public class LoginHintContent extends Composite {
|
||||
|
||||
private static LoginPopupContentUiBinder uiBinder = GWT.create(LoginPopupContentUiBinder.class);
|
||||
|
||||
@@ -30,8 +34,10 @@ public class LoginHintContent extends Composite{
|
||||
Anchor moreInfo;
|
||||
@UiField
|
||||
Anchor dismiss;
|
||||
@UiField
|
||||
Element main;
|
||||
|
||||
public LoginHintContent(final Runnable onDismiss, final Runnable onMoreInfo) {
|
||||
public LoginHintContent(final Runnable onDismiss, final Runnable onMoreInfo, final Runnable toLogin) {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
dismiss.addClickHandler(new ClickHandler() {
|
||||
|
||||
@@ -47,5 +53,20 @@ public class LoginHintContent extends Composite{
|
||||
onMoreInfo.run();
|
||||
}
|
||||
});
|
||||
DOM.sinkEvents(main, Event.ONCLICK);
|
||||
DOM.setEventListener(main, new EventListener() {
|
||||
|
||||
@Override
|
||||
public void onBrowserEvent(Event event) {
|
||||
com.google.gwt.dom.client.EventTarget eventTarget = event.getEventTarget();
|
||||
if (!Element.is(eventTarget)) {
|
||||
return;
|
||||
}
|
||||
final Element target = eventTarget.cast();
|
||||
if(target != moreInfo.getElement() && target != dismiss.getElement()){
|
||||
toLogin.run();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
+33
-28
@@ -1,32 +1,37 @@
|
||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui">
|
||||
<ui:with field="i18n_sec" type="com.sap.sse.security.ui.client.i18n.StringMessages" />
|
||||
<ui:style>
|
||||
.more {
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
color: #008fcc;
|
||||
}
|
||||
|
||||
.dismiss {
|
||||
display: inline-block;
|
||||
right: 0;
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
color: #008fcc;
|
||||
}
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui">
|
||||
<ui:with field="i18n_sec"
|
||||
type="com.sap.sse.security.ui.client.i18n.StringMessages" />
|
||||
<ui:style>
|
||||
.more {
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
color: #008fcc;
|
||||
}
|
||||
|
||||
.btns {
|
||||
padding-top: 0.25em;
|
||||
position: relative;
|
||||
}
|
||||
</ui:style>
|
||||
<g:HTMLPanel>
|
||||
<g:Label text="{i18n_sec.showMoreInfoLogin}" />
|
||||
<div class="{style.btns}">
|
||||
<g:Anchor styleName="{style.more}" ui:field="moreInfo" text="{i18n_sec.moreInfo}" />
|
||||
<g:Anchor styleName="{style.dismiss}" ui:field="dismiss" text="{i18n_sec.dismiss}" />
|
||||
</div>
|
||||
</g:HTMLPanel>
|
||||
.dismiss {
|
||||
display: inline-block;
|
||||
right: 0;
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
color: #008fcc;
|
||||
}
|
||||
|
||||
.btns {
|
||||
padding-top: 0.25em;
|
||||
position: relative;
|
||||
}
|
||||
</ui:style>
|
||||
<g:HTMLPanel>
|
||||
<div ui:field="main">
|
||||
<g:Label text="{i18n_sec.showMoreInfoLogin}" />
|
||||
<div class="{style.btns}">
|
||||
<g:Anchor styleName="{style.more}" ui:field="moreInfo"
|
||||
text="{i18n_sec.moreInfo}" />
|
||||
<g:Anchor styleName="{style.dismiss}" ui:field="dismiss"
|
||||
text="{i18n_sec.dismiss}" />
|
||||
</div>
|
||||
</div>
|
||||
</g:HTMLPanel>
|
||||
</ui:UiBinder>
|
||||
+5
-1
@@ -14,7 +14,7 @@ public class LoginHintPopup extends PopupPanel {
|
||||
protected final LoginHintContent content;
|
||||
private Runnable dismissCallback;
|
||||
|
||||
public LoginHintPopup(AuthenticationManager authenticationManager, Runnable moreInfoCallback) {
|
||||
public LoginHintPopup(AuthenticationManager authenticationManager, Runnable moreInfoCallback, Runnable toLogin) {
|
||||
LOCAL_CSS.ensureInjected();
|
||||
this.setStyleName(LOCAL_CSS.flyover());
|
||||
ensureDebugId("loginHintPopup");
|
||||
@@ -26,6 +26,10 @@ public class LoginHintPopup extends PopupPanel {
|
||||
hide();
|
||||
dismissCallback.run();
|
||||
moreInfoCallback.run();
|
||||
}, () -> {
|
||||
if(toLogin != null){
|
||||
toLogin.run();
|
||||
}
|
||||
});
|
||||
content.addStyleName(LOCAL_CSS.flyover_content());
|
||||
|
||||
|
||||
Reference in new issue
Block a user