unified terminology for "opt out" of feature and community updates

references to "subscribe" were replaced and functionally corrected
This commit is contained in:
Sohaib Baig committed 2026-04-27 10:08:17 +02:00
1 parent d03014da14
commit 93a228ea5d
9 files changed
+34 -35

No files matched your search

@@ -6,14 +6,14 @@ public class FavoritesResult implements Result {
private FavoriteBoatClassesDTO favoriteBoatClasses;
private FavoriteCompetitorsDTO favoriteCompetitors;
private boolean isSubscribedToFeatureAndCommunityUpdates;
private boolean didOptOutOfFeatureAndCommunityEmails;
protected FavoritesResult() {}
public FavoritesResult(FavoriteBoatClassesDTO favoriteBoatClasses, FavoriteCompetitorsDTO favoriteCompetitors, boolean isSubscribedToFeatureAndCommunityUpdates) {
public FavoritesResult(FavoriteBoatClassesDTO favoriteBoatClasses, FavoriteCompetitorsDTO favoriteCompetitors, boolean didOptOutOfFeatureAndCommunityEmails) {
this.favoriteBoatClasses = favoriteBoatClasses;
this.favoriteCompetitors = favoriteCompetitors;
this.isSubscribedToFeatureAndCommunityUpdates = isSubscribedToFeatureAndCommunityUpdates;
this.didOptOutOfFeatureAndCommunityEmails = didOptOutOfFeatureAndCommunityEmails;
}
public FavoriteBoatClassesDTO getFavoriteBoatClasses() {
@@ -24,7 +24,7 @@ public class FavoritesResult implements Result {
return favoriteCompetitors;
}
public boolean getIsSubscribedToFeatureAndCommunityUpdates() {
return isSubscribedToFeatureAndCommunityUpdates;
public boolean getDidOptOutOfFeatureAndCommunityEmails() {
return didOptOutOfFeatureAndCommunityEmails;
}
}
@@ -26,7 +26,7 @@ public class GetFavoritesAction implements SailingAction<FavoritesResult> {
@GwtIncompatible
public FavoritesResult execute(SailingDispatchContext ctx) throws DispatchException {
return new FavoritesResult(getFavoriteBoatClasses(ctx), getFavoriteCompetitors(ctx),
!getDidOptOutOfFeatureAndCommunityEmails(ctx));
getDidOptOutOfFeatureAndCommunityEmails(ctx));
}
@GwtIncompatible
@@ -9,13 +9,13 @@ import com.sap.sse.gwt.dispatch.shared.exceptions.DispatchException;
import com.sap.sse.security.shared.UserManagementException;
public class SaveMiscEmailPreferences implements SailingAction<VoidResult>, HasWriteAction {
private Boolean subscribeToFeatureAndCommunityUpdates;
private Boolean didOptOutOfFeatureAndCommunityEmails;
protected SaveMiscEmailPreferences() {
}
public SaveMiscEmailPreferences(final Boolean subscribeToFeatureAndCommunityUpdates) {
this.subscribeToFeatureAndCommunityUpdates = subscribeToFeatureAndCommunityUpdates;
public SaveMiscEmailPreferences(final Boolean didOptOutOfFeatureAndCommunityEmails) {
this.didOptOutOfFeatureAndCommunityEmails = didOptOutOfFeatureAndCommunityEmails;
}
@Override
@@ -24,7 +24,7 @@ public class SaveMiscEmailPreferences implements SailingAction<VoidResult>, HasW
try {
final String username = ctx.getSecurityService().getCurrentUser().getName();
ctx.getSecurityService().updateUserProperties(username, null, null, null,
!subscribeToFeatureAndCommunityUpdates);
didOptOutOfFeatureAndCommunityEmails);
} catch (UserManagementException e) {
throw new DispatchException(e.getMessage());
}
@@ -18,7 +18,6 @@ public class MiscellaneousDisplayImpl {
public MiscellaneousDisplayImpl(final MiscPreferencesPresenter presenter) {
presenter.registerDisplay(this);
// compose ui
final String securityUpdatesTitle = StringMessages.INSTANCE.securityUpdates();
final CheckBoxTile securityUpdates = new CheckBoxTile(securityUpdatesTitle, true, null);
featureAndCommunityUpdates = composeFeatureAndCommunityUpdatesTile(presenter);
@@ -29,7 +28,7 @@ public class MiscellaneousDisplayImpl {
selectionUi = new LabeledBox(boxTitle, tileList);
}
public void setIsSubscribedToFeatureAndCommunityUpdates(final boolean b, final boolean fireChangeHandlers) {
public void setDidOptOutOfFeatureAndCommunityEmails(final boolean b, final boolean fireChangeHandlers) {
featureAndCommunityUpdates.setValue(b, fireChangeHandlers);
}
@@ -38,7 +37,7 @@ public class MiscellaneousDisplayImpl {
final AsyncCallback<VoidResult> callbackWrappedWithToastNotification = new AsyncCallback<VoidResult>() {
@Override
public void onFailure(Throwable caught) {
final String failText = StringMessages.INSTANCE.failedToSetStatusOfFeatureAndCommunityUpdates();
final String failText = StringMessages.INSTANCE.couldNotOptOutOfFeatureAndCommunityUpdates();
Notification.notify(failText, NotificationType.ERROR);
if (callback != null) {
callback.onFailure(caught);
@@ -47,9 +46,9 @@ public class MiscellaneousDisplayImpl {
@Override
public void onSuccess(VoidResult result) {
final String passAndTrue = StringMessages.INSTANCE.youWillNowReceiveFeatureAndCommunityUpdates();
final String passAndTrue = StringMessages.INSTANCE.optedOutOfFeatureAndCommunityUpdates();
final String passAndFalse = StringMessages.INSTANCE
.youWillNotReceiveFeatureAndCommunityUpdatesAnymore();
.optedInToFeatureAndCommunityUpdates();
final String message = isNowTrue ? passAndTrue : passAndFalse;
Notification.notify(message, NotificationType.SUCCESS);
if (callback != null) {
@@ -63,7 +62,7 @@ public class MiscellaneousDisplayImpl {
private CheckBoxTile composeFeatureAndCommunityUpdatesTile(final MiscPreferencesPresenter presenter) {
final BiConsumer<Boolean, AsyncCallback<VoidResult>> onToggle = (isNowTrue, callback) -> {
final AsyncCallback<VoidResult> wrappedCallback = wrapCallbackWithToastResponse(isNowTrue, callback);
presenter.updateIsSubscribedToFeatureAndCommunityUpdates(isNowTrue, wrappedCallback);
presenter.updateDidOptOutOfFeatureAndCommunityEmails(isNowTrue, wrappedCallback);
};
final String title = StringMessages.INSTANCE.featureAndCommunityUpdates();
return new CheckBoxTile(title, false, onToggle);
@@ -6,9 +6,9 @@ import com.sap.sse.gwt.dispatch.shared.commands.VoidResult;
public interface MiscPreferencesPresenter {
void registerDisplay(MiscellaneousDisplayImpl display);
void updateIsSubscribedToFeatureAndCommunityUpdates(final boolean b, final AsyncCallback<VoidResult> callback);
void updateDidOptOutOfFeatureAndCommunityEmails(final boolean b, final AsyncCallback<VoidResult> callback);
/** get value via dispatch method, set first correct value onto checkbox */
void initIsSubscribedToFeatureAndCommunityUpdates(final boolean b);
void initDidOptOutOfFeatureAndCommunityEmails(final boolean b);
}
@@ -56,7 +56,7 @@ public class UserPreferencesPresenter<C extends ClientFactoryWithDispatch & Erro
final FavoriteBoatClassesDTO favoriteBoatClasses = result.getFavoriteBoatClasses();
boatClassSelectionPresenter.initNotifications(favoriteBoatClasses.isNotifyAboutUpcomingRaces(),
favoriteBoatClasses.isNotifyAboutResults(), favoriteBoatClasses.getSelectedBoatClasses());
miscPresenter.initIsSubscribedToFeatureAndCommunityUpdates(result.getIsSubscribedToFeatureAndCommunityUpdates());
miscPresenter.initDidOptOutOfFeatureAndCommunityEmails(result.getDidOptOutOfFeatureAndCommunityEmails());
}
};
clientFactory.getDispatch().execute(new GetFavoritesAction(), callback);
@@ -76,14 +76,14 @@ public class UserPreferencesPresenter<C extends ClientFactoryWithDispatch & Erro
}
@Override
public void initIsSubscribedToFeatureAndCommunityUpdates(final boolean b) {
public void initDidOptOutOfFeatureAndCommunityEmails(final boolean b) {
if (display != null) {
display.setIsSubscribedToFeatureAndCommunityUpdates(b, false);
display.setDidOptOutOfFeatureAndCommunityEmails(b, false);
}
}
@Override
public void updateIsSubscribedToFeatureAndCommunityUpdates(final boolean b, final AsyncCallback<VoidResult> callback) {
public void updateDidOptOutOfFeatureAndCommunityEmails(final boolean b, final AsyncCallback<VoidResult> callback) {
clientFactory.getDispatch().execute(new SaveMiscEmailPreferences(b), callback);
}
}
@@ -2559,9 +2559,9 @@ public interface StringMessages extends com.sap.sse.gwt.client.StringMessages,
String miscellaneous();
String securityUpdates();
String featureAndCommunityUpdates();
String youWillNowReceiveFeatureAndCommunityUpdates();
String youWillNotReceiveFeatureAndCommunityUpdatesAnymore();
String failedToSetStatusOfFeatureAndCommunityUpdates();
String optedOutOfFeatureAndCommunityUpdates();
String optedInToFeatureAndCommunityUpdates();
String couldNotOptOutOfFeatureAndCommunityUpdates();
String youWillNowReceiveNotificationsForFavoriteCompetitors();
String youWillNotReceiveNotificationsForFavoriteCompetitorsAnymore();
String failedToSetStatusOfNotificationsForFavoriteCompetitors();
@@ -2594,10 +2594,10 @@ unableToLoadIpsBlockedForUserCreationAbuse=Unable to load IPs Blocked for User C
sourceCode=Source Code
miscellaneous=Miscellaneous
securityUpdates=Security Updates
featureAndCommunityUpdates=Feature and Community Updates
youWillNowReceiveFeatureAndCommunityUpdates=You will now receive feature and community updates
youWillNotReceiveFeatureAndCommunityUpdatesAnymore=You will not receive feature and community updates anymore
failedToSetStatusOfFeatureAndCommunityUpdates=Failed to set status of feature and community updates
featureAndCommunityUpdates=Opt out of feature and community updates
optedOutOfFeatureAndCommunityUpdates=You have opted out of feature and community updates
optedInToFeatureAndCommunityUpdates=You will now receive feature and community updates
couldNotOptOutOfFeatureAndCommunityUpdates=Could not opt-out of feature and community updates
failedToSetStatusOfNotificationsForFavoriteCompetitors=Failed to set status of notifications for favorite competitors
youWillNowReceiveNotificationsForFavoriteCompetitors=You will now receive notifications for favorite competitors
failedToSetStatusOfUpdatesOnUpcomingRacesForYourFavoredBoatClasses=Failed to set status of notifications for upcoming races of your favored boat classes
@@ -2588,10 +2588,10 @@ unableToLoadIpsBlockedForUserCreationAbuse=Wegen Missbrauchs der Benutzererstell
sourceCode=Quellcode
miscellaneous=Verschiedenes
securityUpdates=Sicherheitsupdates
featureAndCommunityUpdates=Funktions- und Community-Updates
youWillNowReceiveFeatureAndCommunityUpdates=Sie erhalten nun Funktions- und Community-Updates.
youWillNotReceiveFeatureAndCommunityUpdatesAnymore=Sie erhalten keine Funktions- und Community-Updates mehr.
failedToSetStatusOfFeatureAndCommunityUpdates=Fehler beim Festlegen des Status von Funktions- und Community-Updates
featureAndCommunityUpdates=Funktions- und Community-Updates abbestellen
optedOutOfFeatureAndCommunityUpdates=Sie haben Funktions- und Community-Updates abbestellt.
optedInToFeatureAndCommunityUpdates=Sie erhalten nun Funktions- und Community-Updates.
couldNotOptOutOfFeatureAndCommunityUpdates=Funktions- und Community-Updates konnten nicht abbestellt werden.
failedToSetStatusOfNotificationsForFavoriteCompetitors=Status der Benachrichtigungen für bevorzugte Teilnehmer konnte nicht festgelegt werden.
youWillNowReceiveNotificationsForFavoriteCompetitors=Sie erhalten nun Benachrichtigungen für Ihre bevorzugten Teilnehmer.
youWillNotReceiveNotificationsForFavoriteCompetitorsAnymore=Sie erhalten keine Benachrichtigungen mehr für Ihre Lieblingskonkurrenten.