From a334675744c80cd98bb5a61171eed1d1c140d99a Mon Sep 17 00:00:00 2001 From: sjrumsby Date: Tue, 14 May 2019 12:31:50 -0700 Subject: [PATCH] Sprint 11 2 (#259) * Updated finance reporting now that individual exams can be booked offsite * Financial Reporting - Filtering Offices Clients asked that if a user is a financial reporting designate to return ALL exams when the query for reporting is submited. Otherwise the exams returned to the user are filtered based upon the users office. * Fix Edit Exam Modal: Date Received / Expiry Date Inconsistency App was inconsistent with formatting/parsing of dates at capture, display and during POST/PUT actions. All dates now captured in local time, submitted as UTC and converted to local time for display. This eliminates the issue where DatePickers were showing the day before the actual date value held in the backend/store * Fixed Issue w/ the Q where CSR able to navigate away when serving citizen Added condition to display of hamburger menu to prevent this from happening * Fix Serve Citizen Modal Loading Spinner Previously added trigger to show the spinner when clicking on a citizen from the queue table but failed to consider the scenarios of clicking on a citizen in the hold table or directly from the Add Citizen Modal. Added triggers for the other ways to launch the modal. * Group Exam Notifications - SBC Staff Clients noticed after production release that group exams were causing the notification banner to show if SBC Staff were selected as invigilators. This condition met the requirements of not having to notify staff about exams, and such was fixed by adding a filter the group exam object in the csrs/me endpoint that only counted exams with booking.sbc_staff_invigilated == 0. This was tested by creating a group exam object, then creating a booking for this exams without an inviglator and making sure the notification would present itself on refresh. Then, altering the booking to have SBC staff invigilate the booking, refreshing the page to make sure no notification was present. Finally, the booking was altered to have an actual invigilator present for the booking, and refreshing the page to make sure that the notification banner was not present. --- .../bookings/exam/exam_export_list.py | 15 +- api/app/resources/theq/csrs.py | 3 +- frontend/src/booking/scheduling-indicator.vue | 2 +- frontend/src/exams/add-exam-form-confirm.vue | 4 +- frontend/src/exams/edit-exam-form-modal.vue | 152 +++++++++++++----- frontend/src/exams/exam-inventory-table.vue | 6 +- frontend/src/layout/nav.vue | 3 +- frontend/src/serve-citizen/serve-citizen.vue | 12 +- frontend/src/store/index.js | 51 +++--- 9 files changed, 167 insertions(+), 81 deletions(-) diff --git a/api/app/resources/bookings/exam/exam_export_list.py b/api/app/resources/bookings/exam/exam_export_list.py index 8ac8b209e..ee488eee2 100644 --- a/api/app/resources/bookings/exam/exam_export_list.py +++ b/api/app/resources/bookings/exam/exam_export_list.py @@ -37,8 +37,11 @@ class ExamList(Resource): def get(self): try: + csr = CSR.find_by_username(g.oidc_token_info['username']) + is_designate = csr.finance_designate + start_param = request.args.get("start_date") end_param = request.args.get("end_date") exam_type = request.args.get("exam_type") @@ -59,8 +62,7 @@ def get(self): end_date = self.timezone.localize(end_date) - exams = Exam.query.filter_by(office_id=csr.office_id) \ - .join(Booking, Exam.booking_id == Booking.booking_id) \ + exams = Exam.query.join(Booking, Exam.booking_id == Booking.booking_id) \ .filter(Booking.start_time >= start_date) \ .filter(Booking.start_time < end_date) \ .join(Invigilator, Booking.invigilator_id == Invigilator.invigilator_id, isouter=True) \ @@ -68,6 +70,9 @@ def get(self): .join(Office, Booking.office_id == Office.office_id) \ .join(ExamType, Exam.exam_type_id == ExamType.exam_type_id) + if not is_designate: + exams = exams.filter(Booking.office_id == csr.office_id) + if exam_type == 'ita': exams = exams.filter(ExamType.ita_ind == 1) elif exam_type == 'all_non_ita': @@ -160,10 +165,10 @@ def get(self): def write_room(row, exam): - if exam.exam_type.group_exam_ind == 1: - row.append("") - else: + if exam.booking and exam.booking.room: row.append(exam.booking.room.room_name) + else: + row.append("") def write_invigilator(row, exam): diff --git a/api/app/resources/theq/csrs.py b/api/app/resources/theq/csrs.py index 55c40b10c..dfbfe9293 100644 --- a/api/app/resources/theq/csrs.py +++ b/api/app/resources/theq/csrs.py @@ -89,7 +89,8 @@ def get(self): .join(ExamType, Exam.exam_type_id == ExamType.exam_type_id) \ .filter(ExamType.group_exam_ind == 1) \ .join(Booking, Exam.booking_id == Booking.booking_id) \ - .filter(Booking.invigilator_id.is_(None)).count() + .filter(Booking.invigilator_id.is_(None))\ + .filter(Booking.sbc_staff_invigilated == 0).count() result = self.csr_schema.dump(csr) active_citizens = self.citizen_schema.dump(active_citizens) diff --git a/frontend/src/booking/scheduling-indicator.vue b/frontend/src/booking/scheduling-indicator.vue index c21a11f50..ac27a31f6 100644 --- a/frontend/src/booking/scheduling-indicator.vue +++ b/frontend/src/booking/scheduling-indicator.vue @@ -74,7 +74,7 @@ return } let pushToExams = false - if (this.selectedExam && this.selectedExam.referrer === 'scheduling') { + if (this.selectedExam && this.selectedExam.referrer === 'inventory') { pushToExams = true } this.finishBooking() diff --git a/frontend/src/exams/add-exam-form-confirm.vue b/frontend/src/exams/add-exam-form-confirm.vue index 3581dec8d..0439b6106 100644 --- a/frontend/src/exams/add-exam-form-confirm.vue +++ b/frontend/src/exams/add-exam-form-confirm.vue @@ -75,10 +75,10 @@ Received Date - {{ exam.exam_received_date }} + {{ formatDate(exam.exam_received_date) }} - {{ exam.exam_received_date }} + {{ formatDate(exam.exam_received_date) }} Not Yet Received diff --git a/frontend/src/exams/edit-exam-form-modal.vue b/frontend/src/exams/edit-exam-form-modal.vue index f5aae7fce..71859965b 100644 --- a/frontend/src/exams/edit-exam-form-modal.vue +++ b/frontend/src/exams/edit-exam-form-modal.vue @@ -9,10 +9,13 @@
Edit Exam Details + + + @@ -23,6 +26,7 @@ v-model="fields.event_id" /> +
@@ -33,6 +37,7 @@
+ @@ -68,6 +73,7 @@ + @@ -79,7 +85,8 @@ - + + @@ -90,18 +97,22 @@ :options="examReceivedOptions" /> +
+ class="w-100 my-0 less-10-mb">
+
@@ -109,14 +120,17 @@ id="number_of_students" />
+
+ class="w-100 less-10-mb">