mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-11 14:50:56 +00:00
UI support for the new EventBase fields (untested as yet)
This commit is contained in:
1 parent
89d8d4c7ba
commit
97bea21d84
14 files changed
+113
-38
No files matched your search
@@ -365,14 +365,11 @@ public interface RacingEventService extends TrackedRegattaRegistry, RegattaFetch
|
||||
* The name of the venue of the event
|
||||
* @param isPublic
|
||||
* Indicates whether the event is public accessible via the publication URL or not
|
||||
* @param leaderboardGroupIds
|
||||
* TODO
|
||||
* @param imageURLs TODO
|
||||
* @param videoURLs TODO
|
||||
*
|
||||
* @return The new event
|
||||
*/
|
||||
void updateEvent(UUID id, String eventName, TimePoint startDate, TimePoint endDate, String venueName, boolean isPublic, Iterable<UUID> leaderboardGroupIds, Iterable<URL> imageURLs, Iterable<URL> videoURLs);
|
||||
void updateEvent(UUID id, String eventName, String eventDescription, TimePoint startDate, TimePoint endDate,
|
||||
String venueName, boolean isPublic, Iterable<UUID> leaderboardGroupIds, URL officialWebsiteURL,
|
||||
URL logoImageURL, Iterable<URL> imageURLs, Iterable<URL> videoURLs, Iterable<URL> sponsorImageURLs);
|
||||
|
||||
/**
|
||||
* Renames a sailing event. If a sailing event by the name <code>oldName</code> does not exist in {@link #getEvents()},
|
||||
|
||||
+7
-2
@@ -2278,13 +2278,15 @@ public class RacingEventServiceImpl implements RacingEventServiceWithTestSupport
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEvent(UUID id, String eventName, TimePoint startDate, TimePoint endDate, String venueName,
|
||||
boolean isPublic, Iterable<UUID> leaderboardGroupIds, Iterable<URL> imageURLs, Iterable<URL> videoURLs) {
|
||||
public void updateEvent(UUID id, String eventName, String eventDescription, TimePoint startDate, TimePoint endDate,
|
||||
String venueName, boolean isPublic, Iterable<UUID> leaderboardGroupIds, URL officialWebsiteURL,
|
||||
URL logoImageURL, Iterable<URL> imageURLs, Iterable<URL> videoURLs, Iterable<URL> sponsorImageURLs) {
|
||||
final Event event = eventsById.get(id);
|
||||
if (event == null) {
|
||||
throw new IllegalArgumentException("Sailing event with ID " + id + " does not exist.");
|
||||
}
|
||||
event.setName(eventName);
|
||||
event.setDescription(eventDescription);
|
||||
event.setStartDate(startDate);
|
||||
event.setEndDate(endDate);
|
||||
event.setPublic(isPublic);
|
||||
@@ -2299,8 +2301,11 @@ public class RacingEventServiceImpl implements RacingEventServiceWithTestSupport
|
||||
}
|
||||
}
|
||||
event.setLeaderboardGroups(leaderboardGroups);
|
||||
event.setOfficialWebsiteURL(officialWebsiteURL);
|
||||
event.setLogoImageURL(logoImageURL);
|
||||
event.setImageURLs(imageURLs);
|
||||
event.setVideoURLs(videoURLs);
|
||||
event.setSponsorImageURLs(sponsorImageURLs);
|
||||
// TODO consider use diffutils to compute diff between old and new leaderboard groups list and apply the patch to keep changes minimial
|
||||
mongoObjectFactory.storeEvent(event);
|
||||
}
|
||||
|
||||
+13
-3
@@ -15,20 +15,29 @@ public class UpdateEvent extends AbstractEventOperation<Void> {
|
||||
private final boolean isPublic;
|
||||
private final Iterable<UUID> leaderboardGroupIds;
|
||||
private final String eventName;
|
||||
private final String eventDescription;
|
||||
private final URL officialWebsiteURL;
|
||||
private final URL logoImageURL;
|
||||
private final Iterable<URL> imageURLs;
|
||||
private final Iterable<URL> videoURLs;
|
||||
private final Iterable<URL> sponsorImageURLs;
|
||||
|
||||
public UpdateEvent(UUID id, String eventName, TimePoint startDate, TimePoint endDate, String venueName,
|
||||
boolean isPublic, Iterable<UUID> leaderboardGroupIds, Iterable<URL> imageURLs, Iterable<URL> videoURLs) {
|
||||
public UpdateEvent(UUID id, String eventName, String eventDescription, TimePoint startDate, TimePoint endDate,
|
||||
String venueName, boolean isPublic, Iterable<UUID> leaderboardGroupIds, URL logoImageURL,
|
||||
URL officialWebsiteURL, Iterable<URL> imageURLs, Iterable<URL> videoURLs, Iterable<URL> sponsorImageURLs) {
|
||||
super(id);
|
||||
this.eventName = eventName;
|
||||
this.eventDescription = eventDescription;
|
||||
this.startDate = startDate;
|
||||
this.endDate = endDate;
|
||||
this.venueName = venueName;
|
||||
this.isPublic = isPublic;
|
||||
this.leaderboardGroupIds = leaderboardGroupIds;
|
||||
this.officialWebsiteURL = officialWebsiteURL;
|
||||
this.logoImageURL = logoImageURL;
|
||||
this.imageURLs = imageURLs;
|
||||
this.videoURLs = videoURLs;
|
||||
this.sponsorImageURLs = sponsorImageURLs;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -45,7 +54,8 @@ public class UpdateEvent extends AbstractEventOperation<Void> {
|
||||
|
||||
@Override
|
||||
public Void internalApplyTo(RacingEventService toState) {
|
||||
toState.updateEvent(getId(), eventName, startDate, endDate, venueName, isPublic, leaderboardGroupIds, imageURLs, videoURLs);
|
||||
toState.updateEvent(getId(), eventName, eventDescription, startDate, endDate, venueName, isPublic,
|
||||
leaderboardGroupIds, officialWebsiteURL, logoImageURL, imageURLs, videoURLs, sponsorImageURLs);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user