Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BRP-5: Re-route duplicate application requests to separate email address. #769

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

SarahJaneLuff
Copy link
Contributor

@SarahJaneLuff SarahJaneLuff commented Jun 1, 2023

Changes

  • behaviours/email.js changed to include setSubmissionReference and addSubmissionReference functions to check if report has previously been submitted.
  • models/email.js updated to include isResubmission property.
  • email/index.js updated to include switch statement to change between the two mail boxes.
  • behaviours/email.spec.js and models/email.spec.js updated for unit tests to support the new logic.
  • drone.yml updated to include new sonar scanner image.
  • index.js changed for all paths to include new 'previous-submission' step.
  • /views/previous-submission.html template page created for all route.
  • /common/fields/previous-submission.js changed to include new 'previous submission' fields.
  • /common/translations/src/en/fields.json changed to include lable options for new 'previous submission' radio group.
  • config.js update to include CASEWORKER_DUPLICATE_EMAIL env variable.
  • Acceptance tests updated to include new 'previous-submission' page and fields.

…ess.

	* behaviours/email.js changed to include setSubmissionReference and addSubmissionReference functions to check if report has previously been submitted.
	* models/email.js updated to include isResubmission property.
	* email/index.js updated to include switch statement to change between the two mail boxes.
	* behaviours/email.spec.js and models/email.spec.js updated for unit tests to support the new logic.
@SarahJaneLuff SarahJaneLuff changed the title Brp 5 email testing BRP-5: Re-route duplicate application requests to separate email address. Jun 6, 2023
@@ -41,7 +41,7 @@ unit_tests: &unit_tests

sonar_scanner: &sonar_scanner
pull: if-not-exists
image: quay.io/ukhomeofficedigital/sonar-scanner-node:549b75f593f28da1c4a0a6f79877ec69d3b21037
image: quay.io/ukhomeofficedigital/sonar-scanner-nodejs:latest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s usually good idea to avoid latest as it will keep updating the image for every deployment to the latest one. Ideally it’ll be good to take a specific sha

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you give this one a try sha256:dcc00d2581fdca090c171d4ae53d2a49b3a3bbb08a96cdaa4933a041d0ba2a42

@@ -41,7 +41,7 @@ unit_tests: &unit_tests

sonar_scanner: &sonar_scanner
pull: if-not-exists
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it doesn't work just add a comment saying usually good practice is to have a version number a sha pointing to the image because you don't want to grab the latest one in case it gets updated

function errorChecked(key, data) {
if (data[key + '-checkbox']) {
return key;
}
}

function setSubmissionReference(data) {
// This function is responsible for storing a submission referene if one is required
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// This function is responsible for storing a submission referene if one is required
// This function is responsible for storing a submission reference if one is required

let recipientEmailAddress = config.email.caseworker[email.template];
// If it's a resubmission, we should be sending them through to the new duplicate inbox
// Else we continue to send to the original caseworker inbox
let recipientEmailAddress = email.isResubmission ?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it be a const

Copy link
Contributor

@sulthan-ahmed sulthan-ahmed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, well done @SarahJaneLuff for putting all of this together from various other people's work and adding the salt and pepper

o and just some minor things to look at

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants