mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-14 06:18:12 +00:00
fix for bug4494
This commit is contained in:
1 parent
ffb5cb39b9
commit
efe9db4c63
5 files changed
+31
-13
No files matched your search
+13
-3
@@ -5,19 +5,28 @@ import com.sap.sailing.gwt.autoplay.client.app.AutoPlayClientFactory;
|
||||
import com.sap.sailing.gwt.ui.shared.EventDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.StrippedLeaderboardDTO;
|
||||
import com.sap.sse.gwt.client.shared.perspective.PerspectiveCompositeSettings;
|
||||
import com.sap.sse.security.ui.client.UserService;
|
||||
|
||||
public abstract class AutoPlayConfiguration {
|
||||
|
||||
public abstract void startRootNode(AutoPlayClientFactory cf, AutoPlayContextDefinition context,
|
||||
PerspectiveCompositeSettings<?> settings);
|
||||
|
||||
/**
|
||||
* This method should be pure/standalone, it is not allowed to make any guesses on fields written by startRootNode,
|
||||
* as it can be called before that
|
||||
*/
|
||||
public void openSettingsDialog(EventDTO selectedEvent, StrippedLeaderboardDTO leaderboard,
|
||||
OnSettingsCallback holder, PerspectiveCompositeSettings<?> settings,AutoPlayContextDefinition apcd) {
|
||||
OnSettingsCallback holder, PerspectiveCompositeSettings<?> settings, AutoPlayContextDefinition apcd,
|
||||
UserService userService) {
|
||||
Window.alert("This configuration does not have settings");
|
||||
|
||||
}
|
||||
|
||||
public void loadSettingsDefault(EventDTO selectedEvent, StrippedLeaderboardDTO leaderboard,
|
||||
/**
|
||||
* This method should be pure/standalone, it is not allowed to make any guesses on fields written by startRootNode,
|
||||
* as it can be called before that
|
||||
*/
|
||||
public void loadSettingsDefault(EventDTO selectedEvent, StrippedLeaderboardDTO leaderboard, UserService userService,
|
||||
OnSettingsCallback holder) {
|
||||
holder.newSettings(null);
|
||||
}
|
||||
@@ -25,4 +34,5 @@ public abstract class AutoPlayConfiguration {
|
||||
public interface OnSettingsCallback {
|
||||
void newSettings(PerspectiveCompositeSettings<?> newSettings);
|
||||
}
|
||||
|
||||
}
|
||||
+5
-6
@@ -19,14 +19,13 @@ import com.sap.sse.gwt.client.dialog.DataEntryDialog.DialogCallback;
|
||||
import com.sap.sse.gwt.client.shared.components.LinkWithSettingsGenerator;
|
||||
import com.sap.sse.gwt.client.shared.components.SettingsDialogForLinkSharing;
|
||||
import com.sap.sse.gwt.client.shared.perspective.PerspectiveCompositeSettings;
|
||||
import com.sap.sse.security.ui.client.UserService;
|
||||
|
||||
public class AutoPlayClassicConfiguration extends AutoPlayConfiguration {
|
||||
private AutoPlayClientFactory cf;
|
||||
|
||||
@Override
|
||||
public void startRootNode(AutoPlayClientFactory cf, AutoPlayContextDefinition context,
|
||||
PerspectiveCompositeSettings<?> settings) {
|
||||
this.cf = cf;
|
||||
final UUID eventUUID = context.getEventId();
|
||||
AsyncCallback<EventDTO> getEventByIdAsyncCallback = new AsyncCallback<EventDTO>() {
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -53,7 +52,7 @@ public class AutoPlayClassicConfiguration extends AutoPlayConfiguration {
|
||||
|
||||
@Override
|
||||
public void openSettingsDialog(EventDTO selectedEvent, StrippedLeaderboardDTO leaderboard,
|
||||
OnSettingsCallback settingsCallback, PerspectiveCompositeSettings<?> settings,AutoPlayContextDefinition apcd) {
|
||||
OnSettingsCallback settingsCallback, PerspectiveCompositeSettings<?> settings, AutoPlayContextDefinition apcd, UserService userService) {
|
||||
DialogCallback<PerspectiveCompositeSettings<AutoplayPerspectiveOwnSettings>> callback = new DialogCallback<PerspectiveCompositeSettings<AutoplayPerspectiveOwnSettings>>() {
|
||||
@Override
|
||||
public void ok(PerspectiveCompositeSettings<AutoplayPerspectiveOwnSettings> editedObject) {
|
||||
@@ -64,7 +63,7 @@ public class AutoPlayClassicConfiguration extends AutoPlayConfiguration {
|
||||
public void cancel() {
|
||||
}
|
||||
};
|
||||
AutoplayPerspectiveLifecycle autoplayLifecycle = new AutoplayPerspectiveLifecycle(leaderboard, cf.getUserService());
|
||||
AutoplayPerspectiveLifecycle autoplayLifecycle = new AutoplayPerspectiveLifecycle(leaderboard, userService);
|
||||
PerspectiveCompositeSettings<AutoplayPerspectiveOwnSettings> autoplayPerspectiveSettings = autoplayLifecycle
|
||||
.createDefaultSettings();
|
||||
LinkWithSettingsGenerator<PerspectiveCompositeSettings<AutoplayPerspectiveOwnSettings>> settingsGenerator = new LinkWithSettingsGenerator<>(Window.Location.getPath(), autoplayLifecycle::createDefaultSettings, apcd);
|
||||
@@ -74,8 +73,8 @@ public class AutoPlayClassicConfiguration extends AutoPlayConfiguration {
|
||||
|
||||
@Override
|
||||
public void loadSettingsDefault(EventDTO selectedEvent, StrippedLeaderboardDTO leaderboard,
|
||||
OnSettingsCallback settingsCallback) {
|
||||
AutoplayPerspectiveLifecycle autoplayLifecycle = new AutoplayPerspectiveLifecycle(leaderboard, cf.getUserService());
|
||||
UserService userService, OnSettingsCallback settingsCallback) {
|
||||
AutoplayPerspectiveLifecycle autoplayLifecycle = new AutoplayPerspectiveLifecycle(leaderboard, userService);
|
||||
settingsCallback.newSettings(autoplayLifecycle.createDefaultSettings());
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -37,6 +37,7 @@ public class AutoPlayStartPresenterImpl extends AbstractActivity implements Auto
|
||||
AutoPlayStartView view) {
|
||||
this.clientFactory = clientFactory;
|
||||
this.view = view;
|
||||
view.setUserService(this.clientFactory.getUserService());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -54,7 +55,7 @@ public class AutoPlayStartPresenterImpl extends AbstractActivity implements Auto
|
||||
StrippedLeaderboardDTO leaderBoard = AutoplayHelper.getSelectedLeaderboard(event,
|
||||
apcd.getLeaderboardName());
|
||||
|
||||
apcd.getType().getConfig().loadSettingsDefault(event, leaderBoard, new OnSettingsCallback() {
|
||||
apcd.getType().getConfig().loadSettingsDefault(event, leaderBoard, clientFactory.getUserService(), new OnSettingsCallback() {
|
||||
|
||||
@Override
|
||||
public void newSettings(PerspectiveCompositeSettings<?> newSettings) {
|
||||
|
||||
+2
@@ -6,6 +6,7 @@ import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.gwt.autoplay.client.configs.AutoPlayContextDefinition;
|
||||
import com.sap.sailing.gwt.ui.shared.EventDTO;
|
||||
import com.sap.sse.gwt.client.shared.perspective.PerspectiveCompositeSettings;
|
||||
import com.sap.sse.security.ui.client.UserService;
|
||||
|
||||
public interface AutoPlayStartView {
|
||||
public interface Presenter {
|
||||
@@ -20,4 +21,5 @@ public interface AutoPlayStartView {
|
||||
|
||||
void setEvents(List<EventDTO> events);
|
||||
void showLoading();
|
||||
void setUserService(UserService userService);
|
||||
}
|
||||
+9
-3
@@ -32,6 +32,7 @@ import com.sap.sse.gwt.client.GWTLocaleUtil;
|
||||
import com.sap.sse.gwt.client.shared.perspective.PerspectiveCompositeSettings;
|
||||
import com.sap.sse.gwt.settings.SettingsToUrlSerializer;
|
||||
import com.sap.sse.gwt.settings.UrlBuilderUtil;
|
||||
import com.sap.sse.security.ui.client.UserService;
|
||||
|
||||
public class AutoPlayStartViewImpl extends Composite implements AutoPlayStartView {
|
||||
private static StartPageViewUiBinder uiBinder = GWT.create(StartPageViewUiBinder.class);
|
||||
@@ -65,6 +66,7 @@ public class AutoPlayStartViewImpl extends Composite implements AutoPlayStartVie
|
||||
private AutoPlayContextDefinitionImpl apcd;
|
||||
private PerspectiveCompositeSettings<?> settings;
|
||||
private String configuratedUrl;
|
||||
private UserService userService;
|
||||
|
||||
public AutoPlayStartViewImpl() {
|
||||
super();
|
||||
@@ -151,7 +153,7 @@ public class AutoPlayStartViewImpl extends Composite implements AutoPlayStartVie
|
||||
settings = newSettings;
|
||||
updateURL();
|
||||
}
|
||||
}, settings, apcd);
|
||||
}, settings, apcd, userService);
|
||||
}
|
||||
|
||||
private boolean validate() {
|
||||
@@ -190,9 +192,8 @@ public class AutoPlayStartViewImpl extends Composite implements AutoPlayStartVie
|
||||
settingsButton.removeStyleName(SharedResources.INSTANCE.mainCss().buttoninactive());
|
||||
startAutoPlayButton.removeStyleName(SharedResources.INSTANCE.mainCss().buttoninactive());
|
||||
apcd = new AutoPlayContextDefinitionImpl(selectedAutoPlayType, selectedEvent.id, selectedLeaderboardName);
|
||||
apcd.getType().getConfig().loadSettingsDefault(selectedEvent, selectedLeaderboard,
|
||||
apcd.getType().getConfig().loadSettingsDefault(selectedEvent, selectedLeaderboard, userService,
|
||||
new OnSettingsCallback() {
|
||||
|
||||
@Override
|
||||
public void newSettings(PerspectiveCompositeSettings<?> newSettings) {
|
||||
settings = newSettings;
|
||||
@@ -286,4 +287,9 @@ public class AutoPlayStartViewImpl extends Composite implements AutoPlayStartVie
|
||||
startAutoPlayButton.setEnabled(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUserService(UserService userService) {
|
||||
this.userService = userService;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user