diff --git a/src/app.constants.ts b/src/app.constants.ts index faad4960aa..73dab1f491 100644 --- a/src/app.constants.ts +++ b/src/app.constants.ts @@ -244,6 +244,7 @@ export enum JOURNEY_TYPE { export enum CHANNEL { WEB = "web", STRATEGIC_APP = "strategic_app", + GENERIC_APP = "generic_app", } export const ENVIRONMENT_NAME = { diff --git a/src/components/account-created/account-created-controller.ts b/src/components/account-created/account-created-controller.ts index d3e16cc882..bc15b232d3 100644 --- a/src/components/account-created/account-created-controller.ts +++ b/src/components/account-created/account-created-controller.ts @@ -7,7 +7,6 @@ export function accountCreatedGet(req: Request, res: Response): void { res.render("account-created/index.njk", { serviceType, name, - strategicAppChannel: res.locals.strategicAppChannel, }); } diff --git a/src/components/account-created/index.njk b/src/components/account-created/index.njk index e215eabc79..f06fa99e48 100644 --- a/src/components/account-created/index.njk +++ b/src/components/account-created/index.njk @@ -20,7 +20,7 @@ }) }} {% else %} - {% if strategicAppChannel === true %} + {% if isApp %}
{{'mobileAppPages.accountCreated.text' | translate}}
{% else %}{{'pages.accountCreated.text' | translate}}
diff --git a/src/components/account-created/tests/account-created-controller.test.ts b/src/components/account-created/tests/account-created-controller.test.ts index 4cc3162e3c..a7e9077d37 100644 --- a/src/components/account-created/tests/account-created-controller.test.ts +++ b/src/components/account-created/tests/account-created-controller.test.ts @@ -34,21 +34,8 @@ describe("account created controller", () => { expect(res.render).to.have.been.calledWith("account-created/index.njk"); }); - - it("should pass through the strategicAppChannel", () => { - req.session.client.serviceType = "MANDATORY"; - req.session.client.name = "test client name"; - res.locals.strategicAppChannel = true; - - accountCreatedGet(req as Request, res as Response); - - expect(res.render).to.have.been.calledWith("account-created/index.njk", { - serviceType: "MANDATORY", - name: "test client name", - strategicAppChannel: true, - }); - }); }); + describe("accountCreatedPost", () => { it("should redirect to auth code", async () => { await accountCreatedPost(req as Request, res as Response); diff --git a/src/components/account-not-found/account-not-found-controller.ts b/src/components/account-not-found/account-not-found-controller.ts index f10ace29d2..ee52739ad8 100644 --- a/src/components/account-not-found/account-not-found-controller.ts +++ b/src/components/account-not-found/account-not-found-controller.ts @@ -17,7 +17,7 @@ export function accountNotFoundGet(req: Request, res: Response): void { const template: string = getAccountNotFoundTemplate( clientIsOneLogin(req), req.session.client.serviceType, - res.locals.strategicAppChannel + res.locals.isApp ); res.render(template, { diff --git a/src/components/account-not-found/get-account-not-found-template.ts b/src/components/account-not-found/get-account-not-found-template.ts index c8f0a7d898..990c8d130a 100644 --- a/src/components/account-not-found/get-account-not-found-template.ts +++ b/src/components/account-not-found/get-account-not-found-template.ts @@ -6,7 +6,7 @@ import { getChannelSpecificTemplate } from "../../utils/get-channel-specific-tem export function getAccountNotFoundTemplate( isOneLoginService: boolean, serviceType: string, - isStrategicAppChannel: boolean + isApp: boolean ): string { let webTemplate; @@ -20,7 +20,7 @@ export function getAccountNotFoundTemplate( return getChannelSpecificTemplate( webTemplate, - isStrategicAppChannel, + isApp, WEB_TO_MOBILE_TEMPLATE_MAPPINGS ); } diff --git a/src/components/account-not-found/tests/account-not-found-controller.test.ts b/src/components/account-not-found/tests/account-not-found-controller.test.ts index 49d5091945..dab62e1099 100644 --- a/src/components/account-not-found/tests/account-not-found-controller.test.ts +++ b/src/components/account-not-found/tests/account-not-found-controller.test.ts @@ -25,7 +25,7 @@ describe("account not found controller", () => { }); describe("accountNotFoundGet", () => { - describe("when strategicAppChannel is not defined", () => { + describe("when isApp is not defined", () => { it("should render the account not found mandatory view when serviceType undefined", () => { accountNotFoundGet(req, res); @@ -53,9 +53,9 @@ describe("account not found controller", () => { }); }); - describe("when strategicAppChannel is false", () => { + describe("when isApp is false", () => { beforeEach(() => { - res.locals.strategicAppChannel = false; + res.locals.isApp = false; }); it("should render the account not found mandatory view when serviceType undefined", () => { @@ -85,9 +85,9 @@ describe("account not found controller", () => { }); }); - describe("when strategicAppChannel is true", () => { + describe("when isApp is true", () => { beforeEach(() => { - res.locals.strategicAppChannel = true; + res.locals.isApp = true; }); it("should render the account not found mandatory view when serviceType undefined", () => { @@ -100,6 +100,7 @@ describe("account not found controller", () => { it("should render the account not found optional view when serviceType optional", () => { req.session.client.serviceType = SERVICE_TYPE.OPTIONAL; + accountNotFoundGet(req, res); expect(res.render).to.have.calledWith( @@ -109,6 +110,7 @@ describe("account not found controller", () => { it("should render the account not found optional view when the service is part of One Login", () => { req.session.client.isOneLoginService = true; + accountNotFoundGet(req, res); expect(res.render).to.have.calledWith( diff --git a/src/components/account-not-found/tests/get-account-not-found-template.test.ts b/src/components/account-not-found/tests/get-account-not-found-template.test.ts index 53e648d7ff..2a41f5ce9b 100644 --- a/src/components/account-not-found/tests/get-account-not-found-template.test.ts +++ b/src/components/account-not-found/tests/get-account-not-found-template.test.ts @@ -3,7 +3,7 @@ import { describe } from "mocha"; import { getAccountNotFoundTemplate } from "../get-account-not-found-template.js"; import { SERVICE_TYPE } from "../../../app.constants.js"; describe("getAccountNotFoundWebTemplate", () => { - describe("when isStrategicApp is false", () => { + describe("when isApp is false", () => { describe("when isOneLoginService is true", () => { it("should always return 'account-not-found/index-one-login.njk'", () => { [SERVICE_TYPE.OPTIONAL, SERVICE_TYPE.MANDATORY].forEach((i) => { @@ -31,7 +31,7 @@ describe("getAccountNotFoundWebTemplate", () => { }); }); - describe("when isStrategicApp is true", () => { + describe("when isApp is true", () => { describe("when isOneLoginService is true", () => { it("should always return 'account-not-found/index-mobile.njk'", () => { [SERVICE_TYPE.OPTIONAL, SERVICE_TYPE.MANDATORY].forEach((i) => { diff --git a/src/components/common/errors/session-expired.njk b/src/components/common/errors/session-expired.njk index 647333235f..35396e974e 100644 --- a/src/components/common/errors/session-expired.njk +++ b/src/components/common/errors/session-expired.njk @@ -9,7 +9,7 @@{{ 'error.timeoutError.content.paragraph1' | translate }}
{{ 'error.timeoutError.content.whatYouCanDo' | translate }}
- {% if strategicAppChannel === true %} + {% if isApp %}{{ 'mobileAppError.timeoutError.content.paragraph2' | translate }}
{% else %}{{ 'error.timeoutError.content.paragraph2' | translate }}
diff --git a/src/components/common/layout/base.njk b/src/components/common/layout/base.njk index 9944e5dfd0..262fa135cd 100644 --- a/src/components/common/layout/base.njk +++ b/src/components/common/layout/base.njk @@ -6,7 +6,7 @@ {% from "../header/macro.njk" import strategicAppHeader %} -{% if strategicAppChannel == true %} +{% if isApp %} {% set htmlClasses = 'govuk-template__mobile' %} {% endif %} @@ -53,7 +53,7 @@ {% set phaseBannerClasses = "test-banner" if showTestBanner %} {% block header %} - {% if strategicAppChannel %} + {% if isApp %} {{ strategicAppHeader({ useTudorCrown: true, classes: phaseBannerClasses @@ -90,7 +90,7 @@ {% block main %}{{'pages.createPassword.termsOfUse.paragraph1' | translate}}
-{% if strategicAppChannel %} +{% if isApp %} {% set bullet1LinkText = 'pages.createPassword.termsOfUse.bullet1LinkTextApp' %} {% set bullet2LinkText = 'pages.createPassword.termsOfUse.bullet2LinkTextApp' %} {% else %} diff --git a/src/components/enter-email/index-re-enter-email-account.njk b/src/components/enter-email/index-re-enter-email-account.njk index 2675f7e823..697c02de4c 100644 --- a/src/components/enter-email/index-re-enter-email-account.njk +++ b/src/components/enter-email/index-re-enter-email-account.njk @@ -14,13 +14,13 @@