use of org.openremote.app.client.event.ShowSuccessEvent in project openremote by openremote.
the class AdminTenantActivity method delete.
@Override
public void delete() {
adminContent.showConfirmation(environment.getMessages().confirmation(), environment.getMessages().confirmationDelete(this.realm), () -> {
adminContent.setFormBusy(true);
adminContent.clearFormMessages();
clearViewFieldErrors();
environment.getApp().getRequests().send(requestParams -> tenantResource.delete(requestParams, this.realm), 204, () -> {
adminContent.setFormBusy(false);
environment.getEventBus().dispatch(new ShowSuccessEvent(environment.getMessages().tenantDeleted(tenant.getDisplayName())));
environment.getPlaceController().goTo(new AdminTenantsPlace());
});
});
}
use of org.openremote.app.client.event.ShowSuccessEvent in project openremote by openremote.
the class AdminTenantActivity method create.
@Override
public void create() {
adminContent.setFormBusy(true);
adminContent.clearFormMessages();
clearViewFieldErrors();
readFromView();
environment.getApp().getRequests().sendWith(tenantMapper, requestParams -> tenantResource.create(requestParams, tenant), 204, () -> {
adminContent.setFormBusy(false);
environment.getEventBus().dispatch(new ShowSuccessEvent(environment.getMessages().tenantCreated(tenant.getDisplayName())));
environment.getPlaceController().goTo(new AdminTenantsPlace());
}, validationErrorHandler);
}
use of org.openremote.app.client.event.ShowSuccessEvent in project openremote by openremote.
the class AdminUserEditActivity method onDeviceRegistrationDelete.
@Override
public void onDeviceRegistrationDelete(DeviceNotificationToken.Id id) {
environment.getApp().getRequests().send(requestParams -> notificationResource.deleteDeviceToken(requestParams, id.getUserId(), id.getDeviceId()), 204, () -> {
adminContent.removeDeviceRegistration(id);
environment.getEventBus().dispatch(new ShowSuccessEvent(environment.getMessages().registeredDeviceDeleted(id.getDeviceId())));
});
}
use of org.openremote.app.client.event.ShowSuccessEvent in project openremote by openremote.
the class AdminUserEditActivity method create.
@Override
public void create() {
adminContent.setFormBusy(true);
adminContent.clearFormMessages();
clearViewFieldErrors();
readFromView();
environment.getApp().getRequests().sendWith(userMapper, requestParams -> userResource.create(requestParams, realm, user), 204, () -> {
adminContent.setFormBusy(false);
environment.getEventBus().dispatch(new ShowSuccessEvent(environment.getMessages().userCreated(user.getUsername())));
environment.getPlaceController().goTo(new AdminUsersPlace(realm));
}, validationErrorHandler);
}
use of org.openremote.app.client.event.ShowSuccessEvent in project openremote by openremote.
the class AdminUserNotificationsActivity method onNotificationDelete.
@Override
public void onNotificationDelete(Long id) {
adminContent.setFormBusy(true);
environment.getApp().getRequests().send(requestParams -> notificationResource.removeNotification(requestParams, userId, id), 204, () -> {
adminContent.setFormBusy(false);
adminContent.removeNotification(id);
environment.getEventBus().dispatch(new ShowSuccessEvent(environment.getMessages().notificationDeleted(id)));
});
}
Aggregations