use of org.openremote.app.client.event.ShowSuccessEvent in project openremote by openremote.
the class AdminUserNotificationsActivity method onSendNotification.
@Override
public void onSendNotification() {
// Keep it so we can send it again later
if (this.alertNotification == null)
this.alertNotification = createDefaultNotification();
// TODO Constraint violation handler and @Valid AlertNotification on resource method?
notificationEditor.setAlertNotification(this.alertNotification);
notificationEditor.setOnSend(updatedNotification -> {
adminContent.setFormBusy(true);
this.alertNotification = updatedNotification;
environment.getApp().getRequests().sendWith(alertNotificationMapper, requestParams -> notificationResource.storeNotificationForUser(requestParams, userId, this.alertNotification), 204, () -> {
environment.getEventBus().dispatch(new ShowSuccessEvent(environment.getMessages().notificationSentToUser()));
loadNotifications(() -> adminContent.setFormBusy(false));
});
});
notificationEditor.show();
}
use of org.openremote.app.client.event.ShowSuccessEvent in project openremote by openremote.
the class AssetsTenantActivity method onDeleteAssetLink.
@Override
public void onDeleteAssetLink(UserAsset.Id id) {
view.setFormBusy(true);
environment.getApp().getRequests().sendWith(userAssetMapper, requestParams -> assetResource.deleteUserAsset(requestParams, id.getRealmId(), id.getUserId(), id.getAssetId()), 204, () -> {
environment.getEventBus().dispatch(new ShowSuccessEvent(environment.getMessages().userAssetLinkDeleted()));
view.setFormBusy(false);
loadUserAssets();
});
}
Aggregations