Skip to content

Commit 8d4c18d

Browse files
rivaleeRebecca Cottrelledwardhorsford
authored
Add endpoint pages (#188)
* Replace appointment button menu with links, create page to reschedule or cancel appointment * Update content for appointment should not proceed and attended not screened reason * Update content for consent and appointment cannot proceed * Content tweaks for end points * Fix author name * Get data showing for rescheduled and cancelled appointments * Fix tags so they use the toTag filter * Test to see if this fixes the heroku problem * Fix statuses, fix index * Update content for the other end point pages * Update event generator to sort out issue with reschedule event status * Fix statuses and missing reschedule note * Get data saving for appointment cannot proceed, fix structure of data displayed when appointment is cancelled or rescheduled * Turn off autocomplete for fields * Fix label * Appointment header change * Bugfixes --------- Co-authored-by: Rebecca Cottrell <[email protected]> Co-authored-by: Ed Horsford <[email protected]>
1 parent 75fb635 commit 8d4c18d

File tree

16 files changed

+1211
-167
lines changed

16 files changed

+1211
-167
lines changed

app/lib/generators/event-generator.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ const determineEventStatus = (
4545
})
4646
}
4747

48+
// For past dates, use final_seed_data statuses
49+
// This excludes event_rescheduled which should only happen through user action, not seed data
4850
if (slotDate.isBefore(currentDate)) {
49-
return weighted.select(STATUS_GROUPS.final, attendanceWeights)
51+
return weighted.select(STATUS_GROUPS.final_seed_data, attendanceWeights)
5052
}
5153

5254
// For past slots, generate a status based on how long ago the slot was

app/lib/utils/status.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ const STATUS_GROUPS = {
1111
not_started: ['event_scheduled', 'event_checked_in'],
1212
completed: ['event_complete', 'event_partially_screened'],
1313
final: [
14+
'event_complete',
15+
'event_partially_screened',
16+
'event_did_not_attend',
17+
'event_attended_not_screened',
18+
'event_cancelled',
19+
'event_rescheduled'
20+
],
21+
// Final statuses for seed data generation - excludes event_rescheduled which is user-initiated only
22+
final_seed_data: [
1423
'event_complete',
1524
'event_partially_screened',
1625
'event_did_not_attend',
@@ -174,6 +183,7 @@ const getStatusTagColour = (status) => {
174183
'event_partially_screened': 'orange',
175184
'event_did_not_attend': 'red',
176185
'event_cancelled': 'red',
186+
'event_rescheduled': 'red',
177187
'event_attended_not_screened': 'orange',
178188

179189
// Task list
@@ -245,15 +255,16 @@ const getStatusTagColour = (status) => {
245255
const getStatusText = (status) => {
246256
const statusMap = {
247257
// Clinic statuses
248-
event_scheduled: 'Scheduled', // default blue
258+
event_scheduled: 'Scheduled',
249259
// Event statuses
250-
event_checked_in: 'Checked in', // no colour will get solid dark blue
260+
event_checked_in: 'Checked in',
251261
event_in_progress: 'In progress',
252262
event_complete: 'Screened',
253263
event_partially_screened: 'Partially screened',
254264
event_did_not_attend: 'Did not attend',
255265
event_attended_not_screened: 'Attended not screened',
256-
event_cancelled: 'Cancelled'
266+
event_cancelled: 'Cancelled',
267+
event_rescheduled: 'Reschedule requested'
257268

258269
// "technical-recall": 'Technical recall',
259270
// "recall-for-assesment": 'Recall for assessment',

0 commit comments

Comments
 (0)