Merge branch 'master' into translation

This commit is contained in:
Axel Uhl committed 2017-11-07 21:36:05 +01:00
commit 3dcf09cf69
30 files changed
+263 -121

No files matched your search

@@ -88,7 +88,7 @@ public class DesktopActivityMapper implements ActivityMapper {
} else if (place instanceof ImprintPlace) {
return new ImprintActivityProxy((ImprintPlace) place);
} else if (place instanceof MoreLoginInformationPlace) {
return new MoreLoginInformationActivity(place);
return new MoreLoginInformationActivity(place, clientFactory);
} else {
return null;
}
@@ -35,7 +35,6 @@ import com.sap.sse.security.ui.authentication.AuthenticationClientFactoryImpl;
import com.sap.sse.security.ui.authentication.AuthenticationManager;
import com.sap.sse.security.ui.authentication.AuthenticationManagerImpl;
import com.sap.sse.security.ui.authentication.AuthenticationPlaceManagementController;
import com.sap.sse.security.ui.authentication.WrappedPlaceManagementController;
import com.sap.sse.security.ui.authentication.info.LoggedInUserInfoPlace;
import com.sap.sse.security.ui.authentication.view.FlyoutAuthenticationPresenter;
import com.sap.sse.security.ui.client.i18n.StringMessages;
@@ -43,7 +42,7 @@ import com.sap.sse.security.ui.client.i18n.StringMessages;
public class TabletAndDesktopApplicationClientFactory extends AbstractApplicationClientFactory<DesktopApplicationTopLevelView> implements DesktopClientFactory {
private final SailingDispatchSystem dispatch = new SailingDispatchSystemImpl();
private final WrappedPlaceManagementController userManagementWizardController;
private final AuthenticationPlaceManagementController userManagementWizardController;
private final AuthenticationManager authenticationManager;
public TabletAndDesktopApplicationClientFactory(boolean isStandaloneServer) {
@@ -5,7 +5,7 @@ import java.util.Collection;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Anchor;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.view.client.SelectionChangeEvent;
import com.sap.sailing.gwt.common.client.SharedResources;
@@ -28,7 +28,7 @@ public class SailingFullscreenViewer extends FullscreenContainer<SailingGalleryP
private static final String IS_AUTOPLAYING_STYLE = SailingFullscreenViewerResources.INSTANCE.css().is_autoplaying();
private final EventNavigationHandler eventNavigationHandler;
private final Button eventLinkControl = new Button();
private final Anchor eventLinkControl = new Anchor();
private final Image autoRefreshControl = new Image("images/home/reload.svg");
private SailingGalleryPlayer player = null;
@@ -52,17 +52,12 @@ public class SailingFullscreenViewer extends FullscreenContainer<SailingGalleryP
SailingFullscreenViewerResources.INSTANCE.css().ensureInjected();
eventNavigationHandler = new EventNavigationHandler(navigator);
if (eventNavigationHandler.isNavigationConfigured()) {
eventLinkControl.addClickHandler(eventNavigationHandler);
eventLinkControl.addStyleName(SharedResources.INSTANCE.mainCss().buttonarrowrightwhite());
eventLinkControl.setTabIndex(-1);
eventLinkControl.setTarget("_blank");
addToolbarAction(eventLinkControl);
}
autoRefreshControl.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
SailingFullscreenViewer.this.toggleAutoplay();
}
});
autoRefreshControl.addClickHandler(event -> SailingFullscreenViewer.this.toggleAutoplay());
addToolbarAction(autoRefreshControl);
}
@@ -94,10 +89,11 @@ public class SailingFullscreenViewer extends FullscreenContainer<SailingGalleryP
@Override
public void onSelectionChange(SelectionChangeEvent event) {
EventLinkDTO eventLink = player.getSelectedImage().getEventLink();
eventLinkControl.setText(eventLink.getDisplayName());
String evnetId = String.valueOf(eventLink.getId()), baseURL = eventLink.getBaseURL();
final EventLinkDTO eventLink = player.getSelectedImage().getEventLink();
final String evnetId = String.valueOf(eventLink.getId()), baseURL = eventLink.getBaseURL();
eventNavigation = navigator.getEventNavigation(evnetId, baseURL, eventLink.isOnRemoteServer());
eventLinkControl.setText(eventLink.getDisplayName());
eventLinkControl.setHref(eventNavigation.getSafeTargetUrl());
}
@Override
@@ -1,33 +1,16 @@
package com.sap.sailing.gwt.home.desktop.places.morelogininformation;
import com.google.gwt.activity.shared.Activity;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.place.shared.Place;
import com.google.gwt.user.client.ui.AcceptsOneWidget;
import com.sap.sailing.gwt.home.desktop.app.DesktopClientFactory;
import com.sap.sailing.gwt.home.shared.places.morelogininformation.AbstractMoreLoginInformationActivity;
import com.sap.sse.security.ui.authentication.AuthenticationPlaces;
import com.sap.sse.security.ui.authentication.AuthenticationRequestEvent;
public class MoreLoginInformationActivity implements Activity {
public class MoreLoginInformationActivity extends AbstractMoreLoginInformationActivity {
public MoreLoginInformationActivity(Place place) {
}
@Override
public String mayStop() {
return null;
}
@Override
public void onCancel() {
}
@Override
public void onStop() {
}
@Override
public void start(AcceptsOneWidget panel, EventBus eventBus) {
panel.setWidget(new MoreLoginInformation());
public MoreLoginInformationActivity(Place place, DesktopClientFactory clientFactory) {
super(clientFactory, new MoreLoginInformationDesktop(() -> clientFactory.getEventBus()
.fireEvent(new AuthenticationRequestEvent(AuthenticationPlaces.CREATE_ACCOUNT))));
}
}
@@ -2,21 +2,21 @@ package com.sap.sailing.gwt.home.desktop.places.morelogininformation;
import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;
import com.sap.sailing.gwt.home.shared.places.morelogininformation.AbstractMoreLoginInformation;
/**
* Desktop page that shows the benefits of logging in on sapsailing.com.
*/
public class MoreLoginInformation extends Composite {
public class MoreLoginInformationDesktop extends AbstractMoreLoginInformation {
private static MoreLoginInformationUiBinder uiBinder = GWT.create(MoreLoginInformationUiBinder.class);
interface MoreLoginInformationUiBinder extends UiBinder<Widget, MoreLoginInformation> {
interface MoreLoginInformationUiBinder extends UiBinder<Widget, AbstractMoreLoginInformation> {
}
public MoreLoginInformation() {
initWidget(uiBinder.createAndBindUi(this));
public MoreLoginInformationDesktop(Runnable registerCallback) {
super(uiBinder, registerCallback);
}
}
@@ -9,12 +9,23 @@
.clear {
clear: both;
}
.registerContainer {
text-align: center;
}
.register {
cursor: pointer;
}
</ui:style>
<g:HTMLPanel addStyleNames="{res.mediaCss.grid}">
<h1 class="{res.mediaCss.small12} {res.mediaCss.columns}"><ui:text from="{i18n.moreLoginInformationHeadline}" /></h1>
<p class="{res.mediaCss.small12} {res.mediaCss.columns}"><ui:text from="{i18n.moreLoginInformationIntroduction}" /></p>
<login:MoreLoginInformationContent addStyleNames="{style.clear}" title="{i18n.moreLoginInformationSectionUserSettingsHeading}" image="{local_res.settings}" imageOnLeft="true" content="{i18n.moreLoginInformationSectionUserSettingsDescription}" />
<login:MoreLoginInformationContent title="{i18n.strategySimulator}" image="{local_res.simulator}" imageOnLeft="false" content="{i18n.moreLoginInformationSectionStrategySimulatorDescription}" />
<login:MoreLoginInformationContent addStyleNames="{res.mainCss.spacermarginbottommedium}" title="{i18n.moreLoginInformationSectionUserNotificationsHeading}" image="{local_res.notifications}" imageOnLeft="true" content="{i18n.moreLoginInformationSectionUserNotificationsDescription}" />
<login:MoreLoginInformationContent title="{i18n.moreLoginInformationSectionUserNotificationsHeading}" image="{local_res.notifications}" imageOnLeft="true" content="{i18n.moreLoginInformationSectionUserNotificationsDescription}" />
<div class="{res.mainCss.spacermargintopmediumsmall} {res.mainCss.spacermarginbottommedium} {style.registerContainer}">
<a ui:field="registerControl" class="{res.mainCss.button} {style.register}">
<ui:text from="{i18n.moreLoginInformationRegisterControlText}"/>
</a>
</div>
</g:HTMLPanel>
</ui:UiBinder>
@@ -17,6 +17,7 @@ import com.sap.sailing.gwt.home.shared.places.fakeseries.AbstractSeriesPlace;
import com.sap.sailing.gwt.home.shared.places.start.StartPlace;
import com.sap.sailing.gwt.home.shared.places.user.profile.AbstractUserProfilePlace;
import com.sap.sse.security.ui.authentication.AuthenticationContextEvent;
import com.sap.sse.security.ui.authentication.AuthenticationPlaces;
import com.sap.sse.security.ui.authentication.AuthenticationRequestEvent;
import com.sap.sse.security.ui.client.i18n.StringMessages;
@@ -91,7 +92,7 @@ public class UserProfileActivity extends AbstractActivity implements UserProfile
@Override
public void doTriggerLoginForm() {
clientFactory.getEventBus().fireEvent(new AuthenticationRequestEvent());
clientFactory.getEventBus().fireEvent(new AuthenticationRequestEvent(AuthenticationPlaces.SIGN_IN));
}
@Override
@@ -78,8 +78,6 @@ public class MobileActivityMapper implements ActivityMapper {
return new PasswordResetActivityProxy((PasswordResetPlace) place, clientFactory);
} else if (place instanceof AbstractUserProfilePlace) {
return new UserProfileActivityProxy((AbstractUserProfilePlace) place, clientFactory);
} else if (place instanceof AuthenticationPlace) {
return new AuthenticationActivityProxy((AuthenticationPlace) place, clientFactory);
} else if (place instanceof ConfirmationPlace) {
return new ConfirmationActivityProxy((ConfirmationPlace) place, clientFactory);
} else if (place instanceof PasswordResetPlace) {
@@ -87,7 +85,7 @@ public class MobileActivityMapper implements ActivityMapper {
} else if (place instanceof ImprintPlace) {
return new ImprintActivityProxy((ImprintPlace) place);
} else if (place instanceof MoreLoginInformationPlace) {
return new MoreLoginInformationActivity(place);
return new MoreLoginInformationActivity(place, clientFactory);
} else {
return null;
}
@@ -9,6 +9,7 @@ import com.sap.sailing.gwt.home.mobile.places.user.authentication.Authentication
import com.sap.sailing.gwt.home.shared.app.HomePlacesNavigator;
import com.sap.sailing.gwt.home.shared.app.PlaceNavigation;
import com.sap.sailing.gwt.home.shared.places.event.EventContext;
import com.sap.sse.security.ui.authentication.AuthenticationPlaces;
public class MobilePlacesNavigator extends HomePlacesNavigator {
@@ -23,6 +24,11 @@ public class MobilePlacesNavigator extends HomePlacesNavigator {
}
public PlaceNavigation<AuthenticationPlace> getSignInNavigation() {
return createLocalPlaceNavigation(new AuthenticationPlace());
return createLocalPlaceNavigation(new AuthenticationPlace(AuthenticationPlaces.SIGN_IN));
}
public PlaceNavigation<AuthenticationPlace> getCreateAccountNavigation() {
return createLocalPlaceNavigation(new AuthenticationPlace(AuthenticationPlaces.CREATE_ACCOUNT));
}
}
@@ -68,7 +68,7 @@ public class Header extends Composite {
signInNavigationItem = addNavigation(com.sap.sse.security.ui.client.i18n.StringMessages.INSTANCE.signIn(), new Runnable() {
@Override
public void run() {
placeNavigator.getSignInNavigation().goToPlace();
placeNavigator.getSignInNavigation().goToPlace();
}
});
userDetailsNavigationItem = addNavigation(placeNavigator.getUserProfileNavigation(), com.sap.sse.security.ui.client.i18n.StringMessages.INSTANCE.userDetails());
@@ -1,33 +1,14 @@
package com.sap.sailing.gwt.home.mobile.places.morelogininformation;
import com.google.gwt.activity.shared.Activity;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.place.shared.Place;
import com.google.gwt.user.client.ui.AcceptsOneWidget;
import com.sap.sailing.gwt.home.mobile.app.MobileApplicationClientFactory;
import com.sap.sailing.gwt.home.shared.places.morelogininformation.AbstractMoreLoginInformationActivity;
public class MoreLoginInformationActivity implements Activity {
public class MoreLoginInformationActivity extends AbstractMoreLoginInformationActivity {
public MoreLoginInformationActivity(Place place) {
}
@Override
public String mayStop() {
return null;
}
@Override
public void onCancel() {
}
@Override
public void onStop() {
}
@Override
public void start(AcceptsOneWidget panel, EventBus eventBus) {
panel.setWidget(new MoreLoginInformationMobile());
public MoreLoginInformationActivity(Place place, MobileApplicationClientFactory clientFactory) {
super(clientFactory, new MoreLoginInformationMobile(
() -> clientFactory.getNavigator().getCreateAccountNavigation().goToPlace()));
}
}
@@ -2,21 +2,21 @@ package com.sap.sailing.gwt.home.mobile.places.morelogininformation;
import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;
import com.sap.sailing.gwt.home.shared.places.morelogininformation.AbstractMoreLoginInformation;
/**
* Mobile page that shows the benefits of logging in on sapsailing.com.
*/
public class MoreLoginInformationMobile extends Composite {
public class MoreLoginInformationMobile extends AbstractMoreLoginInformation {
private static MoreLoginInformationUiBinder uiBinder = GWT.create(MoreLoginInformationUiBinder.class);
interface MoreLoginInformationUiBinder extends UiBinder<Widget, MoreLoginInformationMobile> {
interface MoreLoginInformationUiBinder extends UiBinder<Widget, AbstractMoreLoginInformation> {
}
public MoreLoginInformationMobile() {
initWidget(uiBinder.createAndBindUi(this));
public MoreLoginInformationMobile(Runnable registerCallback) {
super(uiBinder, registerCallback);
}
}
@@ -4,6 +4,7 @@
xmlns:login="urn:import:com.sap.sailing.gwt.home.mobile.places.morelogininformation"
xmlns:a="urn:import:com.sap.sailing.gwt.home.mobile.partials.accordion">
<ui:with field="i18n" type="com.sap.sailing.gwt.ui.client.StringMessages" />
<ui:with field="i18nsec" type="com.sap.sse.security.ui.client.i18n.StringMessages" />
<ui:with field="res" type="com.sap.sailing.gwt.common.client.SharedResources" />
<ui:with field="local_res" type="com.sap.sailing.gwt.home.shared.places.morelogininformation.MoreLoginInformationResources" />
<ui:style>
@@ -11,13 +12,12 @@
font-size: 1.5em;
}
.register {
border-radius: .3846154em;
border-radius: .384615384615385em;
width: 100%;
text-align: center;
}
.buttonContainer {
padding: 1em 0.625em;
margin-top: 1em;
}
</ui:style>
<a:Accordion>
@@ -47,13 +47,13 @@
image="{local_res.notifications}"
content="{i18n.moreLoginInformationSectionUserNotificationsDescription}" />
</a:item>
<!--
<a:footer>
<g:HTMLPanel addStyleNames="{style.buttonContainer}">
<a
class="{style.register} {res.mainCss.button} {res.mainCss.buttonstrong} {res.mainCss.buttonarrowrightwhite}">TODO: register</a>
<a ui:field="registerControl" class="{style.register} {res.mainCss.button} {res.mainCss.buttonstrong}
{res.mainCss.buttonarrowrightwhite}">
<ui:text from="{i18n.moreLoginInformationRegisterControlText}"/>
</a>
</g:HTMLPanel>
</a:footer>
-->
</a:Accordion>
</ui:UiBinder>
@@ -10,33 +10,27 @@ import com.sap.sailing.gwt.home.shared.usermanagement.AuthenticationCallbackImpl
import com.sap.sailing.gwt.home.shared.usermanagement.view.AuthenticationViewMobile;
import com.sap.sse.security.ui.authentication.AuthenticationClientFactoryImpl;
import com.sap.sse.security.ui.authentication.AuthenticationPlaceManagementController;
import com.sap.sse.security.ui.authentication.WrappedPlaceManagementController;
import com.sap.sse.security.ui.authentication.view.AuthenticationView;
public class AuthenticationActivity extends AbstractActivity {
private final MobileApplicationClientFactory clientFactory;
private final AuthenticationView userManagementView = new AuthenticationViewMobile();
private final AuthenticationPlace place;
public AuthenticationActivity(AuthenticationPlace place, MobileApplicationClientFactory clientFactory) {
this.clientFactory = clientFactory;
this.place = place;
}
@Override
public void start(final AcceptsOneWidget panel, EventBus eventBus) {
panel.setWidget(userManagementView);
WrappedPlaceManagementController userManagementController = new AuthenticationPlaceManagementController(
final AuthenticationPlaceManagementController userManagementController = new AuthenticationPlaceManagementController(
new AuthenticationClientFactoryImpl(clientFactory.getAuthenticationManager(), SharedResources.INSTANCE),
new AuthenticationCallbackImpl(clientFactory.getNavigator().getUserProfileNavigation(),
new SignInSuccessfulNavigationMobile()),
() -> History.back()),
userManagementView, eventBus);
userManagementController.start();
userManagementController.goTo(place.getRequestedPlace());
}
private class SignInSuccessfulNavigationMobile implements Runnable {
@Override
public void run() {
History.back();
}
}
}
@@ -6,14 +6,25 @@ import com.google.gwt.place.shared.Prefix;
import com.sap.sailing.gwt.home.shared.app.HasLocationTitle;
import com.sap.sailing.gwt.home.shared.app.HasMobileVersion;
import com.sap.sailing.gwt.home.shared.places.PlaceTokenPrefixes;
import com.sap.sse.security.ui.authentication.AuthenticationPlaces;
import com.sap.sse.security.ui.client.i18n.StringMessages;
public class AuthenticationPlace extends Place implements HasMobileVersion, HasLocationTitle {
private final AuthenticationPlaces requestedPlace;
public AuthenticationPlace(AuthenticationPlaces requestedPlace) {
this.requestedPlace = requestedPlace;
}
@Override
public String getLocationTitle() {
return StringMessages.INSTANCE.user();
}
public AuthenticationPlaces getRequestedPlace() {
return requestedPlace;
}
@Prefix(PlaceTokenPrefixes.UserAuthentication)
public static class Tokenizer implements PlaceTokenizer<AuthenticationPlace> {
@@ -24,7 +35,7 @@ public class AuthenticationPlace extends Place implements HasMobileVersion, HasL
@Override
public AuthenticationPlace getPlace(String token) {
return new AuthenticationPlace();
return new AuthenticationPlace(AuthenticationPlaces.SIGN_IN);
}
}
@@ -50,11 +50,19 @@
padding: 10px;
vertical-align: top;
}
button.toolbarAction {
background-color: transparent;
a.toolbarAction, button.toolbarAction {
border-radius: initial;
font-size: 1.25em;
}
a.toolbarAction {
color: #fff;
text-decoration: none;
outline: none;
padding-top: 0.666666666666667em
}
button.toolbarAction {
background-color: transparent;
}
.toolbarBusyIndicator {
display: inline-block;
height: 50px;
@@ -0,0 +1,29 @@
package com.sap.sailing.gwt.home.shared.places.morelogininformation;
import com.google.gwt.dom.client.Element;
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.ui.Composite;
import com.google.gwt.user.client.ui.UIObject;
import com.google.gwt.user.client.ui.Widget;
public class AbstractMoreLoginInformation extends Composite implements MoreLoginInformationView {
@UiField
public Element registerControl;
protected AbstractMoreLoginInformation(UiBinder<Widget, AbstractMoreLoginInformation> uiBinder,
Runnable registerCallback) {
initWidget(uiBinder.createAndBindUi(this));
DOM.sinkEvents(registerControl, Event.ONCLICK);
Event.setEventListener(registerControl, event -> registerCallback.run());
}
@Override
public final void setRegisterControlVisible(boolean visible) {
UIObject.setVisible(registerControl, visible);
}
}
@@ -0,0 +1,41 @@
package com.sap.sailing.gwt.home.shared.places.morelogininformation;
import java.util.Objects;
import com.google.gwt.activity.shared.AbstractActivity;
import com.google.gwt.activity.shared.Activity;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.user.client.ui.AcceptsOneWidget;
import com.sap.sse.security.ui.authentication.WithUserService;
import com.sap.sse.security.ui.client.UserService;
import com.sap.sse.security.ui.client.UserStatusEventHandler;
/**
* Abstract {@link Activity activity} implementation for {@link MoreLoginInformationView}s.
*/
public class AbstractMoreLoginInformationActivity extends AbstractActivity {
private final WithUserService clientFactory;
private final MoreLoginInformationView view;
/**
* Creates new {@link AbstractMoreLoginInformationActivity} instance for the provided view using the given factory.
*
* @param clientFactory
* {@link WithUserService client factory} providing access to the {@link UserService}
* @param view
* the {@link MoreLoginInformationView} to show
*/
protected AbstractMoreLoginInformationActivity(WithUserService clientFactory, MoreLoginInformationView view) {
this.clientFactory = clientFactory;
this.view = view;
}
@Override
public final void start(AcceptsOneWidget panel, EventBus eventBus) {
final UserStatusEventHandler handler = user -> view.setRegisterControlVisible(Objects.isNull(user));
this.clientFactory.getUserService().addUserStatusEventHandler(handler, true);
panel.setWidget(view);
}
}
@@ -0,0 +1,17 @@
package com.sap.sailing.gwt.home.shared.places.morelogininformation;
import com.google.gwt.user.client.ui.IsWidget;
/**
* Interface for views containing information about benefits of signing in on SAP Sailing Analytics.
*/
public interface MoreLoginInformationView extends IsWidget {
/**
* Show or hide the control leading to register form (usually based on login state).
*
* @param visible
* <code>true</code> to show register control, <code>false</code> to hide
*/
void setRegisterControlVisible(boolean visible);
}
@@ -12,6 +12,7 @@ public class AuthenticationViewDesktop extends AbstractFlyoutAuthenticationView
}
public void show() {
getPresenter().onVisibilityChanged(true);
popupPanel.show();
popupPanel.getElement().getStyle().clearLeft();
popupPanel.getElement().getStyle().clearTop();
@@ -1897,6 +1897,7 @@ public interface StringMessages extends com.sap.sse.gwt.client.StringMessages,
String moreLoginInformationSectionStrategySimulatorDescription();
String moreLoginInformationSectionUserNotificationsHeading();
String moreLoginInformationSectionUserNotificationsDescription();
String moreLoginInformationRegisterControlText();
String anniversaryUnitText(@Optional @PluralCount(DefaultRule_1_0n.class) int count);
String anniversaryMajorCountdownTeaser(@PluralCount(DefaultRule_1_0n.class) int countdown, int anniversary);
String anniversaryMajorCountdownDescription(int anniversary);
@@ -1879,6 +1879,7 @@ moreLoginInformationSectionUserSettingsDescription=Many parts of the user interf
moreLoginInformationSectionStrategySimulatorDescription=The simulator enables sailors to simulate strategies for legs based on configurable wind conditions. The simulator is based on all the historical data available in SAP Sailing Analytics to provide simulations on the accurate behavior of specific boat classes.
moreLoginInformationSectionUserNotificationsHeading=User Notifications
moreLoginInformationSectionUserNotificationsDescription=User notifications are an easy way to keep you up to date about your favorite competitor/team or boat class. You can subscribe for mail-based notifications about new results for your favorite sailor/team or boat class as well as upcoming races of specific boat classes.
moreLoginInformationRegisterControlText=Sign up now
anniversaryUnitText=Races
anniversaryUnitText[one]=Race
anniversaryMajorCountdownTeaser=Countdown! Only {0,number,#,###} races left until the {1,number,#,###}th race.
@@ -1883,6 +1883,7 @@ moreLoginInformationSectionUserSettingsDescription=Viele Teile der Benutzeroberf
moreLoginInformationSectionStrategySimulatorDescription=Der Simulator ermöglicht es Seglern, Strategien für die Bewältigung von Bahnschenkeln anhand einer einstellbaren Windsituation zu simulieren. Die Simulation basiert auf den historischen Daten, über welche die SAP Sailing Analytics verfügt und ermöglich damit realitätsnahe Analysen auf Basis spezifischer Bootsklassen.
moreLoginInformationSectionUserNotificationsHeading=Benachrichtigungen
moreLoginInformationSectionUserNotificationsDescription=Benachrichtigungen sind eine einfache Möglichkeit, über einen Teilnehmer/ein Team oder eine Bootsklasse auf dem Laufenden zu bleiben. Mail-Benachrichtigungen für neue Ergebnisse von Lieblings-Seglern oder Bootsklassen sowie demnächst startende Rennen spezifischer Bootsklassen können abonniert werden.
moreLoginInformationRegisterControlText=Jetzt registrieren
anniversaryUnitText=Rennen
anniversaryUnitText[one]=Rennen
anniversaryMajorCountdownTeaser=Countdown! Noch {0,number,#,###} Rennen bis zum {1,number,#,###}. Rennen.
@@ -159,7 +159,7 @@ public class AuthenticationManagerImpl implements AuthenticationManager {
@Override
public void logout() {
userService.logout();
eventBus.fireEvent(new AuthenticationRequestEvent());
eventBus.fireEvent(new AuthenticationRequestEvent(AuthenticationPlaces.SIGN_IN));
}
@Override
@@ -24,6 +24,8 @@ import com.sap.sse.security.ui.authentication.view.AuthenticationView;
*/
public class AuthenticationPlaceManagementController extends WrappedPlaceManagementController {
private final AuthenticationClientFactory clientFactory;
/**
* Creates a new {@link AuthenticationPlaceManagementController} instance with the given parameters.
*
@@ -35,14 +37,25 @@ public class AuthenticationPlaceManagementController extends WrappedPlaceManagem
public AuthenticationPlaceManagementController(AuthenticationClientFactory clientFactory,
AuthenticationCallback callback, AuthenticationView authenticationView, EventBus globalEventBus) {
super(new Configuration(clientFactory, callback, authenticationView));
globalEventBus.addHandler(AuthenticationContextEvent.TYPE, new AuthenticationContextEvent.Handler() {
@Override
public void onUserChangeEvent(AuthenticationContextEvent event) {
AuthenticationPlaceManagementController.this.fireEvent(event);
}
});
this.clientFactory = clientFactory;
globalEventBus.addHandler(AuthenticationContextEvent.TYPE, this::fireEvent);
}
/**
* Tells the wrapped framework to go to the {@link Place} represented by the given {@link AuthenticationPlaces}
* instance is no user is logged in. Otherwise the wrapped framework will go to the {@link LoggedInUserInfoPlace
* user info} page.
*
* @param authPlace
* {@link AuthenticationPlaces} instance representing a {@link Place} instance to go to
*
* @see #goTo(Place)
*/
public void goTo(AuthenticationPlaces authPlace) {
final boolean isLoggedIn = clientFactory.getAuthenticationManager().getAuthenticationContext().isLoggedIn();
super.goTo(isLoggedIn ? new LoggedInUserInfoPlace() : authPlace.getPlace());
}
private static class Configuration implements PlaceManagementConfiguration {
private final AuthenticationClientFactory clientFactory;
private final AuthenticationCallback callback;
@@ -0,0 +1,31 @@
package com.sap.sse.security.ui.authentication;
import java.util.function.Supplier;
import com.sap.sse.security.ui.authentication.create.CreateAccountPlace;
import com.sap.sse.security.ui.authentication.signin.SignInPlace;
/**
* Enumeration to specify a requested {@link AbstractAuthenticationPlace authentication places}.
*/
public enum AuthenticationPlaces {
/** {@link AuthenticationPlaces} representation for {@link SignInPlace} */
SIGN_IN(SignInPlace::new),
/** {@link AuthenticationPlaces} representation for {@link CreateAccountPlace} */
CREATE_ACCOUNT(CreateAccountPlace::new);
private final Supplier<? extends AbstractAuthenticationPlace> placeSupplier;
private AuthenticationPlaces(Supplier<? extends AbstractAuthenticationPlace> placeSupplier) {
this.placeSupplier = placeSupplier;
}
/**
* @return new instance of the {@link AbstractAuthenticationPlace} represented by this {@link AuthenticationPlaces}
*/
public AbstractAuthenticationPlace getPlace() {
return this.placeSupplier.get();
}
}
@@ -9,10 +9,19 @@ import com.google.gwt.event.shared.GwtEvent;
public class AuthenticationRequestEvent extends GwtEvent<AuthenticationRequestEvent.Handler> {
public static final Type<Handler> TYPE = new Type<AuthenticationRequestEvent.Handler>();
private final AuthenticationPlaces requestedPlace;
public AuthenticationRequestEvent(AuthenticationPlaces requestedPlace) {
this.requestedPlace = requestedPlace;
}
public interface Handler extends EventHandler {
void onUserManagementRequestEvent(AuthenticationRequestEvent event);
}
public AuthenticationPlaces getRequestedPlace() {
return requestedPlace;
}
@Override
public Type<Handler> getAssociatedType() {
@@ -1,6 +1,7 @@
package com.sap.sse.security.ui.authentication.decorator;
import com.google.web.bindery.event.shared.EventBus;
import com.sap.sse.security.ui.authentication.AuthenticationPlaces;
import com.sap.sse.security.ui.authentication.AuthenticationRequestEvent;
/**
@@ -19,6 +20,6 @@ public class FlyoutNotLoggedInPresenter implements NotLoggedInPresenter {
@Override
public void doTriggerLoginForm() {
eventBus.fireEvent(new AuthenticationRequestEvent());
eventBus.fireEvent(new AuthenticationRequestEvent(AuthenticationPlaces.SIGN_IN));
}
}
@@ -7,6 +7,7 @@ import com.google.gwt.user.client.ui.AcceptsOneWidget;
import com.sap.sse.security.ui.authentication.AuthenticationCallback;
import com.sap.sse.security.ui.authentication.AuthenticationClientFactory;
import com.sap.sse.security.ui.authentication.AuthenticationContextEvent;
import com.sap.sse.security.ui.authentication.AuthenticationPlaces;
import com.sap.sse.security.ui.authentication.AuthenticationRequestEvent;
import com.sap.sse.security.ui.authentication.signin.SignInPlace;
@@ -45,7 +46,7 @@ public class LoggedInUserInfoActivity extends AbstractActivity implements Logged
@Override
public void gotoProfileUi() {
eventBus.fireEvent(new AuthenticationRequestEvent());
eventBus.fireEvent(new AuthenticationRequestEvent(AuthenticationPlaces.SIGN_IN));
callback.handleUserProfileNavigation();
}
@@ -2,9 +2,11 @@ package com.sap.sse.security.ui.authentication.view;
import com.google.web.bindery.event.shared.EventBus;
import com.sap.sse.security.ui.authentication.AuthenticationContextEvent;
import com.sap.sse.security.ui.authentication.AuthenticationPlaceManagementController;
import com.sap.sse.security.ui.authentication.AuthenticationRequestEvent;
import com.sap.sse.security.ui.authentication.WrappedPlaceManagementController;
import com.sap.sse.security.ui.authentication.app.AuthenticationContext;
import com.sap.sse.security.ui.authentication.create.CreateAccountPlace;
/**
* Default implementation of {@link AuthenticationMenuView.Presenter} and {@link FlyoutAuthenticationView.Presenter} to
@@ -33,7 +35,7 @@ public class FlyoutAuthenticationPresenter implements AuthenticationMenuView.Pre
*/
public FlyoutAuthenticationPresenter(final FlyoutAuthenticationView flyoutAuthenticationView,
final AuthenticationMenuView authenticationMenuView,
WrappedPlaceManagementController authenticationPlaceManagementController,
AuthenticationPlaceManagementController authenticationPlaceManagementController,
EventBus eventBus, AuthenticationContext initialAuthentication) {
this.flyoutAuthenticationView = flyoutAuthenticationView;
this.authenticationMenuView = authenticationMenuView;
@@ -44,11 +46,9 @@ public class FlyoutAuthenticationPresenter implements AuthenticationMenuView.Pre
authenticationMenuView.setPresenter(this);
flyoutAuthenticationView.setAutoHidePartner(authenticationMenuView);
eventBus.addHandler(AuthenticationRequestEvent.TYPE, new AuthenticationRequestEvent.Handler() {
@Override
public void onUserManagementRequestEvent(AuthenticationRequestEvent event) {
toggleFlyout();
}
eventBus.addHandler(AuthenticationRequestEvent.TYPE, event -> {
flyoutAuthenticationView.show();
authenticationPlaceManagementController.goTo(event.getRequestedPlace());
});
eventBus.addHandler(AuthenticationContextEvent.TYPE, new AuthenticationContextEvent.Handler() {
@@ -60,6 +60,14 @@ public class FlyoutAuthenticationPresenter implements AuthenticationMenuView.Pre
authenticationMenuView.setAuthenticated(initialAuthentication.isLoggedIn());
}
public void showRegister() {
if (!flyoutAuthenticationView.isShowing()) {
flyoutAuthenticationView.show();
authenticationPlaceManagementController.start();
authenticationPlaceManagementController.goTo(new CreateAccountPlace());
}
}
@Override
public void toggleFlyout() {
if (flyoutAuthenticationView.isShowing()) {