Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions app/controllers/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -541,16 +541,7 @@ export const sessionController = {
const journey = {
[`/`]: {},
[`/${session_id}/${type}/type`]: {},
[`/${session_id}/${type}/programmes`]: {
[`/${session_id}/${type}/school`]: {
data: 'session.type',
value: SessionType.School
},
[`/${session_id}/${type}/clinic`]: {
data: 'session.type',
value: SessionType.Clinic
}
},
[`/${session_id}/${type}/programmes`]: {},
...(session.type === SessionType.School
? {
[`/${session_id}/${type}/school`]: {},
Expand All @@ -562,6 +553,11 @@ export const sessionController = {
[`/${session_id}/${type}/date`]: {}
}),
[`/${session_id}/${type}/date-check`]: {},
...(session.presetNames?.includes(SessionPresetName.MMR)
? {
[`/${session_id}/${type}/mmr-consent`]: {}
}
: {}),
[`/${session_id}/${type}/check-answers`]: {},
[`/${session_id}`]: {}
}
Expand Down
11 changes: 10 additions & 1 deletion app/enums.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,16 @@ export const SessionPresetName = {
Flu: 'Flu',
HPV: 'HPV',
Doubles: 'Doubles',
MMR: 'MMR'
MMR: 'MMR(V)'
}

/**
* @readonly
* @enum {string}
*/
export const SessionMMRConsent = {
Standard: 'Standard request',
Outbreak: 'Outbreak request'
}

/**
Expand Down
13 changes: 13 additions & 0 deletions app/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -1726,6 +1726,19 @@ export const en = {
consentWindow: {
label: 'Consent period'
},
mmrConsent: {
title:
'What type of MMR(V) consent request do you want to send to parents?',
label: 'Type of MMR(V) consent request',
standard: {
label: 'Standard request',
hint: 'This is for standard catch-up sessions'
},
outbreak: {
label: 'Outbreak request ',
hint: 'This is urgent in tone, and should be used in an outbreak scenario'
}
},
schedule: {
title: 'Schedule sessions',
description: 'Add dates for this school.'
Expand Down
4 changes: 4 additions & 0 deletions app/models/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import {
* @property {object} [date_] - Dates (from `dateInput`s)
* @property {number} [academicYear] - Programme year
* @property {Array<SessionPresetName>} [presetNames] - Session preset names
* @property {string<SessionMMRConsent>} [mmrConsent] - Does session use MMR outbreak comms?
* @property {boolean} [registration] - Does session have registration?
*
* Clinics only
Expand Down Expand Up @@ -104,6 +105,9 @@ export class Session {
this.closed = options?.closed || false
this.reminderWeeks =
options?.reminderWeeks || TeamDefaults.SessionReminderWeeks
this.mmrConsent = this.presetNames?.includes(SessionPresetName.MMR)
? options?.mmrConsent
: undefined
this.registration = stringToBoolean(options?.registration)
this.register = options?.register || {}
this.psdProtocol = stringToBoolean(options?.psdProtocol) || false
Expand Down
3 changes: 3 additions & 0 deletions app/views/session/edit.njk
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
reminderWeeks: {
href: session.uri + "/edit/reminders"
},
mmrConsent: {
href: session.uri + "/new/mmr-consent"
},
registration: {
href: session.uri + "/edit/registration"
},
Expand Down
3 changes: 3 additions & 0 deletions app/views/session/form/check-answers.njk
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
reminderWeeks: {
href: session.uri + "/new/reminders"
},
mmrConsent: {
href: session.uri + "/new/mmr-consent"
},
registration: {
href: session.uri + "/new/registration"
},
Expand Down
23 changes: 23 additions & 0 deletions app/views/session/form/mmr-consent.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{% extends "_layouts/form.njk" %}

{% set title = __("session.mmrConsent.title") %}

{% block form %}
{{ radios({
fieldset: {
legend: {
isPageHeading: true,
text: title,
size: "l"
}
},
items: [{
text: SessionMMRConsent.Standard,
hint: { text: __("session.mmrConsent.standard.hint") }
}, {
text: SessionMMRConsent.Outbreak,
hint: { text: __("session.mmrConsent.outbreak.hint") }
}],
decorate: "session.mmrConsent"
}) }}
{% endblock %}