From c6b8a6028db71cfc86436807d1f321b42cbeb813 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Zl=C3=A1mal?= Date: Fri, 1 Apr 2022 14:12:16 +0200 Subject: [PATCH 1/2] fix(registrar): handle CantBeApprovedException - WUI is expected to ignore soft version of CantBeApprovedException. Later code processing required Application and its ID to be returned, but summary contained only Exception thrown and not the Application. - Now we get application ID from Exception itself. --- .../perun/wui/model/PerunException.java | 4 ++++ .../registrar/pages/steps/SummaryStep.java | 22 ++++++------------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/perun-wui-core/src/main/java/cz/metacentrum/perun/wui/model/PerunException.java b/perun-wui-core/src/main/java/cz/metacentrum/perun/wui/model/PerunException.java index e372582d..6a80cd9b 100644 --- a/perun-wui-core/src/main/java/cz/metacentrum/perun/wui/model/PerunException.java +++ b/perun-wui-core/src/main/java/cz/metacentrum/perun/wui/model/PerunException.java @@ -266,4 +266,8 @@ public final Service getService() { return JsUtils.getNativePropertyObject(this, "service").cast(); } + public final int getApplicationId() { + return JsUtils.getNativePropertyInt(this, "applicationId"); + } + } diff --git a/perun-wui-registrar/src/main/java/cz/metacentrum/perun/wui/registrar/pages/steps/SummaryStep.java b/perun-wui-registrar/src/main/java/cz/metacentrum/perun/wui/registrar/pages/steps/SummaryStep.java index 9768f08e..5f29deb5 100644 --- a/perun-wui-registrar/src/main/java/cz/metacentrum/perun/wui/registrar/pages/steps/SummaryStep.java +++ b/perun-wui-registrar/src/main/java/cz/metacentrum/perun/wui/registrar/pages/steps/SummaryStep.java @@ -5,19 +5,14 @@ import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.user.client.Timer; import com.google.gwt.user.client.Window; -import com.google.gwt.user.client.ui.HTML; import cz.metacentrum.perun.wui.client.resources.PerunConfiguration; -import cz.metacentrum.perun.wui.client.utils.JsUtils; -import cz.metacentrum.perun.wui.client.utils.Utils; import cz.metacentrum.perun.wui.json.ErrorTranslator; import cz.metacentrum.perun.wui.json.Events; import cz.metacentrum.perun.wui.json.JsonEvents; -import cz.metacentrum.perun.wui.json.managers.AttributesManager; import cz.metacentrum.perun.wui.json.managers.RegistrarManager; import cz.metacentrum.perun.wui.model.GeneralObject; import cz.metacentrum.perun.wui.model.PerunException; import cz.metacentrum.perun.wui.model.beans.Application; -import cz.metacentrum.perun.wui.model.beans.Attribute; import cz.metacentrum.perun.wui.model.beans.Group; import cz.metacentrum.perun.wui.model.beans.Vo; import cz.metacentrum.perun.wui.model.common.PerunPrincipal; @@ -41,7 +36,6 @@ import org.gwtbootstrap3.client.ui.constants.ColumnOffset; import org.gwtbootstrap3.client.ui.constants.ColumnSize; import org.gwtbootstrap3.client.ui.constants.HeadingSize; -import org.gwtbootstrap3.client.ui.constants.IconPosition; import org.gwtbootstrap3.client.ui.constants.IconSize; import org.gwtbootstrap3.client.ui.constants.IconType; import org.gwtbootstrap3.client.ui.constants.ListGroupItemType; @@ -52,10 +46,7 @@ import org.gwtbootstrap3.extras.notify.client.constants.NotifyType; import org.gwtbootstrap3.extras.notify.client.ui.Notify; -import java.util.ArrayList; -import java.util.Arrays; import java.util.List; -import java.util.Objects; /** * Represents a final step in registration process. Show info. @@ -151,7 +142,7 @@ private void caseVoInit(Summary summary, Heading title, ListGroup messages) { title.add(new Text(" "+translation.initTitle())); msg.setText(translation.waitForAcceptation()); messages.add(msg); - verifyMailMessage(summary, messages, summary.getApplication().getId()); + verifyMailMessage(summary, messages, res.getException().getApplicationId()); } else { displayException(res.getException(), res.getBean()); @@ -212,7 +203,7 @@ private void caseVoExt(Summary summary, Heading title, ListGroup messages) { title.add(new Text(" "+translation.extendTitle())); msg.setText(translation.waitForExtAcceptation()); messages.add(msg); - verifyMailMessage(summary, messages, summary.getApplication().getId()); + verifyMailMessage(summary, messages, res.getException().getApplicationId()); } else { // FIXME - solve this BLEEEH hack in better way. @@ -285,7 +276,7 @@ private void caseGroupInit(Summary summary, Heading title, ListGroup messages) { msg.setText(translation.waitForAcceptation()); messages.add(msg); - verifyMailMessage(summary, messages, summary.getApplication().getId()); + verifyMailMessage(summary, messages, res.getException().getApplicationId()); } else { displayException(res.getException(), res.getBean()); @@ -343,7 +334,7 @@ private void caseGroupExt(Summary summary, Heading title, ListGroup messages) { msg.setText(translation.waitForExtAcceptation()); messages.add(msg); - verifyMailMessage(summary, messages, summary.getApplication().getId()); + verifyMailMessage(summary, messages, res.getException().getApplicationId()); } else { // FIXME - solve this BLEEEH hack in better way. @@ -391,19 +382,20 @@ private void caseVoInitGroupInit(Summary summary, Heading title, ListGroup messa if (!msg.getText().isEmpty()) { messages.add(msg); } + verifyMailMessage(summary, messages, summary.getApplication().getId()); + } else if (resultVo.getException() != null && "CantBeApprovedException".equals(resultVo.getException().getName())) { // FIXME - hack to ignore CantBeApprovedException since VO manager can manually handle it. ListGroupItem msg = new ListGroupItem(); msg.setText(translation.waitForAcceptation()); messages.add(msg); + verifyMailMessage(summary, messages, resultVo.getException().getApplicationId()); } else { displayException(resultVo.getException(), resultVo.getBean()); } - verifyMailMessage(summary, messages, summary.getApplication().getId()); - // Show summary about application to group if (resultGroup.isOk()) { From e7d0fbb654e7c9721008036dae4994a36f983301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Zl=C3=A1mal?= Date: Mon, 9 May 2022 14:34:49 +0200 Subject: [PATCH 2/2] refactor: removed unused HTML templates for Elixir - Elixir instance has been migrated into LifeScience RI instance. Old HTML templates for WUI are no longer needed. --- .../main/webapp/PerunConsolidatorElixir.html | 283 ----------------- .../webapp/PerunConsolidatorElixirSISU.html | 286 ----------------- .../src/main/webapp/PerunProfileElixir.html | 267 ---------------- .../src/main/webapp/PerunPwdResetElixir.html | 291 ------------------ .../src/main/webapp/PerunRegistrarElixir.html | 290 ----------------- 5 files changed, 1417 deletions(-) delete mode 100644 perun-wui-consolidator/src/main/webapp/PerunConsolidatorElixir.html delete mode 100644 perun-wui-consolidator/src/main/webapp/PerunConsolidatorElixirSISU.html delete mode 100644 perun-wui-profile/src/main/webapp/PerunProfileElixir.html delete mode 100644 perun-wui-pwdreset/src/main/webapp/PerunPwdResetElixir.html delete mode 100644 perun-wui-registrar/src/main/webapp/PerunRegistrarElixir.html diff --git a/perun-wui-consolidator/src/main/webapp/PerunConsolidatorElixir.html b/perun-wui-consolidator/src/main/webapp/PerunConsolidatorElixir.html deleted file mode 100644 index b6496231..00000000 --- a/perun-wui-consolidator/src/main/webapp/PerunConsolidatorElixir.html +++ /dev/null @@ -1,283 +0,0 @@ - - - - - - - - - - - - - - - - - - - Perun Identity Consolidator - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - -
- - -
- -
- - - - - - - - - - - diff --git a/perun-wui-consolidator/src/main/webapp/PerunConsolidatorElixirSISU.html b/perun-wui-consolidator/src/main/webapp/PerunConsolidatorElixirSISU.html deleted file mode 100644 index 719d83cd..00000000 --- a/perun-wui-consolidator/src/main/webapp/PerunConsolidatorElixirSISU.html +++ /dev/null @@ -1,286 +0,0 @@ - - - - - - - - - - - - - - - - - - - Perun Identity Consolidator - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - -
- - -
- -
- - - - - - - - - - - diff --git a/perun-wui-profile/src/main/webapp/PerunProfileElixir.html b/perun-wui-profile/src/main/webapp/PerunProfileElixir.html deleted file mode 100644 index a9cb9499..00000000 --- a/perun-wui-profile/src/main/webapp/PerunProfileElixir.html +++ /dev/null @@ -1,267 +0,0 @@ - - - - - - - - - - - - - - - - - - - Perun - User profile - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - -
- - -
- -
- - - - - diff --git a/perun-wui-pwdreset/src/main/webapp/PerunPwdResetElixir.html b/perun-wui-pwdreset/src/main/webapp/PerunPwdResetElixir.html deleted file mode 100644 index b7ee4572..00000000 --- a/perun-wui-pwdreset/src/main/webapp/PerunPwdResetElixir.html +++ /dev/null @@ -1,291 +0,0 @@ - - - - - - - - - - - - - - - - - - - Perun Password Reset - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - -
- - -
- -
- - - - - - diff --git a/perun-wui-registrar/src/main/webapp/PerunRegistrarElixir.html b/perun-wui-registrar/src/main/webapp/PerunRegistrarElixir.html deleted file mode 100644 index 0e17c5f3..00000000 --- a/perun-wui-registrar/src/main/webapp/PerunRegistrarElixir.html +++ /dev/null @@ -1,290 +0,0 @@ - - - - - - - - - - - - - - - - - - - Perun Registrar - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - -
- - -
- -
- - - - - -