From 41d9d808a32e872b51db1d4db63d0872a606ec93 Mon Sep 17 00:00:00 2001 From: yasin Date: Fri, 21 Jul 2023 09:11:41 +0100 Subject: [PATCH] ADJUST1-87 More about text change for RADA's --- server/model/adjustmentTypes.ts | 2 ++ server/model/viewModel.ts | 5 ++++- server/routes/adjustmentRoutes.test.ts | 3 +++ server/views/macros/hubAdjustmentCard.njk | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/server/model/adjustmentTypes.ts b/server/model/adjustmentTypes.ts index e6e83e17..522c32f1 100644 --- a/server/model/adjustmentTypes.ts +++ b/server/model/adjustmentTypes.ts @@ -38,6 +38,8 @@ const adjustmentTypes: AdjustmentType[] = [ text: 'RADA (Restoration of added days)', alternativeText: 'RADA', shortText: 'RADA', + moreAboutText: + "Governors can restore some of the Added days awarded (ADA) time for a prisoner. These are known as RADAs (Restoration of Added Days Awarded). Any RADA's granted will bring forward release dates.", url: 'restored-additional-days', } as AdjustmentType, { diff --git a/server/model/viewModel.ts b/server/model/viewModel.ts index 3bd53518..87943d0b 100644 --- a/server/model/viewModel.ts +++ b/server/model/viewModel.ts @@ -63,7 +63,10 @@ export default class ViewModel { public totalRow() { const total = this.adjustments.map(it => it.days).reduce((a, b) => a + b, 0) - if (this.adjustmentType.value === 'RESTORATION_OF_ADDITIONAL_DAYS_AWARDED') { + if ( + this.adjustmentType.value === 'RESTORATION_OF_ADDITIONAL_DAYS_AWARDED' || + this.adjustmentType.value === 'REMAND' + ) { return [ [{ html: 'Total days' }, { text: '' }, { html: `${total}`, format: 'numeric' }, { html: '' }], ] diff --git a/server/routes/adjustmentRoutes.test.ts b/server/routes/adjustmentRoutes.test.ts index b0fa2f79..5faf538e 100644 --- a/server/routes/adjustmentRoutes.test.ts +++ b/server/routes/adjustmentRoutes.test.ts @@ -74,6 +74,9 @@ describe('Adjustment routes tests', () => { expect(res.text).toContain('Nobody') expect(res.text).toContain('Nobody may have 20 days remand') expect(res.text).toContain('24') + expect(res.text).toContain( + 'Governors can restore some of the Added days awarded (ADA) time for a prisoner. These are known as RADAs (Restoration of Added Days Awarded)', + ) }) }) it('GET /{nomsId} relevant remand throws error', () => { diff --git a/server/views/macros/hubAdjustmentCard.njk b/server/views/macros/hubAdjustmentCard.njk index 342a84d4..fc6c38d4 100644 --- a/server/views/macros/hubAdjustmentCard.njk +++ b/server/views/macros/hubAdjustmentCard.njk @@ -13,7 +13,7 @@ {% endif %} {{ govukDetails({ summaryText: "More about " + adjustmentType.shortText, - text: "More about " + adjustmentType.shortText + text: adjustmentType.moreAboutText or "More about " + adjustmentType.shortText }) }}