mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-13 14:12:11 +00:00
bug4100 Further bugfixing for the new layered settings building pipeline
This commit is contained in:
1 parent
c62e4b6149
commit
04f8f13984
12 files changed
+184
-141
No files matched your search
+14
-14
@@ -11,11 +11,11 @@ import com.sap.sailing.gwt.ui.leaderboard.LeaderboardPanel;
|
||||
import com.sap.sse.common.Util;
|
||||
import com.sap.sse.common.settings.generic.AbstractGenericSerializableSettings;
|
||||
import com.sap.sse.common.settings.generic.BooleanSetting;
|
||||
import com.sap.sse.common.settings.generic.EnumListSetting;
|
||||
import com.sap.sse.common.settings.generic.EnumSetSetting;
|
||||
import com.sap.sse.common.settings.generic.EnumSetting;
|
||||
import com.sap.sse.common.settings.generic.IntegerSetting;
|
||||
import com.sap.sse.common.settings.generic.LongSetting;
|
||||
import com.sap.sse.common.settings.generic.StringListSetting;
|
||||
import com.sap.sse.common.settings.generic.StringSetSetting;
|
||||
import com.sap.sse.common.settings.generic.StringSetting;
|
||||
import com.sap.sse.common.settings.util.SettingsDefaultValuesUtils;
|
||||
|
||||
@@ -34,23 +34,23 @@ public class LeaderboardSettings extends AbstractGenericSerializableSettings {
|
||||
* Only one of {@link #namesOfRaceColumnsToShow} and {@link #namesOfRacesToShow} must be non-<code>null</code>.
|
||||
* Only valid when the {@link #activeRaceColumnSelectionStrategy} is set to EXPLIZIT
|
||||
*/
|
||||
private StringListSetting namesOfRaceColumnsToShow;
|
||||
private StringSetSetting namesOfRaceColumnsToShow;
|
||||
|
||||
/**
|
||||
* Only one of {@link #namesOfRaceColumnsToShow} and {@link #namesOfRacesToShow} must be non-<code>null</code>.
|
||||
* Only valid when the {@link #activeRaceColumnSelectionStrategy} is set to EXPLIZIT
|
||||
*/
|
||||
private StringListSetting namesOfRacesToShow;
|
||||
private StringSetSetting namesOfRacesToShow;
|
||||
|
||||
/**
|
||||
* Only valid when the {@link #activeRaceColumnSelectionStrategy} is set to LAST_N
|
||||
*/
|
||||
private IntegerSetting numberOfLastRacesToShow;
|
||||
|
||||
private EnumListSetting<DetailType> maneuverDetailsToShow;
|
||||
private EnumListSetting<DetailType> legDetailsToShow;
|
||||
private EnumListSetting<DetailType> raceDetailsToShow;
|
||||
private EnumListSetting<DetailType> overallDetailsToShow;
|
||||
private EnumSetSetting<DetailType> maneuverDetailsToShow;
|
||||
private EnumSetSetting<DetailType> legDetailsToShow;
|
||||
private EnumSetSetting<DetailType> raceDetailsToShow;
|
||||
private EnumSetSetting<DetailType> overallDetailsToShow;
|
||||
private boolean autoExpandPreSelectedRace = false;
|
||||
private LongSetting delayBetweenAutoAdvancesInMilliseconds;
|
||||
private BooleanSetting updateUponPlayStateChange;
|
||||
@@ -85,25 +85,25 @@ public class LeaderboardSettings extends AbstractGenericSerializableSettings {
|
||||
|
||||
@Override
|
||||
protected void addChildSettings() {
|
||||
namesOfRaceColumnsToShow = new StringListSetting("namesOfRaceColumnsToShow", this);
|
||||
namesOfRacesToShow = new StringListSetting("namesOfRacesToShow", this, null);
|
||||
namesOfRaceColumnsToShow = new StringSetSetting("namesOfRaceColumnsToShow", this);
|
||||
namesOfRacesToShow = new StringSetSetting("namesOfRacesToShow", this, null);
|
||||
numberOfLastRacesToShow = new IntegerSetting("numberOfLastRacesToShow", this, null);
|
||||
List<DetailType> maneuverDetails = new ArrayList<DetailType>();
|
||||
maneuverDetails.add(DetailType.TACK);
|
||||
maneuverDetails.add(DetailType.JIBE);
|
||||
maneuverDetails.add(DetailType.PENALTY_CIRCLE);
|
||||
maneuverDetailsToShow = new EnumListSetting<>("maneuverDetailsToShow", this, maneuverDetails, new DetailTypeStringToEnumConverter());
|
||||
maneuverDetailsToShow = new EnumSetSetting<>("maneuverDetailsToShow", this, maneuverDetails, new DetailTypeStringToEnumConverter());
|
||||
List<DetailType> legDetails = new ArrayList<DetailType>();
|
||||
legDetails.add(DetailType.DISTANCE_TRAVELED);
|
||||
legDetails.add(DetailType.AVERAGE_SPEED_OVER_GROUND_IN_KNOTS);
|
||||
legDetails.add(DetailType.RANK_GAIN);
|
||||
legDetailsToShow = new EnumListSetting<>("legDetailsToShow", this, legDetails, new DetailTypeStringToEnumConverter());
|
||||
legDetailsToShow = new EnumSetSetting<>("legDetailsToShow", this, legDetails, new DetailTypeStringToEnumConverter());
|
||||
List<DetailType> raceDetails = new ArrayList<DetailType>();
|
||||
raceDetails.add(DetailType.DISPLAY_LEGS);
|
||||
raceDetailsToShow = new EnumListSetting<>("raceDetailsToShow", this, raceDetails, new DetailTypeStringToEnumConverter());
|
||||
raceDetailsToShow = new EnumSetSetting<>("raceDetailsToShow", this, raceDetails, new DetailTypeStringToEnumConverter());
|
||||
List<DetailType> overallDetails = new ArrayList<>();
|
||||
overallDetails.add(DetailType.REGATTA_RANK);
|
||||
overallDetailsToShow = new EnumListSetting<>("overallDetailsToShow", this, overallDetails, new DetailTypeStringToEnumConverter());
|
||||
overallDetailsToShow = new EnumSetSetting<>("overallDetailsToShow", this, overallDetails, new DetailTypeStringToEnumConverter());
|
||||
delayBetweenAutoAdvancesInMilliseconds = new LongSetting("delayBetweenAutoAdvancesInMilliseconds", this, LeaderboardEntryPoint.DEFAULT_REFRESH_INTERVAL_MILLIS);
|
||||
activeRaceColumnSelectionStrategy = new EnumSetting<>("activeRaceColumnSelectionStrategy", this, RaceColumnSelectionStrategies.EXPLICIT, new RaceColumnSelectionStrategiesStringToEnumConverter());
|
||||
nameOfRaceToSort = new StringSetting("nameOfRaceToSort", this, null);
|
||||
|
||||
+3
-3
@@ -7,7 +7,7 @@ import com.sap.sailing.gwt.settings.client.settingtypes.converter.ZoomTypesStrin
|
||||
import com.sap.sse.common.Util;
|
||||
import com.sap.sse.common.settings.generic.AbstractGenericSerializableSettings;
|
||||
import com.sap.sse.common.settings.generic.BooleanSetting;
|
||||
import com.sap.sse.common.settings.generic.EnumListSetting;
|
||||
import com.sap.sse.common.settings.generic.EnumSetSetting;
|
||||
|
||||
/**
|
||||
* @author Lennart Hensler (D054527)
|
||||
@@ -35,12 +35,12 @@ public class RaceMapZoomSettings extends AbstractGenericSerializableSettings {
|
||||
}
|
||||
};
|
||||
|
||||
private EnumListSetting<ZoomTypes> typesToConsiderOnZoom;
|
||||
private EnumSetSetting<ZoomTypes> typesToConsiderOnZoom;
|
||||
private BooleanSetting zoomToSelectedCompetitors;
|
||||
|
||||
@Override
|
||||
protected void addChildSettings() {
|
||||
typesToConsiderOnZoom = new EnumListSetting<>("typesToConsiderOnZoom", this, Collections.singleton(ZoomTypes.BUOYS), new ZoomTypesStringToEnumConverter());
|
||||
typesToConsiderOnZoom = new EnumSetSetting<>("typesToConsiderOnZoom", this, Collections.singleton(ZoomTypes.BUOYS), new ZoomTypesStringToEnumConverter());
|
||||
zoomToSelectedCompetitors = new BooleanSetting("zoomToSelectedCompetitors", this, false);
|
||||
}
|
||||
|
||||
|
||||
-1
@@ -183,7 +183,6 @@ public class StartAnalysisMode extends RaceBoardModeWithPerRaceCompetitors {
|
||||
raceDetailsToShow.add(DetailType.RACE_SPEED_OVER_GROUND_FIVE_SECONDS_BEFORE_START);
|
||||
raceDetailsToShow.add(DetailType.RACE_DISTANCE_TO_START_FIVE_SECONDS_BEFORE_RACE_START);
|
||||
raceDetailsToShow.add(DetailType.DISTANCE_TO_START_AT_RACE_START);
|
||||
raceDetailsToShow.add(DetailType.DISTANCE_TO_START_LINE);
|
||||
raceDetailsToShow.add(DetailType.DISTANCE_TO_STARBOARD_END_OF_STARTLINE_WHEN_PASSING_START_IN_METERS);
|
||||
raceDetailsToShow.add(DetailType.SPEED_OVER_GROUND_AT_RACE_START);
|
||||
raceDetailsToShow.add(DetailType.SPEED_OVER_GROUND_WHEN_PASSING_START);
|
||||
|
||||
+121
-99
@@ -90,34 +90,36 @@ public class SettingsTest extends AbstractSeleniumTest {
|
||||
|
||||
RaceBoardPage raceboard = RaceBoardPage.goToRaceboardUrl(getWebDriver(), getContextRoot(), BMW_CUP_REGATTA,
|
||||
BMW_CUP_REGATTA, String.format(BMW_RACE, 1), "PLAYER");
|
||||
|
||||
//FIXME uncomment the leaderboard code when selenium on remote build server displays the raceboard properly
|
||||
|
||||
// DetailCheckboxInfo[] detailsToSelect = new DetailCheckboxInfo[] {
|
||||
// // Overall details
|
||||
//
|
||||
// // Race details
|
||||
// DetailCheckboxInfo.RACE_GAP_TO_LEADER,
|
||||
// DetailCheckboxInfo.RACE_CURRENT_SPEED_OVER_GROUND,
|
||||
// DetailCheckboxInfo.DISPLAY_LEGS,
|
||||
//
|
||||
// // Race Start Analysis
|
||||
//
|
||||
// // Leg Details
|
||||
// DetailCheckboxInfo.AVERAGE_SPEED_OVER_GROUND, DetailCheckboxInfo.DISTANCE, DetailCheckboxInfo.RANK_GAIN,
|
||||
//
|
||||
// // Maneuvers
|
||||
// DetailCheckboxInfo.TACK, DetailCheckboxInfo.JIBE,
|
||||
// DetailCheckboxInfo.PENALTY_CIRCLE
|
||||
//
|
||||
// };
|
||||
//
|
||||
// LeaderboardSettingsDialogPO leaderboardSettingsDialog = raceboard.openLeaderboardSettingsDialog();
|
||||
// LeaderboardSettingsPanelPO leaderboardSettingsPanelPO =
|
||||
// leaderboardSettingsDialog.getLeaderboardSettingsPanelPO();
|
||||
// DetailCheckboxInfo[] selectedDetails = leaderboardSettingsPanelPO.getSelectedDetails();
|
||||
// Assert.assertArrayEquals(detailsToSelect, selectedDetails);
|
||||
// leaderboardSettingsPanelPO.setRefreshInterval(2);
|
||||
// leaderboardSettingsDialog.pressMakeDefault();
|
||||
// leaderboardSettingsDialog.pressCancel();
|
||||
// DetailCheckboxInfo[] detailsToSelect = new DetailCheckboxInfo[] {
|
||||
// // Overall details
|
||||
//
|
||||
// // Race details
|
||||
// DetailCheckboxInfo.RACE_GAP_TO_LEADER,
|
||||
// DetailCheckboxInfo.RACE_CURRENT_SPEED_OVER_GROUND,
|
||||
// DetailCheckboxInfo.DISPLAY_LEGS,
|
||||
//
|
||||
// // Race Start Analysis
|
||||
//
|
||||
// // Leg Details
|
||||
// DetailCheckboxInfo.AVERAGE_SPEED_OVER_GROUND, DetailCheckboxInfo.DISTANCE, DetailCheckboxInfo.RANK_GAIN,
|
||||
//
|
||||
// // Maneuvers
|
||||
// DetailCheckboxInfo.TACK, DetailCheckboxInfo.JIBE,
|
||||
// DetailCheckboxInfo.PENALTY_CIRCLE
|
||||
//
|
||||
// };
|
||||
//
|
||||
// LeaderboardSettingsDialogPO leaderboardSettingsDialog = raceboard.openLeaderboardSettingsDialog();
|
||||
// LeaderboardSettingsPanelPO leaderboardSettingsPanelPO =
|
||||
// leaderboardSettingsDialog.getLeaderboardSettingsPanelPO();
|
||||
// DetailCheckboxInfo[] selectedDetails = leaderboardSettingsPanelPO.getSelectedDetails();
|
||||
// Assert.assertArrayEquals(detailsToSelect, selectedDetails);
|
||||
// leaderboardSettingsPanelPO.setRefreshInterval(2);
|
||||
// leaderboardSettingsDialog.pressMakeDefault();
|
||||
// leaderboardSettingsDialog.pressCancel();
|
||||
|
||||
MapSettingsPO mapSettings = raceboard.openMapSettings();
|
||||
// Verify initial mode settings
|
||||
@@ -130,57 +132,58 @@ public class SettingsTest extends AbstractSeleniumTest {
|
||||
raceboard = RaceBoardPage.goToRaceboardUrl(getWebDriver(), getContextRoot(), BMW_CUP_REGATTA, BMW_CUP_REGATTA,
|
||||
String.format(BMW_RACE, 1), "WINNING_LANES");
|
||||
|
||||
// detailsToSelect = new DetailCheckboxInfo[] {
|
||||
// // Overall details
|
||||
//
|
||||
// // Race details
|
||||
// DetailCheckboxInfo.RACE_GAP_TO_LEADER, //merged from user settings
|
||||
// DetailCheckboxInfo.RACE_DISTANCE,
|
||||
// DetailCheckboxInfo.RACE_TIME,
|
||||
// DetailCheckboxInfo.RACE_CURRENT_SPEED_OVER_GROUND, //merged from user settings
|
||||
// DetailCheckboxInfo.RACE_AVERAGE_ABSOLUTE_CROSS_TRACK_ERROR,
|
||||
// DetailCheckboxInfo.RACE_AVERAGE_SIGNED_CROSS_TRACK_ERROR,
|
||||
//
|
||||
// // Race Start Analysis
|
||||
//
|
||||
// // Leg Details
|
||||
// DetailCheckboxInfo.AVERAGE_SPEED_OVER_GROUND, DetailCheckboxInfo.DISTANCE, DetailCheckboxInfo.RANK_GAIN,
|
||||
//
|
||||
// // Maneuvers
|
||||
// DetailCheckboxInfo.TACK, DetailCheckboxInfo.JIBE,
|
||||
// DetailCheckboxInfo.PENALTY_CIRCLE
|
||||
//
|
||||
// };
|
||||
//
|
||||
//
|
||||
// leaderboardSettingsDialog = raceboard.openLeaderboardSettingsDialog();
|
||||
// leaderboardSettingsPanelPO = leaderboardSettingsDialog.getLeaderboardSettingsPanelPO();
|
||||
// selectedDetails = leaderboardSettingsPanelPO.getSelectedDetails();
|
||||
// Assert.assertArrayEquals(detailsToSelect, selectedDetails);
|
||||
//
|
||||
// detailsToSelect = new DetailCheckboxInfo[] {
|
||||
// // Overall details
|
||||
//
|
||||
// // Race details
|
||||
// DetailCheckboxInfo.RACE_GAP_TO_LEADER,
|
||||
// DetailCheckboxInfo.RACE_DISTANCE,
|
||||
// DetailCheckboxInfo.RACE_TIME,
|
||||
// DetailCheckboxInfo.RACE_CURRENT_SPEED_OVER_GROUND,
|
||||
// DetailCheckboxInfo.RACE_RATIO_BETWEEN_TIME_SINCE_LAST_POSITION_FIX_AND_AVERAGE_SAMPLING_INTERVAL, //new value
|
||||
//
|
||||
// // Race Start Analysis
|
||||
//
|
||||
// // Leg Details
|
||||
// DetailCheckboxInfo.AVERAGE_SPEED_OVER_GROUND, DetailCheckboxInfo.DISTANCE, DetailCheckboxInfo.RANK_GAIN,
|
||||
//
|
||||
// // Maneuvers
|
||||
// DetailCheckboxInfo.TACK, DetailCheckboxInfo.JIBE,
|
||||
// DetailCheckboxInfo.PENALTY_CIRCLE
|
||||
//
|
||||
// };
|
||||
// leaderboardSettingsPanelPO.selectDetailsAndDeselectOther(detailsToSelect);
|
||||
// leaderboardSettingsPanelPO.setRefreshInterval(1);
|
||||
// leaderboardSettingsDialog.pressOk();
|
||||
// detailsToSelect = new DetailCheckboxInfo[] {
|
||||
// // Overall details
|
||||
//
|
||||
// // Race details
|
||||
// DetailCheckboxInfo.RACE_GAP_TO_LEADER, //merged from user settings
|
||||
// DetailCheckboxInfo.RACE_DISTANCE,
|
||||
// DetailCheckboxInfo.RACE_TIME,
|
||||
// DetailCheckboxInfo.RACE_CURRENT_SPEED_OVER_GROUND, //merged from user settings
|
||||
// DetailCheckboxInfo.RACE_AVERAGE_ABSOLUTE_CROSS_TRACK_ERROR,
|
||||
// DetailCheckboxInfo.RACE_AVERAGE_SIGNED_CROSS_TRACK_ERROR,
|
||||
//
|
||||
// // Race Start Analysis
|
||||
//
|
||||
// // Leg Details
|
||||
// DetailCheckboxInfo.AVERAGE_SPEED_OVER_GROUND, DetailCheckboxInfo.DISTANCE, DetailCheckboxInfo.RANK_GAIN,
|
||||
//
|
||||
// // Maneuvers
|
||||
// DetailCheckboxInfo.TACK, DetailCheckboxInfo.JIBE,
|
||||
// DetailCheckboxInfo.PENALTY_CIRCLE
|
||||
//
|
||||
// };
|
||||
//
|
||||
//
|
||||
// leaderboardSettingsDialog = raceboard.openLeaderboardSettingsDialog();
|
||||
// leaderboardSettingsPanelPO = leaderboardSettingsDialog.getLeaderboardSettingsPanelPO();
|
||||
// selectedDetails = leaderboardSettingsPanelPO.getSelectedDetails();
|
||||
// Assert.assertArrayEquals(detailsToSelect, selectedDetails);
|
||||
//
|
||||
// detailsToSelect = new DetailCheckboxInfo[] {
|
||||
// // Overall details
|
||||
//
|
||||
// // Race details
|
||||
// DetailCheckboxInfo.RACE_GAP_TO_LEADER,
|
||||
// DetailCheckboxInfo.RACE_DISTANCE,
|
||||
// DetailCheckboxInfo.RACE_TIME,
|
||||
// DetailCheckboxInfo.RACE_CURRENT_SPEED_OVER_GROUND,
|
||||
// DetailCheckboxInfo.RACE_RATIO_BETWEEN_TIME_SINCE_LAST_POSITION_FIX_AND_AVERAGE_SAMPLING_INTERVAL, //new value
|
||||
// DetailCheckboxInfo.DISPLAY_LEGS, //new value which should override mode settings
|
||||
//
|
||||
// // Race Start Analysis
|
||||
//
|
||||
// // Leg Details
|
||||
// DetailCheckboxInfo.AVERAGE_SPEED_OVER_GROUND, DetailCheckboxInfo.DISTANCE, DetailCheckboxInfo.RANK_GAIN,
|
||||
//
|
||||
// // Maneuvers
|
||||
// DetailCheckboxInfo.TACK, DetailCheckboxInfo.JIBE,
|
||||
// DetailCheckboxInfo.PENALTY_CIRCLE
|
||||
//
|
||||
// };
|
||||
// leaderboardSettingsPanelPO.selectDetailsAndDeselectOther(detailsToSelect);
|
||||
// leaderboardSettingsPanelPO.setRefreshInterval(1);
|
||||
// leaderboardSettingsDialog.pressOk();
|
||||
|
||||
mapSettings = raceboard.openMapSettings();
|
||||
// verify default mode settings override custom user settings
|
||||
@@ -196,16 +199,16 @@ public class SettingsTest extends AbstractSeleniumTest {
|
||||
raceboard = RaceBoardPage.goToRaceboardUrl(getWebDriver(), getContextRoot(), BMW_CUP_REGATTA, BMW_CUP_REGATTA,
|
||||
String.format(BMW_RACE, 1), "WINNING_LANES");
|
||||
|
||||
// leaderboardSettingsDialog = raceboard.openLeaderboardSettingsDialog();
|
||||
// leaderboardSettingsPanelPO = leaderboardSettingsDialog.getLeaderboardSettingsPanelPO();
|
||||
// selectedDetails = leaderboardSettingsPanelPO.getSelectedDetails();
|
||||
//
|
||||
// //verify highest precedence of document settings
|
||||
// Assert.assertArrayEquals(detailsToSelect, selectedDetails);
|
||||
// //verify that document settings are able to override custom user settings by a system default value
|
||||
// Assert.assertEquals(1, leaderboardSettingsPanelPO.getRefreshInterval());
|
||||
//
|
||||
// leaderboardSettingsDialog.pressCancel();
|
||||
// leaderboardSettingsDialog = raceboard.openLeaderboardSettingsDialog();
|
||||
// leaderboardSettingsPanelPO = leaderboardSettingsDialog.getLeaderboardSettingsPanelPO();
|
||||
// selectedDetails = leaderboardSettingsPanelPO.getSelectedDetails();
|
||||
//
|
||||
// //verify highest precedence of document settings
|
||||
// Assert.assertArrayEquals(detailsToSelect, selectedDetails);
|
||||
// //verify that document settings are able to override custom user settings by a system default value
|
||||
// Assert.assertEquals(1, leaderboardSettingsPanelPO.getRefreshInterval());
|
||||
//
|
||||
// leaderboardSettingsDialog.pressCancel();
|
||||
|
||||
mapSettings = raceboard.openMapSettings();
|
||||
// Verify that mode settings are overridden by document settings
|
||||
@@ -213,17 +216,36 @@ public class SettingsTest extends AbstractSeleniumTest {
|
||||
// verify that document settings are able to override custom user settings by a system default value
|
||||
Assert.assertFalse(mapSettings.isTransparentHoverlines());
|
||||
|
||||
// // verify that custom document settings override mode settings of other modes
|
||||
// raceboard = RaceBoardPage.goToRaceboardUrl(getWebDriver(), getContextRoot(), BMW_CUP_REGATTA,
|
||||
// BMW_CUP_REGATTA,
|
||||
// String.format(BMW_RACE, 1), "START_ANALYSIS");
|
||||
// leaderboardSettingsDialog = raceboard.openLeaderboardSettingsDialog();
|
||||
// leaderboardSettingsPanelPO = leaderboardSettingsDialog.getLeaderboardSettingsPanelPO();
|
||||
// selectedDetails = leaderboardSettingsPanelPO.getSelectedDetails();
|
||||
// Assert.assertArrayEquals(detailsToSelect, selectedDetails);
|
||||
//
|
||||
// mapSettings = raceboard.openMapSettings();
|
||||
// Assert.assertFalse(mapSettings.isWindUp());
|
||||
// verify that custom document settings override mode settings of other modes
|
||||
raceboard = RaceBoardPage.goToRaceboardUrl(getWebDriver(), getContextRoot(), BMW_CUP_REGATTA,
|
||||
BMW_CUP_REGATTA,
|
||||
String.format(BMW_RACE, 1), "START_ANALYSIS");
|
||||
// leaderboardSettingsDialog = raceboard.openLeaderboardSettingsDialog();
|
||||
// leaderboardSettingsPanelPO = leaderboardSettingsDialog.getLeaderboardSettingsPanelPO();
|
||||
// selectedDetails = leaderboardSettingsPanelPO.getSelectedDetails();
|
||||
//
|
||||
// detailsToSelect = new DetailCheckboxInfo[] {
|
||||
// DetailCheckboxInfo.RACE_GAP_TO_LEADER, //start analysis mode
|
||||
// DetailCheckboxInfo.RACE_CURRENT_SPEED_OVER_GROUND, //user settings
|
||||
// DetailCheckboxInfo.DISPLAY_LEGS, //document settings which override mode settings
|
||||
// DetailCheckboxInfo.RACE_RATIO_BETWEEN_TIME_SINCE_LAST_POSITION_FIX_AND_AVERAGE_SAMPLING_INTERVAL, //document settings
|
||||
// DetailCheckboxInfo.RACE_DISTANCE_TO_START_FIVE_SECONDS_BEFORE_START, //start analysis mode
|
||||
// DetailCheckboxInfo.RACE_SPEED_OVER_GROUND_FIVE_SECONDS_BEFORE_START, //start analysis mode
|
||||
// DetailCheckboxInfo.DISTANCE_TO_START_AT_RACE_START, //start analysis mode
|
||||
// DetailCheckboxInfo.SPEED_OVER_GROUND_AT_RACE_START, //start analysis mode
|
||||
// DetailCheckboxInfo.SPEED_OVER_GROUND_WHEN_STARTING, //start analysis mode
|
||||
// DetailCheckboxInfo.DISTANCE_TO_STARBOARD_END_OF_STARTLINE_WHEN_STARTING, //start analysis mode
|
||||
// DetailCheckboxInfo.START_TACK, //start analysis mode
|
||||
//
|
||||
// DetailCheckboxInfo.AVERAGE_SPEED_OVER_GROUND, DetailCheckboxInfo.DISTANCE, DetailCheckboxInfo.RANK_GAIN,
|
||||
//
|
||||
// DetailCheckboxInfo.TACK, DetailCheckboxInfo.JIBE, DetailCheckboxInfo.PENALTY_CIRCLE
|
||||
// };
|
||||
// Assert.assertArrayEquals(detailsToSelect, selectedDetails);
|
||||
// leaderboardSettingsDialog.pressCancel();
|
||||
|
||||
mapSettings = raceboard.openMapSettings();
|
||||
Assert.assertFalse(mapSettings.isWindUp());
|
||||
}
|
||||
|
||||
private void initTrackingForBmwCupRace(AdminConsolePage adminConsole) {
|
||||
|
||||
+5
-7
@@ -24,7 +24,7 @@ public final class SettingsUtil {
|
||||
private interface ValuesSetter {
|
||||
<V> void setDefaultValue(ValueSetting<V> setting, V value);
|
||||
|
||||
<V> void getDefaultValue(ValueCollectionSetting<V> setting, Iterable<V> values);
|
||||
<V> void setDefaultValue(ValueCollectionSetting<V> setting, Iterable<V> values);
|
||||
}
|
||||
|
||||
private static final ValuesExtractor defaultValuesExtractor = new ValuesExtractor() {
|
||||
@@ -43,7 +43,7 @@ public final class SettingsUtil {
|
||||
setting.setDefaultValue(value);
|
||||
}
|
||||
@Override
|
||||
public <V> void getDefaultValue(ValueCollectionSetting<V> setting, Iterable<V> values) {
|
||||
public <V> void setDefaultValue(ValueCollectionSetting<V> setting, Iterable<V> values) {
|
||||
setting.setDefaultValues(values);
|
||||
}
|
||||
};
|
||||
@@ -64,7 +64,7 @@ public final class SettingsUtil {
|
||||
setting.setValue(value);
|
||||
}
|
||||
@Override
|
||||
public <V> void getDefaultValue(ValueCollectionSetting<V> setting, Iterable<V> values) {
|
||||
public <V> void setDefaultValue(ValueCollectionSetting<V> setting, Iterable<V> values) {
|
||||
setting.setValues(values);
|
||||
}
|
||||
};
|
||||
@@ -151,14 +151,12 @@ public final class SettingsUtil {
|
||||
if (settingToSetDefault instanceof ValueSetting) {
|
||||
ValueSetting valueSettingToSetDefault = (ValueSetting) settingToSetDefault;
|
||||
ValueSetting valueSettingWithDefault = (ValueSetting) childSettingsWithDefaults.get(settingKey);
|
||||
valueSettingToSetDefault
|
||||
.setDefaultValue(defaultValuesExtractor.getDefaultValue(valueSettingWithDefault));
|
||||
valuesSetter.setDefaultValue(valueSettingToSetDefault, defaultValuesExtractor.getDefaultValue(valueSettingWithDefault));
|
||||
} else if (settingToSetDefault instanceof ValueCollectionSetting) {
|
||||
ValueCollectionSetting valueCollectionSettingToSetDefault = (ValueCollectionSetting) settingToSetDefault;
|
||||
ValueCollectionSetting valueCollectionSettingWithDefault = (ValueCollectionSetting) childSettingsWithDefaults
|
||||
.get(settingKey);
|
||||
valueCollectionSettingToSetDefault
|
||||
.setDefaultValues(defaultValuesExtractor.getDefaultValue(valueCollectionSettingWithDefault));
|
||||
valuesSetter.setDefaultValue(valueCollectionSettingToSetDefault, defaultValuesExtractor.getDefaultValue(valueCollectionSettingWithDefault));
|
||||
} else if (settingToSetDefault instanceof GenericSerializableSettings) {
|
||||
GenericSerializableSettings settingsToSetDefault = (GenericSerializableSettings) settingToSetDefault;
|
||||
GenericSerializableSettings settingsWithDefault = (GenericSerializableSettings) childSettingsWithDefaults
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ public interface SettingsBuildingPipeline {
|
||||
* @return The constructed settings object
|
||||
*/
|
||||
<CS extends Settings> CS getSettingsObject(CS systemDefaultSettings,
|
||||
StorableRepresentationOfDocumentAndUserSettings settingsRepresentation, List<String> absolutePathOfComponentWithSettings);
|
||||
StorableRepresentationOfDocumentAndUserSettings settingsRepresentation);
|
||||
|
||||
/**
|
||||
* Converts the provided settings according to the storage scope and the settings tree path of provided settings.
|
||||
|
||||
+22
@@ -115,5 +115,27 @@ public class StorableSettingsRepresentation {
|
||||
}
|
||||
return root;
|
||||
}
|
||||
|
||||
public StorableSettingsRepresentation getSubSettingsRepresentation(List<String> subPath) {
|
||||
return new StorableSettingsRepresentation(getSubSettingsRepresentation(internalSettingsRepresentation, new ArrayList<>(subPath)));
|
||||
}
|
||||
|
||||
public static JSONObject getSubSettingsRepresentation(JSONObject root, List<String> subPath) {
|
||||
if (subPath.isEmpty()) {
|
||||
return root;
|
||||
} else {
|
||||
String current = subPath.remove(subPath.size() - 1);
|
||||
// we need to go further
|
||||
JSONValue child = root.get(current);
|
||||
boolean haskey = root.containsKey(current);
|
||||
if (child == null || child.isObject() == null) {
|
||||
if (haskey) {
|
||||
GWT.log("Warning: replacing some subtree element that is wrong type!");
|
||||
}
|
||||
child = new JSONObject();
|
||||
}
|
||||
return getSubSettingsRepresentation(child.isObject(), subPath);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+2
-2
@@ -152,7 +152,7 @@ public class ComponentContextWithSettingsStorage<S extends Settings> extends Sim
|
||||
|
||||
} else {
|
||||
S newDefaultSettings = settingsBuildingPipeline.getSettingsObject(systemDefaultSettings,
|
||||
cachedSettingsRepresentation, new ArrayList<>());
|
||||
cachedSettingsRepresentation);
|
||||
callback.onSuccess(newDefaultSettings);
|
||||
}
|
||||
}
|
||||
@@ -161,7 +161,7 @@ public class ComponentContextWithSettingsStorage<S extends Settings> extends Sim
|
||||
S systemDefaultSettings) {
|
||||
cachedSettingsRepresentation = settingsRepresentation;
|
||||
S settingsObject = settingsBuildingPipeline.getSettingsObject(systemDefaultSettings,
|
||||
cachedSettingsRepresentation, new ArrayList<>());
|
||||
cachedSettingsRepresentation);
|
||||
return settingsObject;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -101,7 +101,7 @@ public class SimpleComponentContext<S extends Settings> implements ComponentCont
|
||||
private S getDefaultSettings() {
|
||||
S defaultSettings = rootLifecycle.createDefaultSettings();
|
||||
return settingsBuildingPipeline.getSettingsObject(defaultSettings,
|
||||
new StorableRepresentationOfDocumentAndUserSettings(null, null), new ArrayList<>());
|
||||
new StorableRepresentationOfDocumentAndUserSettings(null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ public class UrlSettingsBuildingPipeline implements SettingsBuildingPipeline {
|
||||
*/
|
||||
@Override
|
||||
public <S extends Settings> S getSettingsObject(S systemDefaultSettings,
|
||||
StorableRepresentationOfDocumentAndUserSettings settingsRepresentation, List<String> absolutePathOfComponentWithSettings) {
|
||||
StorableRepresentationOfDocumentAndUserSettings settingsRepresentation) {
|
||||
return settingsRepresentationTransformer.mergeSettingsObjectWithUrlSettings(systemDefaultSettings);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -45,7 +45,7 @@ public class UserSettingsBuildingPipeline extends UrlSettingsBuildingPipeline {
|
||||
*/
|
||||
@Override
|
||||
public <CS extends Settings> CS getSettingsObject(CS systemDefaultSettings,
|
||||
StorableRepresentationOfDocumentAndUserSettings settingsRepresentation, List<String> absolutePathOfComponentWithSettings) {
|
||||
StorableRepresentationOfDocumentAndUserSettings settingsRepresentation) {
|
||||
CS effectiveSettings = systemDefaultSettings;
|
||||
if (settingsRepresentation.hasStoredUserSettings()) {
|
||||
effectiveSettings = settingsRepresentationTransformer.mergeSettingsObjectWithStorableRepresentation(effectiveSettings,
|
||||
@@ -94,7 +94,7 @@ public class UserSettingsBuildingPipeline extends UrlSettingsBuildingPipeline {
|
||||
if(previousSettingsRepresentation.hasStoredUserSettings()) {
|
||||
CS pipelinedSettings = SettingsUtil.copyDefaultsFromValues(newInstance, newInstance);
|
||||
pipelinedSettings = SettingsUtil.copyDefaults(newSettings, newInstance); //overrides values which are set to default values
|
||||
CS previousUserSettings = settingsRepresentationTransformer.mergeSettingsObjectWithStorableRepresentation(newInstance, previousSettingsRepresentation.getUserSettingsRepresentation());
|
||||
CS previousUserSettings = settingsRepresentationTransformer.mergeSettingsObjectWithStorableRepresentation(newInstance, previousSettingsRepresentation.getUserSettingsRepresentation().getSubSettingsRepresentation(path));
|
||||
pipelinedSettings = SettingsUtil.copyDefaultsFromValues(previousUserSettings, pipelinedSettings);
|
||||
documentSettingsWithUserSettingsDiff = SettingsUtil.copyValues(newSettings, pipelinedSettings);
|
||||
} else {
|
||||
|
||||
+12
-10
@@ -45,23 +45,23 @@ public class UserSettingsBuildingPipelineWithAdditionalSettingsLayers extends Us
|
||||
|
||||
@Override
|
||||
public <CS extends Settings> CS getSettingsObject(CS systemDefaultSettings,
|
||||
StorableRepresentationOfDocumentAndUserSettings settingsRepresentations,
|
||||
List<String> absolutePathOfComponentWithSettings) {
|
||||
StorableRepresentationOfDocumentAndUserSettings settingsRepresentations) {
|
||||
List<String> rootPath = new ArrayList<>();
|
||||
CS effectiveSettings = applyPatchesForPipelineLevel(systemDefaultSettings, PipelineLevel.SYSTEM_DEFAULTS,
|
||||
absolutePathOfComponentWithSettings, layersSettingsPatches);
|
||||
rootPath, layersSettingsPatches);
|
||||
if (settingsRepresentations.hasStoredUserSettings()) {
|
||||
effectiveSettings = settingsRepresentationTransformer.mergeSettingsObjectWithStorableRepresentation(
|
||||
effectiveSettings, settingsRepresentations.getUserSettingsRepresentation());
|
||||
}
|
||||
effectiveSettings = applyPatchesForPipelineLevel(effectiveSettings, PipelineLevel.USER_DEFAULTS,
|
||||
absolutePathOfComponentWithSettings, layersSettingsPatches);
|
||||
rootPath, layersSettingsPatches);
|
||||
if (settingsRepresentations.hasStoredDocumentSettings()) {
|
||||
effectiveSettings = settingsRepresentationTransformer.mergeSettingsObjectWithStorableRepresentation(
|
||||
effectiveSettings, settingsRepresentations.getDocumentSettingsRepresentation());
|
||||
}
|
||||
|
||||
effectiveSettings = applyPatchesForPipelineLevel(effectiveSettings, PipelineLevel.DOCUMENT_DEFAULTS,
|
||||
absolutePathOfComponentWithSettings, layersSettingsPatches);
|
||||
rootPath, layersSettingsPatches);
|
||||
effectiveSettings = settingsRepresentationTransformer.mergeSettingsObjectWithUrlSettings(effectiveSettings);
|
||||
return effectiveSettings;
|
||||
}
|
||||
@@ -150,17 +150,19 @@ public class UserSettingsBuildingPipelineWithAdditionalSettingsLayers extends Us
|
||||
pipelinedSettings = SettingsUtil.copyDefaultsFromValues(pipelinedSettings, pipelinedSettings);
|
||||
|
||||
if (previousSettingsRepresentation.hasStoredUserSettings()) {
|
||||
CS previousUserSettings = settingsRepresentationTransformer.mergeSettingsObjectWithStorableRepresentation(
|
||||
pipelinedSettings, previousSettingsRepresentation.getUserSettingsRepresentation());
|
||||
previousUserSettings = applyPatchesForPipelineLevel(previousUserSettings, PipelineLevel.USER_DEFAULTS, path,
|
||||
pipelinedSettings = settingsRepresentationTransformer.mergeSettingsObjectWithStorableRepresentation(
|
||||
pipelinedSettings, previousSettingsRepresentation.getUserSettingsRepresentation().getSubSettingsRepresentation(path));
|
||||
|
||||
pipelinedSettings = SettingsUtil.copyDefaultsFromValues(pipelinedSettings, pipelinedSettings);
|
||||
|
||||
pipelinedSettings = applyPatchesForPipelineLevel(pipelinedSettings, PipelineLevel.USER_DEFAULTS, path,
|
||||
layersSettingsPatches);
|
||||
|
||||
pipelinedSettings = SettingsUtil.copyDefaultsFromValues(previousUserSettings, pipelinedSettings);
|
||||
} else {
|
||||
pipelinedSettings = applyPatchesForPipelineLevel(pipelinedSettings, PipelineLevel.USER_DEFAULTS, path,
|
||||
layersSettingsPatches);
|
||||
pipelinedSettings = SettingsUtil.copyDefaultsFromValues(pipelinedSettings, pipelinedSettings);
|
||||
}
|
||||
pipelinedSettings = SettingsUtil.copyDefaultsFromValues(pipelinedSettings, pipelinedSettings);
|
||||
pipelinedSettings = SettingsUtil.copyValues(newSettings, pipelinedSettings);
|
||||
return settingsRepresentationTransformer.convertToSettingsRepresentation(pipelinedSettings);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user