Skip to content

Commit d8f1df0

Browse files
committed
Format clinic booking references as codes.
1 parent 4495622 commit d8f1df0

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

app/models/clinic-booking.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import _ from 'lodash'
44
import allProgrammesData from '../datasets/programmes.js'
55
import { SessionPresets } from '../enums.js'
66
import { ClinicAppointment, Parent, Programme } from '../models.js'
7-
import { stringToBoolean } from '../utils/string.js'
7+
import { formatMonospace, stringToBoolean } from '../utils/string.js'
88

99
/**
1010
* @class ClinicBooking
@@ -124,7 +124,8 @@ export class ClinicBooking {
124124
get formatted() {
125125
return {
126126
// TODO: make this work using commas for more than 2 programmes
127-
primaryProgramme: this.primaryProgrammes.map((p) => p.name).join(' and ')
127+
primaryProgramme: this.primaryProgrammes.map((p) => p.name).join(' and '),
128+
bookingReference: formatMonospace(this.bookingReference, true)
128129
}
129130
}
130131

app/views/book-into-a-clinic/form/confirmation.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
{% set paths = { back: false } %}
44
{% set title = __("clinicBooking.confirmation.title") %}
5-
{% set subtitle = __("clinicBooking.confirmation.subtitle", booking.bookingReference) %}
5+
{% set subtitle = __("clinicBooking.confirmation.subtitle", booking.formatted.bookingReference) %}
66

77
{% block content %}
88
<div class="nhsuk-grid-row">

app/views/book-into-a-clinic/form/offer-health-questions.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
title: title
88
}) }}
99

10-
{{ __("clinicBooking.offerHealthQuestions.bookingReference", booking.bookingReference) | nhsukMarkdown }}
10+
{{ __("clinicBooking.offerHealthQuestions.bookingReference", booking.formatted.bookingReference) | nhsukMarkdown }}
1111

1212
{{ __("clinicBooking.offerHealthQuestions.beforeYouGo") | nhsukMarkdown }}
1313

0 commit comments

Comments
 (0)