Allow changes to the reflection to be made after it's been submitted #13
|
@ -20,7 +20,7 @@ public class ProjectEvent extends NotificationEvent {
|
|||
ROUGH_DRAFT_APPROVAL_APPROVED, ROUGH_DRAFT_APPROVAL_REJECTED, REVIEWER_GRADING_REPORT_SUBMITTED,
|
||||
ONE_YEAR_PASSED_FROM_LATEST_ANNUAL_REVIEW, SUPERVISOR_GRADING_INITIAL_ASSESSMENT_DONE,
|
||||
EXPORTED_SUCCESS, REVIEWER_GRADING_INITIAL_ASSESSMENT_DONE, FIRST_MEETING, OPPOSITION_FAILED, PARTICIPATION_APPROVED, COMPLETED,
|
||||
REFLECTION_IMPROVEMENTS_REQUESTED, PARTICIPATION_FAILED
|
||||
REFLECTION_IMPROVEMENTS_REQUESTED, REFLECTION_IMPROVEMENTS_SUBMITTED, PARTICIPATION_FAILED
|
||||
}
|
||||
|
||||
@ManyToOne
|
||||
|
|
|
@ -89,6 +89,9 @@ PROJECT.REFLECTION_IMPROVEMENTS_REQUESTED.title = Reflection improvements reques
|
|||
PROJECT.REFLECTION_IMPROVEMENTS_REQUESTED.body = The supervisor has deemed that the reflection submitted does not meet \
|
||||
the minimum requirements and has requested improvements. Please log into SciPro and submit a new reflection. \
|
||||
Their comments can be seen below:\n\n{0}
|
||||
PROJECT.REFLECTION_IMPROVEMENTS_SUBMITTED.title = Reflection improvements submitted
|
||||
PROJECT.REFLECTION_IMPROVEMENTS_SUBMITTED.body = The reflection improvements have been submitted. \
|
||||
\n\n{0}
|
||||
|
||||
FORUM.NEW_FORUM_POST.title = Forum post: {2}
|
||||
FORUM.NEW_FORUM_POST.body = New forum post submitted:<br /><br />{0}
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
package se.su.dsv.scipro.reflection;
|
||||
|
||||
import se.su.dsv.scipro.project.Project;
|
||||
import se.su.dsv.scipro.system.User;
|
||||
|
||||
/**
|
||||
* This event may be triggered by the supervisor if they edit the reflection after requesting improvements.
|
||||
*/
|
||||
public record ReflectionImprovementsSubmittedEvent(Project project, User author, String reflection) {
|
||||
}
|
|
@ -50,6 +50,9 @@ class ReflectionServiceImpl implements ReflectionService {
|
|||
public void submitReflection(Project project, User user, String reflection) {
|
||||
authorRepository.findByProjectAndUser(project, user)
|
||||
.ifPresent(author -> {
|
||||
if (author.getReflectionStatus() == ReflectionStatus.IMPROVEMENTS_NEEDED) {
|
||||
eventBus.post(new ReflectionImprovementsSubmittedEvent(project, user, reflection));
|
||||
}
|
||||
author.setReflection(reflection);
|
||||
author.setReflectionStatus(ReflectionStatus.SUBMITTED);
|
||||
});
|
||||
|
|
|
@ -8,6 +8,7 @@ import se.su.dsv.scipro.notifications.NotificationController;
|
|||
import se.su.dsv.scipro.notifications.dataobject.NotificationSource;
|
||||
import se.su.dsv.scipro.notifications.dataobject.ProjectEvent;
|
||||
import se.su.dsv.scipro.reflection.ReflectionImprovementsRequestedEvent;
|
||||
import se.su.dsv.scipro.reflection.ReflectionImprovementsSubmittedEvent;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
|
@ -30,4 +31,16 @@ public class NotifyFailedReflection {
|
|||
source,
|
||||
Set.of(new Member(event.author(), Member.Type.AUTHOR)));
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void reflectionImprovementsSubmittted(ReflectionImprovementsSubmittedEvent event) {
|
||||
NotificationSource source = new NotificationSource();
|
||||
source.setMessage(event.reflection());
|
||||
source.setAdditionalMessage(event.author().getFullName());
|
||||
notificationController.notifyCustomProject(
|
||||
event.project(),
|
||||
ProjectEvent.Event.REFLECTION_IMPROVEMENTS_SUBMITTED,
|
||||
source,
|
||||
Set.of(new Member(event.project().getHeadSupervisor(), Member.Type.SUPERVISOR)));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -158,7 +158,7 @@ public class NotificationLandingPage extends WebPage {
|
|||
setResponsePage(RoughDraftApprovalDecisionPage.class, reviewerParameters);
|
||||
}
|
||||
break;
|
||||
case REVIEWER_GRADING_INITIAL_ASSESSMENT_DONE, REVIEWER_GRADING_REPORT_SUBMITTED:
|
||||
case REVIEWER_GRADING_INITIAL_ASSESSMENT_DONE, REVIEWER_GRADING_REPORT_SUBMITTED, REFLECTION_IMPROVEMENTS_SUBMITTED:
|
||||
if (project.isSupervisor(currentUser)) {
|
||||
setResponsePage(SupervisorGradingReportPage.class, pp);
|
||||
}
|
||||
|
|
|
@ -66,6 +66,7 @@ ProjectEvent.OPPOSITION_FAILED = An author fails their opposition.
|
|||
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.
|
||||
ProjectEvent.REFLECTION_IMPROVEMENTS_SUBMITTED = Reflection improvements submitted.
|
||||
|
||||
ProjectForumEvent.NEW_FORUM_POST = Forum thread created.
|
||||
ProjectForumEvent.NEW_FORUM_POST_COMMENT = Comment posted in forum thread.
|
||||
|
|
Loading…
Reference in New Issue
Block a user