mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-10 22:30:56 +00:00
User management was added for the different content views
This commit is contained in:
1 parent
df5393c8f4
commit
f4480e13d5
6 files changed
+24
-38
No files matched your search
-19
@@ -2,17 +2,12 @@ package com.sap.sailing.gwt.autoplay.client;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.dom.client.Document;
|
||||
import com.google.gwt.dom.client.Style.Position;
|
||||
import com.google.gwt.dom.client.Style.Unit;
|
||||
import com.google.gwt.user.client.ui.RootPanel;
|
||||
import com.sap.sailing.gwt.autoplay.client.app.AutoPlayAppActivityMapper;
|
||||
import com.sap.sailing.gwt.autoplay.client.app.AutoPlayAppClientFactory;
|
||||
import com.sap.sailing.gwt.autoplay.client.app.AutoPlayAppHistoryMapper;
|
||||
import com.sap.sailing.gwt.common.authentication.FixedSailingAuthentication;
|
||||
import com.sap.sailing.gwt.common.client.SharedResources;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sse.gwt.client.mvp.AbstractMvpEntryPoint;
|
||||
import com.sap.sse.security.ui.authentication.generic.sapheader.SAPHeaderWithAuthentication;
|
||||
|
||||
public class AutoPlayEntryPoint extends AbstractMvpEntryPoint<StringMessages, AutoPlayAppClientFactory> {
|
||||
@Override
|
||||
@@ -22,11 +17,6 @@ public class AutoPlayEntryPoint extends AbstractMvpEntryPoint<StringMessages, Au
|
||||
AutoPlayAppHistoryMapper applicationHistoryMapper = GWT.create(AutoPlayAppHistoryMapper.class);
|
||||
initMvp(clientFactory, applicationHistoryMapper, new AutoPlayAppActivityMapper(clientFactory));
|
||||
|
||||
SAPHeaderWithAuthentication header = initHeader();
|
||||
new FixedSailingAuthentication(clientFactory.getUserService(), header.getAuthenticationMenuView());
|
||||
|
||||
RootPanel.get().add(header);
|
||||
|
||||
SharedResources.INSTANCE.mediaCss().ensureInjected();
|
||||
SharedResources.INSTANCE.mainCss().ensureInjected();
|
||||
Document.get().getBody().addClassName(SharedResources.INSTANCE.mainCss().desktop());
|
||||
@@ -36,13 +26,4 @@ public class AutoPlayEntryPoint extends AbstractMvpEntryPoint<StringMessages, Au
|
||||
protected StringMessages createStringMessages() {
|
||||
return GWT.create(StringMessages.class);
|
||||
}
|
||||
|
||||
private SAPHeaderWithAuthentication initHeader() {
|
||||
SAPHeaderWithAuthentication header = new SAPHeaderWithAuthentication(getStringMessages().sapSailingAnalytics(),
|
||||
getStringMessages().autoplayConfiguration());
|
||||
header.getElement().getStyle().setPosition(Position.FIXED);
|
||||
header.getElement().getStyle().setTop(0, Unit.PX);
|
||||
header.getElement().getStyle().setWidth(100, Unit.PCT);
|
||||
return header;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -29,7 +29,7 @@ public class DesktopApplicationClientFactory extends AbstractApplicationClientFa
|
||||
|
||||
@Override
|
||||
public StartView createStartView() {
|
||||
return new DesktopStartView(getPlaceNavigator(), getEventBus());
|
||||
return new DesktopStartView(getPlaceNavigator(), getEventBus(), getUserService());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -100,7 +100,7 @@ public class AutoPlayController implements RaceTimesInfoProviderListener, Leader
|
||||
playerView.clearContent();
|
||||
boolean withFullscreenButton = autoPlayerConfiguration.isFullscreenMode() && isInitialScreen;
|
||||
LeaderboardWithHeaderPerspective leaderboardPerspective = new LeaderboardWithHeaderPerspective(leaderboardPerspectiveLifecycleWithAllSettings,
|
||||
sailingService, asyncActionsExecutor,
|
||||
sailingService, userService, asyncActionsExecutor,
|
||||
new CompetitorSelectionModel(/* hasMultiSelection */ true), leaderboardTimer,
|
||||
autoPlayerConfiguration.getLeaderboardName(), errorReporter, StringMessages.INSTANCE,
|
||||
userAgent, withFullscreenButton);
|
||||
|
||||
+9
-6
@@ -27,6 +27,7 @@ import com.sap.sailing.gwt.autoplay.client.app.PlaceNavigator;
|
||||
import com.sap.sailing.gwt.autoplay.client.place.player.AutoPlayerConfiguration;
|
||||
import com.sap.sailing.gwt.autoplay.client.shared.leaderboard.LeaderboardWithHeaderPerspectiveLifecycle;
|
||||
import com.sap.sailing.gwt.autoplay.client.shared.leaderboard.LeaderboardWithHeaderPerspectiveSettings;
|
||||
import com.sap.sailing.gwt.common.authentication.FixedSailingAuthentication;
|
||||
import com.sap.sailing.gwt.common.client.SharedResources;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.raceboard.RaceBoardPerspectiveLifecycle;
|
||||
@@ -38,11 +39,12 @@ import com.sap.sse.common.settings.Settings;
|
||||
import com.sap.sse.gwt.client.GWTLocaleUtil;
|
||||
import com.sap.sse.gwt.client.dialog.DataEntryDialog.DialogCallback;
|
||||
import com.sap.sse.gwt.client.event.LocaleChangeEvent;
|
||||
import com.sap.sse.gwt.client.sapheader.SAPHeader;
|
||||
import com.sap.sse.gwt.client.shared.perspective.PerspectiveCompositeLifecycleTabbedSettingsDialog;
|
||||
import com.sap.sse.gwt.client.shared.perspective.PerspectiveCompositeSettings;
|
||||
import com.sap.sse.gwt.client.shared.perspective.PerspectiveLifecycle;
|
||||
import com.sap.sse.gwt.client.shared.perspective.PerspectiveLifecycleWithAllSettings;
|
||||
import com.sap.sse.security.ui.authentication.generic.sapheader.SAPHeaderWithAuthentication;
|
||||
import com.sap.sse.security.ui.client.UserService;
|
||||
|
||||
public class DesktopStartView extends Composite implements StartView {
|
||||
private static StartPageViewUiBinder uiBinder = GWT.create(StartPageViewUiBinder.class);
|
||||
@@ -50,7 +52,7 @@ public class DesktopStartView extends Composite implements StartView {
|
||||
interface StartPageViewUiBinder extends UiBinder<Widget, DesktopStartView> {
|
||||
}
|
||||
|
||||
@UiField(provided=true) SAPHeader sapHeader;
|
||||
@UiField(provided=true) SAPHeaderWithAuthentication sapHeader;
|
||||
@UiField(provided=true) ListBox localeSelectionBox;
|
||||
@UiField(provided=true) ListBox eventSelectionBox;
|
||||
@UiField(provided=true) ListBox leaderboardSelectionBox;
|
||||
@@ -73,15 +75,16 @@ public class DesktopStartView extends Composite implements StartView {
|
||||
|
||||
private final int defaultTimeToRaceStartTimeInSeconds = 180;
|
||||
|
||||
public DesktopStartView(PlaceNavigator navigator, EventBus eventBus) {
|
||||
public DesktopStartView(PlaceNavigator navigator, EventBus eventBus, UserService userService) {
|
||||
super();
|
||||
this.navigator = navigator;
|
||||
this.eventBus = eventBus;
|
||||
this.events = new ArrayList<EventDTO>();
|
||||
|
||||
sapHeader = new SAPHeaderWithAuthentication(StringMessages.INSTANCE.sapSailingAnalytics(),
|
||||
StringMessages.INSTANCE.autoplayConfiguration());
|
||||
new FixedSailingAuthentication(userService, sapHeader.getAuthenticationMenuView());
|
||||
|
||||
// sapHeader = new SAPHeaderWithAuthentication(StringMessages.INSTANCE.sapSailingAnalytics(), StringMessages.INSTANCE.autoplayConfiguration());
|
||||
sapHeader = new SAPHeader(StringMessages.INSTANCE.sapSailingAnalytics());
|
||||
sapHeader.setHeaderTitle(StringMessages.INSTANCE.autoplayConfiguration());
|
||||
eventSelectionBox = new ListBox();
|
||||
eventSelectionBox.setMultipleSelect(false);
|
||||
leaderboardSelectionBox = new ListBox();
|
||||
|
||||
+8
-6
@@ -3,24 +3,26 @@ package com.sap.sailing.gwt.autoplay.client.shared.header;
|
||||
import com.google.gwt.core.client.Scheduler;
|
||||
import com.google.gwt.core.client.Scheduler.RepeatingCommand;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.gwt.common.authentication.FixedSailingAuthentication;
|
||||
import com.sap.sailing.gwt.common.client.FullscreenUtil;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sse.gwt.client.sapheader.SAPHeader;
|
||||
import com.sap.sse.gwt.client.shared.components.AbstractCompositeComponent;
|
||||
import com.sap.sse.security.ui.authentication.generic.sapheader.SAPHeaderWithAuthentication;
|
||||
import com.sap.sse.security.ui.client.UserService;
|
||||
|
||||
public class SAPHeaderComponent extends AbstractCompositeComponent<SAPHeaderComponentSettings> {
|
||||
private SAPHeaderComponentSettings settings;
|
||||
private final SAPHeaderComponentLifecycle componentLifecycle;
|
||||
|
||||
private final SAPHeader sapHeader;
|
||||
private final SAPHeaderWithAuthentication sapHeader;
|
||||
|
||||
public SAPHeaderComponent(SAPHeaderComponentLifecycle componentLifecycle, SAPHeaderComponentSettings settings,
|
||||
public SAPHeaderComponent(SAPHeaderComponentLifecycle componentLifecycle, UserService userService, SAPHeaderComponentSettings settings,
|
||||
StringMessages stringMessages, boolean startInAutoScreenMode) {
|
||||
this.componentLifecycle = componentLifecycle;
|
||||
this.settings = settings;
|
||||
this.sapHeader = new SAPHeader(stringMessages.sapSailingAnalytics());
|
||||
|
||||
sapHeader.setHeaderTitle(settings.getTitle());
|
||||
this.sapHeader = new SAPHeaderWithAuthentication(stringMessages.sapSailingAnalytics(), settings.getTitle());
|
||||
new FixedSailingAuthentication(userService, sapHeader.getAuthenticationMenuView());
|
||||
|
||||
initWidget(sapHeader);
|
||||
|
||||
if (startInAutoScreenMode) {
|
||||
|
||||
+5
-5
@@ -30,6 +30,7 @@ import com.sap.sse.gwt.client.shared.components.SettingsDialogComponent;
|
||||
import com.sap.sse.gwt.client.shared.perspective.AbstractPerspectiveComposite;
|
||||
import com.sap.sse.gwt.client.shared.perspective.PerspectiveLifecycleWithAllSettings;
|
||||
import com.sap.sse.gwt.client.useragent.UserAgentDetails;
|
||||
import com.sap.sse.security.ui.client.UserService;
|
||||
|
||||
/**
|
||||
* A perspective managing a header with a single leaderboard filling the rest of the screen.
|
||||
@@ -47,7 +48,7 @@ public class LeaderboardWithHeaderPerspective extends AbstractPerspectiveComposi
|
||||
private final PerspectiveLifecycleWithAllSettings<LeaderboardWithHeaderPerspectiveLifecycle, LeaderboardWithHeaderPerspectiveSettings> componentLifecyclesAndSettings;
|
||||
|
||||
public LeaderboardWithHeaderPerspective(PerspectiveLifecycleWithAllSettings<LeaderboardWithHeaderPerspectiveLifecycle, LeaderboardWithHeaderPerspectiveSettings> perspectiveLifecycleWithAllSettings,
|
||||
SailingServiceAsync sailingService, AsyncActionsExecutor asyncActionsExecutor,
|
||||
SailingServiceAsync sailingService, UserService userService, AsyncActionsExecutor asyncActionsExecutor,
|
||||
CompetitorSelectionProvider competitorSelectionProvider, Timer timer,
|
||||
String leaderboardName, final ErrorReporter errorReporter, final StringMessages stringMessages,
|
||||
UserAgentDetails userAgent, boolean startInFullScreenMode) {
|
||||
@@ -62,9 +63,8 @@ public class LeaderboardWithHeaderPerspective extends AbstractPerspectiveComposi
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
SAPHeaderComponentLifecycle sapHeaderLifecycle = getPerspectiveLifecycle().getSapHeaderLifecycle();
|
||||
SAPHeaderComponent sapHeader = createSAPHeader(sapHeaderLifecycle,
|
||||
SAPHeaderComponent sapHeader = createSAPHeader(sapHeaderLifecycle, userService,
|
||||
perspectiveLifecycleWithAllSettings.findComponentSettingsByLifecycle(sapHeaderLifecycle),
|
||||
stringMessages, startInFullScreenMode);
|
||||
leaderboardPanel = createLeaderboardPanel(sailingService, asyncActionsExecutor,
|
||||
@@ -183,9 +183,9 @@ public class LeaderboardWithHeaderPerspective extends AbstractPerspectiveComposi
|
||||
leaderboardPanel.removeLeaderboardUpdateListener(listener);
|
||||
}
|
||||
|
||||
private SAPHeaderComponent createSAPHeader(SAPHeaderComponentLifecycle componentLifecycle, SAPHeaderComponentSettings settings,
|
||||
private SAPHeaderComponent createSAPHeader(SAPHeaderComponentLifecycle componentLifecycle, UserService userService, SAPHeaderComponentSettings settings,
|
||||
final StringMessages stringMessages, boolean withFullscreenButton) {
|
||||
return new SAPHeaderComponent(componentLifecycle, settings, stringMessages, withFullscreenButton);
|
||||
return new SAPHeaderComponent(componentLifecycle, userService, settings, stringMessages, withFullscreenButton);
|
||||
}
|
||||
|
||||
private LeaderboardPanel createLeaderboardPanel(SailingServiceAsync sailingService, AsyncActionsExecutor asyncActionsExecutor,
|
||||
|
||||
Reference in new issue
Block a user