mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-02 02:13:55 +00:00
show wind charts to all users because they like them
This commit is contained in:
1 parent
1f81f4074b
commit
b8f92da9c3
2 files changed
+10
-22
No files matched your search
+9
-19
@@ -75,13 +75,11 @@ public class RaceBoardPanel extends FormPanel implements EventDisplayer, RaceSel
|
||||
private final RaceTimePanel timePanel;
|
||||
private final Timer timer;
|
||||
private final RaceSelectionProvider raceSelectionProvider;
|
||||
private final UserDTO user;
|
||||
|
||||
public RaceBoardPanel(SailingServiceAsync sailingService, UserDTO theUser, RaceSelectionProvider theRaceSelectionProvider, String leaderboardName,
|
||||
String leaderboardGroupName, ErrorReporter errorReporter, final StringMessages stringMessages, UserAgentTypes userAgentType) {
|
||||
this.sailingService = sailingService;
|
||||
this.raceSelectionProvider = theRaceSelectionProvider;
|
||||
this.user = theUser;
|
||||
this.scrollOffset = 0;
|
||||
raceSelectionProvider.addRaceSelectionChangeListener(this);
|
||||
racesByIdentifier = new HashMap<RaceIdentifier, RaceDTO>();
|
||||
@@ -113,14 +111,7 @@ public class RaceBoardPanel extends FormPanel implements EventDisplayer, RaceSel
|
||||
|
||||
boolean showLeaderboard = true;
|
||||
boolean showMap = true;
|
||||
boolean showWindCharts = true;
|
||||
boolean showCompetitorCharts = true;
|
||||
|
||||
if (user == null) {
|
||||
// anonymous user
|
||||
showWindCharts = false;
|
||||
}
|
||||
|
||||
// create the default leaderboard and select the right race
|
||||
if(showLeaderboard) {
|
||||
LeaderboardSettings leaderBoardSettings = LeaderboardSettingsFactory.getInstance().createNewSettingsForPlayMode(timer.getPlayMode());
|
||||
@@ -142,16 +133,15 @@ public class RaceBoardPanel extends FormPanel implements EventDisplayer, RaceSel
|
||||
raceMap.onRaceSelectionChange(Collections.singletonList(selectedRaceIdentifier));
|
||||
collapsableViewers.add(raceMapViewer);
|
||||
}
|
||||
|
||||
if(showWindCharts) {
|
||||
WindChartSettings windChartSettings = new WindChartSettings(WindSource.values());
|
||||
WindChart windChart = new WindChart(sailingService, raceSelectionProvider, timer, windChartSettings, stringMessages, errorReporter);
|
||||
CollapsableComponentViewer<WindChartSettings> windChartViewer = new CollapsableComponentViewer<WindChartSettings>(
|
||||
windChart, "auto", "400px", stringMessages);
|
||||
windChart.onRaceSelectionChange(raceSelectionProvider.getSelectedRaces());
|
||||
collapsableViewers.add(windChartViewer);
|
||||
}
|
||||
if(showCompetitorCharts) {
|
||||
|
||||
WindChartSettings windChartSettings = new WindChartSettings(WindSource.values());
|
||||
WindChart windChart = new WindChart(sailingService, raceSelectionProvider, timer, windChartSettings,
|
||||
stringMessages, errorReporter);
|
||||
CollapsableComponentViewer<WindChartSettings> windChartViewer = new CollapsableComponentViewer<WindChartSettings>(
|
||||
windChart, "auto", "400px", stringMessages);
|
||||
windChart.onRaceSelectionChange(raceSelectionProvider.getSelectedRaces());
|
||||
collapsableViewers.add(windChartViewer);
|
||||
if (showCompetitorCharts) {
|
||||
// DON'T DELETE -> this is temporary for testing of different chart types
|
||||
// ChartPanel competitorCharts = new ChartPanel(sailingService, competitorSelectionModel, raceSelectionProvider,
|
||||
// timer, DetailType.WINDWARD_DISTANCE_TO_OVERALL_LEADER, stringMessages, errorReporter);
|
||||
|
||||
+1
-3
@@ -20,10 +20,9 @@ public class SpectatorEntryPoint extends AbstractEntryPoint implements EventRefr
|
||||
@Override
|
||||
public void onModuleLoad() {
|
||||
super.onModuleLoad();
|
||||
|
||||
String groupParamValue = Window.Location.getParameter("leaderboardGroupName");
|
||||
final String groupName;
|
||||
if(groupParamValue == null || groupParamValue.isEmpty()) {
|
||||
if (groupParamValue == null || groupParamValue.isEmpty()) {
|
||||
groupName = null;
|
||||
} else {
|
||||
groupName = groupParamValue;
|
||||
@@ -36,7 +35,6 @@ public class SpectatorEntryPoint extends AbstractEntryPoint implements EventRefr
|
||||
public void onSuccess(LeaderboardGroupDTO group) {}
|
||||
});
|
||||
}
|
||||
|
||||
String root = Window.Location.getParameter("root");
|
||||
//Check if the root contains an allowed value
|
||||
if (root != null) {
|
||||
|
||||
Reference in new issue
Block a user