mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-08 05:11:04 +00:00
Removed support to specify the preselectedRace in LeaderboardEntryPoint
and Home via URL. This is primarily intended for use in the RaceBoard and was never used by end users in the case of LeaderboardEntryPoint and Home.
This commit is contained in:
1 parent
4463bd2dec
commit
264e765112
6 files changed
+5
-73
No files matched your search
+1
-3
@@ -2,7 +2,6 @@ package com.sap.sailing.gwt.home.desktop.places.event.regatta;
|
||||
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
|
||||
import com.sap.sailing.gwt.home.desktop.utils.EventParamUtils;
|
||||
import com.sap.sailing.gwt.settings.client.leaderboard.LeaderboardSettings;
|
||||
import com.sap.sailing.gwt.settings.client.leaderboard.LeaderboardUrlSettings;
|
||||
@@ -27,10 +26,9 @@ public abstract class SharedLeaderboardRegattaTabView<T extends AbstractEventReg
|
||||
LeaderboardUrlSettings.PARAM_AUTO_EXPAND_LAST_RACE_COLUMN, false);
|
||||
final LeaderboardSettings leaderboardSettings = EventParamUtils
|
||||
.createLeaderboardSettingsFromURLParameters(Window.Location.getParameterMap());
|
||||
final RegattaAndRaceIdentifier preselectedRace = EventParamUtils.getPreselectedRace();
|
||||
final LeaderboardPanel leaderboardPanel = regattaAnalyticsManager.createLeaderboardPanel( //
|
||||
leaderboardSettings, //
|
||||
preselectedRace, //
|
||||
null, //
|
||||
"leaderboardGroupName", // TODO: keep using magic string? ask frank!
|
||||
leaderboardName, //
|
||||
true,
|
||||
|
||||
+1
-4
@@ -2,7 +2,6 @@ package com.sap.sailing.gwt.home.desktop.places.fakeseries;
|
||||
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
|
||||
import com.sap.sailing.gwt.home.desktop.utils.EventParamUtils;
|
||||
import com.sap.sailing.gwt.settings.client.leaderboard.LeaderboardPanelLifecycle;
|
||||
import com.sap.sailing.gwt.settings.client.leaderboard.LeaderboardSettings;
|
||||
@@ -28,14 +27,12 @@ public abstract class SharedLeaderboardEventSeriesTabView<T extends AbstractSeri
|
||||
final LeaderboardSettings leaderboardSettings = EventParamUtils
|
||||
.createLeaderboardSettingsFromURLParameters(Window.Location
|
||||
.getParameterMap());
|
||||
final RegattaAndRaceIdentifier preselectedRace = EventParamUtils
|
||||
.getPreselectedRace();
|
||||
|
||||
LeaderboardPanelLifecycle lifeCycle = new LeaderboardPanelLifecycle(null, StringMessages.INSTANCE);
|
||||
LeaderboardPanel leaderboardPanel = eventSeriesAnalyticsManager.createOverallLeaderboardPanel(null,
|
||||
new SimpleComponentContext<>(lifeCycle),
|
||||
leaderboardSettings,
|
||||
preselectedRace,
|
||||
null,
|
||||
"leaderboardGroupName",
|
||||
leaderboardName,
|
||||
true, // this information came from place, now hard coded. check with frank
|
||||
|
||||
+1
-2
@@ -66,12 +66,11 @@ public class EventSeriesLeaderboardsTabView extends Composite implements SeriesT
|
||||
EventSeriesAnalyticsDataManager regattaAnalyticsManager = currentPresenter.getCtx().getAnalyticsManager();
|
||||
boolean autoExpandLastRaceColumn = GwtHttpRequestUtils.getBooleanParameter(LeaderboardUrlSettings.PARAM_AUTO_EXPAND_LAST_RACE_COLUMN, false);
|
||||
final LeaderboardSettings leaderboardSettings = EventParamUtils.createLeaderboardSettingsFromURLParameters(Window.Location.getParameterMap());
|
||||
final RaceIdentifier preselectedRace = EventParamUtils.getPreselectedRace();
|
||||
|
||||
MultiLeaderboardProxyPanel leaderboardPanel = regattaAnalyticsManager.createMultiLeaderboardPanel(null, null,
|
||||
leaderboardSettings,
|
||||
null, // TODO: preselectedLeaderboardName
|
||||
preselectedRace,
|
||||
null,
|
||||
"leaderboardGroupName",
|
||||
leaderboardName,
|
||||
true, // TODO @FM this information came from place, now hard coded. check with frank
|
||||
|
||||
-9
@@ -7,20 +7,11 @@ import java.util.Map;
|
||||
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.sap.sailing.domain.common.DetailType;
|
||||
import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
|
||||
import com.sap.sailing.gwt.settings.client.base.RegattaAndRaceIdentifierSettings;
|
||||
import com.sap.sailing.gwt.settings.client.leaderboard.LeaderboardSettings;
|
||||
import com.sap.sailing.gwt.settings.client.leaderboard.LeaderboardSettings.RaceColumnSelectionStrategies;
|
||||
import com.sap.sailing.gwt.settings.client.leaderboard.LeaderboardUrlSettings;
|
||||
import com.sap.sse.gwt.settings.SettingsToUrlSerializer;
|
||||
|
||||
public class EventParamUtils {
|
||||
|
||||
public static RegattaAndRaceIdentifier getPreselectedRace() {
|
||||
return new SettingsToUrlSerializer()
|
||||
.deserializeFromCurrentLocation(new RegattaAndRaceIdentifierSettings()).getRegattaAndRaceIdentifier();
|
||||
}
|
||||
|
||||
public static LeaderboardSettings createLeaderboardSettingsFromURLParameters(Map<String, List<String>> parameterMap) {
|
||||
LeaderboardSettings result;
|
||||
Long refreshIntervalMillis = parameterMap.containsKey(LeaderboardUrlSettings.PARAM_REFRESH_INTERVAL_MILLIS) ? Long
|
||||
|
||||
-48
@@ -1,48 +0,0 @@
|
||||
package com.sap.sailing.gwt.settings.client.base;
|
||||
|
||||
import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
|
||||
import com.sap.sailing.domain.common.RegattaNameAndRaceName;
|
||||
import com.sap.sailing.gwt.settings.client.leaderboard.LeaderboardUrlSettings;
|
||||
import com.sap.sse.common.settings.generic.AbstractGenericSerializableSettings;
|
||||
import com.sap.sse.common.settings.generic.StringSetting;
|
||||
|
||||
public class RegattaAndRaceIdentifierSettings extends AbstractGenericSerializableSettings {
|
||||
private static final long serialVersionUID = -6633826106133939710L;
|
||||
|
||||
private transient StringSetting raceName;
|
||||
private transient StringSetting regattaName;
|
||||
|
||||
public RegattaAndRaceIdentifierSettings() {
|
||||
}
|
||||
|
||||
public RegattaAndRaceIdentifierSettings(RegattaAndRaceIdentifier regattaAndRaceIdentifier) {
|
||||
raceName.setValue(regattaAndRaceIdentifier == null ? null : regattaAndRaceIdentifier.getRaceName());
|
||||
regattaName.setValue(regattaAndRaceIdentifier == null ? null : regattaAndRaceIdentifier.getRegattaName());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addChildSettings() {
|
||||
raceName = new StringSetting(LeaderboardUrlSettings.PARAM_RACE_NAME, this);
|
||||
regattaName = new StringSetting(LeaderboardUrlSettings.PARAM_REGATTA_NAME, this);
|
||||
}
|
||||
|
||||
public String getRaceName() {
|
||||
return raceName.getValue();
|
||||
}
|
||||
|
||||
public String getRegattaName() {
|
||||
return regattaName.getValue();
|
||||
}
|
||||
|
||||
public RegattaAndRaceIdentifier getRegattaAndRaceIdentifier() {
|
||||
final String raceName = this.raceName.getValue();
|
||||
final String regattaName = this.regattaName.getValue();
|
||||
RegattaAndRaceIdentifier result;
|
||||
if (raceName != null && !raceName.isEmpty() && regattaName != null && !regattaName.isEmpty()) {
|
||||
result = new RegattaNameAndRaceName(regattaName, raceName);
|
||||
} else {
|
||||
result = null;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
+2
-7
@@ -13,11 +13,9 @@ import com.google.gwt.user.client.ui.ScrollPanel;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.domain.common.DetailType;
|
||||
import com.sap.sailing.domain.common.LeaderboardType;
|
||||
import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
|
||||
import com.sap.sailing.domain.common.dto.AbstractLeaderboardDTO;
|
||||
import com.sap.sailing.gwt.common.authentication.FixedSailingAuthentication;
|
||||
import com.sap.sailing.gwt.common.authentication.SAPSailingHeaderWithAuthentication;
|
||||
import com.sap.sailing.gwt.settings.client.base.RegattaAndRaceIdentifierSettings;
|
||||
import com.sap.sailing.gwt.settings.client.leaderboard.AbstractLeaderboardPerspectiveLifecycle;
|
||||
import com.sap.sailing.gwt.settings.client.leaderboard.LeaderboardContextDefinition;
|
||||
import com.sap.sailing.gwt.settings.client.leaderboard.LeaderboardPerspectiveLifecycle;
|
||||
@@ -120,9 +118,6 @@ public class LeaderboardEntryPoint extends AbstractSailingEntryPoint {
|
||||
long delayBetweenAutoAdvancesInMilliseconds = DEFAULT_REFRESH_INTERVAL_MILLIS;
|
||||
final Timer timer = new Timer(PlayModes.Live, PlayStates.Paused, delayBetweenAutoAdvancesInMilliseconds);
|
||||
|
||||
final RegattaAndRaceIdentifier preselectedRace = new SettingsToUrlSerializer()
|
||||
.deserializeFromCurrentLocation(new RegattaAndRaceIdentifierSettings()).getRegattaAndRaceIdentifier();
|
||||
|
||||
// make a single live request as the default but don't continue to play by default
|
||||
|
||||
final UserSettingsStorageManager<PerspectiveCompositeSettings<LeaderboardPerspectiveOwnSettings>> settingsManager = new UserSettingsStorageManager<>(
|
||||
@@ -144,7 +139,7 @@ public class LeaderboardEntryPoint extends AbstractSailingEntryPoint {
|
||||
|
||||
final MetaLeaderboardViewer leaderboardViewer = new MetaLeaderboardViewer(null, context,
|
||||
rootComponentLifeCycle, defaultSettings, sailingService, new AsyncActionsExecutor(),
|
||||
timer, null, preselectedRace, leaderboardGroupName, leaderboardName,
|
||||
timer, null, null, leaderboardGroupName, leaderboardName,
|
||||
LeaderboardEntryPoint.this, getStringMessages(),
|
||||
getActualChartDetailType(defaultSettings));
|
||||
createUi(leaderboardViewer, defaultSettings, timer, leaderboardContextSettings);
|
||||
@@ -172,7 +167,7 @@ public class LeaderboardEntryPoint extends AbstractSailingEntryPoint {
|
||||
|
||||
final LeaderboardViewer leaderboardViewer = new LeaderboardViewer(null, context,
|
||||
rootComponentLifeCycle, defaultSettings, sailingService, new AsyncActionsExecutor(),
|
||||
timer, preselectedRace, leaderboardGroupName, leaderboardName,
|
||||
timer, null, leaderboardGroupName, leaderboardName,
|
||||
LeaderboardEntryPoint.this, getStringMessages(), getActualChartDetailType(defaultSettings));
|
||||
createUi(leaderboardViewer, defaultSettings, timer, leaderboardContextSettings);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user