From 8f0fbb2d375de6d0ef69896e3fcceb5bc24b03e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Zl=C3=A1mal?= Date: Tue, 15 Dec 2020 12:48:07 +0100 Subject: [PATCH] Display custom not eligible messages for einfra - Support custom not eligible messages when user uses Metacentrum IdP or when is not eligible for membership extension (using new einfra verification way). --- .../perun/wui/registrar/client/ExceptionResolverImpl.java | 6 ++++++ .../client/resources/PerunRegistrarTranslation.java | 6 ++++++ .../resources/PerunRegistrarTranslation_cs.properties | 3 ++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/perun-wui-registrar/src/main/java/cz/metacentrum/perun/wui/registrar/client/ExceptionResolverImpl.java b/perun-wui-registrar/src/main/java/cz/metacentrum/perun/wui/registrar/client/ExceptionResolverImpl.java index b6885c3a..1a443388 100644 --- a/perun-wui-registrar/src/main/java/cz/metacentrum/perun/wui/registrar/client/ExceptionResolverImpl.java +++ b/perun-wui-registrar/src/main/java/cz/metacentrum/perun/wui/registrar/client/ExceptionResolverImpl.java @@ -13,6 +13,7 @@ import cz.metacentrum.perun.wui.model.beans.ApplicationFormItem; import cz.metacentrum.perun.wui.model.beans.ApplicationFormItemData; import cz.metacentrum.perun.wui.model.beans.Group; +import cz.metacentrum.perun.wui.model.beans.User; import cz.metacentrum.perun.wui.model.beans.Vo; import cz.metacentrum.perun.wui.registrar.client.resources.PerunRegistrarTranslation; @@ -235,6 +236,11 @@ private void resolveCantBeSubmittedException() { setInfo(trans.cantSubmitLoA(), trans.notAcademicLoA(Utils.translateIdp(PerunSession.getInstance().getPerunPrincipal().getExtSource()))); } else if (Objects.equals("NOT_ELIGIBLE", exception.getReason())) { setInfo(trans.cantSubmitLoA(), trans.notEligibleCESNET()); + } else if (Objects.equals("NOT_ELIGIBLE_EINFRA_EXTENSION", exception.getReason())) { + String url = Window.Location.getProtocol() + "//" + Window.Location.getHost() + "/"; + setInfo(trans.cantSubmitLoA(), trans.notEligibleEINFRAextension(Utils.getIdentityConsolidatorLink(true), url+PerunSession.getInstance().getRpcServer()+"/registrar/?vo=einfra&group=verified_users:catch_all")); + } else if (Objects.equals("NOT_ELIGIBLE_METAIDP", exception.getReason())) { + setInfo(trans.cantSubmitLoA(), trans.notEligibleMETAIDP()); } else { setInfo(trans.cantSubmitLoA(), exception.getMessage()); } diff --git a/perun-wui-registrar/src/main/java/cz/metacentrum/perun/wui/registrar/client/resources/PerunRegistrarTranslation.java b/perun-wui-registrar/src/main/java/cz/metacentrum/perun/wui/registrar/client/resources/PerunRegistrarTranslation.java index 95e6f03c..9b0cd573 100644 --- a/perun-wui-registrar/src/main/java/cz/metacentrum/perun/wui/registrar/client/resources/PerunRegistrarTranslation.java +++ b/perun-wui-registrar/src/main/java/cz/metacentrum/perun/wui/registrar/client/resources/PerunRegistrarTranslation.java @@ -339,6 +339,12 @@ public interface PerunRegistrarTranslation extends PerunTranslation { @DefaultMessage("In order to access CESNET services you must log-in using verified academic identity (at least once a year). Please use such identity to access this form.") public String notEligibleCESNET(); + @DefaultMessage("

To renew your membership, verification of academic status is required for your e-Infrastructure account.