Skip to content

Commit 2df4f1d

Browse files
Merge remote-tracking branch 'origin/master'
2 parents 5e4213f + 91500a6 commit 2df4f1d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

frontend/src/components/assessments/reports/AssessmentReports.vue

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,18 @@ export default {
349349
}
350350
});
351351
this.sessionSearchNames = sortBy(this.sessions, ['sessionCourseYear','sessionCourseMonth']);
352+
353+
const approvedSessions = this.schoolYearSessions.filter(session =>
354+
!session.isOpen && parseInt(session.courseYear) >= sessionYearMinusTwo
355+
);
356+
357+
if (approvedSessions.length > 0) {
358+
const mostRecentApprovedSession = approvedSessions.sort((a, b) =>
359+
LocalDateTime.parse(b.activeUntilDate).compareTo(LocalDateTime.parse(a.activeUntilDate))
360+
)[0];
361+
362+
this.selectedSessionID = mostRecentApprovedSession.sessionID;
363+
}
352364
},
353365
setupSchoolLists() {
354366
this.schoolSearchNames = [];

0 commit comments

Comments
 (0)