shift editor ¶
ShiftEditor.vue is a component that serves as a basis for managing individual shift information (location, date, times, incentives, notes, etc). It was an effort to standardize and consolidate multiple different repeated-yet-slightly-different forms in to one main form.
There was much development on this in late summer to early fall 2021.
note ¶
‘mode’ ¶
11/29/21
There is a ‘mode’ property, which defaults to ‘admin’, but can also be set to ‘hospital’. If set to hospital, the system will request only hospital-visible incentives via an ajax call.
The mode was added to differentiate this specific call.
The call was to get ‘all incentives for site X’, but incentives may be visible to different actors, and the ‘mode’ property was added to make the decision to call a separate endpoint to get slightly different data back.
There may be other use cases for the ‘mode’ property.
Another flavor of this might be to pass in the role(s)
of the current user, and make decisions that way. This
was a rapid response move to a major error blocking release.
repeatingMode ¶
Earlier work was done to create a ‘repeating shift’ process, and a separate RepeatShiftEditor was created from ShiftEditor, essentially as a clone with minimal differences.
May 2022 saw a merging of the repeating shift functionality from RepeatShiftEditor back to the main ShiftEditor component, with a ‘repeatingMode’ boolean prop.
tests ¶
Some initial tests were added to the ShiftEditor component in shift_editor.spec.js.
Initial problem with testing the shift editor when mounted with a shiftId prop is that the mounting process attempts some http calls. The shift_editor.spec.js has an initial first pass at providing an endpoint mock object to intercept and mock reply payloads.
This mocking can be improved in future tests, but may serve as an initial starting point for someone interested in taking this further.