Skip to content

Commit

Permalink
Sprint 11 2 (#259)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
sjrumsby authored and gil0109 committed May 14, 2019
1 parent bec8eae commit a334675
Show file tree
Hide file tree
Showing 9 changed files with 167 additions and 81 deletions.
15 changes: 10 additions & 5 deletions api/app/resources/bookings/exam/exam_export_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -59,15 +62,17 @@ 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) \
.join(Room, Booking.room_id == Room.room_id, isouter=True) \
.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':
Expand Down Expand Up @@ -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):
Expand Down
3 changes: 2 additions & 1 deletion api/app/resources/theq/csrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/booking/scheduling-indicator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/exams/add-exam-form-confirm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@
<span class="confirm-header">Received Date</span>
</b-col>
<b-col align-self="end" v-if="setup === 'individual'">
<span class="confirm-item">{{ exam.exam_received_date }}</span>
<span class="confirm-item">{{ formatDate(exam.exam_received_date) }}</span>
</b-col>
<b-col align-self="end" v-else>
<span v-if="!tab.showRadio" class="confirm-item">{{ exam.exam_received_date }}</span>
<span v-if="!tab.showRadio" class="confirm-item">{{ formatDate(exam.exam_received_date) }}</span>
<span v-if="tab.showRadio" class="confirm-item">Not Yet Received</span>
</b-col>
</b-row>
Expand Down
Loading

0 comments on commit a334675

Please sign in to comment.