diff --git a/packages/gafl-webapp-service/src/locales/en.json b/packages/gafl-webapp-service/src/locales/en.json index 53afbbc1ea..a0d865f49f 100644 --- a/packages/gafl-webapp-service/src/locales/en.json +++ b/packages/gafl-webapp-service/src/locales/en.json @@ -460,6 +460,9 @@ "newsletter_error_set_email": "Enter an email address in the correct format, like name@example.com", "newsletter_subscribe": "Stay up to date with the latest news on angling, fisheries and how we spend your licence money. You can unsubscribe at any time.", "newsletter_title": "Would you like to receive our email newsletter?", + "notification_heading": "Plastic-coated card licences will be replaced by a printed letter from 31 May 2024.", + "notification_label": "Important", + "notification_text": "Choosing to get a licence by email or text message helps reduce the paper we use and invests more licence income back into fishing.", "no_licence_req_body": "How much will this cost?", "no_licence_req_title": "You do not need a licence yet", "no": "No", @@ -504,10 +507,6 @@ "period": ".", "phone_number": "phone number", "pound": "£", - "price_increase_notification_heading": "Licence prices are changing", - "price_increase_notification_label": "Important", - "price_increase_notification_link_text": "See licence price increases (opens in new tab)", - "price_increase_notification_text": "Rod fishing licences starting on or after 1 April 2023 are increasing in price.", "pricing_summary_heading": "You can go fishing without a rod licence because you’re under 13. You’ll need to get a licence to fish as soon as you turn 13.", "privacy_dp_officer_body_1": "Our Data Protection Officer (DPO) is responsible for independent advice and monitoring of the Environment Agency’s use of personal data. You can read our ", "privacy_dp_officer_body_2": " which explains how we deal with personal data in general. If you have any concerns or queries about how we process personal data, or if you would like to make a complaint or request relating to data protection, please contact our DPO using the following details:", diff --git a/packages/gafl-webapp-service/src/pages/contact/digital-licence/licence-fulfilment/__tests__/route.spec.js b/packages/gafl-webapp-service/src/pages/contact/digital-licence/licence-fulfilment/__tests__/route.spec.js index 0831f3ddad..d2f1aa4ac2 100644 --- a/packages/gafl-webapp-service/src/pages/contact/digital-licence/licence-fulfilment/__tests__/route.spec.js +++ b/packages/gafl-webapp-service/src/pages/contact/digital-licence/licence-fulfilment/__tests__/route.spec.js @@ -41,5 +41,17 @@ describe('licence-fulfilment > route', () => { const result = await getData(getMockRequest()) expect(result.youOrOther).toEqual(returnedValue) }) + + it.each([ + [true, 'true'], + [false, 'false'], + [false, undefined] + ])('showNotificationBanner is %s when process.env.SHOW_NOTIFICATION_BANNER is %s', async (expectedResult, notification) => { + process.env.SHOW_NOTIFICATION_BANNER = notification + const mockRequest = getMockRequest() + const result = await getData(mockRequest) + + expect(result.showNotificationBanner).toEqual(expectedResult) + }) }) }) diff --git a/packages/gafl-webapp-service/src/pages/contact/digital-licence/licence-fulfilment/licence-fulfilment.njk b/packages/gafl-webapp-service/src/pages/contact/digital-licence/licence-fulfilment/licence-fulfilment.njk index 4e4c838272..fc2e3d9671 100644 --- a/packages/gafl-webapp-service/src/pages/contact/digital-licence/licence-fulfilment/licence-fulfilment.njk +++ b/packages/gafl-webapp-service/src/pages/contact/digital-licence/licence-fulfilment/licence-fulfilment.njk @@ -1,5 +1,6 @@ {% extends "standard-form.njk" %} {% from "radios/macro.njk" import govukRadios %} +{% from "notification-banner.njk" import notificationBanner %} {% set title = mssgs['licence_fulfilment_title_' + data.youOrOther] %} @@ -10,6 +11,12 @@ } %} +{% block notificationContent %} + {% if data.showNotificationBanner %} + {{ notificationBanner(mssgs) }} + {% endif%} +{% endblock %} + {% block pageContent %}

{{ mssgs.licence_fulfilment_content_info }}

{{ govukRadios({ diff --git a/packages/gafl-webapp-service/src/pages/contact/digital-licence/licence-fulfilment/route.js b/packages/gafl-webapp-service/src/pages/contact/digital-licence/licence-fulfilment/route.js index 523219e605..f14f94d89e 100644 --- a/packages/gafl-webapp-service/src/pages/contact/digital-licence/licence-fulfilment/route.js +++ b/packages/gafl-webapp-service/src/pages/contact/digital-licence/licence-fulfilment/route.js @@ -16,7 +16,10 @@ export const getData = async request => { throw new GetDataRedirect(CONTACT.uri) } - return { youOrOther: youOrOther(permission) } + return { + showNotificationBanner: process.env.SHOW_NOTIFICATION_BANNER?.toLowerCase() === 'true', + youOrOther: youOrOther(permission) + } } const validator = Joi.object({ diff --git a/packages/gafl-webapp-service/src/pages/licence-details/licence-to-start/__tests__/route.spec.js b/packages/gafl-webapp-service/src/pages/licence-details/licence-to-start/__tests__/route.spec.js index e6560f6a4d..3d76e2b007 100644 --- a/packages/gafl-webapp-service/src/pages/licence-details/licence-to-start/__tests__/route.spec.js +++ b/packages/gafl-webapp-service/src/pages/licence-details/licence-to-start/__tests__/route.spec.js @@ -1,6 +1,4 @@ import { getData } from '../route' -import { NEW_PRICES } from '../../../../uri.js' -import { addLanguageCodeToUri } from '../../../../processors/uri-helper.js' jest.mock('../../../../processors/uri-helper.js') @@ -29,22 +27,5 @@ describe('licence-to-start > route', () => { const result = await getData(request) expect(result.isLicenceForYou).toBeFalsy() }) - - it.each([ - ['true', true], - ['false', false], - [undefined, false] - ])('SHOW_NOTIFICATION_BANNER is set to value of process.env.SHOW_NOTIFICATION_BANNER', async (notification, expectedResult) => { - process.env.SHOW_NOTIFICATION_BANNER = notification - const request = getMockRequest() - const result = await getData(request) - expect(result.SHOW_NOTIFICATION_BANNER).toEqual(expectedResult) - }) - - it('addLanguageCodeToUri is called with request and NEW_PRICES.uri', async () => { - const request = getMockRequest() - await getData(request) - expect(addLanguageCodeToUri).toHaveBeenCalledWith(request, NEW_PRICES.uri) - }) }) }) diff --git a/packages/gafl-webapp-service/src/pages/licence-details/licence-to-start/licence-to-start.njk b/packages/gafl-webapp-service/src/pages/licence-details/licence-to-start/licence-to-start.njk index 9eb56d38d7..834f8fa05e 100644 --- a/packages/gafl-webapp-service/src/pages/licence-details/licence-to-start/licence-to-start.njk +++ b/packages/gafl-webapp-service/src/pages/licence-details/licence-to-start/licence-to-start.njk @@ -2,7 +2,6 @@ {% from "radios/macro.njk" import govukRadios %} {% from "date-input/macro.njk" import govukDateInput %} -{% from "notification-banner.njk" import notificationBanner %} {% set title = mssgs.licence_start_title_you if data.isLicenceForYou else mssgs.licence_start_title_other %} {% @@ -59,12 +58,6 @@ }) }} {% endset -%} -{% block notificationContent %} - {% if data.SHOW_NOTIFICATION_BANNER %} - {{ notificationBanner(data.uri.newPrices, mssgs) }} - {% endif %} -{% endblock %} - {% block pageContent %}

{{ mssgs.licence_start_today_or_within + data.advancedPurchaseMaxDays + mssgs.licence_start_days }}

diff --git a/packages/gafl-webapp-service/src/pages/licence-details/licence-to-start/route.js b/packages/gafl-webapp-service/src/pages/licence-details/licence-to-start/route.js index 35f884fa96..31ae6d2ffa 100644 --- a/packages/gafl-webapp-service/src/pages/licence-details/licence-to-start/route.js +++ b/packages/gafl-webapp-service/src/pages/licence-details/licence-to-start/route.js @@ -3,11 +3,10 @@ import moment from 'moment-timezone' import JoiDate from '@hapi/joi-date' import { START_AFTER_PAYMENT_MINUTES, ADVANCED_PURCHASE_MAX_DAYS, SERVICE_LOCAL_TIME } from '@defra-fish/business-rules-lib' -import { LICENCE_TO_START, NEW_PRICES } from '../../../uri.js' +import { LICENCE_TO_START } from '../../../uri.js' import pageRoute from '../../../routes/page-route.js' import { dateFormats } from '../../../constants.js' import { nextPage } from '../../../routes/next-page.js' -import { addLanguageCodeToUri } from '../../../processors/uri-helper.js' const JoiX = Joi.extend(JoiDate) @@ -43,11 +42,7 @@ export const getData = async request => { minStartDate: moment().tz(SERVICE_LOCAL_TIME).format(fmt), maxStartDate: moment().tz(SERVICE_LOCAL_TIME).add(ADVANCED_PURCHASE_MAX_DAYS, 'days').format(fmt), advancedPurchaseMaxDays: ADVANCED_PURCHASE_MAX_DAYS, - startAfterPaymentMinutes: START_AFTER_PAYMENT_MINUTES, - SHOW_NOTIFICATION_BANNER: process.env.SHOW_NOTIFICATION_BANNER?.toLowerCase() === 'true', - uri: { - newPrices: addLanguageCodeToUri(request, NEW_PRICES.uri) - } + startAfterPaymentMinutes: START_AFTER_PAYMENT_MINUTES } } diff --git a/packages/gafl-webapp-service/src/pages/macros/notification-banner.njk b/packages/gafl-webapp-service/src/pages/macros/notification-banner.njk index b1796db597..b2a01decdd 100644 --- a/packages/gafl-webapp-service/src/pages/macros/notification-banner.njk +++ b/packages/gafl-webapp-service/src/pages/macros/notification-banner.njk @@ -1,12 +1,12 @@ {% from "notification-banner/macro.njk" import govukNotificationBanner %} -{% macro notificationBanner(newPricesUri, mssgs) %} +{% macro notificationBanner(mssgs) %} {% set bannerHtml %}

- {{ mssgs.price_increase_notification_heading }} + {{ mssgs.notification_heading }}

- {{ mssgs.price_increase_notification_text }} {{ mssgs.price_increase_notification_link_text }} + {{ mssgs.notification_text }}

{% endset %} diff --git a/packages/gafl-webapp-service/src/pages/summary/licence-summary/__tests__/route.spec.js b/packages/gafl-webapp-service/src/pages/summary/licence-summary/__tests__/route.spec.js index e9e8691970..3015c8565b 100644 --- a/packages/gafl-webapp-service/src/pages/summary/licence-summary/__tests__/route.spec.js +++ b/packages/gafl-webapp-service/src/pages/summary/licence-summary/__tests__/route.spec.js @@ -1,6 +1,6 @@ import { getData } from '../route' import { LICENCE_SUMMARY_SEEN } from '../../../../constants.js' -import { DATE_OF_BIRTH, LICENCE_LENGTH, LICENCE_TO_START, LICENCE_TYPE, NAME, NEW_TRANSACTION, NEW_PRICES } from '../../../../uri.js' +import { DATE_OF_BIRTH, LICENCE_LENGTH, LICENCE_TO_START, LICENCE_TYPE, NAME, NEW_TRANSACTION } from '../../../../uri.js' import findPermit from '../../../../processors/find-permit.js' import hashPermission from '../../../../processors/hash-permission.js' import { licenceTypeDisplay } from '../../../../processors/licence-type-display.js' @@ -302,10 +302,10 @@ describe('licence-summary > route', () => { expect(transactionCacheSet).not.toHaveBeenCalled() }) - it.each([[NEW_TRANSACTION.uri], [NEW_PRICES.uri]])('addLanguageCodeToUri is called with request and %s', async uri => { + it('addLanguageCodeToUri is called with request and NEW_TRANSACTION.uri', async () => { const mockRequest = getMockRequest() await getData(mockRequest) - expect(addLanguageCodeToUri).toHaveBeenCalledWith(mockRequest, uri) + expect(addLanguageCodeToUri).toHaveBeenCalledWith(mockRequest, NEW_TRANSACTION.uri) }) it('licenceTypeDisplay is called with the permission and i18n label catalog', async () => { @@ -322,18 +322,6 @@ describe('licence-summary > route', () => { expect(licenceTypeDisplay).toHaveBeenCalledWith(mockPermission, catalog) }) - - it.each([ - ['true', true], - ['false', false], - [undefined, false] - ])('SHOW_NOTIFICATION_BANNER is set to value of process.env.SHOW_NOTIFICATION_BANNER', async (notification, expectedResult) => { - process.env.SHOW_NOTIFICATION_BANNER = notification - const mockRequest = getMockRequest() - const data = await getData(mockRequest) - - expect(data.SHOW_NOTIFICATION_BANNER).toEqual(expectedResult) - }) }) describe('checkNavigation', () => { diff --git a/packages/gafl-webapp-service/src/pages/summary/licence-summary/licence-summary.njk b/packages/gafl-webapp-service/src/pages/summary/licence-summary/licence-summary.njk index fab124c72f..fdf89572f8 100644 --- a/packages/gafl-webapp-service/src/pages/summary/licence-summary/licence-summary.njk +++ b/packages/gafl-webapp-service/src/pages/summary/licence-summary/licence-summary.njk @@ -4,7 +4,6 @@ {% from "fieldset/macro.njk" import govukFieldset %} {% from "warning-text/macro.njk" import govukWarningText %} {% from "button/macro.njk" import govukButton %} -{% from "notification-banner.njk" import notificationBanner %} {% set title = mssgs.licence_summary_title %} {% block pageTitle %}{{ title }}{{ mssgs.gov_uk }}{% endblock %} @@ -27,11 +26,6 @@ {% block content %}
- {% block notificationContent %} - {% if data.SHOW_NOTIFICATION_BANNER %} - {{ notificationBanner(data.uri.newPrices, mssgs) }} - {% endif%} - {% endblock %}
{{ licenseDetailsSummary | trim | safe }} diff --git a/packages/gafl-webapp-service/src/pages/summary/licence-summary/route.js b/packages/gafl-webapp-service/src/pages/summary/licence-summary/route.js index f0b6a18b16..b91b3b4ec2 100644 --- a/packages/gafl-webapp-service/src/pages/summary/licence-summary/route.js +++ b/packages/gafl-webapp-service/src/pages/summary/licence-summary/route.js @@ -14,8 +14,7 @@ import { DISABILITY_CONCESSION, DATE_OF_BIRTH, RENEWAL_START_DATE, - NEW_TRANSACTION, - NEW_PRICES + NEW_TRANSACTION } from '../../../uri.js' import { START_AFTER_PAYMENT_MINUTES } from '@defra-fish/business-rules-lib' import { LICENCE_SUMMARY_SEEN } from '../../../constants.js' @@ -202,10 +201,8 @@ export const getData = async request => { licenceSummaryRows: getLicenceSummaryRows(request, permission), isRenewal: permission.isRenewal, uri: { - clear: addLanguageCodeToUri(request, NEW_TRANSACTION.uri), - newPrices: addLanguageCodeToUri(request, NEW_PRICES.uri) - }, - SHOW_NOTIFICATION_BANNER: process.env.SHOW_NOTIFICATION_BANNER?.toLowerCase() === 'true' + clear: addLanguageCodeToUri(request, NEW_TRANSACTION.uri) + } } }