From 69c0e6f752259eaa3b7361748bbbbf67766c4e6d Mon Sep 17 00:00:00 2001 From: hutcheonb <106151419+hutcheonb-moj@users.noreply.github.com> Date: Mon, 20 May 2024 14:56:23 +0100 Subject: [PATCH 1/2] VB-3518, additional support page --- server/@types/bapv.d.ts | 2 + server/@types/orchestration-api.d.ts | 26 ++- server/routes/bookingJourney/index.ts | 15 ++ .../selectAdditionalSupport.test.ts | 169 ++++++++++++++++++ .../selectAdditionalSupportController.ts | 49 +++++ .../selectMainContactController.ts | 15 ++ .../selectAdditionalSupport.njk | 81 +++++++++ .../bookingJourney/selectDateAndTime.njk | 4 +- .../bookingJourney/selectMainContact.njk | 10 ++ 9 files changed, 362 insertions(+), 9 deletions(-) create mode 100644 server/routes/bookingJourney/selectAdditionalSupport.test.ts create mode 100644 server/routes/bookingJourney/selectAdditionalSupportController.ts create mode 100644 server/routes/bookingJourney/selectMainContactController.ts create mode 100644 server/views/pages/bookingJourney/selectAdditionalSupport.njk create mode 100644 server/views/pages/bookingJourney/selectMainContact.njk diff --git a/server/@types/bapv.d.ts b/server/@types/bapv.d.ts index de035181..f9d958e5 100644 --- a/server/@types/bapv.d.ts +++ b/server/@types/bapv.d.ts @@ -19,6 +19,8 @@ export type BookingJourneyData = { // selected visitors for this visit selectedVisitors?: VisitorInfoDto[] + + visitorSupport?: string } export type FlashData = { diff --git a/server/@types/orchestration-api.d.ts b/server/@types/orchestration-api.d.ts index 28e286c5..bf48691f 100644 --- a/server/@types/orchestration-api.d.ts +++ b/server/@types/orchestration-api.d.ts @@ -695,21 +695,21 @@ export interface components { visitTimeSlot: components['schemas']['SessionTimeSlotDto'] } PageVisitDto: { - /** Format: int64 */ - totalElements?: number /** Format: int32 */ totalPages?: number + /** Format: int64 */ + totalElements?: number + first?: boolean + last?: boolean + content?: components['schemas']['VisitDto'][] /** Format: int32 */ size?: number - content?: components['schemas']['VisitDto'][] /** Format: int32 */ number?: number sort?: components['schemas']['SortObject'][] + pageable?: components['schemas']['PageableObject'] /** Format: int32 */ numberOfElements?: number - pageable?: components['schemas']['PageableObject'] - first?: boolean - last?: boolean empty?: boolean } PageableObject: { @@ -920,13 +920,18 @@ export interface components { * @example 2020-11-01 */ sessionDate: string + /** + * @description sessionTemplateReference + * @example v9d.7ed.7u + */ + sessionTemplateReference: string sessionTimeSlot: components['schemas']['SessionTimeSlotDto'] /** * @description Visit Restriction * @example OPEN * @enum {string} */ - visitRestriction: 'OPEN' | 'CLOSED' | 'UNKNOWN' + visitRestriction: 'OPEN' | 'CLOSED' } GetDlqResult: { /** Format: int32 */ @@ -2171,7 +2176,12 @@ export interface operations { * @description Filter sessions by session restriction - OPEN or CLOSED, if prisoner has CLOSED it will use that * @example CLOSED */ - sessionRestriction: 'OPEN' | 'CLOSED' + sessionRestriction?: 'OPEN' | 'CLOSED' + /** + * @description List of visitors who require visit sessions + * @example 4729510,4729220 + */ + visitors?: number[] } } responses: { diff --git a/server/routes/bookingJourney/index.ts b/server/routes/bookingJourney/index.ts index 87a3383e..8419d3a7 100644 --- a/server/routes/bookingJourney/index.ts +++ b/server/routes/bookingJourney/index.ts @@ -6,6 +6,8 @@ import type { Services } from '../../services' import SelectPrisonerController from './selectPrisonerController' import SelectVisitorsController from './selectVisitorsController' import DateAndTimeController from './selectDateAndTimeController' +import AdditionalSupportController from './selectAdditionalSupportController' +import MainContactController from './selectMainContactController' export default function routes(services: Services): Router { const router = Router() @@ -18,6 +20,8 @@ export default function routes(services: Services): Router { const selectPrisonerController = new SelectPrisonerController() const selectVisitorsController = new SelectVisitorsController(services.bookerService, services.prisonService) const dateAndTimeController = new DateAndTimeController(services.bookerService) + const additionalSupportController = new AdditionalSupportController(services.bookerService) + const mainContactController = new MainContactController(services.bookerService) // TODO need session checks for each stage to validate what is in session - add middleware here to apply to all booking journey routes? @@ -28,5 +32,16 @@ export default function routes(services: Services): Router { postWithValidation('/select-visitors', selectVisitorsController.validate(), selectVisitorsController.submit()) get('/select-date-and-time', dateAndTimeController.view()) + + get('/select-additional-support', additionalSupportController.view()) + + postWithValidation( + '/select-additional-support', + additionalSupportController.validate(), + additionalSupportController.submit(), + ) + + get('/select-main-contact', mainContactController.view()) + return router } diff --git a/server/routes/bookingJourney/selectAdditionalSupport.test.ts b/server/routes/bookingJourney/selectAdditionalSupport.test.ts new file mode 100644 index 00000000..90672c4f --- /dev/null +++ b/server/routes/bookingJourney/selectAdditionalSupport.test.ts @@ -0,0 +1,169 @@ +import type { Express } from 'express' +import request from 'supertest' +import * as cheerio from 'cheerio' +import { SessionData } from 'express-session' +import { FieldValidationError } from 'express-validator' +import { appWithAllRoutes, flashProvider } from '../testutils/appSetup' +import { createMockBookerService, createMockPrisonService } from '../../services/testutils/mocks' +import TestData from '../testutils/testData' +import { FlashData } from '../../@types/bapv' + +let app: Express + +const bookerService = createMockBookerService() +const prisonService = createMockPrisonService() +let sessionData: SessionData + +const url = '/book-a-visit/select-additional-support' + +const bookerReference = TestData.bookerReference().value +const prisoner = TestData.prisonerInfoDto() +const prison = TestData.prisonDto() +const visitors = [ + TestData.visitorInfoDto({ personId: 1, firstName: 'Visitor', lastName: 'One', dateOfBirth: '1980-02-03' }), + TestData.visitorInfoDto({ personId: 2, firstName: 'Visitor', lastName: 'Two', dateOfBirth: '1990-09-03' }), + TestData.visitorInfoDto({ personId: 3, firstName: 'Visitor', lastName: 'Three', dateOfBirth: '2024-03-01' }), +] + +afterEach(() => { + jest.resetAllMocks() + jest.useRealTimers() +}) + +describe('Select additional support page', () => { + let flashData: FlashData + + describe(`GET ${url}`, () => { + beforeEach(() => { + flashData = {} + flashProvider.mockImplementation((key: keyof FlashData) => flashData[key]) + + sessionData = { + booker: { reference: bookerReference, prisoners: [prisoner] }, + bookingJourney: { allVisitors: visitors, selectedVisitors: visitors, prisoner, prison }, + } as SessionData + + app = appWithAllRoutes({ services: { bookerService, prisonService }, sessionData }) + }) + + it('should render additional support page', () => { + return request(app) + .get(url) + .expect('Content-Type', /html/) + .expect(res => { + const $ = cheerio.load(res.text) + expect($('title').text()).toMatch(/^Any additional support needs\? -/) + expect($('[data-test="back-link"]').attr('href')).toBe('/') + expect($('h1').text()).toBe('Is additional support needed for any of the visitors?') + + expect($('[data-test=prison-name]').text().trim()).toContain('Hewell (HMP)') + + expect($('form[method=POST]').attr('action')).toBe('/book-a-visit/select-additional-support') + + expect($('[data-test="continue-button"]').text().trim()).toBe('Continue') + }) + }) + + it('should render validation errors', () => { + const validationError: FieldValidationError = { + type: 'field', + location: 'body', + path: 'additionalSupport', + value: [], + msg: 'Enter details of the request', + } + + flashData = { errors: [validationError], formValues: { visitorIds: [] } } + + return request(app) + .get(url) + .expect('Content-Type', /html/) + .expect(res => { + const $ = cheerio.load(res.text) + expect($('.govuk-error-summary a[href="#additionalSupport-error"]').text()).toBe( + 'Enter details of the request', + ) + expect($('#additionalSupport-error').text()).toContain('Enter details of the request') + }) + }) + }) + + describe(`POST ${url}`, () => { + beforeEach(() => { + sessionData = { + booker: { + reference: bookerReference, + prisoners: [prisoner], + }, + bookingJourney: { + prisoner, + prison, + allVisitors: visitors, + selectedVisitors: [visitors[0], visitors[2]], + }, + } as SessionData + + app = appWithAllRoutes({ sessionData }) + }) + + it('should should save entered additional support to session and redirect to main contact page', () => { + return request(app) + .post(url) + .send({ additionalSupportRequired: 'yes', additionalSupport: 'Wheelchair access' }) + .expect(302) + .expect('Location', '/book-a-visit/select-main-contact') + .expect(() => { + expect(sessionData).toStrictEqual({ + booker: { + reference: bookerReference, + prisoners: [prisoner], + }, + bookingJourney: { + prisoner, + prison, + allVisitors: visitors, + selectedVisitors: [visitors[0], visitors[2]], + visitorSupport: 'Wheelchair access', + }, + } as SessionData) + }) + }) + + it('should set a validation error and redirect to original page when no options selected', () => { + const expectedFlashData: FlashData = { + errors: [ + { + type: 'field', + location: 'body', + path: 'additionalSupportRequired', + value: undefined, + msg: 'No answer selected', + }, + ], + formValues: { additionalSupport: '' }, + } + + return request(app) + .post(url) + .expect(302) + .expect('Location', url) + .expect(() => { + expect(flashProvider).toHaveBeenCalledWith('errors', expectedFlashData.errors) + expect(flashProvider).toHaveBeenCalledWith('formValues', expectedFlashData.formValues) + + expect(sessionData).toStrictEqual({ + booker: { + reference: bookerReference, + prisoners: [prisoner], + }, + bookingJourney: { + prisoner, + prison, + allVisitors: visitors, + selectedVisitors: [visitors[0], visitors[2]], + }, + } as SessionData) + }) + }) + }) +}) diff --git a/server/routes/bookingJourney/selectAdditionalSupportController.ts b/server/routes/bookingJourney/selectAdditionalSupportController.ts new file mode 100644 index 00000000..eb1524fa --- /dev/null +++ b/server/routes/bookingJourney/selectAdditionalSupportController.ts @@ -0,0 +1,49 @@ +import type { RequestHandler } from 'express' +import { ValidationChain, body, validationResult } from 'express-validator' +import { BookerService } from '../../services' + +export default class AdditionalSupportController { + public constructor(private readonly bookerService: BookerService) {} + + public view(): RequestHandler { + return async (req, res) => { + res.render('pages/bookingJourney/selectAdditionalSupport', { + errors: req.flash('errors'), + formValues: req.flash('formValues')?.[0] || {}, + booker: req.session.booker, + bookingJourney: req.session.bookingJourney, + }) + } + } + + public submit(): RequestHandler { + return async (req, res) => { + const { bookingJourney } = req.session + const errors = validationResult(req) + + if (!errors.isEmpty()) { + req.flash('errors', errors.array() as []) + req.flash('formValues', req.body) + return res.redirect(`/book-a-visit/select-additional-support`) + } + + bookingJourney.visitorSupport = req.body.additionalSupportRequired === 'no' ? '' : req.body.additionalSupport + + return res.redirect('/book-a-visit/select-main-contact') + } + } + + validate(): ValidationChain[] { + return [ + body('additionalSupportRequired').isIn(['yes', 'no']).withMessage('No answer selected'), + body('additionalSupport') + .trim() + .if(body('additionalSupportRequired').equals('yes')) + .notEmpty() + .withMessage('Enter details of the request') + .bail() + .isLength({ min: 3, max: 512 }) + .withMessage('Please enter at least 3 and no more than 512 characters'), + ] + } +} diff --git a/server/routes/bookingJourney/selectMainContactController.ts b/server/routes/bookingJourney/selectMainContactController.ts new file mode 100644 index 00000000..0c63597d --- /dev/null +++ b/server/routes/bookingJourney/selectMainContactController.ts @@ -0,0 +1,15 @@ +import type { RequestHandler } from 'express' +import { BookerService } from '../../services' + +export default class MainContactController { + public constructor(private readonly bookerService: BookerService) {} + + public view(): RequestHandler { + return async (req, res) => { + res.render('pages/bookingJourney/selectMainContact', { + booker: req.session.booker, + bookingJourney: req.session.bookingJourney, + }) + } + } +} diff --git a/server/views/pages/bookingJourney/selectAdditionalSupport.njk b/server/views/pages/bookingJourney/selectAdditionalSupport.njk new file mode 100644 index 00000000..b02a9192 --- /dev/null +++ b/server/views/pages/bookingJourney/selectAdditionalSupport.njk @@ -0,0 +1,81 @@ +{% extends "../../partials/layout.njk" %} +{% from "govuk/components/button/macro.njk" import govukButton %} +{% from "govuk/components/checkboxes/macro.njk" import govukCheckboxes %} +{% from "govuk/components/radios/macro.njk" import govukRadios %} +{% from "govuk/components/input/macro.njk" import govukInput %} + +{% set pageTitle = "Any additional support needs?" %} + +{% set backLinkHref = "/" %} + +{% block content %} +
+
+ + {% include "partials/errorSummary.njk" %} + +

Is additional support needed for any of the visitors?

+ +

Tell us about any support that visitors will need because of a health condition of disability. For example, wheelchair access.

+

{{ bookingJourney.prison.prisonName }} will make reasonable adjustments for the visit, but may not be able to fulfil your request

+ +
+ + {% set otherSupportHtml %} + {{ govukInput({ + id: "additionalSupport", + name: "additionalSupport", + type: "text", + classes: "govuk-!-width-one-third", + label: { + text: "Provide details" + }, + value: formValues.additionalSupport, + autocomplete: "off", + errorMessage: errors | findError('additionalSupport') + }) }} + {% endset -%} + + {{ govukRadios({ + idPrefix: "additionalSupportRequired", + name: "additionalSupportRequired", + fieldset: { + legend: { + text: pageHeaderTitle, + isPageHeading: true, + classes: "govuk-fieldset__legend--l" + } + }, + items: [ + { + value: "yes", + text: "Yes", + attributes: { + 'data-test': 'support-required-yes' + }, + checked: formValues.additionalSupportRequired == "yes", + conditional: { + html: otherSupportHtml + } + }, + { + value: "no", + text: "No", + attributes: { + 'data-test': 'support-required-no' + }, + checked: formValues.additionalSupportRequired == "no" + } + ], + errorMessage: errors | findError('additionalSupportRequired') + }) }} + + {{ govukButton({ + text: "Continue", + attributes: { "data-test": "continue-button" }, + preventDoubleClick: true + }) }} +
+
+
+{% endblock %} diff --git a/server/views/pages/bookingJourney/selectDateAndTime.njk b/server/views/pages/bookingJourney/selectDateAndTime.njk index a4cc6df3..c95012d4 100644 --- a/server/views/pages/bookingJourney/selectDateAndTime.njk +++ b/server/views/pages/bookingJourney/selectDateAndTime.njk @@ -6,5 +6,7 @@ BOOKING JOURNEY {{ bookingJourney | dump(2) }} + + - \ No newline at end of file +Additional Support link \ No newline at end of file diff --git a/server/views/pages/bookingJourney/selectMainContact.njk b/server/views/pages/bookingJourney/selectMainContact.njk new file mode 100644 index 00000000..8f21b6ad --- /dev/null +++ b/server/views/pages/bookingJourney/selectMainContact.njk @@ -0,0 +1,10 @@ +
+  

Main contact

+ + BOOKER + {{ booker | dump(2) }} + + BOOKING JOURNEY + {{ bookingJourney | dump(2) }} + +
From 4748646e5cb5c4349775a5eebb087bcc0144b280 Mon Sep 17 00:00:00 2001 From: hutcheonb <106151419+hutcheonb-moj@users.noreply.github.com> Date: Mon, 20 May 2024 15:54:39 +0100 Subject: [PATCH 2/2] Amended suggestions --- server/routes/bookingJourney/index.ts | 22 +++++++++---------- .../selectAdditionalSupport.test.ts | 20 +++++------------ .../selectAdditionalSupportController.ts | 7 +++--- .../selectDateAndTimeController.ts | 5 ++--- .../selectMainContactController.ts | 5 ++--- .../selectAdditionalSupport.njk | 7 +++--- 6 files changed, 26 insertions(+), 40 deletions(-) diff --git a/server/routes/bookingJourney/index.ts b/server/routes/bookingJourney/index.ts index 8419d3a7..423eb025 100644 --- a/server/routes/bookingJourney/index.ts +++ b/server/routes/bookingJourney/index.ts @@ -5,9 +5,9 @@ import asyncMiddleware from '../../middleware/asyncMiddleware' import type { Services } from '../../services' import SelectPrisonerController from './selectPrisonerController' import SelectVisitorsController from './selectVisitorsController' -import DateAndTimeController from './selectDateAndTimeController' -import AdditionalSupportController from './selectAdditionalSupportController' -import MainContactController from './selectMainContactController' +import SelectDateAndTimeController from './selectDateAndTimeController' +import SelectAdditionalSupportController from './selectAdditionalSupportController' +import SelectMainContactController from './selectMainContactController' export default function routes(services: Services): Router { const router = Router() @@ -19,9 +19,9 @@ export default function routes(services: Services): Router { const selectPrisonerController = new SelectPrisonerController() const selectVisitorsController = new SelectVisitorsController(services.bookerService, services.prisonService) - const dateAndTimeController = new DateAndTimeController(services.bookerService) - const additionalSupportController = new AdditionalSupportController(services.bookerService) - const mainContactController = new MainContactController(services.bookerService) + const selectDateAndTimeController = new SelectDateAndTimeController() + const selectAdditionalSupportController = new SelectAdditionalSupportController() + const selectMainContactController = new SelectMainContactController() // TODO need session checks for each stage to validate what is in session - add middleware here to apply to all booking journey routes? @@ -31,17 +31,17 @@ export default function routes(services: Services): Router { postWithValidation('/select-visitors', selectVisitorsController.validate(), selectVisitorsController.submit()) - get('/select-date-and-time', dateAndTimeController.view()) + get('/select-date-and-time', selectDateAndTimeController.view()) - get('/select-additional-support', additionalSupportController.view()) + get('/select-additional-support', selectAdditionalSupportController.view()) postWithValidation( '/select-additional-support', - additionalSupportController.validate(), - additionalSupportController.submit(), + selectAdditionalSupportController.validate(), + selectAdditionalSupportController.submit(), ) - get('/select-main-contact', mainContactController.view()) + get('/select-main-contact', selectMainContactController.view()) return router } diff --git a/server/routes/bookingJourney/selectAdditionalSupport.test.ts b/server/routes/bookingJourney/selectAdditionalSupport.test.ts index 90672c4f..b98cb9a8 100644 --- a/server/routes/bookingJourney/selectAdditionalSupport.test.ts +++ b/server/routes/bookingJourney/selectAdditionalSupport.test.ts @@ -4,14 +4,11 @@ import * as cheerio from 'cheerio' import { SessionData } from 'express-session' import { FieldValidationError } from 'express-validator' import { appWithAllRoutes, flashProvider } from '../testutils/appSetup' -import { createMockBookerService, createMockPrisonService } from '../../services/testutils/mocks' import TestData from '../testutils/testData' import { FlashData } from '../../@types/bapv' let app: Express -const bookerService = createMockBookerService() -const prisonService = createMockPrisonService() let sessionData: SessionData const url = '/book-a-visit/select-additional-support' @@ -21,15 +18,8 @@ const prisoner = TestData.prisonerInfoDto() const prison = TestData.prisonDto() const visitors = [ TestData.visitorInfoDto({ personId: 1, firstName: 'Visitor', lastName: 'One', dateOfBirth: '1980-02-03' }), - TestData.visitorInfoDto({ personId: 2, firstName: 'Visitor', lastName: 'Two', dateOfBirth: '1990-09-03' }), - TestData.visitorInfoDto({ personId: 3, firstName: 'Visitor', lastName: 'Three', dateOfBirth: '2024-03-01' }), ] -afterEach(() => { - jest.resetAllMocks() - jest.useRealTimers() -}) - describe('Select additional support page', () => { let flashData: FlashData @@ -43,7 +33,7 @@ describe('Select additional support page', () => { bookingJourney: { allVisitors: visitors, selectedVisitors: visitors, prisoner, prison }, } as SessionData - app = appWithAllRoutes({ services: { bookerService, prisonService }, sessionData }) + app = appWithAllRoutes({ sessionData }) }) it('should render additional support page', () => { @@ -53,7 +43,7 @@ describe('Select additional support page', () => { .expect(res => { const $ = cheerio.load(res.text) expect($('title').text()).toMatch(/^Any additional support needs\? -/) - expect($('[data-test="back-link"]').attr('href')).toBe('/') + expect($('[data-test="back-link"]').attr('href')).toBe('/book-a-visit/select-date-and-time') expect($('h1').text()).toBe('Is additional support needed for any of the visitors?') expect($('[data-test=prison-name]').text().trim()).toContain('Hewell (HMP)') @@ -99,7 +89,7 @@ describe('Select additional support page', () => { prisoner, prison, allVisitors: visitors, - selectedVisitors: [visitors[0], visitors[2]], + selectedVisitors: [visitors[0]], }, } as SessionData @@ -122,7 +112,7 @@ describe('Select additional support page', () => { prisoner, prison, allVisitors: visitors, - selectedVisitors: [visitors[0], visitors[2]], + selectedVisitors: [visitors[0]], visitorSupport: 'Wheelchair access', }, } as SessionData) @@ -160,7 +150,7 @@ describe('Select additional support page', () => { prisoner, prison, allVisitors: visitors, - selectedVisitors: [visitors[0], visitors[2]], + selectedVisitors: [visitors[0]], }, } as SessionData) }) diff --git a/server/routes/bookingJourney/selectAdditionalSupportController.ts b/server/routes/bookingJourney/selectAdditionalSupportController.ts index eb1524fa..5a326cda 100644 --- a/server/routes/bookingJourney/selectAdditionalSupportController.ts +++ b/server/routes/bookingJourney/selectAdditionalSupportController.ts @@ -1,9 +1,8 @@ import type { RequestHandler } from 'express' import { ValidationChain, body, validationResult } from 'express-validator' -import { BookerService } from '../../services' -export default class AdditionalSupportController { - public constructor(private readonly bookerService: BookerService) {} +export default class SelectAdditionalSupportController { + public constructor() {} public view(): RequestHandler { return async (req, res) => { @@ -22,7 +21,7 @@ export default class AdditionalSupportController { const errors = validationResult(req) if (!errors.isEmpty()) { - req.flash('errors', errors.array() as []) + req.flash('errors', errors.array()) req.flash('formValues', req.body) return res.redirect(`/book-a-visit/select-additional-support`) } diff --git a/server/routes/bookingJourney/selectDateAndTimeController.ts b/server/routes/bookingJourney/selectDateAndTimeController.ts index f46c4890..e8c54bf7 100644 --- a/server/routes/bookingJourney/selectDateAndTimeController.ts +++ b/server/routes/bookingJourney/selectDateAndTimeController.ts @@ -1,8 +1,7 @@ import type { RequestHandler } from 'express' -import { BookerService } from '../../services' -export default class DateAndTimeController { - public constructor(private readonly bookerService: BookerService) {} +export default class SelectDateAndTimeController { + public constructor() {} public view(): RequestHandler { return async (req, res) => { diff --git a/server/routes/bookingJourney/selectMainContactController.ts b/server/routes/bookingJourney/selectMainContactController.ts index 0c63597d..50d38e4a 100644 --- a/server/routes/bookingJourney/selectMainContactController.ts +++ b/server/routes/bookingJourney/selectMainContactController.ts @@ -1,8 +1,7 @@ import type { RequestHandler } from 'express' -import { BookerService } from '../../services' -export default class MainContactController { - public constructor(private readonly bookerService: BookerService) {} +export default class SelectMainContactController { + public constructor() {} public view(): RequestHandler { return async (req, res) => { diff --git a/server/views/pages/bookingJourney/selectAdditionalSupport.njk b/server/views/pages/bookingJourney/selectAdditionalSupport.njk index b02a9192..0155efce 100644 --- a/server/views/pages/bookingJourney/selectAdditionalSupport.njk +++ b/server/views/pages/bookingJourney/selectAdditionalSupport.njk @@ -1,12 +1,11 @@ {% extends "../../partials/layout.njk" %} {% from "govuk/components/button/macro.njk" import govukButton %} -{% from "govuk/components/checkboxes/macro.njk" import govukCheckboxes %} {% from "govuk/components/radios/macro.njk" import govukRadios %} {% from "govuk/components/input/macro.njk" import govukInput %} {% set pageTitle = "Any additional support needs?" %} -{% set backLinkHref = "/" %} +{% set backLinkHref = "/book-a-visit/select-date-and-time" %} {% block content %}
@@ -21,7 +20,7 @@
- {% set otherSupportHtml %} + {% set supportDetailsHtml %} {{ govukInput({ id: "additionalSupport", name: "additionalSupport", @@ -55,7 +54,7 @@ }, checked: formValues.additionalSupportRequired == "yes", conditional: { - html: otherSupportHtml + html: supportDetailsHtml } }, {