Merge branch 'master' into bug4429
Change-Id: Ie2dc18c27efe884f7e1bc24206707424b356e739
No files matched your search
@@ -7,6 +7,8 @@ package com.sap.sailing.domain.abstractlog.race;
|
||||
*/
|
||||
public interface CompetitorResults extends Iterable<CompetitorResult> {
|
||||
boolean add(CompetitorResult result);
|
||||
void clear();
|
||||
int size();
|
||||
|
||||
/**
|
||||
* @return {@code true} if there are more than one {@link CompetitorResult} contained with equal
|
||||
|
||||
@@ -170,7 +170,7 @@ public interface RaceState extends ReadonlyRaceState {
|
||||
/**
|
||||
* Sets a new confirmed finishing list.
|
||||
*/
|
||||
void setFinishPositioningConfirmed(TimePoint now);
|
||||
void setFinishPositioningConfirmed(TimePoint now, CompetitorResults positionedCompetitors);
|
||||
|
||||
/**
|
||||
* Sets a new active course design.
|
||||
|
||||
@@ -202,9 +202,9 @@ public class RaceStateImpl extends ReadonlyRaceStateImpl implements RaceState {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFinishPositioningConfirmed(TimePoint timePoint) {
|
||||
public void setFinishPositioningConfirmed(TimePoint timePoint, CompetitorResults positionedCompetitors) {
|
||||
raceLog.add(new RaceLogFinishPositioningConfirmedEventImpl(
|
||||
timePoint, author, raceLog.getCurrentPassId(), getFinishPositioningList()));
|
||||
timePoint, author, raceLog.getCurrentPassId(), positionedCompetitors));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -78,7 +78,7 @@ public final class EventActionUtil {
|
||||
}
|
||||
}
|
||||
if (leaderboardGroups.isEmpty()) {
|
||||
throw new DispatchException("The leaderboard is not part of the given event.");
|
||||
throw new DispatchException("The leaderboard '" + leaderboardId + "' is not part of the given event '" + eventId + "'.");
|
||||
}
|
||||
return new LeaderboardContext(context, event, leaderboardGroups, leaderboard);
|
||||
}
|
||||
|
||||
@@ -35,10 +35,14 @@ import com.google.gwt.user.server.rpc.RemoteServiceServlet;
|
||||
import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
|
||||
import com.sap.sailing.domain.common.dto.VideoMetadataDTO;
|
||||
import com.sap.sailing.domain.common.media.MediaTrack;
|
||||
import com.sap.sailing.domain.common.security.Permission;
|
||||
import com.sap.sailing.domain.common.security.SailingPermissionsForRoleProvider;
|
||||
import com.sap.sailing.gwt.ui.client.MediaService;
|
||||
import com.sap.sailing.server.RacingEventService;
|
||||
import com.sap.sse.common.Duration;
|
||||
import com.sap.sse.common.impl.MillisecondsDurationImpl;
|
||||
import com.sap.sse.security.SecurityService;
|
||||
import com.sap.sse.security.User;
|
||||
|
||||
public class MediaServiceImpl extends RemoteServiceServlet implements MediaService {
|
||||
|
||||
@@ -49,12 +53,17 @@ public class MediaServiceImpl extends RemoteServiceServlet implements MediaServi
|
||||
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z");
|
||||
|
||||
private ServiceTracker<RacingEventService, RacingEventService> racingEventServiceTracker;
|
||||
|
||||
private ServiceTracker<SecurityService, SecurityService> securityServiceTracker;
|
||||
|
||||
private static final int REQUIRED_SIZE = 1000000;
|
||||
private static final long serialVersionUID = -8917349579281305977L;
|
||||
|
||||
public MediaServiceImpl() {
|
||||
super();
|
||||
BundleContext context = Activator.getDefault();
|
||||
securityServiceTracker = new ServiceTracker<>(context, SecurityService.class, /* customizer */ null);
|
||||
securityServiceTracker.open();
|
||||
racingEventServiceTracker = new ServiceTracker<RacingEventService, RacingEventService>(context,
|
||||
RacingEventService.class.getName(), null);
|
||||
racingEventServiceTracker.open();
|
||||
@@ -78,9 +87,26 @@ public class MediaServiceImpl extends RemoteServiceServlet implements MediaServi
|
||||
public Iterable<MediaTrack> getAllMediaTracks() {
|
||||
return racingEventService().getAllMediaTracks();
|
||||
}
|
||||
|
||||
private void ensureUserCanManageMedia() {
|
||||
SecurityService service = securityServiceTracker.getService();
|
||||
if (service == null) {
|
||||
throw new IllegalStateException("SecurityService not initialized");
|
||||
}
|
||||
User user = service.getCurrentUser();
|
||||
if (user == null) {
|
||||
throw new IllegalStateException("User is missing permission to MANAGER_MEDIA");
|
||||
}
|
||||
boolean hasPermission = user.hasPermission(Permission.MANAGE_MEDIA.getStringPermission(),
|
||||
SailingPermissionsForRoleProvider.INSTANCE);
|
||||
if (!hasPermission) {
|
||||
throw new IllegalStateException("User is missing permission to MANAGER_MEDIA");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String addMediaTrack(MediaTrack mediaTrack) {
|
||||
ensureUserCanManageMedia();
|
||||
if (mediaTrack.dbId != null) {
|
||||
throw new IllegalStateException("Property dbId must not be null for newly created media track.");
|
||||
}
|
||||
@@ -90,36 +116,43 @@ public class MediaServiceImpl extends RemoteServiceServlet implements MediaServi
|
||||
|
||||
@Override
|
||||
public void deleteMediaTrack(MediaTrack mediaTrack) {
|
||||
ensureUserCanManageMedia();
|
||||
racingEventService().mediaTrackDeleted(mediaTrack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTitle(MediaTrack mediaTrack) {
|
||||
ensureUserCanManageMedia();
|
||||
racingEventService().mediaTrackTitleChanged(mediaTrack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateUrl(MediaTrack mediaTrack) {
|
||||
ensureUserCanManageMedia();
|
||||
racingEventService().mediaTrackUrlChanged(mediaTrack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStartTime(MediaTrack mediaTrack) {
|
||||
ensureUserCanManageMedia();
|
||||
racingEventService().mediaTrackStartTimeChanged(mediaTrack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDuration(MediaTrack mediaTrack) {
|
||||
ensureUserCanManageMedia();
|
||||
racingEventService().mediaTrackDurationChanged(mediaTrack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateRace(MediaTrack mediaTrack) {
|
||||
ensureUserCanManageMedia();
|
||||
racingEventService().mediaTrackAssignedRacesChanged(mediaTrack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VideoMetadataDTO checkMetadata(String url) {
|
||||
ensureUserCanManageMedia();
|
||||
VideoMetadataDTO response = null;
|
||||
try {
|
||||
URL input = new URL(url);
|
||||
@@ -199,6 +232,7 @@ public class MediaServiceImpl extends RemoteServiceServlet implements MediaServi
|
||||
|
||||
@Override
|
||||
public VideoMetadataDTO checkMetadata(byte[] start, byte[] end, Long skipped) {
|
||||
ensureUserCanManageMedia();
|
||||
File tmp = null;
|
||||
boolean spherical = false;
|
||||
Duration duration = null;
|
||||
|
||||
@@ -112,7 +112,7 @@ public class ApplyScoresFromRaceLogTest extends LeaderboardScoringAndRankingTest
|
||||
f1RaceState.setFinishPositioningListChanged(now, results);
|
||||
final List<Competitor> rankedCompetitorsBeforeApplying = leaderboard.getCompetitorsFromBestToWorst(later);
|
||||
assertEquals(competitors, rankedCompetitorsBeforeApplying); // no effects of preliminary results list yet
|
||||
f1RaceState.setFinishPositioningConfirmed(now);
|
||||
f1RaceState.setFinishPositioningConfirmed(now, results);
|
||||
final Function<Competitor, Double> expectedPoints =
|
||||
(c)->scores.get(c)==null?(mprs.get(c) == null || mprs.get(c) == MaxPointsReason.NONE ?
|
||||
competitors.indexOf(c)+1 : competitors.size()+1):scores.get(c);
|
||||
@@ -159,7 +159,7 @@ public class ApplyScoresFromRaceLogTest extends LeaderboardScoringAndRankingTest
|
||||
f1RaceState.setFinishPositioningListChanged(now, results);
|
||||
final List<Competitor> rankedCompetitorsBeforeApplying = leaderboard.getCompetitorsFromBestToWorst(later);
|
||||
assertEquals(competitors, rankedCompetitorsBeforeApplying); // no effects of preliminary results list yet
|
||||
f1RaceState.setFinishPositioningConfirmed(now);
|
||||
f1RaceState.setFinishPositioningConfirmed(now, results);
|
||||
|
||||
assertScoreCorrections(leaderboard, f1Column, competitors.get(0), MaxPointsReason.DNF, 0, /* score is corrected */ false, later);
|
||||
assertScoreCorrections(leaderboard, f1Column, competitors.get(1), MaxPointsReason.OCS, 0, /* score is corrected */ false, later);
|
||||
@@ -201,7 +201,7 @@ public class ApplyScoresFromRaceLogTest extends LeaderboardScoringAndRankingTest
|
||||
f1RaceState.setFinishPositioningListChanged(now, results);
|
||||
final List<Competitor> rankedCompetitorsBeforeApplying = leaderboard.getCompetitorsFromBestToWorst(later);
|
||||
assertEquals(competitors, rankedCompetitorsBeforeApplying); // no effects of preliminary results list yet
|
||||
f1RaceState.setFinishPositioningConfirmed(now);
|
||||
f1RaceState.setFinishPositioningConfirmed(now, results);
|
||||
// validate that it arrived in leaderboard
|
||||
assertScoreCorrections(leaderboard, f1Column, competitors.get(0), MaxPointsReason.OCS, numberOfCompetitors+1, /* score is corrected */ false, later);
|
||||
assertScoreCorrections(leaderboard, f1Column, competitors.get(1), MaxPointsReason.OCS, numberOfCompetitors+1, /* score is corrected */ false, later);
|
||||
@@ -210,14 +210,14 @@ public class ApplyScoresFromRaceLogTest extends LeaderboardScoringAndRankingTest
|
||||
final CompetitorResults resultsWithOCSCleared = new CompetitorResultsImpl();
|
||||
setResultForCompetitor(competitors.get(1), /* one-based rank */ 0, resultsWithOCSCleared, MaxPointsReason.OCS, /* explicit score */ null);
|
||||
f1RaceState.setFinishPositioningListChanged(later, resultsWithOCSCleared);
|
||||
f1RaceState.setFinishPositioningConfirmed(later);
|
||||
f1RaceState.setFinishPositioningConfirmed(later, resultsWithOCSCleared);
|
||||
// validate that it did not get cleared in leaderboard (changed by bug 4167):
|
||||
assertScoreCorrections(leaderboard, f1Column, competitors.get(1), MaxPointsReason.OCS, numberOfCompetitors+1, /* score is corrected */ false, later);
|
||||
assertScoreCorrections(leaderboard, f1Column, competitors.get(0), MaxPointsReason.OCS, numberOfCompetitors+1, /* score is corrected */ false, later); // ranking first, one point in low-point scheme
|
||||
// now explicitly overwrite with a 0/null/null result, validating that this will clear the corrections for competitor 0:
|
||||
setResultForCompetitor(competitors.get(0), /* one-based rank */ 0, resultsWithOCSCleared, /* maxPointsReason */ null, /* explicit score */ null);
|
||||
f1RaceState.setFinishPositioningListChanged(yetLater, resultsWithOCSCleared);
|
||||
f1RaceState.setFinishPositioningConfirmed(yetLater);
|
||||
f1RaceState.setFinishPositioningConfirmed(yetLater, resultsWithOCSCleared);
|
||||
assertScoreCorrections(leaderboard, f1Column, competitors.get(1), MaxPointsReason.OCS, numberOfCompetitors+1, /* score is corrected */ false, yetLater);
|
||||
assertScoreCorrections(leaderboard, f1Column, competitors.get(0), MaxPointsReason.NONE, 1, /* score is corrected */ false, yetLater); // ranking first, one point in low-point scheme
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src/main/java"/>
|
||||
<classpathentry exported="true" kind="lib" path="WEB-INF/classes/"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
@@ -1,8 +1,12 @@
|
||||
#Thu Jan 19 09:59:11 CET 2012
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
||||
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.7
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
@@ -6,6 +6,7 @@ Bundle-Version: 1.0.0.qualifier
|
||||
Bundle-Vendor: SAP
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Web-ContextPath: /
|
||||
Import-Package: javax.servlet;version="2.6.0",
|
||||
javax.servlet.http;version="2.6.0"
|
||||
Import-Package: javax.servlet;version="3.1.0",
|
||||
javax.servlet.http;version="3.1.0"
|
||||
Bundle-ClassPath: WEB-INF/classes/
|
||||
Bundle-ActivationPolicy: lazy
|
||||
@@ -9,9 +9,18 @@
|
||||
<servlet-class>org.eclipse.jetty.servlet.DefaultServlet
|
||||
</servlet-class>
|
||||
<init-param>
|
||||
<param-name>useFileMappedBuffer</param-name>
|
||||
<param-value>false</param-value>
|
||||
</init-param>
|
||||
<param-name>useFileMappedBuffer</param-name>
|
||||
<param-value>false</param-value>
|
||||
</init-param>
|
||||
</servlet>
|
||||
|
||||
<filter>
|
||||
<filter-name>CORSFilter</filter-name>
|
||||
<filter-class>com.sap.sailing.www.CORSFilter</filter-class>
|
||||
</filter>
|
||||
|
||||
<filter-mapping>
|
||||
<filter-name>CORSFilter</filter-name>
|
||||
<url-pattern>/fonts/*</url-pattern>
|
||||
</filter-mapping>
|
||||
</web-app>
|
||||
@@ -1,3 +1,5 @@
|
||||
source.WEB-INF/classes/ = src/main/java
|
||||
output.WEB-INF/classes/ = bin
|
||||
bin.includes = META-INF/,\
|
||||
WEB-INF/web.xml,\
|
||||
index.html,\
|
||||
@@ -18,4 +20,6 @@ bin.includes = META-INF/,\
|
||||
EULA_Android_BuoyPinger.html,\
|
||||
EULA_Android_SailingBoatTracker.html,\
|
||||
EULA_Android_SailingRaceManager.html,\
|
||||
EULA_iOS_SailingBoatTracker.html
|
||||
EULA_iOS_SailingBoatTracker.html
|
||||
output.. = WEB-INF/classes/
|
||||
jre.compilation.profile = JavaSE-1.8
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.sap.sailing.www;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.FilterConfig;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
public class CORSFilter implements Filter {
|
||||
|
||||
@Override
|
||||
public void init(FilterConfig filterConfig) throws ServletException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
|
||||
throws IOException, ServletException {
|
||||
final HttpServletResponse httpResponse = (HttpServletResponse) response;
|
||||
httpResponse.setHeader("Access-Control-Allow-Origin", "*");
|
||||
chain.doFilter(request, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,8 @@ import com.sap.sse.common.NamedWithID;
|
||||
import com.sap.sse.common.WithID;
|
||||
import com.sap.sse.security.shared.Account;
|
||||
import com.sap.sse.security.shared.Account.AccountType;
|
||||
import com.sap.sse.security.shared.PermissionsForRoleProvider;
|
||||
import com.sap.sse.security.shared.WildcardPermission;
|
||||
|
||||
public class User implements NamedWithID {
|
||||
private static final long serialVersionUID = 1788215575606546042L;
|
||||
@@ -269,4 +271,21 @@ public class User implements NamedWithID {
|
||||
return validationSecret;
|
||||
}
|
||||
|
||||
public boolean hasPermission(String stringPermission, PermissionsForRoleProvider provider) {
|
||||
WildcardPermission requested = new WildcardPermission(stringPermission);
|
||||
for (String permission : getPermissions()) {
|
||||
if (new WildcardPermission(permission).implies(requested)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
for (String role : getRoles()) {
|
||||
for (String permission : provider.getPermissions(role)) {
|
||||
if (new WildcardPermission(permission).implies(requested)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
After Width: | Height: | Size: 410 B |
|
After Width: | Height: | Size: 479 B |
|
After Width: | Height: | Size: 611 B |
|
After Width: | Height: | Size: 698 B |
|
After Width: | Height: | Size: 811 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 335 B |
|
After Width: | Height: | Size: 377 B |
|
After Width: | Height: | Size: 479 B |
|
After Width: | Height: | Size: 533 B |
|
After Width: | Height: | Size: 682 B |
|
After Width: | Height: | Size: 811 B |
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:drawable="@drawable/ic_warning_red_36dp" />
|
||||
|
||||
</selector>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:drawable="@drawable/ic_warning_red_24dp" />
|
||||
|
||||
</selector>
|
||||
|
After Width: | Height: | Size: 479 B |
|
After Width: | Height: | Size: 533 B |
|
After Width: | Height: | Size: 698 B |
|
After Width: | Height: | Size: 811 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 611 B |
|
After Width: | Height: | Size: 698 B |
|
After Width: | Height: | Size: 893 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 698 B |
|
After Width: | Height: | Size: 811 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:drawable="@drawable/ic_warning_red_24dp" />
|
||||
|
||||
</selector>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:drawable="@drawable/ic_warning_red_18dp" />
|
||||
|
||||
</selector>
|
||||
@@ -65,7 +65,7 @@
|
||||
android:layout_alignRight="@id/panel_image"
|
||||
android:visibility="gone"
|
||||
tools:src="@drawable/ic_warning_yellow"
|
||||
tools:visibility="gone" />
|
||||
tools:visibility="visible" />
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
|
||||
@@ -31,7 +31,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@drawable/ic_warning_yellow"
|
||||
android:visibility="gone"/>
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
|
||||
@@ -70,9 +70,10 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:visibility="gone"
|
||||
android:layout_margin="2dp"
|
||||
android:src="@drawable/ic_warning_yellow" />
|
||||
android:src="@drawable/ic_warning_yellow"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
|
||||
@@ -117,6 +117,7 @@
|
||||
<fragment
|
||||
class="com.sap.sailing.racecommittee.app.ui.fragments.DemoOverlayFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
android:layout_height="match_parent"
|
||||
tools:ignore="MissingId" />
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -1,20 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/race_panel_setup"
|
||||
android:layout_width="@dimen/side_button"
|
||||
android:layout_height="match_parent"/>
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/race_panel_flags"
|
||||
android:layout_width="@dimen/side_button"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"/>
|
||||
android:layout_alignParentRight="true" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -28,28 +28,29 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"/>
|
||||
android:orientation="vertical" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/race_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="3"/>
|
||||
android:layout_weight="3" />
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/race_panel_extra"
|
||||
android:layout_width="@dimen/side_button"
|
||||
android:layout_height="@dimen/side_button"/>
|
||||
android:layout_height="@dimen/side_button" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/protest_time_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/demo_overlay_fragment"
|
||||
class="com.sap.sailing.racecommittee.app.ui.fragments.DemoOverlayFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
android:layout_height="match_parent"
|
||||
tools:ignore="MissingId" />
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -25,6 +25,14 @@
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/item_merge_state"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:paddingRight="6dp"
|
||||
tools:src="@drawable/ic_warning_red" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_penalty"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -42,6 +50,7 @@
|
||||
android:id="@+id/item_edit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:src="?attr/create" />
|
||||
</LinearLayout>
|
||||
|
||||
@@ -54,6 +63,8 @@
|
||||
android:layout_marginLeft="24dp"
|
||||
android:layout_toLeftOf="@id/item_right"
|
||||
android:layout_toRightOf="@id/item_check"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="3"
|
||||
tools:text="ABD 1234 - Angel Dunn" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
@@ -1,11 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="24dp"
|
||||
android:paddingRight="24dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/competitor_warning_message"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableLeft="@drawable/ic_warning_red"
|
||||
android:gravity="center"
|
||||
android:text="@string/competitor_merge_error_message"
|
||||
android:textColor="@color/dialog_color_text" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/competitor_position_layout"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -1,11 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="24dp"
|
||||
android:paddingRight="24dp">
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="24dp"
|
||||
android:paddingRight="24dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/competitor_warning_message"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableLeft="@drawable/ic_warning_red"
|
||||
android:gravity="center"
|
||||
android:text="@string/competitor_merge_error_message"
|
||||
android:textColor="@color/dialog_color_text" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/competitor_position_layout"
|
||||
@@ -20,14 +39,14 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="8dp"
|
||||
android:text="@string/position"
|
||||
android:textColor="@color/dialog_color_text"/>
|
||||
android:textColor="@color/dialog_color_text" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/competitor_position"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/spinner_background_light"
|
||||
android:spinnerMode="dropdown"/>
|
||||
android:spinnerMode="dropdown" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
@@ -43,14 +62,14 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="8dp"
|
||||
android:text="@string/penalty"
|
||||
android:textColor="@color/dialog_color_text"/>
|
||||
android:textColor="@color/dialog_color_text" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/competitor_penalty"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/spinner_background_light"
|
||||
android:spinnerMode="dropdown"/>
|
||||
android:spinnerMode="dropdown" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
@@ -72,7 +91,7 @@
|
||||
android:hint="@string/score"
|
||||
android:inputType="numberDecimal"
|
||||
android:textColor="?attr/white"
|
||||
android:textColorHint="@color/dialog_color_text"/>
|
||||
android:textColorHint="@color/dialog_color_text" />
|
||||
</com.sap.sailing.racecommittee.app.ui.layouts.FloatLabelLayout>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -90,7 +109,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="8dp"
|
||||
android:text="@string/finishing_time"
|
||||
android:textColor="@color/dialog_color_text"/>
|
||||
android:textColor="@color/dialog_color_text" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/competitor_finish_time_input"
|
||||
@@ -157,7 +176,7 @@
|
||||
android:hint="@string/comment"
|
||||
android:inputType="text"
|
||||
android:textColor="?attr/white"
|
||||
android:textColorHint="@color/dialog_color_text"/>
|
||||
android:textColorHint="@color/dialog_color_text" />
|
||||
</com.sap.sailing.racecommittee.app.ui.layouts.FloatLabelLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
@@ -29,20 +29,35 @@
|
||||
android:layout_weight="12"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_penalty"
|
||||
<LinearLayout
|
||||
android:id="@+id/penalty_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginRight="16dp"
|
||||
android:background="@drawable/penalty_text_background"
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="4dp"
|
||||
android:paddingLeft="6dp"
|
||||
android:paddingRight="6dp"
|
||||
android:paddingTop="4dp"
|
||||
tools:text="OCS" />
|
||||
android:paddingTop="4dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/warning_sign"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="6dp"
|
||||
android:paddingRight="6dp"
|
||||
tools:src="@drawable/ic_warning_red" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_penalty"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginRight="16dp"
|
||||
android:background="@drawable/penalty_text_background"
|
||||
android:paddingLeft="6dp"
|
||||
android:paddingRight="6dp"
|
||||
tools:text="OCS" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/vessel_id"
|
||||
@@ -58,7 +73,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toLeftOf="@id/item_penalty"
|
||||
android:layout_toLeftOf="@id/penalty_layout"
|
||||
android:layout_toRightOf="@id/vessel_id"
|
||||
android:padding="5dp"
|
||||
android:singleLine="true"
|
||||
|
||||
@@ -529,9 +529,14 @@
|
||||
<string name="publish_clicked">Ergebnisliste veröffentlicht</string>
|
||||
<string name="competitor_count">%d</string>
|
||||
|
||||
<string name="refresh_title">Datenänderung</string>
|
||||
<string name="refresh_message">Die Daten der folgenden Teilnehmer haben sich geändert. Bitte überprüfen:\n\n%s</string>
|
||||
<string name="refresh_positive">@android:string/ok</string>
|
||||
<string name="hello_call_error_title">Keine Verbindung zu SAP</string>
|
||||
<string name="hello_call_error_message">Die App konnte keine Verbindung zu SAP Sailing hergestellt.\nPrüfen Sie bitte, ob Sie eine stabile Mobilfunkverbindung haben.\nWollen Sie es erneut versuchen?</string>
|
||||
<string name="hello_call_error_positive">Wiederholen</string>
|
||||
<string name="hello_call_error_negative">Beenden</string>
|
||||
|
||||
<string name="competitor_merge_error_message">Dieser Teilnehmer wurde an einem anderen Gerät verändert und hat überschneidende Änderungen. Bitte stellen Sie sicher, dass die Daten korrekt sind.</string>
|
||||
|
||||
</resources>
|
||||
@@ -558,9 +558,14 @@
|
||||
<string name="publish_clicked">Results published</string>
|
||||
<string name="competitor_count">%d</string>
|
||||
|
||||
<string name="refresh_title">Data changed</string>
|
||||
<string name="refresh_message">The data of following competitors has changed. Please review:\n\n%s</string>
|
||||
<string name="refresh_positive">@android:string/ok</string>
|
||||
<string name="hello_call_error_title">Can\'t connect to SAP</string>
|
||||
<string name="hello_call_error_message">The App couldn\'t establish a connection to SAP Sailing.\nPlease check if you have a stable mobile connection.\nDo you want to retry?</string>
|
||||
<string name="hello_call_error_positive">Retry</string>
|
||||
<string name="hello_call_error_negative">Exit</string>
|
||||
|
||||
<string name="competitor_merge_error_message">This competitor was changed from another device and you have changed the same data. Please be sure, that this data is correct now.</string>
|
||||
|
||||
</resources>
|
||||
@@ -119,6 +119,17 @@ public class CompetitorResultEditableImpl implements CompetitorResult {
|
||||
this.mMergeState = mergeState;
|
||||
}
|
||||
|
||||
public void setValue(CompetitorResult result) {
|
||||
mCompetitorId = result.getCompetitorId();
|
||||
mCompetitorDisplayName = result.getCompetitorDisplayName();
|
||||
mOneBasedRank = result.getOneBasedRank();
|
||||
mMaxPointsReason = result.getMaxPointsReason();
|
||||
mScore = result.getScore();
|
||||
mFinishingTime = result.getFinishingTime();
|
||||
mComment = result.getComment();
|
||||
mMergeState = result.getMergeState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o)
|
||||
|
||||
@@ -440,6 +440,12 @@ public class RacingActivity extends SessionActivity implements RaceListCallbacks
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
ExLog.i(RacingActivity.this, LogEvent.RACE_RESET_YES, mSelectedRace.getId());
|
||||
ExLog.w(RacingActivity.this, TAG, String.format("Race %s is selected for reset.", mSelectedRace.getId()));
|
||||
Fragment fragment = getFragmentManager().findFragmentById(R.id.race_content);
|
||||
if (fragment != null) {
|
||||
FragmentTransaction transaction = getFragmentManager().beginTransaction();
|
||||
transaction.remove(fragment);
|
||||
transaction.commit();
|
||||
}
|
||||
mSelectedRace.getState().setAdvancePass(MillisecondsTimePoint.now());
|
||||
}
|
||||
});
|
||||
|
||||
@@ -14,10 +14,12 @@ import com.sap.sailing.racecommittee.app.utils.ThemeHelper;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v4.view.ViewCompat;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class FinishListAdapter extends BaseDraggableSwipeAdapter<FinishListAdapter.ViewHolder> {
|
||||
@@ -61,6 +63,21 @@ public class FinishListAdapter extends BaseDraggableSwipeAdapter<FinishListAdapt
|
||||
}
|
||||
holder.container.setBackgroundColor(bgColor);
|
||||
}
|
||||
Drawable warning;
|
||||
switch (item.getMergeState()) {
|
||||
case ERROR:
|
||||
warning = ContextCompat.getDrawable(mContext, R.drawable.ic_warning_red);
|
||||
break;
|
||||
|
||||
case WARNING:
|
||||
warning = ContextCompat.getDrawable(mContext, R.drawable.ic_warning_yellow);
|
||||
break;
|
||||
|
||||
default:
|
||||
warning = null;
|
||||
break;
|
||||
}
|
||||
holder.warning.setImageDrawable(warning);
|
||||
holder.penalty.setText(item.getMaxPointsReason().name());
|
||||
holder.penalty.setVisibility(item.getMaxPointsReason().equals(MaxPointsReason.NONE) ? View.GONE : View.VISIBLE);
|
||||
int bgId = R.attr.sap_gray_black_30;
|
||||
@@ -172,6 +189,10 @@ public class FinishListAdapter extends BaseDraggableSwipeAdapter<FinishListAdapt
|
||||
}
|
||||
}
|
||||
|
||||
public int getFirstRankZeroPosition() {
|
||||
return mCompetitor.getFirstRankZeroPosition();
|
||||
}
|
||||
|
||||
public interface FinishEvents {
|
||||
void onItemMove(int fromPosition, int toPosition);
|
||||
|
||||
@@ -189,6 +210,7 @@ public class FinishListAdapter extends BaseDraggableSwipeAdapter<FinishListAdapt
|
||||
TextView position;
|
||||
TextView vesselId;
|
||||
TextView competitor;
|
||||
ImageView warning;
|
||||
TextView penalty;
|
||||
|
||||
public ViewHolder(View itemView) {
|
||||
@@ -210,6 +232,7 @@ public class FinishListAdapter extends BaseDraggableSwipeAdapter<FinishListAdapt
|
||||
}
|
||||
vesselId = ViewHelper.get(itemView, R.id.vessel_id);
|
||||
competitor = ViewHelper.get(itemView, R.id.competitor);
|
||||
warning = ViewHelper.get(itemView, R.id.warning_sign);
|
||||
penalty = ViewHelper.get(itemView, R.id.item_penalty);
|
||||
position = ViewHelper.get(itemView, R.id.position);
|
||||
if (position != null) {
|
||||
@@ -230,8 +253,4 @@ public class FinishListAdapter extends BaseDraggableSwipeAdapter<FinishListAdapt
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public int getFirstRankZeroPosition() {
|
||||
return mCompetitor.getFirstRankZeroPosition();
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,9 @@ import com.sap.sse.common.Util;
|
||||
import com.sap.sse.common.util.NaturalComparator;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -23,6 +25,7 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class PenaltyAdapter extends RecyclerView.Adapter<PenaltyAdapter.ViewHolder> {
|
||||
@@ -81,6 +84,21 @@ public class PenaltyAdapter extends RecyclerView.Adapter<PenaltyAdapter.ViewHold
|
||||
}
|
||||
}
|
||||
});
|
||||
Drawable mergeIcon;
|
||||
switch (item.getMergeState()) {
|
||||
case WARNING:
|
||||
mergeIcon = ContextCompat.getDrawable(mContext, R.drawable.ic_warning_yellow);
|
||||
break;
|
||||
|
||||
case ERROR:
|
||||
mergeIcon = ContextCompat.getDrawable(mContext, R.drawable.ic_warning_red);
|
||||
break;
|
||||
|
||||
default:
|
||||
mergeIcon = null;
|
||||
break;
|
||||
}
|
||||
holder.mItemMergeState.setImageDrawable(mergeIcon);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -195,6 +213,7 @@ public class PenaltyAdapter extends RecyclerView.Adapter<PenaltyAdapter.ViewHold
|
||||
private TextView mItemText;
|
||||
private TextView mItemPenalty;
|
||||
private View mItemEdit;
|
||||
private ImageView mItemMergeState;
|
||||
|
||||
public ViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
@@ -203,6 +222,7 @@ public class PenaltyAdapter extends RecyclerView.Adapter<PenaltyAdapter.ViewHold
|
||||
mItemText = ViewHelper.get(itemView, R.id.item_text);
|
||||
mItemPenalty = ViewHelper.get(itemView, R.id.item_penalty);
|
||||
mItemEdit = ViewHelper.get(itemView, R.id.item_edit);
|
||||
mItemMergeState = ViewHelper.get(itemView, R.id.item_merge_state);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -93,7 +93,10 @@ public class ManagedRaceListAdapter extends ArrayAdapter<RaceListDataType> imple
|
||||
for (final ManagedRace race : mAllRaces) {
|
||||
viewItemsRaces.put(race, new RaceListDataTypeRace(race, mInflater));
|
||||
final SeriesBase series = race.getSeries();
|
||||
boolean hasConflict = race.getState().getConfirmedFinishPositioningList() != null && race.getState().getConfirmedFinishPositioningList().hasConflicts();
|
||||
RaceState state = race.getState();
|
||||
boolean draft = state.getFinishPositioningList() != null && state.getFinishPositioningList().hasConflicts();
|
||||
boolean confirmed = state.getConfirmedFinishPositioningList() != null && state.getConfirmedFinishPositioningList().hasConflicts();
|
||||
boolean hasConflict = draft || confirmed;
|
||||
if (!viewItemsSeriesHeaders.containsKey(series)) {
|
||||
viewItemsSeriesHeaders.put(series, new RaceListDataTypeHeader(new RaceGroupSeries(race), mInflater, hasConflict));
|
||||
} else {
|
||||
@@ -200,10 +203,9 @@ public class ManagedRaceListAdapter extends ArrayAdapter<RaceListDataType> imple
|
||||
holder.race_name.setText(RaceHelper.getReverseRaceFleetName(race.getRace()));
|
||||
RaceState state = race.getRace().getState();
|
||||
if (state != null) {
|
||||
CompetitorResults results = state.getConfirmedFinishPositioningList();
|
||||
if (results != null) {
|
||||
holder.warning_sign.setVisibility(results.hasConflicts() ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
CompetitorResults draft = state.getFinishPositioningList();
|
||||
CompetitorResults confirmed = state.getConfirmedFinishPositioningList();
|
||||
holder.warning_sign.setVisibility(((draft != null && draft.hasConflicts()) || confirmed != null && confirmed.hasConflicts()) ? View.VISIBLE : View.GONE);
|
||||
if (state.getStartTime() != null) {
|
||||
int startRes = R.string.race_started;
|
||||
if (state.getFinishedTime() == null) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.sap.sailing.racecommittee.app.ui.fragments;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
@@ -378,8 +379,8 @@ public class LoginBackdrop extends Fragment implements BackPressListener {
|
||||
server = null;
|
||||
if (exception instanceof UnauthorizedException) { // wrong credentials (access token)
|
||||
server = exception.getMessage().split("=")[1];
|
||||
}
|
||||
if (exception instanceof IOException) { // connection error
|
||||
BroadcastManager.getInstance(getActivity()).addIntent(new Intent(AppConstants.INTENT_ACTION_SHOW_LOGIN));
|
||||
} else if (exception instanceof IOException && !(exception instanceof FileNotFoundException)) { // connection error
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(), R.style.AppTheme_AlertDialog);
|
||||
builder.setTitle(R.string.hello_call_error_title);
|
||||
builder.setMessage(R.string.hello_call_error_message);
|
||||
@@ -397,8 +398,6 @@ public class LoginBackdrop extends Fragment implements BackPressListener {
|
||||
});
|
||||
builder.setCancelable(false);
|
||||
builder.show();
|
||||
} else { // unknown error -> show user credential input
|
||||
BroadcastManager.getInstance(getActivity()).addIntent(new Intent(AppConstants.INTENT_ACTION_SHOW_LOGIN));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,21 +91,42 @@ public class RaceListFragment extends LoggableFragment implements OnItemClickLis
|
||||
private final Set<ManagedRace> mAllRaces;
|
||||
|
||||
private BaseRaceStateChangedListener stateListener = new BaseRaceStateChangedListener() {
|
||||
|
||||
@Override
|
||||
public void onFinishingPositioningsChanged(ReadonlyRaceState state) {
|
||||
super.onFinishingPositioningsChanged(state);
|
||||
|
||||
update(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinishingPositionsConfirmed(ReadonlyRaceState state) {
|
||||
super.onFinishingPositionsConfirmed(state);
|
||||
|
||||
update(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartTimeChanged(ReadonlyRaceState state) {
|
||||
super.onStartTimeChanged(state);
|
||||
|
||||
update(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStatusChanged(ReadonlyRaceState state) {
|
||||
super.onStatusChanged(state);
|
||||
|
||||
update(state);
|
||||
}
|
||||
|
||||
public void update(ReadonlyRaceState state) {
|
||||
void update(ReadonlyRaceState state) {
|
||||
dataChanged(state);
|
||||
filterChanged();
|
||||
updateConflictSign();
|
||||
}
|
||||
};
|
||||
|
||||
public RaceListFragment() {
|
||||
mFilterMode = FilterMode.ACTIVE;
|
||||
mSelectedRace = null;
|
||||
@@ -424,10 +445,10 @@ public class RaceListFragment extends LoggableFragment implements OnItemClickLis
|
||||
mAdapter.onRacesChanged();
|
||||
mAdapter.notifyDataSetChanged();
|
||||
filterChanged();
|
||||
showConflictSign();
|
||||
updateConflictSign();
|
||||
}
|
||||
|
||||
private void showConflictSign() {
|
||||
private void updateConflictSign() {
|
||||
boolean showSign = false;
|
||||
for (ManagedRace race : mAllRaces) {
|
||||
CompetitorResults results = race.getState().getFinishPositioningList();
|
||||
|
||||
@@ -247,10 +247,9 @@ public class TimePanelFragment extends BasePanelFragment {
|
||||
}
|
||||
|
||||
private void checkWarnings(ReadonlyRaceState state) {
|
||||
CompetitorResults results = state.getConfirmedFinishPositioningList();
|
||||
if (results != null) {
|
||||
mCompetitorList.showAdditionalImage(results.hasConflicts());
|
||||
}
|
||||
CompetitorResults draft = state.getFinishPositioningList();
|
||||
CompetitorResults confirmed = state.getConfirmedFinishPositioningList();
|
||||
mCompetitorList.showAdditionalImage((draft != null && draft.hasConflicts()) || (confirmed != null && confirmed.hasConflicts()));
|
||||
}
|
||||
|
||||
private class RaceStateChangedListener extends BaseRaceStateChangedListener {
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
package com.sap.sailing.racecommittee.app.ui.fragments.raceinfo;
|
||||
|
||||
import android.app.FragmentTransaction;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.IdRes;
|
||||
|
||||
import com.sap.sailing.android.shared.util.AppUtils;
|
||||
import com.sap.sailing.android.shared.util.BroadcastManager;
|
||||
import com.sap.sailing.domain.abstractlog.race.state.ReadonlyRaceState;
|
||||
@@ -12,7 +7,6 @@ import com.sap.sailing.domain.abstractlog.race.state.impl.BaseRaceStateChangedLi
|
||||
import com.sap.sailing.domain.abstractlog.race.state.racingprocedure.RacingProcedure;
|
||||
import com.sap.sailing.domain.abstractlog.race.state.racingprocedure.ReadonlyRacingProcedure;
|
||||
import com.sap.sailing.domain.abstractlog.race.state.racingprocedure.impl.BaseRacingProcedureChangedListener;
|
||||
import com.sap.sailing.domain.common.racelog.RaceLogRaceStatus;
|
||||
import com.sap.sailing.racecommittee.app.AppConstants;
|
||||
import com.sap.sailing.racecommittee.app.R;
|
||||
import com.sap.sailing.racecommittee.app.ui.activities.RacingActivity;
|
||||
@@ -21,6 +15,11 @@ import com.sap.sailing.racecommittee.app.ui.fragments.panels.FlagPanelFragment;
|
||||
import com.sap.sailing.racecommittee.app.ui.fragments.panels.SetupPanelFragment;
|
||||
import com.sap.sailing.racecommittee.app.ui.fragments.panels.TimePanelFragment;
|
||||
|
||||
import android.app.FragmentTransaction;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.IdRes;
|
||||
|
||||
public abstract class BaseRaceInfoRaceFragment<ProcedureType extends RacingProcedure> extends RaceFragment {
|
||||
|
||||
private final RaceStateChangedListener mRaceStateChangedListener;
|
||||
@@ -107,6 +106,9 @@ public abstract class BaseRaceInfoRaceFragment<ProcedureType extends RacingProce
|
||||
}
|
||||
break;
|
||||
|
||||
case RUNNING:
|
||||
break;
|
||||
|
||||
default:
|
||||
showMainContent();
|
||||
break;
|
||||
@@ -143,8 +145,14 @@ public abstract class BaseRaceInfoRaceFragment<ProcedureType extends RacingProce
|
||||
|
||||
setupUi();
|
||||
|
||||
if (getRaceState().getStatus() == RaceLogRaceStatus.SCHEDULED) {
|
||||
showMainContent();
|
||||
switch (getRaceState().getStatus()) {
|
||||
case SCHEDULED:
|
||||
showMainContent();
|
||||
break;
|
||||
|
||||
default:
|
||||
// nothing
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
package com.sap.sailing.racecommittee.app.ui.fragments.raceinfo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.sap.sailing.android.shared.logging.ExLog;
|
||||
@@ -19,6 +22,8 @@ import com.sap.sailing.domain.abstractlog.race.CompetitorResult.MergeState;
|
||||
import com.sap.sailing.domain.abstractlog.race.CompetitorResults;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.CompetitorResultImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.CompetitorResultsImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.state.ReadonlyRaceState;
|
||||
import com.sap.sailing.domain.abstractlog.race.state.impl.BaseRaceStateChangedListener;
|
||||
import com.sap.sailing.domain.abstractlog.race.state.racingprocedure.RacingProcedure;
|
||||
import com.sap.sailing.domain.abstractlog.race.state.racingprocedure.line.ConfigurableStartModeFlagRacingProcedure;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
@@ -88,11 +93,12 @@ public class PenaltyFragment extends BaseFragment implements PopupMenu.OnMenuIte
|
||||
private PenaltyAdapter mAdapter;
|
||||
private TextView mEntryCount;
|
||||
private CompetitorResultsList<CompetitorResultEditableImpl> mCompetitorResults;
|
||||
private CompetitorResultsList<CompetitorResultEditableImpl> mLastSend;
|
||||
private CompetitorResults mLastPublished;
|
||||
private CompetitorResults mDraftData;
|
||||
private CompetitorResults mConfirmedData;
|
||||
private View mListButtonLayout;
|
||||
private ImageView mListButton;
|
||||
private HeaderLayout mHeader;
|
||||
private StateChangeListener mStateChangeListener;
|
||||
|
||||
public static PenaltyFragment newInstance() {
|
||||
Bundle args = new Bundle();
|
||||
@@ -106,9 +112,12 @@ public class PenaltyFragment extends BaseFragment implements PopupMenu.OnMenuIte
|
||||
@TargetApi(Build.VERSION_CODES.KITKAT)
|
||||
public View onCreateView(final LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
|
||||
View layout = inflater.inflate(R.layout.race_penalty_fragment, container, false);
|
||||
|
||||
mStateChangeListener = new StateChangeListener(this);
|
||||
|
||||
mCompetitorResults = new CompetitorResultsList<>(new ArrayList<CompetitorResultEditableImpl>());
|
||||
mLastSend = new CompetitorResultsList<>(new ArrayList<CompetitorResultEditableImpl>());
|
||||
mLastPublished = new CompetitorResultsImpl();
|
||||
mDraftData = new CompetitorResultsImpl();
|
||||
mConfirmedData = new CompetitorResultsImpl();
|
||||
SearchView searchView = ViewHelper.get(layout, R.id.competitor_search);
|
||||
if (searchView != null) {
|
||||
searchView.setSearchTextWatcher(this);
|
||||
@@ -119,6 +128,7 @@ public class PenaltyFragment extends BaseFragment implements PopupMenu.OnMenuIte
|
||||
mListButtonLayout.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
sendUnconfirmed();
|
||||
RaceFragment fragment = TrackingListFragment.newInstance(new Bundle(), 1);
|
||||
int viewId = R.id.race_content;
|
||||
switch (getRaceState().getStatus()) {
|
||||
@@ -190,11 +200,10 @@ public class PenaltyFragment extends BaseFragment implements PopupMenu.OnMenuIte
|
||||
mPublishButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
confirmData();
|
||||
sendConfirmed();
|
||||
}
|
||||
});
|
||||
}
|
||||
setPublishButton();
|
||||
mEntryCount = ViewHelper.get(layout, R.id.competitor_entry_count);
|
||||
mAdapter = new PenaltyAdapter(getActivity(), this);
|
||||
RecyclerView recyclerView = ViewHelper.get(layout, R.id.competitor_list);
|
||||
@@ -208,6 +217,7 @@ public class PenaltyFragment extends BaseFragment implements PopupMenu.OnMenuIte
|
||||
private void setReason(String reason) {
|
||||
for (CompetitorResultEditableImpl item : mCompetitorResults) {
|
||||
if (item.isChecked()) {
|
||||
item.setMergeState(MergeState.OK);
|
||||
item.setMaxPointsReason(MaxPointsReason.valueOf(reason));
|
||||
item.setChecked(false);
|
||||
item.setDirty(true);
|
||||
@@ -220,6 +230,7 @@ public class PenaltyFragment extends BaseFragment implements PopupMenu.OnMenuIte
|
||||
@Override
|
||||
public void onActivityCreated(Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
|
||||
if (mPenaltyDropDown != null) {
|
||||
int selection = mPenaltyAdapter.getPosition(MaxPointsReason.OCS.name());
|
||||
RacingProcedure procedure = getRaceState().getRacingProcedure();
|
||||
@@ -273,25 +284,40 @@ public class PenaltyFragment extends BaseFragment implements PopupMenu.OnMenuIte
|
||||
mListButtonLayout.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
initLocalData();
|
||||
loadCompetitors();
|
||||
}
|
||||
|
||||
private void initLocalData() {
|
||||
mDraftData.clear();
|
||||
if (getRaceState().getFinishPositioningList() != null) {
|
||||
for (CompetitorResult item : getRaceState().getFinishPositioningList()) {
|
||||
mLastSend.add(new CompetitorResultEditableImpl(item));
|
||||
mDraftData.add(new CompetitorResultImpl(item.getCompetitorId(), item.getCompetitorDisplayName(), item.getOneBasedRank(), item
|
||||
.getMaxPointsReason(), item.getScore(), item.getFinishingTime(), item.getComment(), item.getMergeState()));
|
||||
}
|
||||
}
|
||||
|
||||
initConfirmedData();
|
||||
}
|
||||
|
||||
private void initConfirmedData() {
|
||||
mConfirmedData.clear();
|
||||
if (getRaceState().getConfirmedFinishPositioningList() != null) {
|
||||
for (CompetitorResult item : getRaceState().getConfirmedFinishPositioningList()) {
|
||||
mLastPublished.add(new CompetitorResultImpl(item.getCompetitorId(), item.getCompetitorDisplayName(), item.getOneBasedRank(), item
|
||||
.getMaxPointsReason(), item.getScore(), item.getFinishingTime(), item.getComment(), MergeState.OK)); // TODO handle merge state
|
||||
mConfirmedData.add(new CompetitorResultImpl(item.getCompetitorId(), item.getCompetitorDisplayName(), item.getOneBasedRank(), item
|
||||
.getMaxPointsReason(), item.getScore(), item.getFinishingTime(), item.getComment(), item.getMergeState()));
|
||||
}
|
||||
}
|
||||
loadCompetitors();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
|
||||
if (getRace() != null && getRaceState() != null) {
|
||||
getRaceState().addChangedListener(mStateChangeListener);
|
||||
}
|
||||
|
||||
Intent intent = new Intent(AppConstants.INTENT_ACTION_ON_LIFECYCLE);
|
||||
intent.putExtra(AppConstants.INTENT_ACTION_EXTRA_LIFECYCLE, AppConstants.INTENT_ACTION_EXTRA_START);
|
||||
intent.putExtra(AppConstants.INTENT_ACTION_EXTRA, AppConstants.INTENT_ACTION_TOGGLE_COMPETITOR);
|
||||
@@ -302,6 +328,10 @@ public class PenaltyFragment extends BaseFragment implements PopupMenu.OnMenuIte
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
|
||||
if (getRace() != null && getRaceState() != null) {
|
||||
getRaceState().removeChangedListener(mStateChangeListener);
|
||||
}
|
||||
|
||||
boolean dirty = false;
|
||||
for (CompetitorResultEditableImpl item : mCompetitorResults) {
|
||||
if (item.isDirty()) {
|
||||
@@ -320,18 +350,18 @@ public class PenaltyFragment extends BaseFragment implements PopupMenu.OnMenuIte
|
||||
}
|
||||
|
||||
private void sendUnconfirmed() {
|
||||
CompetitorResults results = getCompetitorResultsDiff();
|
||||
getRaceState().setFinishPositioningListChanged(MillisecondsTimePoint.now(), results);
|
||||
for (CompetitorResultEditableImpl item : mCompetitorResults) {
|
||||
item.setDirty(false);
|
||||
CompetitorResultsImpl results = getCompetitorResultsDiff(mDraftData);
|
||||
if (results.size() > 0) {
|
||||
getRaceState().setFinishPositioningListChanged(MillisecondsTimePoint.now(), results);
|
||||
}
|
||||
}
|
||||
|
||||
private void confirmData() {
|
||||
sendUnconfirmed();
|
||||
getRaceState().setFinishPositioningConfirmed(MillisecondsTimePoint.now());
|
||||
private void sendConfirmed() {
|
||||
CompetitorResultsImpl results = getCompetitorResultsDiff(mDraftData);
|
||||
getRaceState().setFinishPositioningConfirmed(MillisecondsTimePoint.now(), results);
|
||||
Toast.makeText(getActivity(), R.string.publish_clicked, Toast.LENGTH_SHORT).show();
|
||||
loadCompetitors();
|
||||
initLocalData();
|
||||
setPublishButton();
|
||||
}
|
||||
|
||||
private String[] getAllMaxPointsReasons() {
|
||||
@@ -393,7 +423,7 @@ public class PenaltyFragment extends BaseFragment implements PopupMenu.OnMenuIte
|
||||
}
|
||||
name += " - " + item.getName();
|
||||
CompetitorResult result = new CompetitorResultImpl(item.getId(), name, 0, MaxPointsReason.NONE,
|
||||
/* score */ null, /* finishingTime */ null, /* comment */ null, MergeState.OK); // TODO handle merge state
|
||||
/* score */ null, /* finishingTime */ null, /* comment */ null, MergeState.OK);
|
||||
mCompetitorResults.add(new CompetitorResultEditableImpl(result));
|
||||
}
|
||||
if (getRaceState() != null && getRaceState().getFinishPositioningList() != null) { // mix with finish position list
|
||||
@@ -466,18 +496,152 @@ public class PenaltyFragment extends BaseFragment implements PopupMenu.OnMenuIte
|
||||
setPublishButton();
|
||||
}
|
||||
|
||||
private void mergeData(CompetitorResults results, boolean checkDirty) {
|
||||
Map<Serializable, String> changedCompetitor = new HashMap<>();
|
||||
for (CompetitorResult result : results) {
|
||||
CompetitorResultEditableImpl item = null;
|
||||
CompetitorResult draft = null;
|
||||
for (CompetitorResultEditableImpl edited : mCompetitorResults) {
|
||||
if (result.getCompetitorId().equals(edited.getCompetitorId())) {
|
||||
item = edited;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (CompetitorResult saved : mDraftData) {
|
||||
if (result.getCompetitorId().equals(saved.getCompetitorId())) {
|
||||
draft = saved;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (item != null) { // result is in list
|
||||
if (checkDirty & item.isDirty()) {
|
||||
// check max point reason
|
||||
if (!item.getMaxPointsReason().equals(result.getMaxPointsReason())) {
|
||||
if (draft != null) {
|
||||
if (item.getMaxPointsReason().equals(draft.getMaxPointsReason())) {
|
||||
setMergeState(item, MergeState.WARNING);
|
||||
} else {
|
||||
setMergeState(item, MergeState.ERROR);
|
||||
}
|
||||
} else {
|
||||
setMergeState(item, MergeState.ERROR);
|
||||
}
|
||||
item.setMaxPointsReason(result.getMaxPointsReason());
|
||||
changedCompetitor.put(item.getCompetitorId(), item.getCompetitorDisplayName());
|
||||
}
|
||||
|
||||
// check score
|
||||
if (item.getScore() != null) {
|
||||
if (!item.getScore().equals(result.getScore())) {
|
||||
if (draft != null) {
|
||||
if (item.getScore().equals(draft.getScore())) {
|
||||
setMergeState(item, MergeState.WARNING);
|
||||
} else {
|
||||
setMergeState(item, MergeState.ERROR);
|
||||
}
|
||||
} else {
|
||||
setMergeState(item, MergeState.ERROR);
|
||||
}
|
||||
item.setScore(result.getScore());
|
||||
changedCompetitor.put(item.getCompetitorId(), item.getCompetitorDisplayName());
|
||||
}
|
||||
} else if (result.getScore() != null) {
|
||||
setMergeState(item, MergeState.ERROR);
|
||||
item.setScore(result.getScore());
|
||||
changedCompetitor.put(item.getCompetitorId(), item.getCompetitorDisplayName());
|
||||
}
|
||||
|
||||
// check score
|
||||
if (item.getComment() != null) {
|
||||
if (!item.getComment().equals(result.getComment())) {
|
||||
if (draft != null) {
|
||||
if (item.getComment().equals(draft.getComment())) {
|
||||
setMergeState(item, MergeState.WARNING);
|
||||
} else {
|
||||
setMergeState(item, MergeState.ERROR);
|
||||
}
|
||||
} else {
|
||||
setMergeState(item, MergeState.ERROR);
|
||||
}
|
||||
item.setComment(item.getComment() + " ## " + result.getComment());
|
||||
changedCompetitor.put(item.getCompetitorId(), item.getCompetitorDisplayName());
|
||||
}
|
||||
} else if (result.getComment() != null) {
|
||||
setMergeState(item, MergeState.ERROR);
|
||||
item.setComment(result.getComment());
|
||||
changedCompetitor.put(item.getCompetitorId(), item.getCompetitorDisplayName());
|
||||
}
|
||||
|
||||
// check merge state
|
||||
if (!item.getMergeState().equals(result.getMergeState())) {
|
||||
setMergeState(item, result.getMergeState());
|
||||
changedCompetitor.put(item.getCompetitorId(), item.getCompetitorDisplayName());
|
||||
}
|
||||
} else {
|
||||
item.setValue(result);
|
||||
}
|
||||
} else { // unknown result, so it will be added
|
||||
mCompetitorResults.add(new CompetitorResultEditableImpl(result));
|
||||
}
|
||||
}
|
||||
mAdapter.notifyDataSetChanged();
|
||||
setPublishButton();
|
||||
if (changedCompetitor.size() > 0) { // show message to user
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(), R.style.AppTheme_AlertDialog);
|
||||
builder.setTitle(R.string.refresh_title);
|
||||
StringBuilder string = new StringBuilder(1024);
|
||||
for (String competitor : changedCompetitor.values()) {
|
||||
string.append(competitor);
|
||||
string.append("\n");
|
||||
}
|
||||
builder.setMessage(getString(R.string.refresh_message, string.toString()));
|
||||
builder.setPositiveButton(R.string.refresh_positive, null);
|
||||
builder.show();
|
||||
}
|
||||
}
|
||||
|
||||
private void setMergeState(CompetitorResultEditableImpl item, MergeState newState) {
|
||||
switch (item.getMergeState()) {
|
||||
case ERROR:
|
||||
if (newState != MergeState.ERROR) {
|
||||
break;
|
||||
}
|
||||
item.setDirty(true);
|
||||
item.setMergeState(newState);
|
||||
break;
|
||||
|
||||
case WARNING:
|
||||
if (newState != MergeState.WARNING && newState != MergeState.ERROR) {
|
||||
break;
|
||||
}
|
||||
item.setDirty(true);
|
||||
item.setMergeState(newState);
|
||||
break;
|
||||
|
||||
case OK:
|
||||
item.setDirty(true);
|
||||
item.setMergeState(newState);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void setPublishButton() {
|
||||
Set<Serializable> changed = new HashSet<>();
|
||||
boolean isChecked = false;
|
||||
boolean hasError = false;
|
||||
|
||||
for (CompetitorResultEditableImpl item : mCompetitorResults) {
|
||||
if (item.isChecked()) {
|
||||
isChecked = true;
|
||||
}
|
||||
if (item.getMergeState() != MergeState.OK) {
|
||||
hasError = true;
|
||||
}
|
||||
}
|
||||
for (CompetitorResult item : getCompetitorResultsDiff()) {
|
||||
CompetitorResults list = getCompetitorResultsDiff(mDraftData);
|
||||
for (CompetitorResult item : list) {
|
||||
boolean found = false;
|
||||
for (CompetitorResult server : mLastPublished) {
|
||||
for (CompetitorResult server : mConfirmedData) {
|
||||
if (server.equals(item)) {
|
||||
found = true;
|
||||
break;
|
||||
@@ -492,7 +656,9 @@ public class PenaltyFragment extends BaseFragment implements PopupMenu.OnMenuIte
|
||||
text = getString(R.string.publish_button_other, changed.size());
|
||||
}
|
||||
mPublishButton.setText(text);
|
||||
mPublishButton.setEnabled(changed.size() != 0);
|
||||
int warningSign = hasError ? R.drawable.ic_warning_red_small : 0;
|
||||
mPublishButton.setCompoundDrawablesWithIntrinsicBounds(warningSign, 0, 0, 0);
|
||||
mPublishButton.setEnabled(changed.size() != 0 && !hasError);
|
||||
mButtonBar.setVisibility((changed.size() != 0 || isChecked) ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
@@ -505,14 +671,15 @@ public class PenaltyFragment extends BaseFragment implements PopupMenu.OnMenuIte
|
||||
context = actionBar.getThemedContext();
|
||||
}
|
||||
}
|
||||
competitor.setMergeState(MergeState.OK);
|
||||
CompetitorResultWithIdImpl item = new CompetitorResultWithIdImpl(0, competitor.getCompetitorId(), competitor
|
||||
.getCompetitorDisplayName(), competitor.getOneBasedRank(), competitor.getMaxPointsReason(), competitor.getScore(), competitor
|
||||
.getFinishingTime(), competitor.getComment(), MergeState.OK); // TODO handle merge state
|
||||
.getFinishingTime(), competitor.getComment(), competitor.getMergeState());
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context, R.style.AppTheme_AlertDialog);
|
||||
builder.setTitle(item.getCompetitorDisplayName());
|
||||
final CompetitorEditLayout layout = new CompetitorEditLayout(getActivity(), item, mCompetitorResults.getFirstRankZeroPosition() +
|
||||
/* allow for setting rank as the new last in the list in case the competitor did not have a rank so far */
|
||||
(item.getOneBasedRank() == 0 ? 1 : 0));
|
||||
(item.getOneBasedRank() == 0 ? 1 : 0), competitor.getMergeState() == MergeState.ERROR);
|
||||
builder.setView(layout);
|
||||
builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
@@ -531,13 +698,23 @@ public class PenaltyFragment extends BaseFragment implements PopupMenu.OnMenuIte
|
||||
competitor.setScore(item.getScore());
|
||||
competitor.setDirty(true);
|
||||
}
|
||||
if (competitor.isDirty()) {
|
||||
mAdapter.notifyDataSetChanged();
|
||||
}
|
||||
mAdapter.notifyDataSetChanged();
|
||||
setPublishButton();
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(android.R.string.cancel, null);
|
||||
builder.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
builder.setOnCancelListener(new DialogInterface.OnCancelListener() {
|
||||
@Override
|
||||
public void onCancel(DialogInterface dialog) {
|
||||
setPublishButton();
|
||||
mAdapter.notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
AlertDialog dialog = builder.create();
|
||||
dialog.show();
|
||||
if (AppUtils.with(getActivity()).isTablet()) {
|
||||
@@ -548,26 +725,35 @@ public class PenaltyFragment extends BaseFragment implements PopupMenu.OnMenuIte
|
||||
}
|
||||
}
|
||||
|
||||
private CompetitorResults getCompetitorResultsDiff() {
|
||||
private CompetitorResultsImpl getCompetitorResultsDiff(CompetitorResults results) {
|
||||
CompetitorResultsImpl result = new CompetitorResultsImpl();
|
||||
|
||||
for (CompetitorResultEditableImpl item : mCompetitorResults) {
|
||||
if (item.isDirty()) {
|
||||
boolean found = false;
|
||||
for (CompetitorResult published : results) {
|
||||
if (item.getCompetitorId().equals(published.getCompetitorId())) {
|
||||
result.add(new CompetitorResultImpl(item.getCompetitorId(), item.getCompetitorDisplayName(), item.getOneBasedRank(), item
|
||||
.getMaxPointsReason(), item.getScore(), item.getFinishingTime(), item.getComment(), item.getMergeState()));
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found && item.isDirty()) {
|
||||
result.add(new CompetitorResultImpl(item.getCompetitorId(), item.getCompetitorDisplayName(), item.getOneBasedRank(), item
|
||||
.getMaxPointsReason(), item.getScore(), item.getFinishingTime(), item.getComment(), MergeState.OK)); // TODO handle merge state
|
||||
.getMaxPointsReason(), item.getScore(), item.getFinishingTime(), item.getComment(), item.getMergeState()));
|
||||
}
|
||||
}
|
||||
|
||||
for (CompetitorResult item : mLastSend) {
|
||||
for (CompetitorResult item : results) {
|
||||
boolean found = false;
|
||||
for (CompetitorResult dirtyItem : result) {
|
||||
if (item.getCompetitorId().equals(dirtyItem.getCompetitorId())) {
|
||||
for (CompetitorResult current : mCompetitorResults) {
|
||||
if (item.getCompetitorId().equals(current.getCompetitorId())) {
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
result.add(new CompetitorResultImpl(item.getCompetitorId(), item.getCompetitorDisplayName(), item.getOneBasedRank(), item
|
||||
.getMaxPointsReason(), item.getScore(), item.getFinishingTime(), item.getComment(), MergeState.OK)); // TODO handle merge state
|
||||
.getMaxPointsReason(), item.getScore(), item.getFinishingTime(), item.getComment(), item.getMergeState()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -589,4 +775,35 @@ public class PenaltyFragment extends BaseFragment implements PopupMenu.OnMenuIte
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class StateChangeListener extends BaseRaceStateChangedListener {
|
||||
|
||||
private WeakReference<PenaltyFragment> mReference;
|
||||
|
||||
StateChangeListener(PenaltyFragment fragment) {
|
||||
mReference = new WeakReference<>(fragment);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinishingPositionsConfirmed(ReadonlyRaceState state) {
|
||||
super.onFinishingPositionsConfirmed(state);
|
||||
|
||||
PenaltyFragment fragment = mReference.get();
|
||||
if (fragment != null) {
|
||||
fragment.initConfirmedData();
|
||||
fragment.mergeData(state.getConfirmedFinishPositioningList(), true);
|
||||
fragment.setPublishButton();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinishingPositioningsChanged(ReadonlyRaceState state) {
|
||||
super.onFinishingPositioningsChanged(state);
|
||||
|
||||
PenaltyFragment fragment = mReference.get();
|
||||
if (fragment != null) {
|
||||
fragment.mergeData(state.getFinishPositioningList(), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,16 @@
|
||||
package com.sap.sailing.racecommittee.app.ui.fragments.raceinfo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.h6ah4i.android.widget.advrecyclerview.animator.SwipeDismissItemAnimator;
|
||||
import com.h6ah4i.android.widget.advrecyclerview.draggable.RecyclerViewDragDropManager;
|
||||
@@ -20,6 +26,8 @@ import com.sap.sailing.domain.abstractlog.race.CompetitorResult.MergeState;
|
||||
import com.sap.sailing.domain.abstractlog.race.CompetitorResults;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.CompetitorResultImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.CompetitorResultsImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.state.ReadonlyRaceState;
|
||||
import com.sap.sailing.domain.abstractlog.race.state.impl.BaseRaceStateChangedListener;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.CompetitorStore;
|
||||
import com.sap.sailing.domain.base.SharedDomainFactory;
|
||||
@@ -44,6 +52,7 @@ import com.sap.sailing.racecommittee.app.ui.layouts.HeaderLayout;
|
||||
import com.sap.sailing.racecommittee.app.ui.views.SearchView;
|
||||
import com.sap.sailing.racecommittee.app.utils.StringHelper;
|
||||
import com.sap.sailing.racecommittee.app.utils.ThemeHelper;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
import com.sap.sse.common.Util;
|
||||
import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
|
||||
@@ -54,6 +63,7 @@ import android.content.Loader;
|
||||
import android.graphics.drawable.NinePatchDrawable;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
@@ -66,6 +76,7 @@ import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
@@ -94,7 +105,8 @@ public class TrackingListFragment extends BaseFragment
|
||||
private RecyclerView.Adapter<FinishListAdapter.ViewHolder> mFinishedAdapter;
|
||||
private CompetitorAdapter mCompetitorAdapter;
|
||||
private CompetitorResultsList<CompetitorResultWithIdImpl> mFinishedData;
|
||||
private CompetitorResults mLastPublished;
|
||||
private CompetitorResults mDraftData;
|
||||
private CompetitorResults mConfirmedData;
|
||||
private List<Competitor> mCompetitorData;
|
||||
private List<Competitor> mFilteredCompetitorData;
|
||||
private int mId = 0;
|
||||
@@ -105,6 +117,8 @@ public class TrackingListFragment extends BaseFragment
|
||||
private String mFilter;
|
||||
private View mTools;
|
||||
|
||||
private StateChangeListener mStateChangeListener;
|
||||
|
||||
public TrackingListFragment() {
|
||||
mCompetitorData = Collections.synchronizedList(new ArrayList<Competitor>());
|
||||
mFilteredCompetitorData = Collections.synchronizedList(new ArrayList<Competitor>());
|
||||
@@ -120,6 +134,9 @@ public class TrackingListFragment extends BaseFragment
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View layout = inflater.inflate(R.layout.race_tracking_list, container, false);
|
||||
|
||||
mStateChangeListener = new StateChangeListener(this);
|
||||
|
||||
mHeader = ViewHelper.get(layout, R.id.header);
|
||||
mDots = new ArrayList<>();
|
||||
mPanels = new ArrayList<>();
|
||||
@@ -210,6 +227,8 @@ public class TrackingListFragment extends BaseFragment
|
||||
mComparators.add(SORT_NAME, new NaturalNamedComparator<Competitor>());
|
||||
mComparator = mComparators.get(SORT_SAIL_NUMBER);
|
||||
mFinishedData = initializeFinishList();
|
||||
mConfirmedData = new CompetitorResultsImpl();
|
||||
mDraftData = new CompetitorResultsImpl();
|
||||
loadCompetitors();
|
||||
if (getView() != null) {
|
||||
RecyclerView competitorView = (RecyclerView) getView().findViewById(R.id.list_positioning_all);
|
||||
@@ -233,11 +252,11 @@ public class TrackingListFragment extends BaseFragment
|
||||
LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
|
||||
mAdapter = new FinishListAdapter(getActivity(), mFinishedData);
|
||||
mAdapter.setListener(this);
|
||||
@SuppressWarnings("unchecked") RecyclerView.Adapter<FinishListAdapter.ViewHolder> dragManager = mDragDropManager
|
||||
.createWrappedAdapter(mAdapter);
|
||||
@SuppressWarnings("unchecked")
|
||||
RecyclerView.Adapter<FinishListAdapter.ViewHolder> dragManager = mDragDropManager.createWrappedAdapter(mAdapter);
|
||||
mFinishedAdapter = dragManager;
|
||||
@SuppressWarnings("unchecked") RecyclerView.Adapter<FinishListAdapter.ViewHolder> swipeManager = mSwipeManager
|
||||
.createWrappedAdapter(mFinishedAdapter);
|
||||
@SuppressWarnings("unchecked")
|
||||
RecyclerView.Adapter<FinishListAdapter.ViewHolder> swipeManager = mSwipeManager.createWrappedAdapter(mFinishedAdapter);
|
||||
mFinishedAdapter = swipeManager;
|
||||
mFinishView.setLayoutManager(layoutManager);
|
||||
mFinishView.setAdapter(mFinishedAdapter);
|
||||
@@ -253,9 +272,11 @@ public class TrackingListFragment extends BaseFragment
|
||||
mConfirm.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
sendUnconfirmed();
|
||||
getRaceState().setFinishPositioningConfirmed(MillisecondsTimePoint.now());
|
||||
initLastPublished();
|
||||
TimePoint now = MillisecondsTimePoint.now();
|
||||
CompetitorResults result = getCompetitorResultsDiff(mConfirmedData);
|
||||
getRaceState().setFinishPositioningListChanged(now, result);
|
||||
getRaceState().setFinishPositioningConfirmed(now, result);
|
||||
initLocalData();
|
||||
Toast.makeText(getActivity(), R.string.publish_clicked, Toast.LENGTH_SHORT).show();
|
||||
sendIntent(AppConstants.INTENT_ACTION_CLEAR_TOGGLE);
|
||||
sendIntent(AppConstants.INTENT_ACTION_SHOW_SUMMARY_CONTENT);
|
||||
@@ -274,15 +295,22 @@ public class TrackingListFragment extends BaseFragment
|
||||
sortCompetitors();
|
||||
mCompetitorAdapter.notifyDataSetChanged();
|
||||
|
||||
initLastPublished();
|
||||
initLocalData();
|
||||
}
|
||||
|
||||
private void initLastPublished() {
|
||||
mLastPublished = new CompetitorResultsImpl();
|
||||
private void initLocalData() {
|
||||
mDraftData.clear();
|
||||
if (getRaceState().getFinishPositioningList() != null) {
|
||||
for (CompetitorResult item : getRaceState().getFinishPositioningList()) {
|
||||
mDraftData.add(item);
|
||||
}
|
||||
}
|
||||
|
||||
mConfirmedData.clear();
|
||||
if (getRaceState().getConfirmedFinishPositioningList() != null) {
|
||||
for (CompetitorResult item : getRaceState().getConfirmedFinishPositioningList()) {
|
||||
mLastPublished.add(new CompetitorResultImpl(item.getCompetitorId(), item.getCompetitorDisplayName(), item.getOneBasedRank(), item
|
||||
.getMaxPointsReason(), item.getScore(), item.getFinishingTime(), item.getComment(), item.getMergeState())); // TODO handle merge state
|
||||
mConfirmedData.add(new CompetitorResultImpl(item.getCompetitorId(), item.getCompetitorDisplayName(), item.getOneBasedRank(), item
|
||||
.getMaxPointsReason(), item.getScore(), item.getFinishingTime(), item.getComment(), item.getMergeState()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -302,6 +330,10 @@ public class TrackingListFragment extends BaseFragment
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
|
||||
if (getRace() != null && getRaceState() != null) {
|
||||
getRaceState().addChangedListener(mStateChangeListener);
|
||||
}
|
||||
|
||||
Intent intent = new Intent(AppConstants.INTENT_ACTION_ON_LIFECYCLE);
|
||||
intent.putExtra(AppConstants.INTENT_ACTION_EXTRA_LIFECYCLE, AppConstants.INTENT_ACTION_EXTRA_START);
|
||||
intent.putExtra(AppConstants.INTENT_ACTION_EXTRA, AppConstants.INTENT_ACTION_TOGGLE_COMPETITOR);
|
||||
@@ -312,7 +344,13 @@ public class TrackingListFragment extends BaseFragment
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
|
||||
sendUnconfirmed();
|
||||
if (getRace() != null && getRaceState() != null) {
|
||||
getRaceState().removeChangedListener(mStateChangeListener);
|
||||
}
|
||||
|
||||
if (isDirty()) {
|
||||
sendUnconfirmed();
|
||||
}
|
||||
|
||||
Intent intent = new Intent(AppConstants.INTENT_ACTION_ON_LIFECYCLE);
|
||||
intent.putExtra(AppConstants.INTENT_ACTION_EXTRA_LIFECYCLE, AppConstants.INTENT_ACTION_EXTRA_STOP);
|
||||
@@ -374,8 +412,51 @@ public class TrackingListFragment extends BaseFragment
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean isDirty() {
|
||||
CompetitorResultsImpl diff = (CompetitorResultsImpl) getCompetitorResultsDiff(mConfirmedData);
|
||||
boolean dirty = diff.size() != mDraftData.size();
|
||||
if (!dirty) {
|
||||
for (CompetitorResult item : getCompetitorResultsDiff(mConfirmedData)) {
|
||||
for (CompetitorResult last : mDraftData) {
|
||||
if (item.getCompetitorId().equals(last) && !item.equals(last)) {
|
||||
dirty = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (dirty) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return dirty;
|
||||
}
|
||||
|
||||
private void setPublishButton() {
|
||||
Set<Integer> positions = new HashSet<>();
|
||||
boolean multiplePositions = false;
|
||||
Set<Serializable> errors = new HashSet<>();
|
||||
|
||||
for (CompetitorResult item : mFinishedData) {
|
||||
// check for multiple positions
|
||||
if (item.getOneBasedRank() != 0 && positions.contains(item.getOneBasedRank())) {
|
||||
multiplePositions = true;
|
||||
}
|
||||
positions.add(item.getOneBasedRank());
|
||||
|
||||
// check for merge errors
|
||||
if (item.getMergeState() != MergeState.OK) {
|
||||
errors.add(item.getCompetitorId());
|
||||
}
|
||||
}
|
||||
|
||||
boolean error = multiplePositions || errors.size() > 0;
|
||||
int warningSign = error ? R.drawable.ic_warning_red_small : 0;
|
||||
mConfirm.setEnabled(!error);
|
||||
mConfirm.setCompoundDrawablesWithIntrinsicBounds(warningSign, 0, 0, 0);
|
||||
}
|
||||
|
||||
private void sendUnconfirmed() {
|
||||
getRaceState().setFinishPositioningListChanged(MillisecondsTimePoint.now(), getCompetitorResultsDiff());
|
||||
getRaceState().setFinishPositioningListChanged(MillisecondsTimePoint.now(), getCompetitorResultsDiff(mConfirmedData));
|
||||
}
|
||||
|
||||
private void loadCompetitors() {
|
||||
@@ -464,20 +545,18 @@ public class TrackingListFragment extends BaseFragment
|
||||
}
|
||||
|
||||
private void deleteCompetitorsFromFinishedList(Collection<Competitor> validCompetitors) {
|
||||
List<Integer> positions = new ArrayList<>();
|
||||
List<CompetitorResultWithIdImpl> toBeDeleted = new ArrayList<>();
|
||||
for (CompetitorResultWithIdImpl item : mFinishedData) {
|
||||
if (!validCompetitors.contains(getCompetitorStore().getExistingCompetitorById(item.getCompetitorId()))) {
|
||||
positions.add(mFinishedData.indexOf(item));
|
||||
toBeDeleted.add(item);
|
||||
continue;
|
||||
}
|
||||
if (item.getOneBasedRank() == 0 && item.getMaxPointsReason() == MaxPointsReason.NONE) {
|
||||
positions.add(mFinishedData.indexOf(item));
|
||||
toBeDeleted.add(item);
|
||||
}
|
||||
}
|
||||
mFinishedData.removeAll(toBeDeleted);
|
||||
setPublishButton();
|
||||
mFinishedAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@@ -527,8 +606,9 @@ public class TrackingListFragment extends BaseFragment
|
||||
}
|
||||
}
|
||||
mFinishedData.add(pos, new CompetitorResultWithIdImpl(mId, competitor.getId(), name, greatestOneBasedRankSoFar + 1, MaxPointsReason.NONE,
|
||||
/* score */ null, /* finishingTime */ null, /* comment */ null, MergeState.OK)); // TODO handle merge state
|
||||
/* score */ null, /* finishingTime */ null, /* comment */ null, MergeState.OK));
|
||||
mId++;
|
||||
setPublishButton();
|
||||
mFinishedAdapter.notifyItemInserted(pos);
|
||||
if (mDots.size() > 0) {
|
||||
Toast.makeText(getActivity(), getString(R.string.added_to_result_list, name, pos + 1), Toast.LENGTH_SHORT).show();
|
||||
@@ -569,6 +649,7 @@ public class TrackingListFragment extends BaseFragment
|
||||
final int firstPositionChanged = Math.min(getFirstRankZeroPosition(), Math.min(fromPosition, toPosition));
|
||||
final int lastPositionChanged = Math.min(getFirstRankZeroPosition(), Math.max(fromPosition, toPosition) + 1);
|
||||
adjustRanks(firstPositionChanged, lastPositionChanged);
|
||||
setPublishButton();
|
||||
mFinishedAdapter.notifyItemRangeChanged(firstPositionChanged, lastPositionChanged - firstPositionChanged);
|
||||
}
|
||||
|
||||
@@ -578,6 +659,7 @@ public class TrackingListFragment extends BaseFragment
|
||||
if (position >= 0) { // found
|
||||
mFinishedData.remove(position);
|
||||
adjustRanks(position, getFirstRankZeroPosition());
|
||||
setPublishButton();
|
||||
mFinishedAdapter.notifyItemRemoved(position);
|
||||
}
|
||||
Competitor competitor = getCompetitorStore().getExistingCompetitorById(item.getCompetitorId());
|
||||
@@ -609,7 +691,7 @@ public class TrackingListFragment extends BaseFragment
|
||||
.getCompetitorId(), competitorToReplaceWithAdjustedPosition
|
||||
.getCompetitorDisplayName(), newOneBasedRank, competitorToReplaceWithAdjustedPosition
|
||||
.getMaxPointsReason(), competitorToReplaceWithAdjustedPosition.getScore(), competitorToReplaceWithAdjustedPosition
|
||||
.getFinishingTime(), competitorToReplaceWithAdjustedPosition.getComment(), MergeState.OK); // TODO handle merge state
|
||||
.getFinishingTime(), competitorToReplaceWithAdjustedPosition.getComment(), MergeState.OK);
|
||||
}
|
||||
|
||||
private void addNewCompetitorToCompetitorList(Competitor competitor) {
|
||||
@@ -627,6 +709,7 @@ public class TrackingListFragment extends BaseFragment
|
||||
builder.setItems(maxPointsReasons, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int position) {
|
||||
setMaxPointsReasonForItem(item, maxPointsReasons[position]);
|
||||
setPublishButton();
|
||||
mFinishedAdapter.notifyItemChanged(mFinishedData.indexOf(item));
|
||||
}
|
||||
});
|
||||
@@ -647,7 +730,7 @@ public class TrackingListFragment extends BaseFragment
|
||||
final CompetitorEditLayout layout = new CompetitorEditLayout(getActivity(), getRace().getState().getFinishingTime(), item,
|
||||
mAdapter.getFirstRankZeroPosition() +
|
||||
/* allow for setting rank as the new last in the list in case the competitor did not have a rank so far */
|
||||
(item.getOneBasedRank() == 0 ? 1 : 0), false);
|
||||
(item.getOneBasedRank() == 0 ? 1 : 0), false, item.getMergeState() == MergeState.ERROR);
|
||||
builder.setView(layout);
|
||||
builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
@@ -656,11 +739,28 @@ public class TrackingListFragment extends BaseFragment
|
||||
updateItem(item, newItem);
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(android.R.string.cancel, null);
|
||||
builder.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
builder.setOnCancelListener(new DialogInterface.OnCancelListener() {
|
||||
@Override
|
||||
public void onCancel(DialogInterface dialog) {
|
||||
CompetitorResultWithIdImpl newItem = new CompetitorResultWithIdImpl(item.getId(), item.getCompetitorId(), item
|
||||
.getCompetitorDisplayName(), item.getOneBasedRank(), item.getMaxPointsReason(), item.getScore(), item.getFinishingTime(), item
|
||||
.getComment(), MergeState.OK);
|
||||
updateItem(item, newItem);
|
||||
}
|
||||
});
|
||||
AlertDialog dialog = builder.create();
|
||||
dialog.show();
|
||||
if (AppUtils.with(getActivity()).isTablet()) {
|
||||
dialog.getWindow().setLayout(getResources().getDimensionPixelSize(R.dimen.competitor_dialog_width), ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
Window window = dialog.getWindow();
|
||||
if (window != null) {
|
||||
window.setLayout(getResources().getDimensionPixelSize(R.dimen.competitor_dialog_width), ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -677,8 +777,15 @@ public class TrackingListFragment extends BaseFragment
|
||||
* </ol>
|
||||
*/
|
||||
private void updateItem(final CompetitorResultWithIdImpl item, CompetitorResultWithIdImpl newItem) {
|
||||
int index = mFinishedData.indexOf(item);
|
||||
mFinishedData.set(index, newItem); // update the item in the list already; then check where to move it and adjust other elements
|
||||
int index = -1;
|
||||
for (int i = 0; i < mFinishedData.size(); i++) {
|
||||
if (mFinishedData.get(i).getCompetitorId().equals(item.getCompetitorId())) {
|
||||
index = i;
|
||||
}
|
||||
}
|
||||
if (index >= 0) {
|
||||
mFinishedData.set(index, newItem); // update the item in the list already; then check where to move it and adjust other elements
|
||||
}
|
||||
if (item.getOneBasedRank() != 0 && newItem.getOneBasedRank() == 0 && newItem.getMaxPointsReason() != MaxPointsReason.NONE) {
|
||||
// move to the end of the area of "penalized" competitors; may also be an unpenalized competitor that hasn't
|
||||
// been removed yet (e.g., in order to force a score correction reset on the server)
|
||||
@@ -690,6 +797,7 @@ public class TrackingListFragment extends BaseFragment
|
||||
} else {
|
||||
mFinishedAdapter.notifyItemChanged(index);
|
||||
}
|
||||
setPublishButton();
|
||||
}
|
||||
|
||||
private CharSequence[] getAllMaxPointsReasons() {
|
||||
@@ -703,7 +811,8 @@ public class TrackingListFragment extends BaseFragment
|
||||
protected void setMaxPointsReasonForItem(CompetitorResultWithIdImpl item, CharSequence maxPointsReasonName) {
|
||||
MaxPointsReason maxPointsReason = MaxPointsReason.valueOf(maxPointsReasonName.toString());
|
||||
CompetitorResultWithIdImpl newItem = new CompetitorResultWithIdImpl(item.getId(), item.getCompetitorId(), item
|
||||
.getCompetitorDisplayName(), item.getOneBasedRank(), maxPointsReason, item.getScore(), item.getFinishingTime(), item.getComment(), MergeState.OK); // TODO handle merge state
|
||||
.getCompetitorDisplayName(), item.getOneBasedRank(), maxPointsReason, item.getScore(), item.getFinishingTime(), item.getComment(), item
|
||||
.getMergeState());
|
||||
updateItem(item, newItem);
|
||||
getRaceState().setFinishPositioningListChanged(MillisecondsTimePoint.now(), getCompetitorResults());
|
||||
}
|
||||
@@ -712,22 +821,24 @@ public class TrackingListFragment extends BaseFragment
|
||||
CompetitorResults result = new CompetitorResultsImpl();
|
||||
for (CompetitorResultWithIdImpl item : mFinishedData) {
|
||||
result.add(new CompetitorResultImpl(item.getCompetitorId(), item.getCompetitorDisplayName(), item.getOneBasedRank(), item
|
||||
.getMaxPointsReason(), item.getScore(), item.getFinishingTime(), item.getComment(), MergeState.OK)); // TODO handle merge state
|
||||
.getMaxPointsReason(), item.getScore(), item.getFinishingTime(), item.getComment(), item.getMergeState()));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private CompetitorResults getCompetitorResultsDiff() {
|
||||
private CompetitorResults getCompetitorResultsDiff(CompetitorResults results) {
|
||||
CompetitorResults result = new CompetitorResultsImpl();
|
||||
|
||||
// all changed items
|
||||
for (CompetitorResult oldItem : mLastPublished) {
|
||||
for (CompetitorResult oldItem : results) {
|
||||
boolean found = false;
|
||||
for (CompetitorResult newItem : mFinishedData) {
|
||||
if (oldItem.getCompetitorId().equals(newItem.getCompetitorId())) {
|
||||
if (!oldItem.equals(newItem)) {
|
||||
result.add(new CompetitorResultImpl(newItem.getCompetitorId(), newItem.getCompetitorDisplayName(), newItem
|
||||
.getOneBasedRank(), newItem.getMaxPointsReason(), newItem.getScore(), newItem.getFinishingTime(), newItem.getComment(), MergeState.OK)); // TODO handle merge state
|
||||
CompetitorResult temp = new CompetitorResultImpl(newItem.getCompetitorId(), newItem.getCompetitorDisplayName(), newItem
|
||||
.getOneBasedRank(), newItem.getMaxPointsReason(), newItem.getScore(), newItem.getFinishingTime(), newItem
|
||||
.getComment(), newItem.getMergeState());
|
||||
if (!oldItem.equals(temp)) {
|
||||
result.add(temp);
|
||||
}
|
||||
found = true;
|
||||
break;
|
||||
@@ -735,14 +846,14 @@ public class TrackingListFragment extends BaseFragment
|
||||
}
|
||||
if (!found) {
|
||||
result.add(new CompetitorResultImpl(oldItem.getCompetitorId(), oldItem.getCompetitorDisplayName(), 0, oldItem
|
||||
.getMaxPointsReason(), oldItem.getScore(), oldItem.getFinishingTime(), oldItem.getComment(), MergeState.OK)); // TODO handle merge state
|
||||
.getMaxPointsReason(), oldItem.getScore(), oldItem.getFinishingTime(), oldItem.getComment(), oldItem.getMergeState()));
|
||||
}
|
||||
}
|
||||
|
||||
// all new items
|
||||
for (CompetitorResultWithIdImpl newItem : mFinishedData) {
|
||||
boolean found = false;
|
||||
for (CompetitorResult oldItem : mLastPublished) {
|
||||
for (CompetitorResult oldItem : results) {
|
||||
if (oldItem.getCompetitorId().equals(newItem.getCompetitorId())) {
|
||||
found = true;
|
||||
break;
|
||||
@@ -750,7 +861,7 @@ public class TrackingListFragment extends BaseFragment
|
||||
}
|
||||
if (!found) {
|
||||
result.add(new CompetitorResultImpl(newItem.getCompetitorId(), newItem.getCompetitorDisplayName(), newItem.getOneBasedRank(), newItem
|
||||
.getMaxPointsReason(), newItem.getScore(), newItem.getFinishingTime(), newItem.getComment(), MergeState.OK)); // TODO handle merge state
|
||||
.getMaxPointsReason(), newItem.getScore(), newItem.getFinishingTime(), newItem.getComment(), newItem.getMergeState()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -841,4 +952,217 @@ public class TrackingListFragment extends BaseFragment
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void mergeData(CompetitorResults results) {
|
||||
Map<Serializable, String> changedCompetitor = new HashMap<>();
|
||||
for (CompetitorResult result : results) {
|
||||
CompetitorResultWithIdImpl item = null;
|
||||
CompetitorResult draft = null;
|
||||
CompetitorResultWithIdImpl newItem;
|
||||
MergeState state;
|
||||
for (CompetitorResultWithIdImpl edited : mFinishedData) {
|
||||
if (result.getCompetitorId().equals(edited.getCompetitorId())) {
|
||||
item = edited;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (CompetitorResult saved : mDraftData) {
|
||||
if (result.getCompetitorId().equals(saved.getCompetitorId())) {
|
||||
draft = saved;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (item != null) { // result is in list
|
||||
// check one based rank
|
||||
if (item.getOneBasedRank() != result.getOneBasedRank()) {
|
||||
if (draft != null) {
|
||||
if (item.getOneBasedRank() == draft.getOneBasedRank()) {
|
||||
state = MergeState.WARNING;
|
||||
} else {
|
||||
state = MergeState.ERROR;
|
||||
}
|
||||
} else {
|
||||
state = MergeState.ERROR;
|
||||
}
|
||||
newItem = new CompetitorResultWithIdImpl(item.getId(), item.getCompetitorId(), item.getCompetitorDisplayName(), result
|
||||
.getOneBasedRank(), item.getMaxPointsReason(), item.getScore(), item.getFinishingTime(), item
|
||||
.getComment(), getMergeState(item, state));
|
||||
item = updateChangedItem(changedCompetitor, item, newItem);
|
||||
}
|
||||
|
||||
// check max point reasons
|
||||
if (!item.getMaxPointsReason().equals(result.getMaxPointsReason())) {
|
||||
if (draft != null) {
|
||||
if (item.getMaxPointsReason().equals(draft.getMaxPointsReason())) {
|
||||
state = MergeState.WARNING;
|
||||
} else {
|
||||
state = MergeState.ERROR;
|
||||
}
|
||||
} else {
|
||||
state = MergeState.ERROR;
|
||||
}
|
||||
newItem = new CompetitorResultWithIdImpl(item.getId(), item.getCompetitorId(), item.getCompetitorDisplayName(), item
|
||||
.getOneBasedRank(), result.getMaxPointsReason(), item.getScore(), item.getFinishingTime(), item
|
||||
.getComment(), getMergeState(item, state));
|
||||
item = updateChangedItem(changedCompetitor, item, newItem);
|
||||
}
|
||||
|
||||
// check score
|
||||
if (item.getScore() != null) {
|
||||
if (!item.getScore().equals(result.getScore())) {
|
||||
if (draft != null) {
|
||||
if (item.getScore().equals(draft.getScore())) {
|
||||
state = MergeState.WARNING;
|
||||
} else {
|
||||
state = MergeState.ERROR;
|
||||
}
|
||||
} else {
|
||||
state = MergeState.ERROR;
|
||||
}
|
||||
newItem = new CompetitorResultWithIdImpl(item.getId(), item.getCompetitorId(), item.getCompetitorDisplayName(), item
|
||||
.getOneBasedRank(), item.getMaxPointsReason(), result.getScore(), item.getFinishingTime(), item
|
||||
.getComment(), getMergeState(item, state));
|
||||
item = updateChangedItem(changedCompetitor, item, newItem);
|
||||
}
|
||||
} else if (result.getScore() != null) {
|
||||
newItem = new CompetitorResultWithIdImpl(item.getId(), item.getCompetitorId(), item.getCompetitorDisplayName(), item
|
||||
.getOneBasedRank(), item.getMaxPointsReason(), result.getScore(), item.getFinishingTime(), item
|
||||
.getComment(), getMergeState(item, MergeState.ERROR));
|
||||
item = updateChangedItem(changedCompetitor, item, newItem);
|
||||
}
|
||||
|
||||
// check finishing time
|
||||
if (item.getFinishingTime() != null) {
|
||||
if (!item.getFinishingTime().equals(result.getFinishingTime())) {
|
||||
if (draft != null) {
|
||||
if (item.getFinishingTime().equals(draft.getFinishingTime())) {
|
||||
state = MergeState.WARNING;
|
||||
} else {
|
||||
state = MergeState.ERROR;
|
||||
}
|
||||
} else {
|
||||
state = MergeState.ERROR;
|
||||
}
|
||||
newItem = new CompetitorResultWithIdImpl(item.getId(), item.getCompetitorId(), item.getCompetitorDisplayName(), item
|
||||
.getOneBasedRank(), item.getMaxPointsReason(), item.getScore(), result.getFinishingTime(), item
|
||||
.getComment(), getMergeState(item, state));
|
||||
item = updateChangedItem(changedCompetitor, item, newItem);
|
||||
}
|
||||
} else if (result.getFinishingTime() != null) {
|
||||
newItem = new CompetitorResultWithIdImpl(item.getId(), item.getCompetitorId(), item.getCompetitorDisplayName(), item
|
||||
.getOneBasedRank(), item.getMaxPointsReason(), item.getScore(), result.getFinishingTime(), item
|
||||
.getComment(), getMergeState(item, MergeState.ERROR));
|
||||
item = updateChangedItem(changedCompetitor, item, newItem);
|
||||
}
|
||||
|
||||
// check comment
|
||||
if (item.getComment() != null) {
|
||||
if (!item.getComment().equals(result.getComment())) {
|
||||
if (draft != null) {
|
||||
if (item.getComment().equals(draft.getComment())) {
|
||||
state = MergeState.WARNING;
|
||||
} else {
|
||||
state = MergeState.ERROR;
|
||||
}
|
||||
} else {
|
||||
state = MergeState.ERROR;
|
||||
}
|
||||
newItem = new CompetitorResultWithIdImpl(item.getId(), item.getCompetitorId(), item.getCompetitorDisplayName(), item
|
||||
.getOneBasedRank(), item.getMaxPointsReason(), item.getScore(), item.getFinishingTime(),
|
||||
item.getComment() + " ## " + result.getComment(), getMergeState(item, state));
|
||||
item = updateChangedItem(changedCompetitor, item, newItem);
|
||||
}
|
||||
} else if (result.getComment() != null) {
|
||||
newItem = new CompetitorResultWithIdImpl(item.getId(), item.getCompetitorId(), item.getCompetitorDisplayName(), item
|
||||
.getOneBasedRank(), item.getMaxPointsReason(), item.getScore(), item.getFinishingTime(), result
|
||||
.getComment(), getMergeState(item, MergeState.ERROR));
|
||||
item = updateChangedItem(changedCompetitor, item, newItem);
|
||||
}
|
||||
|
||||
// check merge state
|
||||
if (!item.getMergeState().equals(result.getMergeState())) {
|
||||
newItem = new CompetitorResultWithIdImpl(item.getId(), item.getCompetitorId(), item.getCompetitorDisplayName(), item
|
||||
.getOneBasedRank(), item.getMaxPointsReason(), item.getScore(), item.getFinishingTime(), item
|
||||
.getComment(), getMergeState(item, result.getMergeState()));
|
||||
item = updateChangedItem(changedCompetitor, item, newItem);
|
||||
}
|
||||
} else { // unknown result, so it will be added
|
||||
if (result.getOneBasedRank() != 0 || result.getMaxPointsReason() != MaxPointsReason.NONE) {
|
||||
for (Competitor competitor : mCompetitorData) {
|
||||
if (competitor.getId().equals(result.getCompetitorId())) {
|
||||
removeCompetitorFromList(competitor);
|
||||
break;
|
||||
}
|
||||
}
|
||||
mFinishedData.add(new CompetitorResultWithIdImpl(mFinishedData.size(), result));
|
||||
Collections.sort(mFinishedData, new DefaultCompetitorResultComparator(/* lowPoint TODO where to get this from? */ true));
|
||||
}
|
||||
}
|
||||
}
|
||||
setPublishButton();
|
||||
mAdapter.notifyDataSetChanged();
|
||||
if (changedCompetitor.size() > 0) { // show message to user
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(), R.style.AppTheme_AlertDialog);
|
||||
builder.setTitle(R.string.refresh_title);
|
||||
StringBuilder string = new StringBuilder(1024);
|
||||
for (String competitor : changedCompetitor.values()) {
|
||||
string.append(competitor);
|
||||
string.append("\n");
|
||||
}
|
||||
builder.setMessage(getString(R.string.refresh_message, string.toString()));
|
||||
builder.setPositiveButton(R.string.refresh_positive, null);
|
||||
builder.show();
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private CompetitorResultWithIdImpl updateChangedItem(Map<Serializable, String> changedCompetitor, CompetitorResultWithIdImpl item,
|
||||
CompetitorResultWithIdImpl newItem) {
|
||||
updateItem(item, newItem);
|
||||
changedCompetitor.put(newItem.getCompetitorId(), newItem.getCompetitorDisplayName());
|
||||
return newItem;
|
||||
}
|
||||
|
||||
private MergeState getMergeState(CompetitorResultWithIdImpl item, MergeState newState) {
|
||||
MergeState state = item.getMergeState();
|
||||
switch (item.getMergeState()) {
|
||||
case ERROR:
|
||||
if (newState != MergeState.ERROR) {
|
||||
break;
|
||||
}
|
||||
state = newState;
|
||||
break;
|
||||
|
||||
case WARNING:
|
||||
if (newState != MergeState.WARNING && newState != MergeState.ERROR) {
|
||||
break;
|
||||
}
|
||||
state = newState;
|
||||
break;
|
||||
|
||||
case OK:
|
||||
state = newState;
|
||||
break;
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
||||
private static class StateChangeListener extends BaseRaceStateChangedListener {
|
||||
|
||||
private WeakReference<TrackingListFragment> mReference;
|
||||
|
||||
StateChangeListener(TrackingListFragment fragment) {
|
||||
mReference = new WeakReference<>(fragment);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinishingPositioningsChanged(ReadonlyRaceState state) {
|
||||
super.onFinishingPositioningsChanged(state);
|
||||
|
||||
TrackingListFragment fragment = mReference.get();
|
||||
if (fragment != null) {
|
||||
fragment.mergeData(state.getFinishPositioningList());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -49,12 +49,12 @@ public class CompetitorEditLayout extends ScrollView implements DatePickerDialog
|
||||
|
||||
private boolean mRestricted;
|
||||
|
||||
public CompetitorEditLayout(Context context, CompetitorResultWithIdImpl competitor, int maxPos) {
|
||||
this(context, null, competitor, maxPos, true);
|
||||
public CompetitorEditLayout(Context context, CompetitorResultWithIdImpl competitor, int maxPos, boolean hasWarning) {
|
||||
this(context, null, competitor, maxPos, true, hasWarning);
|
||||
}
|
||||
|
||||
public CompetitorEditLayout(final Context context, final TimePoint startTime, CompetitorResultWithIdImpl competitor, int maxPos,
|
||||
boolean restrictedView) {
|
||||
boolean restrictedView, boolean hasWarning) {
|
||||
super(context);
|
||||
|
||||
mRestricted = restrictedView;
|
||||
@@ -74,6 +74,10 @@ public class CompetitorEditLayout extends ScrollView implements DatePickerDialog
|
||||
if (position != null) {
|
||||
position.setVisibility(restrictedView ? GONE : VISIBLE);
|
||||
}
|
||||
View warning = ViewHelper.get(layout, R.id.competitor_warning_message);
|
||||
if (warning != null) {
|
||||
warning.setVisibility(hasWarning ? VISIBLE : GONE);
|
||||
}
|
||||
|
||||
mCalendar = (GregorianCalendar) GregorianCalendar.getInstance();
|
||||
if (mCompetitor.getFinishingTime() != null) {
|
||||
@@ -216,8 +220,7 @@ public class CompetitorEditLayout extends ScrollView implements DatePickerDialog
|
||||
comment = mComment.getText().toString();
|
||||
}
|
||||
CompetitorResult result = new CompetitorResultImpl(mCompetitor.getCompetitorId(), mCompetitor
|
||||
.getCompetitorDisplayName(), oneBaseRank, maxPointsReason, score, finishingTime, comment,
|
||||
MergeState.OK); // TODO handle merge state
|
||||
.getCompetitorDisplayName(), oneBaseRank, maxPointsReason, score, finishingTime, comment, MergeState.OK);
|
||||
return new CompetitorResultWithIdImpl(mCompetitor.getId(), result);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="18dp"
|
||||
android:height="18dp"
|
||||
android:viewportHeight="24.0"
|
||||
android:viewportWidth="24.0">
|
||||
<path
|
||||
android:fillColor="#e94a1b"
|
||||
android:pathData="M1,21h22L12,2 1,21zM13,18h-2v-2h2v2zM13,14h-2v-4h2v4z" />
|
||||
</vector>
|
||||
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="48dp"
|
||||
android:height="48dp"
|
||||
android:viewportHeight="24.0"
|
||||
android:viewportWidth="24.0">
|
||||
<path
|
||||
android:fillColor="#e94a1b"
|
||||
android:pathData="M1,21h22L12,2 1,21zM13,18h-2v-2h2v2zM13,14h-2v-4h2v4z" />
|
||||
</vector>
|
||||
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="64dp"
|
||||
android:height="64dp"
|
||||
android:viewportHeight="24.0"
|
||||
android:viewportWidth="24.0">
|
||||
<path
|
||||
android:fillColor="#e94a1b"
|
||||
android:pathData="M1,21h22L12,2 1,21zM13,18h-2v-2h2v2zM13,14h-2v-4h2v4z" />
|
||||
</vector>
|
||||
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="96dp"
|
||||
android:height="96dp"
|
||||
android:viewportHeight="24.0"
|
||||
android:viewportWidth="24.0">
|
||||
<path
|
||||
android:fillColor="#e94a1b"
|
||||
android:pathData="M1,21h22L12,2 1,21zM13,18h-2v-2h2v2zM13,14h-2v-4h2v4z" />
|
||||
</vector>
|
||||
|
After Width: | Height: | Size: 372 KiB |
@@ -0,0 +1,393 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
|
||||
<link rel="shortcut icon" type="image/x-icon"
|
||||
href="https://www.sapsailing.com/gwt/images/sap.ico">
|
||||
<link
|
||||
href="https://www.sapsailing.com/gwt/images/sap-sailing-app-icon.png"
|
||||
rel="apple-touch-icon">
|
||||
|
||||
<title>SAP Sailing - Jobs</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css"
|
||||
href="https://www.sapsailing.com/sailing-normalize-3.0.2.cache.css">
|
||||
<link rel="stylesheet" type="text/css"
|
||||
href="https://www.sapsailing.com/sailing-fontface-1.0.cache.css">
|
||||
|
||||
<script type="text/javascript">
|
||||
function handleSearch() {
|
||||
var searchUrl = "https://www.sapsailing.com/gwt/Home.html#SearchResultPlace:";
|
||||
var searchBox = document.getElementById("searchBox");
|
||||
if (searchBox && searchBox.value) {
|
||||
searchUrl += searchBox.value;
|
||||
}
|
||||
window.location.href = searchUrl;
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.E6EY1K-c-g {
|
||||
font-size: 15px;
|
||||
font-size: 1rem;
|
||||
background: #333;
|
||||
border-bottom: 5px solid #f0ab00;
|
||||
min-height: 4.333333333333333em;
|
||||
line-height: 4em;
|
||||
width: 100%;
|
||||
overflow: hidden
|
||||
}
|
||||
|
||||
.E6EY1K-c-a {
|
||||
margin: .8em 0;
|
||||
float: left
|
||||
}
|
||||
|
||||
.E6EY1K-c-b {
|
||||
display: none;
|
||||
height: 4.333333333333333em;
|
||||
line-height: 4.333333333333333em;
|
||||
color: #f6f9fc
|
||||
}
|
||||
|
||||
@media ( min-width :50em) {
|
||||
.E6EY1K-c-b {
|
||||
display: inline
|
||||
}
|
||||
}
|
||||
|
||||
.E6EY1K-c-i {
|
||||
float: right;
|
||||
text-align: right;
|
||||
width: 100%;
|
||||
height: 4.333333333333333em
|
||||
}
|
||||
|
||||
.E6EY1K-c-j {
|
||||
display: inline-block;
|
||||
height: 4.642857142857143em;
|
||||
line-height: 4.642857142857143em;
|
||||
font-size: .933333333333333em;
|
||||
font-weight: 600;
|
||||
color: #f6f9fc;
|
||||
text-transform: uppercase;
|
||||
padding: 0 2.5em
|
||||
}
|
||||
|
||||
.E6EY1K-c-j:hover, .E6EY1K-c-j:focus {
|
||||
text-decoration: none;
|
||||
background-color: #2d2d2d
|
||||
}
|
||||
|
||||
.E6EY1K-c-j:hover, .E6EY1K-c-j:focus {
|
||||
color: #f0ab00
|
||||
}
|
||||
|
||||
.E6EY1K-c-l {
|
||||
display: inline-block;
|
||||
height: 4.333333333333333em;
|
||||
font-weight: 600;
|
||||
color: #f6f9fc;
|
||||
text-transform: uppercase;
|
||||
text-align: right
|
||||
}
|
||||
|
||||
.E6EY1K-c-e {
|
||||
-webkit-box-shadow: -10px 0 10px rgba(51, 51, 51, 0.9);
|
||||
box-shadow: -10px 0 10px rgba(51, 51, 51, 0.9)
|
||||
}
|
||||
|
||||
.E6EY1K-c-c {
|
||||
font-size: 15px;
|
||||
font-size: 1rem;
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
margin-top: .2em;
|
||||
position: relative
|
||||
}
|
||||
|
||||
.E6EY1K-c-e {
|
||||
width: 100%;
|
||||
padding: .785714285714286em 2.857142857142857em .785714285714286em
|
||||
1.071428571428571em;
|
||||
background: #222;
|
||||
border: 1px solid #666;
|
||||
font-size: .933333333333333em;
|
||||
color: #fff;
|
||||
outline: none
|
||||
}
|
||||
|
||||
.E6EY1K-c-d {
|
||||
position: absolute;
|
||||
right: 1.5em;
|
||||
top: 50%;
|
||||
margin-top: -0.666666666666667em
|
||||
}
|
||||
|
||||
.E6EY1K-c-d:hover, .E6EY1K-c-d:focus {
|
||||
background-color: transparent
|
||||
}
|
||||
|
||||
.E6EY1K-c-e {
|
||||
-webkit-transition: height .1s ease;
|
||||
-moz-transition: height .1s ease;
|
||||
-o-transition: height .1s ease;
|
||||
-ms-transition: height .1s ease;
|
||||
transition: height .1s ease
|
||||
}
|
||||
|
||||
.E6EY1K-d-d {
|
||||
color: #f0ab00;
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
margin-left: .666666666666667em
|
||||
}
|
||||
|
||||
.E6EY1K-b-b {
|
||||
float: left;
|
||||
padding: 0 1rem;
|
||||
position: relative;
|
||||
width: 100%
|
||||
}
|
||||
|
||||
.E6EY1K-b-b img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
ms-interpolation-mode: bicubic
|
||||
}
|
||||
|
||||
.E6EY1K-b-ib {
|
||||
width: 8.3333333333333%
|
||||
}
|
||||
|
||||
.E6EY1K-b-mb {
|
||||
width: 16.6666666666667%
|
||||
}
|
||||
|
||||
.E6EY1K-b-tb {
|
||||
width: 75%
|
||||
}
|
||||
|
||||
@media ( min-width :25em) {
|
||||
.E6EY1K-b-K {
|
||||
width: 25%
|
||||
}
|
||||
.E6EY1K-b-O {
|
||||
width: 58.3333333333333%
|
||||
}
|
||||
}
|
||||
|
||||
@media ( min-width :50em) {
|
||||
.E6EY1K-b-k {
|
||||
width: 25%
|
||||
}
|
||||
.E6EY1K-b-n {
|
||||
width: 50%
|
||||
}
|
||||
}
|
||||
|
||||
*, *:before, *:after {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box
|
||||
}
|
||||
|
||||
html, body {
|
||||
height: 100%;
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
font-size: 93.75%;
|
||||
line-height: 1.333;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
-ms-content-zooming: none
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: #008fcc
|
||||
}
|
||||
|
||||
a:hover, a:focus {
|
||||
text-decoration: underline
|
||||
}
|
||||
|
||||
a img {
|
||||
vertical-align: bottom
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 2.4em;
|
||||
font-weight: bold;
|
||||
color: #008fcc;
|
||||
margin-top: .7em;
|
||||
margin-bottom: .7em
|
||||
}
|
||||
|
||||
.E6EY1K-a-g {
|
||||
display: block;
|
||||
width: 100%;
|
||||
max-width: 80rem;
|
||||
list-style: none;
|
||||
margin: 0 auto;
|
||||
zoom: 1
|
||||
}
|
||||
|
||||
.E6EY1K-a-g:before, .E6EY1K-a-g:after {
|
||||
content: "";
|
||||
display: table
|
||||
}
|
||||
|
||||
.E6EY1K-a-g:after {
|
||||
clear: both
|
||||
}
|
||||
|
||||
.E6EY1K-a-g * {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box
|
||||
}
|
||||
|
||||
.E6EY1K-a-g .E6EY1K-a-g {
|
||||
width: auto;
|
||||
max-width: none;
|
||||
margin-left: -1rem;
|
||||
margin-right: -1rem
|
||||
}
|
||||
|
||||
.E6EY1K-a-a {
|
||||
font-size: 15px;
|
||||
font-size: 1rem;
|
||||
display: inline-block;
|
||||
font-weight: 600;
|
||||
color: #fff;
|
||||
border: none;
|
||||
padding: .666666666666667em 1.133333333333333em;
|
||||
background-color: #f0ab00;
|
||||
-webkit-transition: background-color .2s;
|
||||
-moz-transition: background-color .2s;
|
||||
-o-transition: background-color .2s;
|
||||
-ms-transition: background-color .2s;
|
||||
transition: background-color .2s;
|
||||
text-decoration: none
|
||||
}
|
||||
|
||||
.E6EY1K-a-a:hover, .E6EY1K-a-a:focus {
|
||||
background-color: #d89a00;
|
||||
outline: none;
|
||||
text-decoration: none
|
||||
}
|
||||
|
||||
.E6EY1K-a-e {
|
||||
background-repeat: no-repeat;
|
||||
background-position: left top;
|
||||
-webkit-background-size: cover;
|
||||
-moz-background-size: cover;
|
||||
background-size: cover;
|
||||
height: 0;
|
||||
border: 0;
|
||||
overflow: hidden;
|
||||
background-color: transparent;
|
||||
width: 1.333333333333333em;
|
||||
padding: 1.4em 0 0;
|
||||
background-image:
|
||||
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAVCAYAAABG1c6oAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2hpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDowMzgwMTE3NDA3MjA2ODExODhDNkY0MENFRkI5ODA4MiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo5MUFEMjM1NkJDQzExMUUzQjg3OTk5M0I5MTJGQ0VFNSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo5MUFEMjM1NUJDQzExMUUzQjg3OTk5M0I5MTJGQ0VFNSIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1LjEgTWFjaW50b3NoIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6RkREN0JFQTYyNjIxNjgxMTg3MUZENzgzOTY3OTA2QzciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6MDM4MDExNzQwNzIwNjgxMTg4QzZGNDBDRUZCOTgwODIiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4wYIhVAAABZklEQVR42qyUwUdEURTGe28S8VbDEPGIiHaJFhlepFXUv9AiQ6tGtJ7N/AFRRCRatCxaJWpTilYRbzUMj9EjRSQmpb7LF8edd++drg4/9zhz53POPeed4L37OfCfFhbEquAYPINv0AXnYKUfwUBkOAyaYMNy/wysgo5LcIhZJIxn4BQ8gJjxKn97AlMm0UGem0JsH9TBm3a3BrZBBRyCeVOGEc5HEDGrZUvJ62CL/iy4LWpKQjFlDceb74IX+kumLo/TfwX3DsEPcE1/wiRYEpf7sd97kUkwo19hR102zbNlElQlfIlHt9kiGKN/YhLMwZ4QXDOIzYADUXZqG2xV7o1o0CU4YpNURgucQ2kpZzE3fXoxBzb5wy7oEZXLQTVnjl9Jpv1Rzd5OQSMmwQUYKcpQt5hPocTajI2CK9GYnkwDj31oFQ09dmiHT9PW4mVF6LmYM000Z8mpr6AUveOZupriZT8CDADoqmLlEaD/6QAAAABJRU5ErkJggg==");
|
||||
}
|
||||
|
||||
.E6EY1K-a-g:before, .E6EY1K-a-g:after {
|
||||
content: "";
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.button-job {
|
||||
font-size: 24px !important;
|
||||
font-size: 1rem;
|
||||
display: inline-block;
|
||||
font-weight: 600;
|
||||
color: #fff;
|
||||
border: none;
|
||||
padding: .666666666666667em 1.133333333333333em;
|
||||
background-color: #f0ab00;
|
||||
-webkit-transition: background-color .2s;
|
||||
-moz-transition: background-color .2s;
|
||||
-o-transition: background-color .2s;
|
||||
-ms-transition: background-color .2s;
|
||||
transition: background-color .2s;
|
||||
text-decoration: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body style="margin: 0 !important;">
|
||||
<div>
|
||||
<header class="E6EY1K-c-g">
|
||||
<div class="E6EY1K-a-g">
|
||||
<div class="E6EY1K-b-mb E6EY1K-b-k E6EY1K-b-b">
|
||||
<a href="https://sapsponsorships.com"> <img
|
||||
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKEAAABQCAYAAABxnxUKAAAVD0lEQVR42u2dCVSV553GL7LDvcguwdg2bSfTNUnbM5N2kkzTczrTSTOnmTOdntOmbTRxiYmJjca4IooaRXGNcTeKS1P3mGhcEdk3AZF957Iv8iGCCIj6zPN+LKIi3O/j3gvq9z/nORC43/v+3+f/e5fvu1ei0528mkNVa9JkdZ24WsOvl3U2JxqbKGjSZHV93QjdiSuBOpvjDRIFTZqsLd3XDbN1IkZ8JUkUNGmyrroAFGF7tF6ioEmTtTTiaP0dAGUIv7gsUdCkyeI6chkjjtwDoAi7w7WS3eE6aNJkcR2qux9AGcKDhPBgLTRpsqgOPABAEfb7ayQKmjRZSnYHah4MoAiHfdUSBU2aLCG7fQMAKEP4eZVEQZMm86tyYABFOO2tlBz3VkKTJnPKZABlCHdXSI57KmAuOeyugH2XxPcOZmxb08Mhh73lpgMoQ7irXKKgVA7UiJ1l0H1GbS+lur7nz+xDO39v0/37ntdQO8rk6+z5e0cV/far3eVy33Yq5NB1vdI+7ULNp27fzO6LdaUMQBnC0DKJgilyDBVAEaStpbAnSE/tr8RvTtVhXnIjtuddw1el1xFV3Yaky+24QMXUtOFkeSv+XtiC1RlNmBzbgH//ula+zlW0ta2zLdGm407TcuhPDmzDQCN8/l6hWM4q+/TaW6Gqv97ypjz2lEMvJvfOrgm7tUv0yMZM/lhB83RqwnlHqUShPzntEIYYZT17uApzkq4goa4NV9tvQU2I6zIbbiA0vxlvRtTjGbZpL4zfXAKbbUa5P2eFEtfY8dojJS2oarmpWO/FStBtKTG5P0eC4bqzFOGVbar6660KqqS5A9lXbiCprp0T9zo+yWzC1LgGvHqqFv98oLLHH1EDp8+U+2NpOX1mnK9TG87bjRKFvuTymRG2WznwTSX41bFqHCy6hvabt2HuaL91G7FcNQMuXMFzhyphs6WzT4dtfefVl0bwmh8eqEDHLXX5JdW2wUEU2MT+HJmbK/3JJTiWjpaO24ijP0tTG/Hil9Ww66qJY1eNTPXIUhoUgCJcthklCn1Jt6EY39xTht15zbh1G1aJNkJ+hivB62frMFIMkIY/KL+7cy3C4uQrqvsVw3vxaBVsNhWb1J8TgdUzvwypHdYMkWdUVSteD6uDo5isG03L13IqHhyAMoRbiiUKveVM6dYX4rUTNai41oGhirTLbfAPNcJh89353Sunrq+ZgwRiU+ZVjrsILgL8LQP0yZz0W4utDmHviCaM/3a4Uq6VqJnL1uIB8zazBg+gCNfNRRKFHm0qgu6TAkw+X4ebt29jKOPzvCbYf1oIl0298utDNizCK19VYbDZljZ1wGtbMRwH6E/Ima8xbClCRn37kHp0nVv1lMg61qxQzmmgvM0lly2F5gFQhnAjIdzIhrukW5uPN87UYIj5Q33rTXxnlxH2BKx3fn1J5PxZ1lWz9PunU9Vsr2DAPp25/Rs2DT2E3TEvrl7O22WAvM0hl01mBFCE/tMCSb+hEEIj1uXjZ5+X4dqNW0NuamA8TV2dj+7cHiTH9QUYs70Yl6/fNEu/+3nHrlszcL8uXKHdNhYOGwhF/FVMIBNyH6TMC2APhJ9yBrGYToQwsuL6kJtZxDtOTxbY6RMaytz6k25VHsbSfHNFY9stfGdHMRzW9d+38MttQ8GwgrCOE/G7zN1+7cC+KRbHq9+Qb34ARRg+yZco2KzMxZ+OVw4LM18/XgUd8xF59Sc9QbFfnYezxhaz9v/O2RroQvrv35V9j1yfjwzePA2n2JHRaJJ3SqVfbyEAZQjX5kn6tXmwX5WLiLLBF/PGrdto5nYu1KbimeIZ4zXYrsyByMkwgByY8492FqOtw7wH2OiKFjiy7f5ycF2Th5Hr8oYdhK304hl6IrwxmOChKdKvy7UcgCLc1uRKjiz6c0y8VWUxK3hXGZxQj/8+VIaf7SrG97YV4vvbC/ETtvni3hL555NPV2PTxQZcqmt7IJziQfgv9pTALiQbzGtA6YKzsSj2stkLeYN5/DSUhaQvD+pbvzoX7mtzkakCwvjK61gWfxmrkySsolZfkLAj/QrCS1tQ0jj4h98BUXWyN6Z4aIIsC6AM4eocSbcsC1NOqztXHc1vgv/6POiWZsGWA3dYkQ2nkE458nt7Svxc9CHE/vDcjiLMjahFUtXd58/NqQ2dr1mVI7+uP+n5GgOVUWeZlUhA0p3vg/p3X5OjCsKF0YRkQXqPJ0I2wVmydz5cXX/1uREHc9Tf7QtfXVZ2+jOQj/1qTbblARQxcmWOZPNxJtZxRiqN8qYb8P8kF/Y0ke2YoGwYBJzLaTz7dKXpv91nxBd5TTByBfjupnw4LTetLTv2+er+Uos9SsoiXG5d+fbVvyEkBx4scqaKSbAsjoB/nCH70VuiPz37E2MT/rx5rELV7tTYdlP20nlFtol1ub9ObqusBKAMYUi2ZMsB78tsVD7juK3YLc2EmxhsiHIZVmTBjn07cRX4FldTVwLobuK1uiUZ+IzbuyXfHhMTRIyv79yz4cFiqYKQRwiRf3/jE57qgtIRcL5GVe4v7+Zx4gG5DyS3ECsCKMJ9RZZkz1n5hYrlX5zhXttvhG7hJYwUAK1QJ3Gt67JMuJvYhnjtN9floMbCbyluTpFgsyi9zxzcmKtnSJYqCINj62ATlG7SOEdzy69uVj7ON74oh+3iDGW1EP4vz7QugDKEwZmS/eJ0HM5Wdwapb+nAHw6WYkTQJTgtobHBmRbXCIIx7miZ4tVB6SdsqnjceHINt8ilGffl4EZAPJdnEsJW5RDGEEJOXFPGasuxHs5RvkvNPVct10SRt0MBoAiPpRmSHQ3ZeVEa1KoRyq3xuU15sF2YBsdFXBlZOI9l5pc723VafAlnCpsV5VfY0IbNyfWKx/XnQ6UQ/tybhxifV3AGMmtVQBhdixEL0kwar/BzU1K9RfuQfV2WPjQAdkKYLo0IvIhF5wf/roN4u29HqoRfhxZCT1BsA9PgzNk48uN0sB+zyIWAP7shlwd2ZW8thjKvZz7NUfyhjK9yr8KRILjfMwYxJq9l6eohpOemjFd4uOWCcghDYtjHfBP64DiGFEAZwiXpksOCi/jfz4vNep5KLG9BUHg1/oWrozu3e1sa4iSKSTjZp2rZBnDChCufMOOPlMnXplYpe1uyuf0Wvr82G65Bd+c9kmPy+lglhFEEhLmYMl4HQngyT/lRaTEXFVP64OQaWgBFeC6+JLkFpcGfS3J5o/nfBxUPfkXhg85V4aUteRB92c5LhYFAsm9Fcl8klIaMGmUgSTy3/tOqLOhmpyCEACiNmScrYMec783Fe8klVRAuj6yRPRhovC5cHL63OguNrco/nDHlyzLYBwzUR9rQAyhDuChNomA3NwVrYmphyRA7YazxGmacKMfTKzPlPl25LYn+TZEjTf3tzgLFzwZP5V+FE68VemWH8usTyq5BL7bPoDu5uPN778VpyKxRAWEEIeTY+xurGyepzZwUbE1S947QK/RJjLfP9sU4hguAIrwWpkkUDIGpeDokQ77btconPq51YB2hf25tFuznJMONRfaiOSKXB8mBhduTqvx8NO1YOftIgTtXFl+CU1iv7LGKeBT1wsZcuLCo3bl48NDvE6QWwmrYzk6G58KLd8mD+Rnmp8JutvAjFYu5e6iJFp7Nf7wmS27rfh/ZV1Dq8AFQhnBBqkTBiwY4cPCTDpVY9Q33prabWMXt6RtLL8n9d+fS+fWO3Gjot3kjoHSSXGdBnlmdCX1AityuPfvYnaIc5LXRNbCbdaEnNw9C4rMwlRAq/+jbEsKlm54I57nJPXKdlyK3+4OVGZh82Ij40muqPU2vvg7Prhzv9dEzcJgBKMI7MFWiIOQVmAInGr0yohrWDrE6/X5XARxmXoDn/BR059QtB+b1DoujNOKMzXBjgbvbdJp9AX/YXai4ndIr7Xgi6CLcAzrb8eSk8GVRs1RAKMZ6PPsKTuU19iiyqAkZhOdq2+A/nLs8vAr2M5Pu89B7OAIoQzifEIoCdclzXjJcWPBglVvBYEI8Sw48WQ4nGugZkNyTkxcL78qcIgqV3yXO/poH9BlJPW25c3xPLUnDZRXvtvxfaAGcZ3a25cmcfDlp1UBoyRAP5F9YnwU9J1vvunoHJA9PAGUIA5Ilb1HwXhIgOs5IxPh9RahtvmF1I1edr4bzR0nwmteZjzD0+TWZaFX4zw5usiAvfsKCzEq6a3wCpCPpyh/OH0yT6EtSj0e+85ORVT28IDyS3tDp3d01Hb4AivCdlyz50NB75c1ziuOHifhRcBr2qbgZGGx8cMTI/hPkXOynJ2DZWeWf+k7mXa3HHJ7j5l64a2xOHNcETjClIVbPp5dwS57NItOfUQHDC8Jr3MqfX50BAydZrzoObwBlCOdckHxYqD7F4rl9lAgXwvDq5hyczW20mqFXW2/iZyHpcOWK7Eczc1Rse8EE1+GDhPvGNZJFejb4Eq61Kz9/TeWNm+O0BHhxdR5Ff4YThLO/KoXDtPiecXrPfggA7IQwSfLlzO5PPpQrVyODgHFjNo5wW2puu2lxU3cl1kH3bix+tyVH1fnyNxu4FTPvvsYjxhKmYlKJiajntZ4zOTnmJBHClmEB4B56JWrkPatnnA8HgDKEswihSNwE+VB6zjT99Hj8ZFkaAo+XIb64SX5XxFKr4bd47toWq/wzdWLlFMXwJix9jcXxb3EI4MqhNNo6buH5FZdkH/xmDw8I9xJAT+5YQvL4Zj5EAMoQzkyUfEWhFMiHcuesc5oaBw+uCi+uTEfgsVKcz2tUfPMwUHx4uBgl9co/s7c2vBK2U2Lh81Hf+es/iMNPl16Uz1FKI/B4Kezfi4UfC55VNXQQigmxkLm4cUJ4zkjoGt9DBqCIUR8lSBTUyoeDH8mCOr0fC3ea8a+8kZlxqBhJJULine truncated
|
||||
width="161" height="80" class="E6EY1K-c-a"
|
||||
alt="SAP Sailing Analytics" style="width: 80px; height: 40px;">
|
||||
</a>
|
||||
<p class="E6EY1K-c-b">Sailing Analytics</p>
|
||||
</div>
|
||||
<div class="E6EY1K-b-tb E6EY1K-b-O E6EY1K-b-n E6EY1K-b-b">
|
||||
<nav class="E6EY1K-c-i">
|
||||
<a class="E6EY1K-c-j"
|
||||
href="https://www.sapsailing.com/gwt/Home.html#StartPlace:null">Home</a>
|
||||
<a class="E6EY1K-c-j"
|
||||
href="https://www.sapsailing.com/gwt/Home.html#EventsPlace:null">Events</a>
|
||||
<!--<a class="E6EY1K-c-j" href="https://www.sapsailing.com/gwt/Home.html#SolutionsPlace:navigationTab=SailingAnalytics">Solutions</a>-->
|
||||
<a class="E6EY1K-c-j E6EY1K-c-k"
|
||||
href="https://jobs.sapsailing.com/index.html">Jobs</a> <a
|
||||
class="E6EY1K-c-j"
|
||||
href="https://www.sap.com/about/legal/impressum.html">Imprint</a>
|
||||
</nav>
|
||||
</div>
|
||||
<form class="E6EY1K-c-l E6EY1K-b-ib E6EY1K-b-K E6EY1K-b-b"
|
||||
method="POST" onSubmit="return handleSearch();">
|
||||
<div class="E6EY1K-c-c">
|
||||
<button type="submit" class="E6EY1K-a-a E6EY1K-a-e E6EY1K-c-d">Search</button>
|
||||
<input id="searchBox" type="text" class="E6EY1K-c-e"
|
||||
placeholder="Search SAPSailing.com ">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</header>
|
||||
</div>
|
||||
|
||||
<table style="margin-top: 45px; margin-bottom: 45px;">
|
||||
<tr>
|
||||
<td align="left" valign="middle"><div
|
||||
style="margin-left: 20px; padding: 25px; width: 500px;">
|
||||
<h2>About Us</h2>
|
||||
<p>SAP is at the center of today’s technology revolution,
|
||||
developing innovations that not only help our customers run at
|
||||
their best, but also improve the lives of people everywhere.</p>
|
||||
<p>As the market leader in enterprise application software, we
|
||||
help organizations of all sizes and industries combat the damaging
|
||||
effects of complexity, generate new opportunities for innovation
|
||||
and growth, and stay ahead of the competition.</p>
|
||||
<p>By delivering real time analytics around race rankings,
|
||||
speeds, maneuvers, bearings etc., SAP is helping to simplify and
|
||||
demystify the complex sport of sailing.</p>
|
||||
<p>SAP Sailing Analytics provide insights and transparency to
|
||||
the world of sailing by utilizing Cloud and In-Memory Technology,
|
||||
processing GPS and wind measurement data in real time and
|
||||
visualizing contents in various frontends accessible from
|
||||
anywhere.</p>
|
||||
<h2>Jobs</h2>
|
||||
<a class="button-job"
|
||||
href="https://jobs.sap.com/job/WalldorfSt_-Leon-Rot-Intern-Working-Student-%28fm%29-SAP-Sailing-Program-Job-BW/346487201/?locale=en_US"
|
||||
target="_blank">» Student Backend Development</a>
|
||||
</div></td>
|
||||
<td align="center" valign="top"><div style="margin-top: 55px;">
|
||||
<img src="RaceViewer2.jpg" height="85%" width="85%" />
|
||||
</div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-top: 20px;" align="center"></td>
|
||||
<td style="padding-top: 20px;" align="center"></td>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,5 +1,87 @@
|
||||
**This page has the purpose to prepare and track the progress of the bug4232 review**
|
||||
(See https://bugzilla.sapsailing.com/bugzilla/show_bug.cgi?id=4232)
|
||||
(See [bugzilla](https://bugzilla.sapsailing.com/bugzilla/show_bug.cgi?id=4232))
|
||||
|
||||
# Test Scenarios
|
||||
|
||||
## Prerequisites
|
||||
* two devices (Smartphone and/or Tablet)
|
||||
* device configuration: bug4232 (so all settings are correct - or manual)
|
||||
* server: https://dev.sapsailing.com
|
||||
* refresh time: 20 sec (because of faster local refreshes)
|
||||
* event: Extreme Sailing Series 2016 Act 8 Sydney
|
||||
|
||||
The edit dialog (open with the pencil) should always be closed if a warning (yellow or red) will be displayed. In case of a red warning, the publish button is always disabled.
|
||||
|
||||
One device will be called **A** and the other **B**, so they are have unique names while testing.
|
||||
|
||||
## While starting
|
||||
|
||||
### Test 1
|
||||
* devices open the penalty fragment
|
||||
* device A give Omar Air OSC, device B set DNS for Omar Air
|
||||
* device A closes the penalty view (without publishing)
|
||||
* device B should see a red warning sign (without active publish button) after the automatic refresh
|
||||
|
||||
### Test 2
|
||||
* same as [test 1](#test-scenarios_while-starting_test-1), but this time the result should be published
|
||||
* same result as [test 1](#test-scenarios_while-starting_test-1).
|
||||
|
||||
### Test 3
|
||||
* same as [test 1](#test-scenarios_while-starting_test-1), but after refresh device B should close the penalty view
|
||||
* after refresh device A should also see the red warning sign, without the possibility to publish
|
||||
|
||||
### Test 4
|
||||
* both devices open the penalty fragment
|
||||
* device A give Omar Air OSC, device B set for Alinghi the value DNS
|
||||
* device A closes the penalty view (without publishing)
|
||||
* device B should see both entries in the list after refresh
|
||||
|
||||
### Test 5
|
||||
* same as [test 4](#test-scenarios_while-starting_test-4), but this time the result should be published
|
||||
* same result as [test 4](#test-scenarios_while-starting_test-4).
|
||||
|
||||
### Test 6
|
||||
* same as [test 4](#test-scenarios_while-starting_test-4), but after refresh device B should publish the merged result
|
||||
* after the refresh device A also see both entries
|
||||
|
||||
## While finishing
|
||||
|
||||
### Test 7
|
||||
* both devices open result list
|
||||
* device A add Omar Air, Alinghi and LR BAR into the list
|
||||
* device A closes the result list
|
||||
* after refresh device B see the three competitors in the result list
|
||||
|
||||
### Test 8
|
||||
* both devices open result list
|
||||
* both devices add Omar Air to the result list
|
||||
* device A set the penalty to OSC and closes the result list
|
||||
* device B should see after the refresh a yellow warning sign
|
||||
|
||||
### Test 9
|
||||
* both devices open result list
|
||||
* both devices add Omar Air to the result list
|
||||
* both devices set the penalty to different values
|
||||
* device A closes the result list
|
||||
* device B should see a red warning sign and the data should show the values from device A
|
||||
|
||||
### Test 10
|
||||
* both devices open result list
|
||||
* both devices add Omar Air to the result list
|
||||
* device A changes to penalty view and set the value to DNF and changes back to result list
|
||||
* device B should see a yellow warning sign after refresh
|
||||
|
||||
### Test 11
|
||||
* both devices open result list
|
||||
* device A add Omar Air and Alinghi
|
||||
* device B add Alinghi and Omar Air
|
||||
* device A closes the result list
|
||||
* device B should see yellow warning sign and the order Omar Air and Alinghi
|
||||
|
||||
### Test 12
|
||||
* both devices open result list
|
||||
* device A add Omar Air and Alinghi
|
||||
* device B add Omar Air and LR Bar
|
||||
* device A closes the result list
|
||||
* device B should see 1. Omar Air, 2. Alinghi and 2. LR Bar - because of two second places the publish button should be disabled
|
||||
|
||||