diff --git a/core/src/main/java/se/su/dsv/scipro/finalseminar/FinalSeminarOppositionServiceImpl.java b/core/src/main/java/se/su/dsv/scipro/finalseminar/FinalSeminarOppositionServiceImpl.java index ac52aba45e..693ed21351 100755 --- a/core/src/main/java/se/su/dsv/scipro/finalseminar/FinalSeminarOppositionServiceImpl.java +++ b/core/src/main/java/se/su/dsv/scipro/finalseminar/FinalSeminarOppositionServiceImpl.java @@ -98,6 +98,8 @@ public class FinalSeminarOppositionServiceImpl opposition.setImprovementsRequestedAt(now); opposition.setSupervisorCommentForImprovements(supervisorComment); + eventBus.post(new OppositionReportImprovementsRequestedEvent(opposition, supervisorComment, deadline)); + return deadline; } diff --git a/core/src/main/java/se/su/dsv/scipro/finalseminar/OppositionReportImprovementsRequestedEvent.java b/core/src/main/java/se/su/dsv/scipro/finalseminar/OppositionReportImprovementsRequestedEvent.java new file mode 100644 index 0000000000..0c063e49cf --- /dev/null +++ b/core/src/main/java/se/su/dsv/scipro/finalseminar/OppositionReportImprovementsRequestedEvent.java @@ -0,0 +1,9 @@ +package se.su.dsv.scipro.finalseminar; + +import java.time.Instant; + +public record OppositionReportImprovementsRequestedEvent( + FinalSeminarOpposition opposition, + String supervisorComment, + Instant deadline +) {} 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 00cbe6b0da..abf4fcb159 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 @@ -12,6 +12,7 @@ import se.su.dsv.scipro.finalseminar.FinalSeminarDeletedEvent; import se.su.dsv.scipro.finalseminar.FinalSeminarThesisDeletedEvent; import se.su.dsv.scipro.finalseminar.FinalSeminarThesisUploadedEvent; import se.su.dsv.scipro.finalseminar.OppositionFailedEvent; +import se.su.dsv.scipro.finalseminar.OppositionReportImprovementsRequestedEvent; import se.su.dsv.scipro.finalseminar.ParticipationFailedEvent; import se.su.dsv.scipro.notifications.dataobject.NotificationSource; import se.su.dsv.scipro.notifications.dataobject.PeerEvent; @@ -168,6 +169,20 @@ public class Notifications { ); } + @Subscribe + public void oppositionReportImprovementsRequested(OppositionReportImprovementsRequestedEvent event) { + Member recipient = new Member(event.opposition().getUser(), Member.Type.AUTHOR); + 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, + source, + recipients + ); + } + @Subscribe public void reviewersChanged(ReviewerAssignedEvent event) { notificationController.notifyProject( 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 99fa21978a..0e0352631c 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,6 +51,7 @@ 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/notifications.properties b/core/src/main/java/se/su/dsv/scipro/notifications/notifications.properties index c5cb11b76a..9019703177 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,6 +79,10 @@ 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. 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 4a999d66f4..1a3f7c6660 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 @@ -180,7 +180,7 @@ public class NotificationLandingPage extends WebPage { case FIRST_MEETING: defaultSplit.accept(ProjectFirstMeetingPage.class, SupervisorFirstMeetingPage.class); break; - case OPPOSITION_FAILED: + case OPPOSITION_FAILED, OPPOSITION_REPORT_IMPROVEMENTS_REQUESTED: defaultSplit.accept(ProjectOppositionPage.class, SupervisorProjectDetailsPage.class); break; default: 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 97ea5d57c3..077b636977 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,6 +63,7 @@ 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.