Search in sources :

Example 1 with SiteHasResourceCreditsRemoveValidationError

use of io.imunity.furms.api.validation.exceptions.SiteHasResourceCreditsRemoveValidationError in project furms by unity-idm.

the class SitesView method actionDeleteSite.

private void actionDeleteSite(SiteGridItem site, Grid<SiteGridItem> siteGrid) {
    FurmsDialog cancelDialog = new FurmsDialog(getTranslation("view.sites.main.confirmation.dialog.delete", site.getName()));
    cancelDialog.addConfirmButtonClickListener(event -> {
        try {
            siteService.delete(site.getId());
            showSuccessNotification(getTranslation("view.sites.main.grid.item.menu.delete.success", site.getName()));
        } catch (SiteHasResourceCreditsRemoveValidationError e) {
            LOG.debug("Could not create Site. ", e);
            showErrorNotification(getTranslation("site.removing.error.message", site.getName()));
        } catch (RuntimeException e) {
            LOG.warn("Could not create Site. ", e);
            showErrorNotification(getTranslation("view.sites.form.error.unexpected", "delete"));
        } finally {
            siteGrid.setItems(fetchSites());
        }
    });
    cancelDialog.open();
}
Also used : SiteHasResourceCreditsRemoveValidationError(io.imunity.furms.api.validation.exceptions.SiteHasResourceCreditsRemoveValidationError) FurmsDialog(io.imunity.furms.ui.components.FurmsDialog)

Aggregations

SiteHasResourceCreditsRemoveValidationError (io.imunity.furms.api.validation.exceptions.SiteHasResourceCreditsRemoveValidationError)1 FurmsDialog (io.imunity.furms.ui.components.FurmsDialog)1