mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-05 20:03:52 +00:00
Fixed news navigation
This commit is contained in:
1 parent
81802fff20
commit
2adf97702c
4 files changed
+19
-23
No files matched your search
+2
-2
@@ -6,7 +6,7 @@ import com.sap.sailing.gwt.home.shared.app.PlaceNavigation;
|
||||
import com.sap.sailing.gwt.ui.shared.dispatch.news.NewsEntryDTO;
|
||||
|
||||
public interface NewsItemLinkProvider {
|
||||
PlaceNavigation<?> getPlaceNavigation(NewsEntryDTO newsEntry);
|
||||
|
||||
void gotoNewsPlace(List<NewsEntryDTO> values);
|
||||
|
||||
PlaceNavigation<?> getNewsEntryPlaceNavigation(NewsEntryDTO newsEntry);
|
||||
}
|
||||
+1
-1
@@ -56,7 +56,7 @@ public class UpdatesBoxItem extends Widget {
|
||||
link.setHref(directLink);
|
||||
link.setTarget("_blank");
|
||||
} else {
|
||||
final PlaceNavigation<?> placeNavigation = provider.getPlaceNavigation(entry);
|
||||
final PlaceNavigation<?> placeNavigation = provider.getNewsEntryPlaceNavigation(entry);
|
||||
if(placeNavigation != null) {
|
||||
placeNavigation.configureAnchorElement(link);
|
||||
} else {
|
||||
|
||||
+14
-16
@@ -21,7 +21,6 @@ import com.sap.sailing.gwt.home.shared.app.PlaceNavigation;
|
||||
import com.sap.sailing.gwt.home.shared.dispatch.DispatchSystem;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.shared.dispatch.event.GetEventViewAction;
|
||||
import com.sap.sailing.gwt.ui.shared.dispatch.news.AbstractRaceNewsEntryDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.dispatch.news.LeaderboardNewsEntryDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.dispatch.news.NewsEntryDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.EventViewDTO;
|
||||
@@ -95,11 +94,7 @@ public class EventActivity extends AbstractActivity implements Presenter {
|
||||
return clientFactory.getDispatch();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlaceNavigation<?> getRegattaLeaderboardNavigation(String leaderboardName) {
|
||||
EventContext ctx = new EventContext(getCtx()).withRegattaId(leaderboardName).withRegattaAnalyticsManager(null);
|
||||
return clientFactory.getNavigator().getEventNavigation(new RegattaLeaderboardPlace(ctx), null, false);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public PlaceNavigation<?> getMediaPageNavigation() {
|
||||
@@ -111,26 +106,29 @@ public class EventActivity extends AbstractActivity implements Presenter {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRaceViewerURL(String regattaName, String trackedRaceName) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public PlaceNavigation<?> getPlaceNavigation(NewsEntryDTO entry) {
|
||||
public PlaceNavigation<?> getNewsEntryPlaceNavigation(NewsEntryDTO entry) {
|
||||
if(entry instanceof LeaderboardNewsEntryDTO) {
|
||||
final LeaderboardNewsEntryDTO dto = (LeaderboardNewsEntryDTO) entry;
|
||||
return getRegattaLeaderboardNavigation(dto.getLeaderboardName());
|
||||
} else if(entry instanceof AbstractRaceNewsEntryDTO) {
|
||||
// TODO
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRaceViewerURL(String regattaName, String trackedRaceName) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlaceNavigation<?> getRegattaLeaderboardNavigation(String leaderboardName) {
|
||||
EventContext ctx = new EventContext(getCtx()).withRegattaId(leaderboardName).withRegattaAnalyticsManager(null);
|
||||
return clientFactory.getNavigator().getEventNavigation(new RegattaLeaderboardPlace(ctx), null, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void gotoNewsPlace(List<NewsEntryDTO> values) {
|
||||
clientFactory.getPlaceController().goTo(new LatestNewsPlace(place.getCtx(), values));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+2
-4
@@ -14,7 +14,6 @@ import com.sap.sailing.gwt.home.mobile.partials.updatesBox.NewsItemLinkProvider;
|
||||
import com.sap.sailing.gwt.home.mobile.places.latestnews.LatestNewsView.Presenter;
|
||||
import com.sap.sailing.gwt.home.shared.app.PlaceNavigation;
|
||||
import com.sap.sailing.gwt.home.shared.dispatch.DispatchSystem;
|
||||
import com.sap.sailing.gwt.ui.shared.dispatch.news.AbstractRaceNewsEntryDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.dispatch.news.LeaderboardNewsEntryDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.dispatch.news.NewsEntryDTO;
|
||||
|
||||
@@ -44,15 +43,14 @@ public class LatestNewsActivity extends AbstractActivity implements Presenter, N
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlaceNavigation<?> getPlaceNavigation(NewsEntryDTO entry) {
|
||||
public PlaceNavigation<?> getNewsEntryPlaceNavigation(NewsEntryDTO entry) {
|
||||
MobilePlacesNavigator navigator = clientFactory.getNavigator();
|
||||
if (entry instanceof LeaderboardNewsEntryDTO) {
|
||||
final LeaderboardNewsEntryDTO dto = (LeaderboardNewsEntryDTO) entry;
|
||||
final String regattaId = dto.getLeaderboardName();
|
||||
navigator.getEventNavigation(new RegattaLeaderboardPlace(new EventContext().withRegattaId(regattaId)),
|
||||
null, false);
|
||||
} else if (entry instanceof AbstractRaceNewsEntryDTO) {
|
||||
// TODO
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user