diff --git a/frontend/sw360-portlet/src/main/java/org/eclipse/sw360/portal/common/PortalConstants.java b/frontend/sw360-portlet/src/main/java/org/eclipse/sw360/portal/common/PortalConstants.java index a81f15e9f0..cb2e1d5aba 100644 --- a/frontend/sw360-portlet/src/main/java/org/eclipse/sw360/portal/common/PortalConstants.java +++ b/frontend/sw360-portlet/src/main/java/org/eclipse/sw360/portal/common/PortalConstants.java @@ -511,6 +511,7 @@ public class PortalConstants { public static final String ACTION_POSTPONE = "action_postpone"; public static final String ACTION_DECLINE = "action_decline"; public static final String ACTION_REMOVEME = "action_removeme"; + public static final String LAST_MODERATOR = "last_moderator"; public static final String ACTION_RENDER_NEXT_AFTER_UNSUBSCRIBE = "action_render_next"; public static final String MODERATION_REQUEST_COMMENT = "moderation_request_comment"; public static final String MODERATION_DECISION_COMMENT = "moderation_decision_comment"; diff --git a/frontend/sw360-portlet/src/main/java/org/eclipse/sw360/portal/portlets/moderation/ModerationPortlet.java b/frontend/sw360-portlet/src/main/java/org/eclipse/sw360/portal/portlets/moderation/ModerationPortlet.java index 1f3cab97c7..e19c983c9e 100644 --- a/frontend/sw360-portlet/src/main/java/org/eclipse/sw360/portal/portlets/moderation/ModerationPortlet.java +++ b/frontend/sw360-portlet/src/main/java/org/eclipse/sw360/portal/portlets/moderation/ModerationPortlet.java @@ -450,7 +450,9 @@ private void renderActionView(RenderRequest request, RenderResponse response) th sessionMessage = LanguageUtil.get(resourceBundle,"you.have.postponed.the.previous.moderation.request"); } else if (ACTION_RENDER_NEXT_AFTER_UNSUBSCRIBE.equals(action)) { sessionMessage = LanguageUtil.get(resourceBundle,"you.are.removed.from.the.list.of.moderators.for.the.previous.moderation.request"); - } else { + } else if (LAST_MODERATOR.equals(action)) { + sessionMessage = LanguageUtil.get(resourceBundle,"you.are.the.last.moderator.for.this.request.you.are.not.allowed.to.unsubscribe"); + } else { throw new PortletException("Unknown action"); } @@ -655,6 +657,12 @@ private void renderNextModeration(RenderRequest request, RenderResponse response return; } + if (LAST_MODERATOR.equals(request.getParameter(ACTION))) { + SessionMessages.add(request, "request_processed", sessionMessage); + renderStandardView(request, response); + return; + } + List requestsByModerator = client.getRequestsByModerator(user); List openModerationRequests = requestsByModerator .stream() diff --git a/frontend/sw360-portlet/src/main/resources/META-INF/resources/html/moderation/includes/moderationHeader.jspf b/frontend/sw360-portlet/src/main/resources/META-INF/resources/html/moderation/includes/moderationHeader.jspf index 2ef0017b14..aa7e4fc207 100644 --- a/frontend/sw360-portlet/src/main/resources/META-INF/resources/html/moderation/includes/moderationHeader.jspf +++ b/frontend/sw360-portlet/src/main/resources/META-INF/resources/html/moderation/includes/moderationHeader.jspf @@ -85,7 +85,8 @@ require(['jquery'], function($) { window.location = portletURL.toString(); } else if (data.result == 'LAST_MODERATOR') { - $.alert(''); + var portletUrl = getBaseURL().setParameter('<%=PortalConstants.ACTION%>', '<%=PortalConstants.LAST_MODERATOR%>'); + window.location = portletUrl.toString(); } else { $.alert('');