From b65bf990c9f6a420a441acc7e1e7c5e06a50da32 Mon Sep 17 00:00:00 2001 From: Matti Lupari Date: Tue, 18 Jun 2024 19:52:25 +0300 Subject: [PATCH 1/5] CSCEXAM-1283 Collab exam search with no filter - Fix query parameter handling so that results are not limited to 100 --- .../iop/collaboration/impl/CollaborativeExamController.java | 2 +- ui/src/app/enrolment/enrolment.service.ts | 2 +- ui/src/app/exam/collaborative/collaborative-exam.service.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/iop/collaboration/impl/CollaborativeExamController.java b/app/controllers/iop/collaboration/impl/CollaborativeExamController.java index ca183ad41..6e198d63f 100644 --- a/app/controllers/iop/collaboration/impl/CollaborativeExamController.java +++ b/app/controllers/iop/collaboration/impl/CollaborativeExamController.java @@ -100,7 +100,7 @@ private Exam prepareDraft(User user) { @Authenticated @Restrict({ @Group("ADMIN"), @Group("TEACHER") }) - public CompletionStage searchExams(Http.Request request, final Optional filter) { + public CompletionStage searchExams(Http.Request request, Optional filter) { WSRequest wsRequest = getSearchRequest(filter); User user = request.attrs().get(Attrs.AUTHENTICATED_USER); String homeOrg = configReader.getHomeOrganisationRef(); diff --git a/ui/src/app/enrolment/enrolment.service.ts b/ui/src/app/enrolment/enrolment.service.ts index cd3c9ddb7..9ff871001 100644 --- a/ui/src/app/enrolment/enrolment.service.ts +++ b/ui/src/app/enrolment/enrolment.service.ts @@ -188,7 +188,7 @@ export class EnrolmentService { this.http.get('/app/iop/student/finishedExams'); searchExams$ = (searchTerm: string): Observable => { - const paramStr = '?filter=' + (searchTerm && searchTerm.length > 0 ? encodeURIComponent(searchTerm) : ''); + const paramStr = searchTerm ? `?filter=${encodeURIComponent(searchTerm)}` : ''; const path = `/app/iop/enrolment${paramStr}`; return this.http.get(path); }; diff --git a/ui/src/app/exam/collaborative/collaborative-exam.service.ts b/ui/src/app/exam/collaborative/collaborative-exam.service.ts index e84c19595..5582c017b 100644 --- a/ui/src/app/exam/collaborative/collaborative-exam.service.ts +++ b/ui/src/app/exam/collaborative/collaborative-exam.service.ts @@ -44,7 +44,7 @@ export class CollaborativeExamService { createExam$ = (): Observable => this.http.post('/app/iop/exams', {}); searchExams$ = (searchTerm: string): Observable => { - const paramStr = '?filter=' + (searchTerm && searchTerm.length > 0 ? encodeURIComponent(searchTerm) : ''); + const paramStr = searchTerm ? `?filter=${encodeURIComponent(searchTerm)}` : ''; const path = `/app/iop/exams${paramStr}`; return this.http.get(path); }; From ac2c298563a301473bda6d4d3f07940732f63f5c Mon Sep 17 00:00:00 2001 From: Aurora Virmasalo <93916893+VirmasaloA@users.noreply.github.com> Date: Wed, 19 Jun 2024 10:33:14 +0300 Subject: [PATCH 2/5] CSCEXAM-1252 Add accessibility improvements * CSCEXAM-1249 Fix main menu keyboard usage * Add searchDone to hide result indicator before first search has been done * Improve accessibility on dropdown to slot-picker --- .../helpers/slot-picker.component.html | 13 +- .../active-enrolment-menu.component.html | 121 ++++++++---------- ...aborative-exam-participations.component.ts | 1 + .../exam-participations.component.html | 9 +- .../finished/exam-participations.component.ts | 2 + .../collaborative-exam-search.component.ts | 9 +- .../enrolment/search/exam-search.component.ts | 8 +- .../select/dropdown-select.component.ts | 26 ++-- ui/src/assets/i18n/en.json | 4 +- ui/src/assets/i18n/fi.json | 4 +- ui/src/assets/i18n/sv.json | 4 +- 11 files changed, 101 insertions(+), 100 deletions(-) diff --git a/ui/src/app/calendar/helpers/slot-picker.component.html b/ui/src/app/calendar/helpers/slot-picker.component.html index 111eb76d1..e1c2586f6 100644 --- a/ui/src/app/calendar/helpers/slot-picker.component.html +++ b/ui/src/app/calendar/helpers/slot-picker.component.html @@ -30,10 +30,15 @@

{{ sequenceNumber }}. {{ 'i18n_calendar_phase_2 diff --git a/ui/src/app/enrolment/active/helpers/active-enrolment-menu.component.html b/ui/src/app/enrolment/active/helpers/active-enrolment-menu.component.html index cde5bacd2..fc0000037 100644 --- a/ui/src/app/enrolment/active/helpers/active-enrolment-menu.component.html +++ b/ui/src/app/enrolment/active/helpers/active-enrolment-menu.component.html @@ -6,69 +6,64 @@
@if (enrolment.reservation && canChangeReservation(enrolment.reservation)) { -
- - @if (enrolment.reservation.machine && enrolment.collaborativeExam) { - {{ 'i18n_student_change_reservation' | translate }} - - } - - @if (enrolment.reservation.machine && !enrolment.collaborativeExam) { - {{ 'i18n_student_change_reservation' | translate }} - - } - - @if (enrolment.reservation.externalReservation && enrolment.exam) { - {{ 'i18n_student_change_reservation' | translate }} - - } - - @if (enrolment.reservation.externalReservation && enrolment.collaborativeExam) { - {{ 'i18n_student_change_reservation' | translate }} - - } -
+ + @if (enrolment.reservation.machine && enrolment.collaborativeExam) { + {{ 'i18n_student_change_reservation' | translate }} + + } + + @if (enrolment.reservation.machine && !enrolment.collaborativeExam) { + {{ 'i18n_student_change_reservation' | translate }} + + } + + @if (enrolment.reservation.externalReservation && enrolment.exam) { + {{ 'i18n_student_change_reservation' | translate }} + + } + + @if (enrolment.reservation.externalReservation && enrolment.collaborativeExam) { + {{ 'i18n_student_change_reservation' | translate }} + + } } @if (enrolment.examinationEventConfiguration && hasUpcomingAlternativeEvents()) { -
- -
+ } @if (enrolment.reservation && canChangeReservation(enrolment.reservation)) { -
- -
+ } @if (enrolment.reservation && !canChangeReservation(enrolment.reservation)) { -
- -
+ } @if (enrolment.examinationEventConfiguration) { -
- -
+ } @if ( @@ -76,19 +71,15 @@ !enrolment.examinationEventConfiguration && (enrolment.exam?.executionType?.type === 'PUBLIC' || enrolment.collaborativeExam) ) { -
- -
+ } @if ((!enrolment.reservation && enrolment.exam?.implementation === 'AQUARIUM') || enrolment.collaborativeExam) { -
- -
+ } @if ( @@ -96,11 +87,9 @@ enrolment.exam?.implementation !== 'AQUARIUM' && hasUpcomingAlternativeEvents() ) { -
- -
+ }
diff --git a/ui/src/app/enrolment/finished/collaborative-exam-participations.component.ts b/ui/src/app/enrolment/finished/collaborative-exam-participations.component.ts index fd9d8f30e..2b928c89d 100644 --- a/ui/src/app/enrolment/finished/collaborative-exam-participations.component.ts +++ b/ui/src/app/enrolment/finished/collaborative-exam-participations.component.ts @@ -56,6 +56,7 @@ export class CollaborativeParticipationsComponent implements OnInit, AfterViewIn pageSize = 10; currentPage = 0; filter = { ordering: 'ended', reverse: true, text: '' }; + searchDone = false; constructor( private changeDetector: ChangeDetectorRef, diff --git a/ui/src/app/enrolment/finished/exam-participations.component.html b/ui/src/app/enrolment/finished/exam-participations.component.html index bb53daf92..63e929548 100644 --- a/ui/src/app/enrolment/finished/exam-participations.component.html +++ b/ui/src/app/enrolment/finished/exam-participations.component.html @@ -37,9 +37,16 @@ - + @if (searchDone) { +
+
+ {{ 'i18n_student_exam_search_result' | translate }} {{ participations.length }} + {{ 'i18n_student_exam_search_result_continues' | translate }} +
+
+ }
- - @if (exams.length > 0 && filter.text.length > 2) { + @if (searchDone) {
-
+
{{ 'i18n_student_exam_search_result' | translate }} {{ exams.length }} {{ 'i18n_student_exam_search_result_continues' | translate }} - "{{ filter.text }}"
} @@ -95,6 +93,7 @@ export class CollaborativeExamSearchComponent implements OnInit, OnDestroy { loader = { loading: false }; filterChanged: Subject = new Subject(); ngUnsubscribe = new Subject(); + searchDone = false; constructor(private Enrolment: EnrolmentService) { this.filterChanged @@ -140,7 +139,7 @@ export class CollaborativeExamSearchComponent implements OnInit, OnDestroy { if (text.length > 2) { this.filter.text = text; this.loader = { loading: true }; - + this.searchDone = true; this.Enrolment.searchExams$(text) .pipe( tap((exams) => this.updateExamList(exams)), diff --git a/ui/src/app/enrolment/search/exam-search.component.ts b/ui/src/app/enrolment/search/exam-search.component.ts index ede4b4faa..ff32a63de 100644 --- a/ui/src/app/enrolment/search/exam-search.component.ts +++ b/ui/src/app/enrolment/search/exam-search.component.ts @@ -65,13 +65,11 @@ import { ExamSearchService } from './exam-search.service';
} - - @if (exams.length > 0) { + @if (searchDone) {
-
+
{{ 'i18n_student_exam_search_result' | translate }} {{ exams.length }} {{ 'i18n_student_exam_search_result_continues' | translate }} - "{{ filter.text }}"
} @@ -116,6 +114,7 @@ export class ExamSearchComponent implements OnInit, OnDestroy { ngUnsubscribe = new Subject(); filter = { text: '' }; permissionCheck = { active: false }; + searchDone = false; constructor( private toast: ToastrService, @@ -163,6 +162,7 @@ export class ExamSearchComponent implements OnInit, OnDestroy { }); this.exams = exams; this.checkEnrolment(); + this.searchDone = true; }, error: (err) => this.toast.error(err), }); diff --git a/ui/src/app/shared/select/dropdown-select.component.ts b/ui/src/app/shared/select/dropdown-select.component.ts index fdd1c5919..3856b3275 100644 --- a/ui/src/app/shared/select/dropdown-select.component.ts +++ b/ui/src/app/shared/select/dropdown-select.component.ts @@ -44,21 +44,19 @@ export interface Option { }
}