mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-27 22:37:15 +00:00
Hide mini leaderboard on overview pages if there are no results yet
This commit is contained in:
1 parent
0daa85b359
commit
cfc3d5b41a
3 files changed
+11
-2
No files matched your search
+9
-2
@@ -30,29 +30,36 @@ public class MinileaderboardBox extends Composite implements RefreshableWidget<G
|
||||
|
||||
@UiField MobileSection itemContainerUi;
|
||||
@UiField SectionHeaderContent headerUi;
|
||||
|
||||
private boolean showIfEmpty = false;
|
||||
|
||||
public MinileaderboardBox(boolean isOverall) {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
headerUi.setSectionTitle(isOverall ? I18N.overallStandings() : I18N.results());
|
||||
headerUi.setInfoText(StringMessages.INSTANCE.details());
|
||||
|
||||
|
||||
setVisible(false);
|
||||
}
|
||||
|
||||
public void setAction(String infoText, final PlaceNavigation<?> placeNavigation) {
|
||||
headerUi.setInfoText(infoText);
|
||||
headerUi.setClickAction(placeNavigation);
|
||||
}
|
||||
|
||||
public void setShowIfEmpty(boolean showIfEmpty) {
|
||||
this.showIfEmpty = showIfEmpty;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setData(final GetMiniLeaderboardDTO data) {
|
||||
itemContainerUi.clearContent();
|
||||
|
||||
if(data.getItems().isEmpty()) {
|
||||
setVisible(showIfEmpty);
|
||||
itemContainerUi.addContent(getNoResultsInfoWidget());
|
||||
return;
|
||||
}
|
||||
|
||||
setVisible(true);
|
||||
headerUi.setLabelType(data.isLive() ? LabelType.LIVE : LabelType.NONE);
|
||||
|
||||
if(data.getScoreCorrectionText() != null || data.getLastScoreUpdate() != null) {
|
||||
|
||||
+1
@@ -15,6 +15,7 @@ public class MiniLeaderboardViewImpl extends AbstractEventView<MiniLeaderboardVi
|
||||
public MiniLeaderboardViewImpl(MiniLeaderboardView.Presenter presenter) {
|
||||
super(presenter, presenter.getCtx().getEventDTO().getType() == EventType.MULTI_REGATTA, true);
|
||||
setViewContent(minileaderboard = new MinileaderboardBox(false));
|
||||
minileaderboard.setShowIfEmpty(true);
|
||||
refreshManager.add(minileaderboard, new GetMiniLeaderbordAction(getEventId(), getRegattaId()));
|
||||
minileaderboard.setAction(MSG.details(), presenter.getRegattaLeaderboardNavigation(getRegattaId()));
|
||||
}
|
||||
|
||||
+1
@@ -35,6 +35,7 @@ public class SeriesMiniOverallLeaderboardViewImpl extends Composite implements S
|
||||
public SeriesMiniOverallLeaderboardViewImpl(Presenter presenter) {
|
||||
this.currentPresenter = presenter;
|
||||
minileaderboardUi = new MinileaderboardBox(true);
|
||||
minileaderboardUi.setShowIfEmpty(true);
|
||||
eventHeaderUi = new SeriesHeader(presenter.getCtx().getSeriesDTO(), presenter.getSeriesNavigation());
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
RefreshManager refreshManager = new RefreshManager(this, currentPresenter.getDispatch());
|
||||
|
||||
Reference in new issue
Block a user