Skip to content

Commit

Permalink
new release 1.26.0
Browse files Browse the repository at this point in the history
  • Loading branch information
HealthPDU committed Jun 10, 2024
1 parent 50251e2 commit acec1a3
Show file tree
Hide file tree
Showing 23 changed files with 720 additions and 713 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 1.26.0 - (2024-06-04)
* Moved from SaaS to HCS runners
* Save and Print functionality fixed for claims history page
* 90 document evidence limit added for file upload
* Prod errors fixed
* Hidden text for TTW journey corrected
* Fix for TTW journey when switching from lift to taxi or vice versa
* Gov.uk link fixed
* Dependency updates

## 1.25.0 - (2024-4-17)
* New TIW journey added
* New TIW content added to various common pages across service
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ the [Health PDU Nexus npm registry](https://dwpdigital.atlassian.net/wiki/spaces

```
npm install
npm install --registry=https://nexus.mgmt.health-dev.dwpcloud.uk/repository/npm-internal/ --always-auth
```

When running the application, please ensure that there is a ```allowedNinos.txt``` file in the root of the repository with any nino's which are allowed.
Expand Down
1 change: 0 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const cookieParser = require('cookie-parser');
const hideSignOutMiddleware = require('./app/middleware/hide-sign-out.middleware');
const languageToggleMiddleware = require('./app/middleware/language-toggle.middleware');
const { registerStaticAssets } = require('./app/lib/static-assets');
const accessibilityStatementGet = require('./app/routes/common/accessibility-statement');

const log = logger('app');
const {
Expand Down
3 changes: 3 additions & 0 deletions app/config/config-mapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ const enableNinoAllowList = config.get('allowList.allowListEnabled');

const megaByteLimit = config.get('services.evidenceHandler.megaByteLimit');
const fileSizeLimit = parseInt(megaByteLimit.toString(), 10) * 1000000;
const filesLimit = config.get('services.evidenceHandler.numberOfFilesLimit');
const numberOfFilesLimit = parseInt(filesLimit.toString(), 10);

const evidenceHandler = {
url: config.get('services.evidenceHandler.url'),
Expand Down Expand Up @@ -91,6 +93,7 @@ module.exports = {
SHOW_WELSH_LANGUAGE_TOGGLE,
enableNinoAllowList,
fileSizeLimit,
numberOfFilesLimit,
evidenceHandler,
addressLookup,
guidLookup,
Expand Down
12 changes: 9 additions & 3 deletions app/custom-validators/file-list-validators.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
const ValidationError = require('@dwp/govuk-casa/lib/validation/ValidationError');
const logger = require('../logger/logger');
const { claimTypesFullName } = require('../config/claim-types');
const {
numberOfFilesLimit,
} = require('../config/config-mapping');

const log = logger('custom-validation:file-list-validators');

Expand All @@ -20,14 +23,17 @@ module.exports = {
const { uploadMore } = dataContext.journeyContext.getDataForPage('receipts-invoices-uploaded');
const { journeyType } = dataContext.journeyContext.getDataForPage('__journey_type__');

if (uploadMore === 'no' && files !== undefined && files.length === 0) {
if (journeyType === claimTypesFullName.EA || journeyType === claimTypesFullName.AV ||
journeyType === claimTypesFullName.SW || journeyType === claimTypesFullName.TW ||
if (uploadMore === 'no' && files !== undefined && files.length === 0) {
if (journeyType === claimTypesFullName.EA || journeyType === claimTypesFullName.AV ||
journeyType === claimTypesFullName.SW || journeyType === claimTypesFullName.TW ||
journeyType === claimTypesFullName.TIW) {
return errorHandler(dataContext, 'receipts-or-invoices-uploaded:validation.noFiles');
}
throw Error(`Unsupported journey type ${journeyType}`);
}
else if (files !== undefined && (files.length === numberOfFilesLimit && uploadMore != 'no')) {
return errorHandler(dataContext, 'receipts-or-invoices-uploaded:validation.maxNumberOfFiles');
}
return true;
},
};
22 changes: 0 additions & 22 deletions app/definitions/pages/common/check-your-answers.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,6 @@ module.exports = function reviewPageDefinition(
fieldValidators,
hooks: {
prerender(req, res, next) {
const monthYear = req.casa.journeyContext.getDataForPage('support-month');
if (monthYear) {
const daysOfSupport = req.casa.journeyContext.getDataForPage('support-days').daysOfSupport;
const daysOfSupportArray = [];

for (let i = 0; i < daysOfSupport.length; i++) {
const createDate = new Date (monthYear.dateOfSupport.yyyy, monthYear.dateOfSupport.mm -1, daysOfSupport[i]);
const dayOfWeek = createDate.getDay();

const dateDisplay = {
'day': daysOfSupport[i],
'weekday' : dayOfWeek,
'month' : monthYear.dateOfSupport.mm
}

daysOfSupportArray.push(dateDisplay);

};

res.locals.daysOfSupport = daysOfSupportArray;
}

req.casa = req.casa || Object.create(null);

// Determine active journey in order to define the "edit origin" URL,
Expand Down
1 change: 1 addition & 0 deletions app/locales/cy/common.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"serviceName": "Gwneud cais am arian yn ôl gan Mynediad at Waith",
"crownLogoLink": "https://www.gov.uk/",
"phaseBannerHtml1": "Mae hwn yn wasanaeth newydd - bydd eich ",
"phaseBannerHtml2": "<a class='govuk-link' href=\"${url}\">adborth</a> ",
"phaseBannerHtml3": "yn ein helpu i'w wella.",
Expand Down
8 changes: 2 additions & 6 deletions app/locales/cy/receipts-or-invoices-uploaded.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@
"remove": "Tynnu",
"validation": {
"required": "Dewiswch ydw os ydych angen llwytho derbyneb neu anfoneb arall",
"noFiles": {
"equipmentOrAdaptations": "Mae'n rhaid i chi lwytho derbyneb neu anfoneb i anfon cais",
"supportWorker": "Mae'n rhaid i chi lwytho derbyneb neu anfoneb i anfon cais",
"travelToWork": "Mae'n rhaid i chi lwytho derbyneb neu anfoneb i anfon cais",
"adaptationToVehicle": "Mae'n rhaid i chi lwytho derbyneb neu anfoneb i anfon cais"
}
"noFiles": "Mae'n rhaid i chi lwytho derbyneb neu anfoneb i anfon cais",
"maxNumberOfFiles": "Gallwch ond llwytho hyd at 90 o ddogfennau."
},
"uploadRecieptsHiddenText": "derbynneb neu anfoneb"
}
6 changes: 4 additions & 2 deletions app/locales/cy/travel-to-work-claim-information.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"reviewBlock": {
"sectionHeader": "Gwybodaeth am y cais",
"taxiHeader": "Gwybodaeth am gais teithiau tacsi",
"liftHeader": "Gwybodaeth am gais am lift",
"taxi": "Tacsi",
"lift": "Lifft gan ffrind, cydweithiwr neu berthynas",
"journeysOrMileage": "Teithio i neu o'r gwaith",
Expand All @@ -22,6 +23,7 @@
"totalOfAllMileage": "Cyfanswm y milltiroedd a deithiwyd",
"daysOfMileage": "Dyddiau cafodd teithiau eu gwneud yn %s",
"changeDaysOfMileage": "Dyddiau cafodd teithiau eu gwneud yn %s",
"changeTotalNumberOfJourneys": "Cyfanswm y teithiau ar gyfer teithio i'r gwaith"
"changeTotalNumberOfJourneys": "Cyfanswm y teithiau ar gyfer teithio i'r gwaith",
"changeTotalNumberOfMiles": "Cyfanswm y pellter mewn milltiroedd ar gyfer teithio i'r gwaith"
}
}
1 change: 1 addition & 0 deletions app/locales/en/common.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"serviceName": "Claim money back from Access to Work",
"crownLogoLink": "https://www.gov.uk/",
"phaseBannerHtml1": "This is a new service – your ",
"phaseBannerHtml2": "<a class='govuk-link' href=\"${url}\">feedback</a> ",
"phaseBannerHtml3": "will help us to improve it.",
Expand Down
3 changes: 2 additions & 1 deletion app/locales/en/receipts-or-invoices-uploaded.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"remove": "Remove",
"validation": {
"required": "Select yes if you need to upload another receipt or invoice",
"noFiles": "You must upload a receipt or invoice to send a claim"
"noFiles": "You must upload a receipt or invoice to send a claim",
"maxNumberOfFiles": "You can only upload up to 90 documents."
},
"uploadRecieptsHiddenText": "receipt or invoice"
}
6 changes: 4 additions & 2 deletions app/locales/en/travel-to-work-claim-information.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"reviewBlock": {
"sectionHeader": "Claim information",
"taxiHeader": "Taxi travel claim information",
"liftHeader": "Lift claim information",
"taxi": "Taxi",
"lift": "Lift from a friend, colleague or relative",
"journeysOrMileage": "Travel to or from work",
Expand All @@ -22,6 +23,7 @@
"totalOfAllMileage": "Total miles travelled",
"daysOfMileage": "Days journeys were made in %s",
"changeDaysOfMileage": "Days journeys were made in %s",
"changeTotalNumberOfJourneys": "Total number of journeys for travel to work"
"changeTotalNumberOfJourneys": "Total number of journeys for travel to work",
"changeTotalNumberOfMiles": "Total distance in miles for travel to work"
}
}
1 change: 1 addition & 0 deletions app/views/layouts/custom-main.njk
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
{{ hmrcHeader({
serviceName: t('common:serviceName'),
serviceUrl : casa.mountUrl,
homepageUrl: t('common:crownLogoLink'),
useTudorCrown: true,
phaseBanner : {
tag: {
Expand Down
1 change: 1 addition & 0 deletions app/views/layouts/full-width.njk
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
{{ hmrcHeader({
serviceName: t('common:serviceName'),
serviceUrl : casa.mountUrl,
homepageUrl: t('common:crownLogoLink'),
useTudorCrown: true,
phaseBanner : {
tag: {
Expand Down
1 change: 1 addition & 0 deletions app/views/layouts/journey.njk
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
{{ hmrcHeader({
serviceName: t('common:serviceName'),
serviceUrl : casa.mountUrl,
homepageUrl: t('common:crownLogoLink'),
useTudorCrown: true,
phaseBanner : {
tag: {
Expand Down
2 changes: 1 addition & 1 deletion app/views/pages/account/view-your-claim-submission.njk
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
<h1 class="govuk-heading-l">{{ t('view-your-claim-submission:tw.h1') }}</h1>
{% endif %}

<a class="govuk-link hide-print" target="_blank" href="{{ accountBaseUrl + "/claims-history" }}">
<a class="govuk-link hide-print" target="_blank" href="{{ accountBaseUrl + "/view-your-claim-submission?id=" + claimId }}" id='print-link'>
{{ t('view-your-claim-submission:saveAndPrint') }}</a>
</br></br>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,6 @@

{% set monthLength = claim | length %}

{% set data = (data.push(
{
key: { text: t('travel-to-work-claim-information:reviewBlock.typeOfTravel') },
value: { text: t('travel-to-work-claim-information:reviewBlock.taxi') if typeOfTravel === 'taxi' else t('travel-to-work-claim-information:reviewBlock.lift') },
actions: {
items: [
{
href: 'which-journey-type' + refererUrl,
text: t('review:block.changeLink'),
visuallyHiddenText: t('travel-to-work-claim-information:reviewBlock.changeTypeOfTravel'),
classes: 'govuk-link--no-visited-state hide-print'
}
]
}
}
), data) %}

{% if journeysOrMileage %}
{% set data = (data.push(
{
Expand Down Expand Up @@ -108,7 +91,7 @@
{
href: 'journey-summary' + refererUrl,
text: t('review:block.changeLink'),
visuallyHiddenText: t('travel-to-work-claim-information:reviewBlock.changeTotalNumberOfJourneys'),
visuallyHiddenText: t('travel-to-work-claim-information:reviewBlock.changeTotalNumberOfMiles'),
classes: 'govuk-link--no-visited-state hide-print'
}
]
Expand Down Expand Up @@ -166,7 +149,7 @@

{{ customSummaryCardTable({
card: {
title: { text: t('travel-to-work-claim-information:reviewBlock.sectionHeader') }
title: { text: t('travel-to-work-claim-information:reviewBlock.taxiHeader') if typeOfTravel === 'taxi' else t('travel-to-work-claim-information:reviewBlock.liftHeader') }
},
rows: data
}) }}
Expand Down
3 changes: 3 additions & 0 deletions app/views/partials/cookie-message.njk
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
{
headingText: t("cookie-message:title") ,
html: html,
classes: ['hide-print'],
actions: [
{
text: t("cookie-message:unset.buttons.accept"),
Expand Down Expand Up @@ -47,6 +48,7 @@
messages: [
{
html: acceptHtml,
classes: ['hide-print'],
actions: [
{
text: t("cookie-message:set.hide"),
Expand All @@ -68,6 +70,7 @@
messages: [
{
html: acceptHtml,
classes: ['hide-print'],
actions: [
{
text: t("cookie-message:set.hide"),
Expand Down
4 changes: 3 additions & 1 deletion config/custom-environment-variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
"services": {
"evidenceHandler": {
"url": "EVIDENCE_URL",
"megaByteLimit": "EVIDENCE_MB_LIMIT"
"megaByteLimit": "EVIDENCE_MB_LIMIT",
"numberOfFilesLimit": "EVIDENCE_DOCUMENTS_LIMIT"
},

"addressLookup": {
"url": "LOCATION_URL",
"contextPath": "LOCATION_CONTEXT_PATH"
Expand Down
3 changes: 2 additions & 1 deletion config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"services": {
"evidenceHandler": {
"url": "http://localhost:9013",
"megaByteLimit": 10
"megaByteLimit": 10,
"numberOfFilesLimit": 90
},
"addressLookup": {
"url": "http://localhost:18082",
Expand Down
Loading

0 comments on commit acec1a3

Please sign in to comment.