From 236f6a0ad3eba8cb9ab47f17010c465b579330d2 Mon Sep 17 00:00:00 2001 From: Andreas Svanberg <andreass@dsv.su.se> Date: Tue, 11 Feb 2025 15:22:21 +0100 Subject: [PATCH] Better UX for notification about opposition report needing improvements Now takes the opponent directly to the form where they can fill in the report and view the feedback from the seminar supervisor. --- .../dsv/scipro/notifications/Notifications.java | 8 ++++---- .../notifications/dataobject/ProjectEvent.java | 1 - .../notifications/dataobject/SeminarEvent.java | 1 + .../notifications/notifications.properties | 8 ++++---- .../pages/NotificationLandingPage.java | 17 ++++++++++++++++- .../dsv/scipro/wicket-package.utf8.properties | 2 +- 6 files changed, 26 insertions(+), 11 deletions(-) diff --git a/core/src/main/java/se/su/dsv/scipro/notifications/Notifications.java b/core/src/main/java/se/su/dsv/scipro/notifications/Notifications.java index cea9c4e28a..2a70b78765 100644 --- a/core/src/main/java/se/su/dsv/scipro/notifications/Notifications.java +++ b/core/src/main/java/se/su/dsv/scipro/notifications/Notifications.java @@ -172,13 +172,13 @@ public class Notifications { @Subscribe public void oppositionReportImprovementsRequested(OppositionReportImprovementsRequestedEvent event) { - Member recipient = new Member(event.opposition().getUser(), Member.Type.AUTHOR); + Member recipient = new Member(event.opposition().getUser(), Member.Type.OPPONENT); Set<Member> recipients = Set.of(recipient); NotificationSource source = new NotificationSource(); source.setMessage(event.supervisorComment()); - notificationController.notifyCustomProject( - event.opposition().getProject(), - ProjectEvent.Event.OPPOSITION_REPORT_IMPROVEMENTS_REQUESTED, + notificationController.notifyCustomSeminar( + event.opposition().getFinalSeminar(), + SeminarEvent.Event.OPPOSITION_REPORT_IMPROVEMENTS_REQUESTED, source, recipients ); diff --git a/core/src/main/java/se/su/dsv/scipro/notifications/dataobject/ProjectEvent.java b/core/src/main/java/se/su/dsv/scipro/notifications/dataobject/ProjectEvent.java index 0e0352631c..99fa21978a 100755 --- a/core/src/main/java/se/su/dsv/scipro/notifications/dataobject/ProjectEvent.java +++ b/core/src/main/java/se/su/dsv/scipro/notifications/dataobject/ProjectEvent.java @@ -51,7 +51,6 @@ public class ProjectEvent extends NotificationEvent { PARTICIPATION_FAILED, REFLECTION_IMPROVEMENTS_REQUESTED, REFLECTION_IMPROVEMENTS_SUBMITTED, - OPPOSITION_REPORT_IMPROVEMENTS_REQUESTED, } @Basic diff --git a/core/src/main/java/se/su/dsv/scipro/notifications/dataobject/SeminarEvent.java b/core/src/main/java/se/su/dsv/scipro/notifications/dataobject/SeminarEvent.java index 5656e9f5c8..6576f98709 100755 --- a/core/src/main/java/se/su/dsv/scipro/notifications/dataobject/SeminarEvent.java +++ b/core/src/main/java/se/su/dsv/scipro/notifications/dataobject/SeminarEvent.java @@ -27,6 +27,7 @@ public class SeminarEvent extends NotificationEvent { THESIS_UPLOAD_REMIND, CANCELLED, OPPOSITION_REPORT_SUBMITTED, + OPPOSITION_REPORT_IMPROVEMENTS_REQUESTED, } @Basic diff --git a/core/src/main/java/se/su/dsv/scipro/notifications/notifications.properties b/core/src/main/java/se/su/dsv/scipro/notifications/notifications.properties index fd1eb01598..206a630073 100755 --- a/core/src/main/java/se/su/dsv/scipro/notifications/notifications.properties +++ b/core/src/main/java/se/su/dsv/scipro/notifications/notifications.properties @@ -79,10 +79,6 @@ PROJECT.FIRST_MEETING.body = Date: {0}\n\nDescription:\n{2} PROJECT.OPPOSITION_FAILED.title = Your opposition on {1} did not meet the minimum requirements. PROJECT.OPPOSITION_FAILED.body = Your opposition did not meet the minimum requirements set, and you will have to \ oppose on a different final seminar to pass this step.\n\nFeedback from the seminar supervisor: {2} -PROJECT.OPPOSITION_REPORT_IMPROVEMENTS_REQUESTED.title = Opposition report improvements requested -PROJECT.OPPOSITION_REPORT_IMPROVEMENTS_REQUESTED.body = The supervisor has deemed that the opposition report submitted \ - does not meet the minimum requirements and has requested improvements. Please log into SciPro and submit a new \ - opposition report. Their comments can be seen below:\n\n{0} PROJECT.PARTICIPATION_APPROVED.title = Active participation on {1} has been approved. PROJECT.PARTICIPATION_APPROVED.body = Your active participation on {0} has been approved, but you still have to complete \ {2} more active participation to meet the minimum requirements for your thesis project. @@ -146,6 +142,10 @@ FINAL_SEMINAR.CANCELLED.title = Final seminar for project {1} was cancelled FINAL_SEMINAR.CANCELLED.body = The final seminar for project {0} was cancelled, supervisor must select a new date for the final seminar. FINAL_SEMINAR.OPPOSITION_REPORT_SUBMITTED.title=Opposition report submitted by {1} for the seminar on project {0} FINAL_SEMINAR.OPPOSITION_REPORT_SUBMITTED.body=The opposition report from {0} has been submitted. +FINAL_SEMINAR.OPPOSITION_REPORT_IMPROVEMENTS_REQUESTED.title = Opposition report improvements requested +FINAL_SEMINAR.OPPOSITION_REPORT_IMPROVEMENTS_REQUESTED.body = The supervisor has deemed that the opposition report submitted \ + does not meet the minimum requirements and has requested improvements. Please log into SciPro and submit a new \ + opposition report. Their comments can be seen below:\n\n{0} FINAL_SEMINAR.compilationSuffix = , project: {0} PEER.REVIEW_COMPLETED.title = Peer review completed diff --git a/view/src/main/java/se/su/dsv/scipro/notifications/pages/NotificationLandingPage.java b/view/src/main/java/se/su/dsv/scipro/notifications/pages/NotificationLandingPage.java index 1a3f7c6660..743fb8b158 100644 --- a/view/src/main/java/se/su/dsv/scipro/notifications/pages/NotificationLandingPage.java +++ b/view/src/main/java/se/su/dsv/scipro/notifications/pages/NotificationLandingPage.java @@ -10,6 +10,8 @@ import org.apache.wicket.util.string.StringValueConversionException; import se.su.dsv.scipro.activityplan.ProjectActivityPlanPage; import se.su.dsv.scipro.activityplan.SupervisorActivityPlanPage; import se.su.dsv.scipro.finalseminar.FinalSeminar; +import se.su.dsv.scipro.finalseminar.FinalSeminarOpposition; +import se.su.dsv.scipro.finalseminar.OppositionReportPage; import se.su.dsv.scipro.finalseminar.ProjectFinalSeminarDetailsPage; import se.su.dsv.scipro.finalseminar.ProjectFinalSeminarPage; import se.su.dsv.scipro.finalseminar.ProjectOppositionPage; @@ -180,7 +182,7 @@ public class NotificationLandingPage extends WebPage { case FIRST_MEETING: defaultSplit.accept(ProjectFirstMeetingPage.class, SupervisorFirstMeetingPage.class); break; - case OPPOSITION_FAILED, OPPOSITION_REPORT_IMPROVEMENTS_REQUESTED: + case OPPOSITION_FAILED: defaultSplit.accept(ProjectOppositionPage.class, SupervisorProjectDetailsPage.class); break; default: @@ -217,6 +219,19 @@ public class NotificationLandingPage extends WebPage { } else if ( seminar.getActiveParticipants().contains(currentUser) || seminar.getOpponents().contains(currentUser) ) { + if (seminarEvent.getEvent() == SeminarEvent.Event.OPPOSITION_REPORT_IMPROVEMENTS_REQUESTED) { + Optional<FinalSeminarOpposition> opposition = seminar + .getOppositions() + .stream() + .filter(op -> op.getUser().equals(currentUser)) + .findFirst(); + if (opposition.isPresent()) { + final PageParameters oppPP = new PageParameters(); + oppPP.set("oid", opposition.get().getId()); + setResponsePage(OppositionReportPage.class, oppPP); + return; + } + } setResponsePage(ProjectFinalSeminarDetailsPage.class, pp); } } diff --git a/view/src/main/java/se/su/dsv/scipro/wicket-package.utf8.properties b/view/src/main/java/se/su/dsv/scipro/wicket-package.utf8.properties index f1a83aa464..01b1039371 100644 --- a/view/src/main/java/se/su/dsv/scipro/wicket-package.utf8.properties +++ b/view/src/main/java/se/su/dsv/scipro/wicket-package.utf8.properties @@ -63,7 +63,6 @@ ProjectEvent.SUPERVISOR_GRADING_INITIAL_ASSESSMENT_DONE = The supervisor finishe ProjectEvent.EXPORTED_SUCCESS = Idea was successfully exported to a thesis course in Daisy and a project in SciPro. ProjectEvent.FIRST_MEETING = First meeting created. (with date, time, place/room/communication method specified by supervisor) ProjectEvent.OPPOSITION_FAILED = An author fails their opposition. -ProjectEvent.OPPOSITION_REPORT_IMPROVEMENTS_REQUESTED = Opposition report improvements requested. ProjectEvent.PARTICIPATION_APPROVED = An author's active participation is approved. ProjectEvent.PARTICIPATION_FAILED = An author fails their active participation. ProjectEvent.REFLECTION_IMPROVEMENTS_REQUESTED = Reflection improvements requested. @@ -85,6 +84,7 @@ SeminarEvent.THESIS_DELETED = Final seminar thesis deleted. SeminarEvent.THESIS_UPLOAD_REMIND = Authors reminded to upload final seminar thesis. SeminarEvent.CANCELLED = Final seminar cancelled. SeminarEvent.OPPOSITION_REPORT_SUBMITTED = Opposition report submitted. +SeminarEvent.OPPOSITION_REPORT_IMPROVEMENTS_REQUESTED = Opposition report improvements requested. IdeaEvent.STATUS_CHANGE = Idea status changed. IdeaEvent.PARTNER_ACCEPT = Partner (author) accepted partnering idea.