use of io.imunity.furms.ui.components.FurmsDialog in project furms by unity-idm.
the class ProjectAllocationComponent method createConfirmDialog.
private Dialog createConfirmDialog(String projectAllocationId, String projectAllocationName) {
FurmsDialog furmsDialog = new FurmsDialog(getTranslation("view.community-admin.project-allocation.dialog.text", projectAllocationName));
furmsDialog.addConfirmButtonClickListener(event -> {
try {
service.delete(communityId, projectAllocationId);
loadGridContent();
} catch (RemovalOfConsumedProjectAllocationIsFirbiddenException e) {
showErrorNotification(getTranslation("project.allocation.removing.message"));
} catch (Exception e) {
showErrorNotification(getTranslation("base.error.message"));
}
});
return furmsDialog;
}
use of io.imunity.furms.ui.components.FurmsDialog in project furms by unity-idm.
the class CommunityAllocationComponent method createConfirmDialog.
private Dialog createConfirmDialog(String CommunityAllocationId, String communityAllocationName) {
FurmsDialog furmsDialog = new FurmsDialog(getTranslation("view.fenix-admin.resource-credits-allocation.dialog.text", communityAllocationName));
furmsDialog.addConfirmButtonClickListener(event -> {
getResultOrException(() -> service.delete(CommunityAllocationId)).getException().ifPresent(t -> showErrorNotification(getTranslation(t.getMessage(), communityAllocationName)));
loadGridContent();
});
return furmsDialog;
}
use of io.imunity.furms.ui.components.FurmsDialog in project furms by unity-idm.
the class ProjectsView method createConfirmDialog.
private Dialog createConfirmDialog(String projectId, String projectName, String communityId) {
FurmsDialog furmsDialog = new FurmsDialog(getTranslation("view.user-settings.projects.dialog.text", projectName));
furmsDialog.addConfirmButtonClickListener(event -> {
try {
projectService.resignFromMembership(communityId, projectId);
loadGridContent();
} catch (Exception e) {
showErrorNotification("base.error.message");
}
});
return furmsDialog;
}
use of io.imunity.furms.ui.components.FurmsDialog in project furms by unity-idm.
the class SSHKeysView method actionDeleteSSHKey.
private void actionDeleteSSHKey(SSHKeyViewModel key, Grid<SSHKeyViewModel> grid) {
FurmsDialog cancelDialog = new FurmsDialog(getTranslation("view.user-settings.ssh-keys.main.confirmation.dialog.delete", key.name));
cancelDialog.addConfirmButtonClickListener(event -> {
try {
sshKeysService.delete(key.id);
showSuccessNotification(getTranslation("view.user-settings.ssh-keys.grid.item.menu.delete.success", key.name));
} catch (RuntimeException e) {
LOG.warn("Could not delete SSH key . ", e);
showErrorNotification(getTranslation("view.user-settings.ssh-keys.form.error.unexpected", "delete"));
} finally {
loadGridContent();
}
});
cancelDialog.open();
}
use of io.imunity.furms.ui.components.FurmsDialog in project furms by unity-idm.
the class ResourceCreditsView method createConfirmDialog.
private Dialog createConfirmDialog(String resourceTypeId, String resourceCreditName) {
FurmsDialog furmsDialog = new FurmsDialog(getTranslation("view.site-admin.resource-credits.dialog.text", resourceCreditName));
furmsDialog.addConfirmButtonClickListener(event -> {
handleExceptions(() -> resourceCreditService.delete(resourceTypeId, getCurrentResourceId()), Map.of(ResourceCreditHasAllocationException.class, "view.site-admin.resource-credits.form.error.resourceCreditHasAllocations"));
loadGridContent();
});
return furmsDialog;
}
Aggregations