Skip to content

Commit

Permalink
Merge pull request #1647 from govuk-one-login/aut-2841-contact-form-a…
Browse files Browse the repository at this point in the history
…dd-new-radio-buttons

AUT-2841 - add new radio button options into "A problem proving your identity" contact form
  • Loading branch information
dbes-gds authored Jun 5, 2024
2 parents c1cccde + 35ea15d commit 5bf2738
Show file tree
Hide file tree
Showing 17 changed files with 97 additions and 14 deletions.
1 change: 1 addition & 0 deletions ci/terraform/authdev1.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ support_authorize_controller = "1"
support_2fa_b4_password_reset = "1"
support_check_email_fraud = "1"
language_toggle_enabled = "1"
no_photo_id_contact_forms = "1"

frontend_task_definition_cpu = 512
frontend_task_definition_memory = 1024
Expand Down
1 change: 1 addition & 0 deletions ci/terraform/authdev2.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ support_authorize_controller = "1"
support_2fa_b4_password_reset = "1"
support_check_email_fraud = "1"
language_toggle_enabled = "1"
no_photo_id_contact_forms = "1"

frontend_task_definition_cpu = 512
frontend_task_definition_memory = 1024
Expand Down
1 change: 1 addition & 0 deletions ci/terraform/build.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
1 change: 1 addition & 0 deletions ci/terraform/dev.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,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 = []

Expand Down
4 changes: 4 additions & 0 deletions ci/terraform/ecs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions ci/terraform/integration.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ support_authorize_controller = "1"
support_2fa_b4_password_reset = "1"
support_2hr_lockout = "1"
support_reauthentication = "1"
no_photo_id_contact_forms = "0"

code_request_blocked_minutes = "120"
account_recovery_code_entered_wrong_blocked_minutes = "120"
Expand Down
1 change: 1 addition & 0 deletions ci/terraform/production.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,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"

Expand Down
1 change: 1 addition & 0 deletions ci/terraform/sandpit.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ support_account_interventions = "1"
support_2fa_b4_password_reset = "1"
support_check_email_fraud = "1"
language_toggle_enabled = "1"
no_photo_id_contact_forms = "0"


frontend_task_definition_cpu = 512
Expand Down
1 change: 1 addition & 0 deletions ci/terraform/staging.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ reduced_code_block_duration_minutes = "15"
support_reauthentication = "1"
language_toggle_enabled = "1"
prove_identity_welcome_enabled = "0"
no_photo_id_contact_forms = "1"

url_for_support_links = "https://home.staging.account.gov.uk/contact-gov-uk-one-login"

Expand Down
6 changes: 6 additions & 0 deletions ci/terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions scripts/_create_env_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
},
{
Expand Down
8 changes: 7 additions & 1 deletion src/components/contact-us/contact-us-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -360,6 +364,7 @@ export function furtherInformationGet(req: Request, res: Response): void {
...(getAppErrorCode(req.query.appErrorCode as string) && {
appErrorCode: getAppErrorCode(req.query.appErrorCode as string),
}),
supportNoPhotoIdContactForms: supportNoPhotoIdContactForms(),
});
}

Expand All @@ -374,6 +379,7 @@ export function furtherInformationGet(req: Request, res: Response): void {
referer: encodeValue(
validateReferer(req.query.referer as string, serviceDomain)
),
supportNoPhotoIdContactForms: supportNoPhotoIdContactForms(),
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -34,14 +25,45 @@
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'])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Request>;
Expand Down Expand Up @@ -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,
}
);
});
Expand All @@ -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,
}
);
});
Expand Down Expand Up @@ -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;
});
});
});
4 changes: 4 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand Down
5 changes: 5 additions & 0 deletions src/locales/cy/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1771,6 +1771,11 @@
"radio3": "Mae angen i chi ddiweddaru eich gwybodaeth bersonol",
"radio4": "Roedd problem dechnegol (er enghraifft fe welsoch neges gwall)",
"radio5": "Rhywbeth arall",
"radio6": "Cawsoch broblem gyda’ch manylion banc neu gymdeithas adeiladu",
"radio7": {
"label": "Cawsoch broblem gyda’ch rhif Yswiriant Gwladol",
"hint": "Gallwch ddarllen mwy am gael neu ddod o hyd i’ch rhif Yswiriant Gwladol yn <a href=\"https://www.gov.uk/rhif-yswiriant-gwladol-coll\" class=\"govuk-link\" rel=\"noreferrer noopener\" target=\"_blank\">www.gov.uk/rhif-yswiriant-gwladol-coll</a>"
},
"errorMessage": "Dewiswch y broblem oedd gennych wrth brofi eich hunaniaeth"
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1771,6 +1771,11 @@
"radio3": "You need to update your personal information",
"radio4": "There was a technical problem (for example, you saw an error message)",
"radio5": "Something else",
"radio6": "You had a problem with your bank or building society details",
"radio7": {
"label": "You had a problem with your National insurance number",
"hint": "You can read more about getting or finding your National Insurance number at <a href=\"https://www.gov.uk/find-national-insurance-number\" class=\"govuk-link\" rel=\"noreferrer noopener\" target=\"_blank\">www.gov.uk/find-national-insurance-number</a>"
},
"errorMessage": "Select the problem you had proving your identity"
}
}
Expand Down

0 comments on commit 5bf2738

Please sign in to comment.