Skip to content

Commit

Permalink
Merge branch 'master' into DTSPB-4457-replace-h1-heading-from-probate…
Browse files Browse the repository at this point in the history
…-cookies
  • Loading branch information
abbasiTahir authored Jan 15, 2025
2 parents cc1cf47 + 593e182 commit a1e82ba
Show file tree
Hide file tree
Showing 123 changed files with 4,970 additions and 4,384 deletions.
557 changes: 279 additions & 278 deletions .eslintrc.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.17.0
20.18.0
925 changes: 0 additions & 925 deletions .yarn/releases/yarn-4.4.1.cjs

This file was deleted.

934 changes: 934 additions & 0 deletions .yarn/releases/yarn-4.6.0.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ enableGlobalCache: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.4.1.cjs
yarnPath: .yarn/releases/yarn-4.6.0.cjs
2 changes: 1 addition & 1 deletion Jenkinsfile_nightly
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
def yarnBuilder = new uk.gov.hmcts.contino.YarnBuilder(this)

properties([
pipelineTriggers([cron('27 06 * * 1-5')]),
pipelineTriggers([cron('37 07 * * 1-5')]),
parameters([
string(name: 'ENVIRONMENT', defaultValue: 'aat', description: 'Environment to test'),
string(name: 'test_path', defaultValue: './paths/**/*.js', description: 'any three like ./paths/probate/*.js or ./paths/generic/*.js or ./paths/intestacy/*.js'),
Expand Down
4 changes: 2 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// eslint-disable-line max-lines
/* eslint-disable max-lines */
/* eslint no-console: 0 no-unused-vars: 0 */

'use strict';
Expand Down Expand Up @@ -293,7 +293,7 @@ exports.init = function (isA11yTest = false, a11yTestSession = {}, ftValue) {
// Add variables that are available in all views
app.use((req, res, next) => {
const commonContent = require(`app/resources/${req.session.language}/translation/common`);

njkEnv.addGlobal('currentHost', req?.headers?.host?.toLowerCase());
res.locals.serviceName = commonContent.serviceName;
res.locals.cookieText = commonContent.cookieText;
res.locals.releaseVersion = `v${releaseVersion}`;
Expand Down
29 changes: 22 additions & 7 deletions app/assets/javascripts/cookie-banner.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(function () {

if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', function() {
initialiseCookieBanner();
Expand All @@ -9,7 +9,7 @@
}

function initialiseCookieBanner() {

/* This callback is called when the 'accept' action is fired within the cookie banner
* This is where you'd hide the first stage in a decision/confirmation style banner
*/
Expand All @@ -35,17 +35,32 @@
// GTM based GA consent
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({'event': 'Cookie Preferences', 'cookiePreferences': cookieStatus});

// Dynatrace RUM Consent
const dtrum = window.dtrum;

/*
Session Replay creates anonymized, video-like recordings of users' interactions with
your website or mobile app, right down to each click, scroll, and tap. You can watch
their mouse movements to identify what they’re trying to do, where they’re having trouble,
and what’s frustrating them (or causing them to abandon their journey altogether).
This is set in the function below. If its needed then dtrum.enableSessionReplay() needs to
be added after the dtrum.enable() line. Conversly, dtrum.disableSessionReplay() should be added
after the disable call.
dtrum.enableSessionReplay = function () {
}
*/
if (dtrum) {
if (cookieStatus.apm === 'on') {
dtrum.enable();
dtrum.enableSessionReplay();
} else {
dtrum.disableSessionReplay();
dtrum.disable();
}
}
}
}

Expand Down Expand Up @@ -99,7 +114,7 @@
}
]
});
}
}
})();


Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/cookie-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
findAndBindCookieBanner();

if(!getUserPreferences() && window.dtrum){
window.dtrum.disableSessionReplay();
//window.dtrum.disableSessionReplay();
window.dtrum.disable();
}
};
Expand Down
6 changes: 3 additions & 3 deletions app/assets/javascripts/document-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var DocumentUpload = {
initDropzone: function() {
if ($('.document-upload__dropzone').length) {
new Dropzone('.document-upload__dropzone', {
url: '/document-upload',
url: '/provide-information',
previewsContainer: '.document-upload__preview',
headers: {
'x-csrf-token': documentUploadConfig.csrfToken
Expand Down Expand Up @@ -75,7 +75,7 @@ var DocumentUpload = {
},
showErrorSummary: function() {
if ($('.govuk-error-summary').length === 0) {
$('.govuk-fieldset').before('<div class="govuk-error-summary" role="alert" aria-labelledby="error-summary-title" tabindex="-1" data-module="govuk-error-summary"><h2 class="govuk-error-summary__title" id="error-summary-title">' + documentUploadConfig.content.errorSummaryHeading + '</h2><div class="govuk-error-summary__body"><ul class="govuk-list govuk-error-summary__list"></ul></div></div>');
$('.uploadDocumentH1').before('<div class="govuk-error-summary" role="alert" aria-labelledby="error-summary-title" tabindex="-1" data-module="govuk-error-summary"><h2 class="govuk-error-summary__title" id="error-summary-title">' + documentUploadConfig.content.errorSummaryHeading + '</h2><div class="govuk-error-summary__body"><ul class="govuk-list govuk-error-summary__list"></ul></div></div>');
}
},
removeErrorSummary: function() {
Expand Down Expand Up @@ -110,6 +110,6 @@ var DocumentUpload = {
});
},
removeDocument: function(index) {
$.get('/document-upload/remove/' + index);
$.get('/provide-information/remove/' + index);
}
};
2 changes: 1 addition & 1 deletion app/assets/javascripts/dropzone.js
Original file line number Diff line number Diff line change
Expand Up @@ -1797,7 +1797,7 @@ var Dropzone = function (_Emitter) {
}, {
key: "accept",
value: function accept(file, done) {
if (this.options.maxFilesize && file.size > this.options.maxFilesize * 1024 * 1024) {
if (this.options.maxFilesize && file.size > this.options.maxFilesize ) {
return done(this.options.dictFileTooBig.replace("{{filesize}}", Math.round(file.size / 1024 / 10.24) / 100).replace("{{maxFilesize}}", this.options.maxFilesize));
} else if (!Dropzone.isValidFile(file, this.options.acceptedFiles)) {
return done(this.options.dictInvalidFileType);
Expand Down
24 changes: 23 additions & 1 deletion app/assets/sass/patterns/_progress-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
.hmcts-progress-bar__icon {
position: relative;
background-color: #ffffff;
border: 6px solid #1E6FB8;
border: 6px solid #B1B4B6;
border-radius: 50%;
box-sizing: border-box;
display: block;
Expand All @@ -92,9 +92,18 @@
width: 32px;
}


.hmcts-progress-bar__icon--complete {
background-color: #1E6FB8;
background-image: url(/public/images/icon-progress-tick.png);
border: 6px solid #1E6FB8;
background-position: 50% 50%;
background-repeat: no-repeat;
}

.hmcts-progress-bar__icon--inprogress {
background-color: #1E6FB8;
border: 6px solid #1E6FB8;
background-position: 50% 50%;
background-repeat: no-repeat;
}
Expand All @@ -113,6 +122,19 @@
position: relative;
word-wrap: break-word;
}
.hmcts-progress-bar__label--inprogress {
font-family: "GDS Transport", arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font-size: 14px;
font-size: 0.875rem;
line-height: 1.1428571429;
display: block;
font-weight: bold;
margin-top: 10px;
position: relative;
word-wrap: break-word;
}
@media print {
.hmcts-progress-bar__label {
font-family: sans-serif;
Expand Down
15 changes: 12 additions & 3 deletions app/components/step-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ const getPreviousUrl = (ctx, req, res, steps, stepName) => {
ctx.previousUrl = previousUrl;
return;
}
if (stepName==='ProvideInformation') {
previousUrl = '/citizens-hub';
ctx.previousUrl = previousUrl;
return;
}
if (stepName==='ReviewResponse') {
previousUrl = '/provide-information';
ctx.previousUrl = previousUrl;
return;
}
if (isNoBackLinkStepName(stepName)) {
previousUrl = '';
ctx.previousUrl = previousUrl;
Expand Down Expand Up @@ -111,7 +121,6 @@ const getScrennersPreviousUrl = (ctx, req, res, steps, currentStepName) => {
const StartEligibilityStep = 'StartEligibility';
let loopingStep = steps[StartEligibilityStep];
if (currentStepName === 'StartEligibility' && req.userLoggedIn) {
previousUrl = '/dashboard';
ctx.previousUrl = previousUrl;
return;
}
Expand All @@ -134,8 +143,8 @@ const getScrennersPreviousUrl = (ctx, req, res, steps, currentStepName) => {

const isNoBackLinkStepName = (stepName) => {
return stepName==='CitizensHub' || stepName==='PaymentBreakdown' || stepName==='PaymentStatus' ||
stepName==='ExecutorsAdditionalInvite' || stepName==='ExecutorsUpdateInvite' || stepName==='ThankYou' ||
stepName==='ExecutorsChangeMade' || stepName==='ExecutorsInvite' || stepName==='ExecutorsInvitesSent';
stepName==='ExecutorsAdditionalInvite' || stepName==='ThankYou' || stepName==='ExecutorsChangeMade' ||
stepName==='ExecutorsInvitesSent' || stepName==='ExecutorsUpdateInviteSent';
};
const isPreDeclarationTask = (taskName) => {
return taskName === 'DeceasedTask' || taskName === 'ExecutorsTask';
Expand Down
2 changes: 1 addition & 1 deletion app/components/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const getStore = (redisConfig, ttl) => {
if (redisConfig.enabled === 'true') {
const Redis = require('ioredis');
const RedisStore = require('connect-redis').default;
const {RedisStore} = require('connect-redis');
const tlsOptions = {
password: redisConfig.password,
tls: true
Expand Down
3 changes: 1 addition & 2 deletions app/core/runners/UIStepRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ class UIStepRunner {
formdata.declaration.hasDataChanged = true;
}
let errorOccurred = false;

if ((get(formdata, 'ccdCase.state') === 'Pending' || get(formdata, 'ccdCase.state') === 'CasePaymentFailed') && session.regId && step.shouldPersistFormData()) {
if ((get(formdata, 'ccdCase.state') === 'Pending' || get(formdata, 'ccdCase.state') === 'CasePaymentFailed' || get(formdata, 'ccdCase.state') === 'BOCaseStopped') && session.regId && step.shouldPersistFormData()) {
const ccdCaseId = formdata.ccdCase.id;
const result = yield step.persistFormData(ccdCaseId, formdata, session.id, req);
if (result.name === 'Error') {
Expand Down
8 changes: 7 additions & 1 deletion app/journeys/intestacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,13 @@ const stepList = {
ThankYou: 'TaskList',
TaskList: 'TaskList',
Dashboard: 'TaskList',
StopPage: 'StopPage'
StopPage: 'StopPage',
ProvideInformation: {
responseOrDocument: 'ReviewResponse',
isUploadingDocument: 'ProvideInformation',
otherwise: 'CitizensHub'
},
ReviewResponse: 'CitizensHub'
};

module.exports.stepList = stepList;
Expand Down
8 changes: 7 additions & 1 deletion app/journeys/probate.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,13 @@ const stepList = {
otherwise: 'CoApplicantDisagreePage'
},
CoApplicantAgreePage: 'CoApplicantAgreePage',
CoApplicantDisagreePage: 'CoApplicantDisagreePage'
CoApplicantDisagreePage: 'CoApplicantDisagreePage',
ProvideInformation: {
responseOrDocument: 'ReviewResponse',
isUploadingDocument: 'ProvideInformation',
otherwise: 'CitizensHub'
},
ReviewResponse: 'CitizensHub'
};

module.exports.stepList = stepList;
Expand Down
9 changes: 5 additions & 4 deletions app/middleware/documentUpload.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const returnError = (req, res, next, error) => {
return res.send(error.js);
}
req.session.form.documents.error = error.nonJs;
console.info(`Uploaded document returnError error: ${req.session.form.documents.error}`);
next();
};

Expand All @@ -46,9 +47,9 @@ const uploadDocument = (req, res, next) => {
formdata = documentUpload.initDocuments(formdata);
const uploads = formdata.documents.uploads;
const error = documentUpload.validate(uploadedDocument, uploads, maxFileSize, req.session.language);

console.info('uploadDocument documentUpload.validate error:' + error);
if (error === null) {
req.log.info('Uploaded document passed frontend validation');
req.log.info(`Uploaded document passed frontend validation for case: ${req.session.form.ccdCase.id}`);
const document = new Document(config.services.orchestrator.url, req.sessionID);
document.post(req.session.regId, uploadedDocument, req.authToken, req.session.serviceAuthorization)
.then(result => {
Expand All @@ -58,7 +59,7 @@ const uploadDocument = (req, res, next) => {
req.session.form.documents.uploads = documentUpload.addDocument(filename, resultBody, uploads);
next();
} else {
req.log.error('Uploaded document failed backend validation');
req.log.error(`Uploaded document failed backend validation for case: ${req.session.form.ccdCase.id}`);
const errorType = Object.entries(config.documentUpload.error).filter(value => value[1] === resultBody)[0][0];
const error = documentUpload.mapError(req.session.language, errorType);
returnError(req, res, next, error);
Expand All @@ -85,7 +86,7 @@ const removeDocument = (req, res, next) => {
.then(() => {
req.session.form.documents.uploads = documentUpload.removeDocument(index, uploads);
persistFormData(req.session.form.ccdCase.id, req.session.form, req.session.regId, req);
res.redirect('/document-upload');
res.redirect('/provide-information');
})
.catch((err) => {
next(err);
Expand Down
5 changes: 3 additions & 2 deletions app/resources/cy/translation/applicant/alias.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"title": "Enw arall y ceisydd",
"question": "Sut mae eich enw wedi cael ei ysgrifennu ar yr ewyllys?",
"question": "Sut mae eich enw wedi cael ei ysgrifennu yn yr ewyllys neu unrhyw godisiliau?",
"alias": "Enw",
"nameOnWill": "Enw ar yr ewyllys",
"nameOnWillQuestionSummary": "Eich enw fel y mae wedi ei ysgrifennu yn yr ewyllys",

"errors": {
"alias": {
"required": "Nodwch yr enw fel y mae&rsquo;n ymddangos ar yr ewyllys"
"required": "Rhowch eich enw fel y mae wedi'i ysgrifennu ar yr ewyllys"
}
}
}
18 changes: 11 additions & 7 deletions app/resources/cy/translation/applicant/aliasreason.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
{
"title": "Enw arall y ceisydd",
"question": "Beth yw&rsquo;r rheswm dros y newid enw?",
"optionMarriage": "Priodas",
"optionDivorce": "Ysgariad",
"optionDeedPoll": "Gweithred newid enw",
"question": "Pam fod eich enw yn wahanol i’r ffordd y mae wedi’i ysgrifennu yn yr ewyllys neu unrhyw godisiliau?",
"content1": "Rhaid i chi egluro'r rheswm am y gwahaniaeth, er enghraifft, rydych wedi newid eich enw ers ysgrifennwyd yr ewyllys, neu ni chynhwyswyd eich enw canol.",
"optionMarriage": "Priodais neu ffurfiais bartneriaeth sifil",
"optionDivorce": "Cefais ysgariad neu daeth fy mhartneriaeth sifil i ben",
"optionDeedPoll": "Newidiais fy enw trwy weithred newid enw",
"optionDifferentSpelling": "Cafodd fy enw ei sillafu’n wahanol",
"optionPartOfNameNotIncluded": "Ni chynhwyswyd rhan o fy enw",
"optionOther": "Arall",
"optionOtherHint": "Rheswm dros newid enw",
"optionOtherHint": "Rheswm dros y gwahaniaeth",
"reasonForNameChangeQuestionSummary": "Pam fod eich enw yn wahanol yn yr ewyllys?",

"errors": {
"aliasReason": {
"required": "Dewiswch reswm dros y newid enw"
"required": "Dewiswch reswm dros pam fod eich enw yn wahanol"
},
"otherReason": {
"required": "Nodwch y rheswm dros y newid enw"
"required": "Rhowch y rheswm dros y gwahaniaeth"
}
}
}
4 changes: 4 additions & 0 deletions app/resources/cy/translation/applicant/name.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{
"title": "Enw&rsquo;r ceisydd",
"question": "Beth yw eich enw llawn?",
"content1": "Bydd yr enw a roddwch inni yn cael ei ysgrifennu ar y grant profiant.",
"content2": "Dylai eich enw fod union yr un fath ag y mae wedi’i ysgrifennu ar eich pasbort neu fath arall o ddogfen adnabod awdurdodedig, er enghraifft trwydded yrru.",
"content3": "Dylech wneud yn siŵr mai dyma’r un math o brawf adnabod a ddefnyddiwch pan fyddwch yn delio ag ystad yr unigolyn sydd wedi marw.",
"firstName": "Enw cyntaf ac unrhyw enwau canol",
"lastName": "Cyfenw",
"warningText": "Os nad yw’r enw ar y grant yn cyfateb i’r prawf adnabod a ddefnyddiwch, efallai y cewch anawsterau wrth ddelio â’r ystad.",

"errors": {
"firstName": {
Expand Down
15 changes: 12 additions & 3 deletions app/resources/cy/translation/applicant/nameasonwill.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
{
"title": "Enw&rsquo;r ceisydd ar yr ewyllys",
"question": "A yw eich enw &lsquo;{applicantName}&rsquo; union beth sy&rsquo;n ymddangos ar yr ewyllys?",
"reminder": "Gwiriwch yr ewyllys a’r codisiliau gwreiddiol nawr",
"question": "A ydy {applicantName} yn union yr un fath â sut mae eich enw wedi ei ysgrifennu yn yr ewyllys?",
"questionWithoutName": "A yw eich enw union beth sy&rsquo;n ymddangos ar yr ewyllys?",
"questionWithCodicil": "A yw eich enw &lsquo;{applicantName}&rsquo; union beth sy&rsquo;n ymddangos ar yr ewyllys neu&rsquo;r codisil?",
"questionWithoutNameWithCodicil": "A yw eich enw union beth sy’n ymddangos ar yr ewyllys neu unrhyw godisiliau?",
"questionWithCodicil": "Ai {applicantName} yw sut mae eich enw wedi ei ysgrifennu yn union yn yr ewyllys neu unrhyw godisiliau?",
"content1": "Mae angen i ni wybod a yw eich enw wedi’i ysgrifennu’n wahanol yn yr ewyllys neu mewn unrhyw godisiliau.",
"content2": "Fe allai hyn fod oherwydd:",
"listItem1": "gwnaethoch newid eich enw ar ôl gwneud yr ewyllys",
"listItem2": "ni chynhwyswyd rhan o’ch enw yn yr ewyllys",
"listItem3": "roedd camgymeriad sillafu yn yr ewyllys",
"listItem4": "rydych hefyd yn cael eich adnabod dan enw gwahanol",
"content3": "Os oes gwahaniaeth, byddwch yn gallu dweud wrthym pam yn ddiweddarach.",
"optionYes": "Ydi",
"optionNo": "Nac ydi",

"errors": {
"nameAsOnTheWill": {
"required": "Atebwch &lsquo;ydi&rsquo; os yw eich enw union beth sy&rsquo;n ymddangos ar yr ewyllys neu&rsquo;r codisil"
"required": "Atebwch &lsquo;ydy&rsquo; os yw'ch enw'n union yr un fath ar yr ewyllys neu'r codisil"
}
}
}
Loading

0 comments on commit a1e82ba

Please sign in to comment.