mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-27 22:37:15 +00:00
Adjusted UI components to work with new EventDTO structure
This commit is contained in:
1 parent
cbd50476f0
commit
c15f2b6d1f
14 files changed
+40
-39
No files matched your search
+7
-1
@@ -1,5 +1,6 @@
|
||||
package com.sap.sailing.gwt.home.mobile.partials.recents;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
@@ -9,6 +10,8 @@ import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.FlowPanel;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.gwt.home.mobile.app.MobilePlacesNavigator;
|
||||
import com.sap.sailing.gwt.home.mobile.partials.stage.Stage;
|
||||
import com.sap.sailing.gwt.ui.shared.eventlist.EventListEventDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.eventlist.EventListYearDTO;
|
||||
|
||||
public class EventsOverviewRecent extends Composite {
|
||||
@@ -21,6 +24,7 @@ public class EventsOverviewRecent extends Composite {
|
||||
private final MobilePlacesNavigator navigator;
|
||||
|
||||
@UiField FlowPanel year;
|
||||
@UiField Stage eventStage;
|
||||
|
||||
public EventsOverviewRecent(MobilePlacesNavigator navigator) {
|
||||
this.navigator = navigator;
|
||||
@@ -33,12 +37,14 @@ public class EventsOverviewRecent extends Composite {
|
||||
// remove old widgets
|
||||
year.clear();
|
||||
|
||||
List<EventListEventDTO> allEvents = new LinkedList<EventListEventDTO>();
|
||||
boolean oneYearIsExpanded = false;
|
||||
for (EventListYearDTO yearDTO : years) {
|
||||
EventsOverviewRecentYear recentEventsOfOneYear = new EventsOverviewRecentYear(yearDTO, navigator, !oneYearIsExpanded);
|
||||
year.add(recentEventsOfOneYear);
|
||||
|
||||
oneYearIsExpanded = true;
|
||||
allEvents.addAll(yearDTO.getEvents());
|
||||
}
|
||||
eventStage.setFeaturedEvents(allEvents);
|
||||
}
|
||||
}
|
||||
+4
-5
@@ -1,10 +1,9 @@
|
||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui"
|
||||
xmlns:s="urn:import:com.sap.sailing.gwt.home.client.shared">
|
||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:g="urn:import:com.google.gwt.user.client.ui"
|
||||
xmlns:mp="urn:import:com.sap.sailing.gwt.home.mobile.partials" xmlns:s="urn:import:com.sap.sailing.gwt.home.client.shared">
|
||||
<ui:with field="i18n" type="com.sap.sailing.gwt.common.client.i18n.TextMessages" />
|
||||
<ui:with field="res" type="com.sap.sailing.gwt.home.mobile.resources.SharedResources" />
|
||||
<ui:with field="local_res" type="com.sap.sailing.gwt.home.mobile.partials.recents.EventsOverviewRecentResources" />
|
||||
<g:FlowPanel ui:field='year' addStyleNames="{local_res.css.eventsoverviewrecent} {local_res.css.accordion}">
|
||||
</g:FlowPanel>
|
||||
<mp:stage.Stage ui:field='eventStage'/>
|
||||
<g:FlowPanel ui:field='year' addStyleNames="{local_res.css.eventsoverviewrecent} {local_res.css.accordion}" />
|
||||
</ui:UiBinder>
|
||||
+2
-2
@@ -1,13 +1,13 @@
|
||||
package com.sap.sailing.gwt.home.mobile.partials.stage;
|
||||
|
||||
import com.sap.sailing.gwt.home.mobile.app.MobilePlacesNavigator;
|
||||
import com.sap.sailing.gwt.ui.shared.start.EventStageDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.eventlist.EventListEventDTO;
|
||||
|
||||
public class LiveEventStageTeaser extends StageTeaser {
|
||||
|
||||
private final LiveStageTeaserBand teaserBand;
|
||||
|
||||
public LiveEventStageTeaser(EventStageDTO event, MobilePlacesNavigator placeNavigator) {
|
||||
public LiveEventStageTeaser(EventListEventDTO event, MobilePlacesNavigator placeNavigator) {
|
||||
super(event);
|
||||
|
||||
title.setInnerText(event.getDisplayName());
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@ import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.sap.sailing.gwt.common.client.i18n.TextMessages;
|
||||
import com.sap.sailing.gwt.home.client.shared.EventDatesFormatterUtil;
|
||||
import com.sap.sailing.gwt.home.mobile.app.MobilePlacesNavigator;
|
||||
import com.sap.sailing.gwt.ui.shared.start.EventStageDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.eventlist.EventListEventDTO;
|
||||
|
||||
/**
|
||||
* Teaser band for a live event on the homepage stage
|
||||
@@ -13,7 +13,7 @@ import com.sap.sailing.gwt.ui.shared.start.EventStageDTO;
|
||||
*/
|
||||
public class LiveStageTeaserBand extends StageTeaserBand {
|
||||
|
||||
public LiveStageTeaserBand(EventStageDTO event, MobilePlacesNavigator placeNavigator) {
|
||||
public LiveStageTeaserBand(EventListEventDTO event, MobilePlacesNavigator placeNavigator) {
|
||||
super(event, placeNavigator);
|
||||
|
||||
bandTitle.setInnerText(event.getDisplayName());
|
||||
|
||||
+2
-2
@@ -1,13 +1,13 @@
|
||||
package com.sap.sailing.gwt.home.mobile.partials.stage;
|
||||
|
||||
import com.sap.sailing.gwt.home.mobile.app.MobilePlacesNavigator;
|
||||
import com.sap.sailing.gwt.ui.shared.start.EventStageDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.eventlist.EventListEventDTO;
|
||||
|
||||
public class PopularEventStageTeaser extends StageTeaser {
|
||||
|
||||
private final PopularEventStageTeaserBand teaserBand;
|
||||
|
||||
public PopularEventStageTeaser(EventStageDTO event, MobilePlacesNavigator placeNavigator) {
|
||||
public PopularEventStageTeaser(EventListEventDTO event, MobilePlacesNavigator placeNavigator) {
|
||||
super(event);
|
||||
|
||||
title.setInnerText(event.getDisplayName());
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@ import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.sap.sailing.gwt.common.client.i18n.TextMessages;
|
||||
import com.sap.sailing.gwt.home.client.shared.EventDatesFormatterUtil;
|
||||
import com.sap.sailing.gwt.home.mobile.app.MobilePlacesNavigator;
|
||||
import com.sap.sailing.gwt.ui.shared.start.EventStageDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.eventlist.EventListEventDTO;
|
||||
|
||||
/**
|
||||
* Teaser band for a popular but finished event on the homepage stage
|
||||
@@ -13,7 +13,7 @@ import com.sap.sailing.gwt.ui.shared.start.EventStageDTO;
|
||||
*/
|
||||
public class PopularEventStageTeaserBand extends StageTeaserBand {
|
||||
|
||||
public PopularEventStageTeaserBand(EventStageDTO event, MobilePlacesNavigator placeNavigator) {
|
||||
public PopularEventStageTeaserBand(EventListEventDTO event, MobilePlacesNavigator placeNavigator) {
|
||||
super(event, placeNavigator);
|
||||
|
||||
bandTitle.setInnerText(event.getDisplayName());
|
||||
|
||||
+3
-4
@@ -9,7 +9,7 @@ import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.gwt.home.mobile.app.MobilePlacesNavigator;
|
||||
import com.sap.sailing.gwt.ui.shared.start.EventStageDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.eventlist.EventListEventDTO;
|
||||
import com.sap.sse.gwt.client.controls.carousel.WidgetCarousel;
|
||||
|
||||
public class Stage extends Composite {
|
||||
@@ -37,9 +37,8 @@ public class Stage extends Composite {
|
||||
stageTeaserComposites = new ArrayList<StageTeaser>();
|
||||
}
|
||||
|
||||
public void setFeaturedEvents(List<EventStageDTO> list) {
|
||||
|
||||
for (EventStageDTO event : list) {
|
||||
public void setFeaturedEvents(List<? extends EventListEventDTO> list) {
|
||||
for (EventListEventDTO event : list) {
|
||||
switch (event.getStageType()) {
|
||||
case POPULAR:
|
||||
stageTeaser = new PopularEventStageTeaser(event, placeNavigator);
|
||||
|
||||
+5
-8
@@ -13,12 +13,13 @@ import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.gwt.home.mobile.partials.countdown.CountdownTicker;
|
||||
import com.sap.sailing.gwt.ui.shared.start.EventStageDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.eventlist.EventListEventDTO;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
import com.sap.sse.gwt.client.controls.carousel.LazyLoadable;
|
||||
|
||||
public abstract class StageTeaser extends Composite implements LazyLoadable {
|
||||
|
||||
@UiField
|
||||
DivElement bandCount;
|
||||
@UiField
|
||||
@@ -36,22 +37,20 @@ public abstract class StageTeaser extends Composite implements LazyLoadable {
|
||||
}
|
||||
|
||||
private static StageTeaserUiBinder uiBinder = GWT.create(StageTeaserUiBinder.class);
|
||||
private final EventStageDTO event;
|
||||
private final EventListEventDTO event;
|
||||
|
||||
@Override
|
||||
public void doInitializeLazyComponents() {
|
||||
String stageImageUrl = event.getStageImageURL() != null ? event.getStageImageURL() : StageResources.INSTANCE
|
||||
String stageImageUrl = event.getThumbnailImageURL() != null ? event.getThumbnailImageURL() : StageResources.INSTANCE
|
||||
.defaultStageEventTeaserImage().getSafeUri().asString();
|
||||
String backgroundImage = "url(" + stageImageUrl + ")";
|
||||
teaserImage.getStyle().setBackgroundImage(backgroundImage);
|
||||
|
||||
}
|
||||
|
||||
protected void handleUserAction() {
|
||||
|
||||
}
|
||||
|
||||
public StageTeaser(EventStageDTO event) {
|
||||
public StageTeaser(EventListEventDTO event) {
|
||||
this.event = event;
|
||||
StageResources.INSTANCE.css().ensureInjected();
|
||||
|
||||
@@ -76,10 +75,8 @@ public abstract class StageTeaser extends Composite implements LazyLoadable {
|
||||
return;
|
||||
}
|
||||
handleUserAction();
|
||||
|
||||
}
|
||||
}, ClickEvent.getType());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+4
-4
@@ -13,7 +13,7 @@ import com.sap.sailing.gwt.home.client.place.event.EventDefaultPlace;
|
||||
import com.sap.sailing.gwt.home.mobile.app.MobilePlacesNavigator;
|
||||
import com.sap.sailing.gwt.home.shared.app.PlaceNavigation;
|
||||
import com.sap.sailing.gwt.home.shared.app.PlaceNavigator;
|
||||
import com.sap.sailing.gwt.ui.shared.start.EventStageDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.eventlist.EventListEventDTO;
|
||||
|
||||
public abstract class StageTeaserBand extends Composite {
|
||||
|
||||
@@ -29,10 +29,10 @@ public abstract class StageTeaserBand extends Composite {
|
||||
@UiField Anchor actionLink;
|
||||
|
||||
private final MobilePlacesNavigator placeNavigator;
|
||||
private final EventStageDTO event;
|
||||
private final EventListEventDTO event;
|
||||
private final PlaceNavigation<EventDefaultPlace> eventNavigation;
|
||||
|
||||
public StageTeaserBand(EventStageDTO event, MobilePlacesNavigator placeNavigator) {
|
||||
public StageTeaserBand(EventListEventDTO event, MobilePlacesNavigator placeNavigator) {
|
||||
this.event = event;
|
||||
this.placeNavigator = placeNavigator;
|
||||
|
||||
@@ -51,7 +51,7 @@ public abstract class StageTeaserBand extends Composite {
|
||||
return placeNavigator;
|
||||
}
|
||||
|
||||
public EventStageDTO getEvent() {
|
||||
public EventListEventDTO getEvent() {
|
||||
return event;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1,13 +1,13 @@
|
||||
package com.sap.sailing.gwt.home.mobile.partials.stage;
|
||||
|
||||
import com.sap.sailing.gwt.home.mobile.app.MobilePlacesNavigator;
|
||||
import com.sap.sailing.gwt.ui.shared.start.EventStageDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.eventlist.EventListEventDTO;
|
||||
|
||||
public class UpcomingEventStageTeaser extends StageTeaser {
|
||||
|
||||
private final UpcomingEventStageTeaserBand teaserBand;
|
||||
|
||||
public UpcomingEventStageTeaser(EventStageDTO event, MobilePlacesNavigator placeNavigator) {
|
||||
public UpcomingEventStageTeaser(EventListEventDTO event, MobilePlacesNavigator placeNavigator) {
|
||||
super(event);
|
||||
|
||||
title.setInnerText(event.getDisplayName());
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@ import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.sap.sailing.gwt.common.client.i18n.TextMessages;
|
||||
import com.sap.sailing.gwt.home.client.shared.EventDatesFormatterUtil;
|
||||
import com.sap.sailing.gwt.home.mobile.app.MobilePlacesNavigator;
|
||||
import com.sap.sailing.gwt.ui.shared.start.EventStageDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.eventlist.EventListEventDTO;
|
||||
|
||||
/**
|
||||
* Teaser band for an upcoming event on the homepage stage
|
||||
@@ -13,7 +13,7 @@ import com.sap.sailing.gwt.ui.shared.start.EventStageDTO;
|
||||
*/
|
||||
public class UpcomingEventStageTeaserBand extends StageTeaserBand {
|
||||
|
||||
public UpcomingEventStageTeaserBand(EventStageDTO event, MobilePlacesNavigator placeNavigator) {
|
||||
public UpcomingEventStageTeaserBand(EventListEventDTO event, MobilePlacesNavigator placeNavigator) {
|
||||
super(event, placeNavigator);
|
||||
|
||||
bandTitle.setInnerText(event.getDisplayName());
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ public class StartActivity extends AbstractActivity implements Presenter {
|
||||
public void start(final AcceptsOneWidget panel, EventBus eventBus) {
|
||||
Window.setTitle(place.getTitle());
|
||||
final StartView view = new StartViewImpl(StartActivity.this);
|
||||
clientFactory.getDispatch().execute(new GetStagedEventsAction(true), new AsyncCallback<ListResult<EventStageDTO>>() {
|
||||
clientFactory.getDispatch().execute(new GetStagedEventsAction(), new AsyncCallback<ListResult<EventStageDTO>>() {
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@ import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.gwt.home.mobile.app.MobilePlacesNavigator;
|
||||
import com.sap.sailing.gwt.home.shared.app.PlaceNavigation;
|
||||
import com.sap.sailing.gwt.ui.shared.dispatch.start.EventQuickfinderDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.start.EventStageDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.eventlist.EventListEventDTO;
|
||||
|
||||
public interface StartView {
|
||||
|
||||
@@ -21,6 +21,6 @@ public interface StartView {
|
||||
PlaceNavigation<?> getEventNavigation(EventQuickfinderDTO event);
|
||||
}
|
||||
|
||||
void setFeaturedEvents(List<EventStageDTO> list);
|
||||
void setFeaturedEvents(List<? extends EventListEventDTO> list);
|
||||
}
|
||||
|
||||
+2
-2
@@ -15,8 +15,8 @@ import com.sap.sailing.gwt.home.mobile.partials.stage.Stage;
|
||||
import com.sap.sailing.gwt.home.shared.app.PlaceNavigation;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.shared.dispatch.start.EventQuickfinderDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.eventlist.EventListEventDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.general.EventState;
|
||||
import com.sap.sailing.gwt.ui.shared.start.EventStageDTO;
|
||||
|
||||
public class StartViewImpl extends Composite implements StartView {
|
||||
private static StartPageViewUiBinder uiBinder = GWT.create(StartPageViewUiBinder.class);
|
||||
@@ -43,7 +43,7 @@ public class StartViewImpl extends Composite implements StartView {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFeaturedEvents(List<EventStageDTO> list) {
|
||||
public void setFeaturedEvents(List<? extends EventListEventDTO> list) {
|
||||
stage.setFeaturedEvents(list);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user