Skip to content

internal notes

Relates to CATS-785, 786, 787

request

Request for internal notes to be added to sites and employee (doctor) records, and to make these more visible in main areas of the system.

work

  • migration to add ‘internal_notes’ text fields to employees and sites tables
  • import of TextareaField custom component to limit to 255 chars
  • UserEdit and SiteDetails vue components were edited to add ‘internal_notes’ fields
  • SelectedShift component - used for calendar/schedule modal view - had internal_notes added

issues

blade/vue

‘shift-changes’ on IV admin home screen was required to have similar ‘notes’ blocks matching other tables. Other tables were vue components - shift-changed was a blade partial file. This required a rebuild in to IndevetsShiftChangesTable. This required modifying BaseShiftsTable to allow for overriding the default behaviour of always allowing for multiple select/checkboxes on the table rows (new boolean prop useCheckboxes added).

shift-changes blade file used embedded forms for each ‘link’ to act as submit button for approving change and cancel requests. Some work was done to convert to vue element @click handlers which hit existing endpoints, but redirect afterwards (the endpoints were modified to return the redirect URL when $request->wantsJSON())

html display / security

When stored, the notes are run through ‘strip tags’ to remove potential injection/xss/etc. The data is displayed via an ‘html’ modified in the bootstrap/vue popover/hover component, and linebreaks are converted to BR tags before display.

There are potentially better ways to address this, but this was the initial chosen option, to balance delivery against reduced risk.

affected vue components

  • BaseShiftsTable.vue
  • IndevetsTakenShiftsTable.vue
  • IndevetsNewShiftsTable.vue
  • IndevetsShiftChangesTable.vue (added)
  • IndevetsSitesIndexTable.vue
  • SelectedShift.vue
  • UserEdit.vue
  • SiteDetails.vue