diff --git a/ci/terraform/build.tfvars b/ci/terraform/build.tfvars index 26798cec02..d42ca6e6b2 100644 --- a/ci/terraform/build.tfvars +++ b/ci/terraform/build.tfvars @@ -26,6 +26,7 @@ code_entered_wrong_blocked_minutes = "1" reduced_code_block_duration_minutes = "0.5" url_for_support_links = "https://home.build.account.gov.uk/contact-gov-uk-one-login" language_toggle_enabled = "1" +no_photo_id_contact_forms = "1" logging_endpoint_arns = [ diff --git a/ci/terraform/dev.tfvars b/ci/terraform/dev.tfvars index 9211e8f98b..cd57b62daf 100644 --- a/ci/terraform/dev.tfvars +++ b/ci/terraform/dev.tfvars @@ -25,6 +25,7 @@ code_entered_wrong_blocked_minutes = "1" reduced_code_block_duration_minutes = "0.5" url_for_support_links = "https://home.dev.account.gov.uk/contact-gov-uk-one-login" language_toggle_enabled = "1" +no_photo_id_contact_forms = "1" logging_endpoint_arns = [] diff --git a/ci/terraform/ecs.tf b/ci/terraform/ecs.tf index 033de4a227..ba2c11e545 100644 --- a/ci/terraform/ecs.tf +++ b/ci/terraform/ecs.tf @@ -160,6 +160,10 @@ locals { name = "SUPPORT_2HR_LOCKOUT" value = var.support_2hr_lockout }, + { + name = "NO_PHOTO_ID_CONTACT_FORMS" + value = var.no_photo_id_contact_forms + }, { name = "SUPPORT_CHECK_EMAIL_FRAUD" value = var.support_check_email_fraud diff --git a/ci/terraform/integration.tfvars b/ci/terraform/integration.tfvars index a275a129c2..d13d1589f9 100644 --- a/ci/terraform/integration.tfvars +++ b/ci/terraform/integration.tfvars @@ -11,6 +11,7 @@ support_authorize_controller = "1" support_2fa_b4_password_reset = "1" support_2hr_lockout = "1" support_reauthentication = "1" +no_photo_id_contact_forms = "1" code_request_blocked_minutes = "120" account_recovery_code_entered_wrong_blocked_minutes = "120" diff --git a/ci/terraform/production.tfvars b/ci/terraform/production.tfvars index eb7a6bd286..b51308fb02 100644 --- a/ci/terraform/production.tfvars +++ b/ci/terraform/production.tfvars @@ -19,6 +19,7 @@ code_entered_wrong_blocked_minutes = "120" email_entered_wrong_blocked_minutes = "120" password_reset_code_entered_wrong_blocked_minutes = "120" reduced_code_block_duration_minutes = "15" +no_photo_id_contact_forms = "0" url_for_support_links = "https://home.account.gov.uk/contact-gov-uk-one-login" diff --git a/ci/terraform/staging.tfvars b/ci/terraform/staging.tfvars index bbfac6e1dd..febc7c96dd 100644 --- a/ci/terraform/staging.tfvars +++ b/ci/terraform/staging.tfvars @@ -27,6 +27,7 @@ password_reset_code_entered_wrong_blocked_minutes = "120" reduced_code_block_duration_minutes = "15" support_reauthentication = "1" language_toggle_enabled = "1" +no_photo_id_contact_forms = "1" url_for_support_links = "https://home.staging.account.gov.uk/contact-gov-uk-one-login" diff --git a/ci/terraform/variables.tf b/ci/terraform/variables.tf index 834bb14219..457d2982f1 100644 --- a/ci/terraform/variables.tf +++ b/ci/terraform/variables.tf @@ -235,6 +235,12 @@ variable "support_2hr_lockout" { default = "0" } +variable "no_photo_id_contact_forms" { + description = "When true enables no photo id contact forms" + type = string + default = "0" +} + variable "support_account_interventions" { description = "When true, turns on account interventions in environment" type = string diff --git a/scripts/_create_env_file.py b/scripts/_create_env_file.py index 198a72ad52..111b726ba9 100644 --- a/scripts/_create_env_file.py +++ b/scripts/_create_env_file.py @@ -92,6 +92,8 @@ class EnvFileSection(TypedDict): "SUPPORT_REAUTHENTICATION": 1, "SUPPORT_2HR_LOCKOUT": 1, "SUPPORT_CHECK_EMAIL_FRAUD": 1, + "NO_PHOTO_ID_CONTACT_FORMS": 1, + "LANGUAGE_TOGGLE_ENABLED": 1, }, }, { diff --git a/src/components/contact-us/contact-us-controller.ts b/src/components/contact-us/contact-us-controller.ts index 4782e82e44..60d577afa2 100644 --- a/src/components/contact-us/contact-us-controller.ts +++ b/src/components/contact-us/contact-us-controller.ts @@ -11,7 +11,11 @@ import { Questions, ThemeQuestions } from "./types"; import { ExpressRouteFunc } from "../../types"; import crypto from "crypto"; import { logger } from "../../utils/logger"; -import { getServiceDomain, getSupportLinkUrl } from "../../config"; +import { + getServiceDomain, + getSupportLinkUrl, + supportNoPhotoIdContactForms, +} from "../../config"; import { contactUsServiceSmartAgent } from "./contact-us-service-smart-agent"; const themeToPageTitle = { @@ -356,6 +360,7 @@ export function furtherInformationGet(req: Request, res: Response): void { ...(getAppErrorCode(req.query.appErrorCode as string) && { appErrorCode: getAppErrorCode(req.query.appErrorCode as string), }), + supportNoPhotoIdContactForms: supportNoPhotoIdContactForms(), }); } @@ -370,6 +375,7 @@ export function furtherInformationGet(req: Request, res: Response): void { referer: encodeValue( validateReferer(req.query.referer as string, serviceDomain) ), + supportNoPhotoIdContactForms: supportNoPhotoIdContactForms(), }); } diff --git a/src/components/contact-us/further-information/_proving-identity-further-information.njk b/src/components/contact-us/further-information/_proving-identity-further-information.njk index 378a260991..9a455b7ae6 100644 --- a/src/components/contact-us/further-information/_proving-identity-further-information.njk +++ b/src/components/contact-us/further-information/_proving-identity-further-information.njk @@ -11,16 +11,7 @@ {% include 'contact-us/questions/_id-check-app-hidden-fields.njk' %} - {{ govukRadios({ - name: "subtheme", - fieldset: { - legend: { - text: 'pages.contactUsFurtherInformation.provingIdentity.section1.header' | translate, - isPageHeading: false, - classes: "govuk-fieldset__legend--m" - } - }, - items: [ + {% set items = [ { value: "proving_identity_problem_answering_security_questions", text: 'pages.contactUsFurtherInformation.provingIdentity.section1.radio1' | translate @@ -29,30 +20,50 @@ value: "proving_identity_problem_with_identity_document", text: 'pages.contactUsFurtherInformation.provingIdentity.section1.radio2' | translate }, - { - value: "proving_identity_problem_with_bank_building_society_details", - text: 'pages.contactUsFurtherInformation.provingIdentity.section1.radio6' | translate - }, - { - value: "proving_identity_problem_with_national_insurance_number", - text: 'pages.contactUsFurtherInformation.provingIdentity.section1.radio7.label' | translate, - hint: { - text: 'pages.contactUsFurtherInformation.provingIdentity.section1.radio7.hint' | translate | safe - } - }, { value: "proving_identity_need_to_update_personal_information", text: 'pages.contactUsFurtherInformation.provingIdentity.section1.radio3' | translate }, { - value: "proving_identity_technical_problem", - text: 'pages.contactUsFurtherInformation.provingIdentity.section1.radio4' | translate + value: "proving_identity_technical_problem", + text: 'pages.contactUsFurtherInformation.provingIdentity.section1.radio4' | translate }, { value: "proving_identity_something_else", text: 'pages.contactUsFurtherInformation.provingIdentity.section1.radio5' | translate } - ], + ] + %} + + {% if supportNoPhotoIdContactForms %} + {% set no_photo_id_bank_item = { + value: "proving_identity_problem_with_bank_building_society_details", + text: 'pages.contactUsFurtherInformation.provingIdentity.section1.radio6' | translate + } + %} + + {% set no_photo_id_nin_item = { + value: "proving_identity_problem_with_national_insurance_number", + text: 'pages.contactUsFurtherInformation.provingIdentity.section1.radio7.label' | translate, + hint: { + text: 'pages.contactUsFurtherInformation.provingIdentity.section1.radio7.hint' | translate | safe + } + } + %} + {% set items = (items.splice(2, 0, no_photo_id_bank_item), items) %} + {% set items = (items.splice(3, 0, no_photo_id_nin_item), items) %} + {% endif %} + + {{ govukRadios({ + name: "subtheme", + fieldset: { + legend: { + text: 'pages.contactUsFurtherInformation.provingIdentity.section1.header' | translate, + isPageHeading: false, + classes: "govuk-fieldset__legend--m" + } + }, + items: items, errorMessage: { text: errors['subtheme'].text } if (errors['subtheme']) diff --git a/src/components/contact-us/tests/contact-us-further-information-controller.test.ts b/src/components/contact-us/tests/contact-us-further-information-controller.test.ts index 230969e495..46d24c49ba 100644 --- a/src/components/contact-us/tests/contact-us-further-information-controller.test.ts +++ b/src/components/contact-us/tests/contact-us-further-information-controller.test.ts @@ -10,6 +10,8 @@ import { import { PATH_NAMES, CONTACT_US_THEMES } from "../../../app.constants"; import { RequestGet, ResponseRedirect } from "../../../types"; +import { supportNoPhotoIdContactForms } from "../../../config"; + describe("contact us further information controller", () => { let sandbox: sinon.SinonSandbox; let req: Partial; @@ -44,6 +46,7 @@ describe("contact us further information controller", () => { theme: "signing_in", referer: encodeURIComponent(REFERER), hrefBack: `${PATH_NAMES.CONTACT_US}?theme=${CONTACT_US_THEMES.SIGNING_IN}`, + supportNoPhotoIdContactForms: false, } ); }); @@ -60,6 +63,7 @@ describe("contact us further information controller", () => { theme: "account_creation", referer: encodeURIComponent(REFERER), hrefBack: `${PATH_NAMES.CONTACT_US}?theme=${CONTACT_US_THEMES.ACCOUNT_CREATION}`, + supportNoPhotoIdContactForms: false, } ); }); @@ -197,4 +201,21 @@ describe("contact us further information controller", () => { ); }); }); + + describe("supportNoPhotoIdContactForms() with the support No photo id contact forms", () => { + it("should return true when NO_PHOTO_ID_CONTACT_FORMS is set to '1'", async () => { + process.env.NO_PHOTO_ID_CONTACT_FORMS = "1"; + expect(supportNoPhotoIdContactForms()).to.be.true; + }); + + it("should return false when NO_PHOTO_ID_CONTACT_FORMS is set to '0'", async () => { + process.env.NO_PHOTO_ID_CONTACT_FORMS = "0"; + expect(supportNoPhotoIdContactForms()).to.be.false; + }); + + it("should return false when NO_PHOTO_ID_CONTACT_FORMS is undefined", async () => { + process.env.NO_PHOTO_ID_CONTACT_FORMS = undefined; + expect(supportNoPhotoIdContactForms()).to.be.false; + }); + }); }); diff --git a/src/config.ts b/src/config.ts index dcb4868ab4..d71f6ca518 100644 --- a/src/config.ts +++ b/src/config.ts @@ -171,6 +171,10 @@ export function support2hrLockout(): boolean { return process.env.SUPPORT_2HR_LOCKOUT === "1"; } +export function supportNoPhotoIdContactForms(): boolean { + return process.env.NO_PHOTO_ID_CONTACT_FORMS === "1"; +} + export function supportAccountInterventions(): boolean { return process.env.SUPPORT_ACCOUNT_INTERVENTIONS === "1"; }