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

OLH-1204 - Clean up webchat demo code. #1097

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ SESSION_STORE_TABLE_NAME=account-mgmt-frontend-SessionStore
SUPPORT_ACTIVITY_LOG=1
ACTIVITY_LOG_STORE_TABLE_NAME=activity_logs
SUPPORT_TRIAGE_PAGE=1
SUPPORT_WEBCHAT_DEMO=1
WEBCHAT_SOURCE_URL=https://dev-chat-loader.smartagent.app/loader/main.js
SUPPORT_WEBCHAT_CONTACT=1
SUPPORT_PHONE_CONTACT=1
Expand Down
12 changes: 0 additions & 12 deletions deploy/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ Mappings:
SERVICEDOMAIN: "dev.account.gov.uk"
LOGSLEVEL: "debug"
SUPPORTTRIAGEPAGE: "1"
SUPPORTWEBCHATDEMO: "1"
WEBCHATSOURCEURL: "https://uat-chat-loader.smartagent.app/loader/main.js"
SUPPORTWEBCHATCONTACT: "0"
SUPPORTPHONECONTACT: "1"
Expand All @@ -163,7 +162,6 @@ Mappings:
SERVICEDOMAIN: "build.account.gov.uk"
LOGSLEVEL: "debug"
SUPPORTTRIAGEPAGE: "1"
SUPPORTWEBCHATDEMO: "1"
WEBCHATSOURCEURL: "https://uat-chat-loader.smartagent.app/loader/main.js"
SUPPORTWEBCHATCONTACT: "0"
SUPPORTPHONECONTACT: "0"
Expand All @@ -184,7 +182,6 @@ Mappings:
SERVICEDOMAIN: "staging.account.gov.uk"
LOGSLEVEL: "info"
SUPPORTTRIAGEPAGE: "1"
SUPPORTWEBCHATDEMO: "1"
WEBCHATSOURCEURL: "https://uat-chat-loader.smartagent.app/loader/main.js"
SUPPORTWEBCHATCONTACT: "1"
SUPPORTPHONECONTACT: "1"
Expand All @@ -205,7 +202,6 @@ Mappings:
SERVICEDOMAIN: "integration.account.gov.uk"
LOGSLEVEL: "info"
SUPPORTTRIAGEPAGE: "1"
SUPPORTWEBCHATDEMO: "1"
WEBCHATSOURCEURL: "https://uat-chat-loader.smartagent.app/loader/main.js"
SUPPORTWEBCHATCONTACT: "0"
SUPPORTPHONECONTACT: "1"
Expand All @@ -226,7 +222,6 @@ Mappings:
SERVICEDOMAIN: "account.gov.uk"
LOGSLEVEL: "info"
SUPPORTTRIAGEPAGE: "1"
SUPPORTWEBCHATDEMO: "0"
WEBCHATSOURCEURL: "0"
SUPPORTWEBCHATCONTACT: "0"
SUPPORTPHONECONTACT: "1"
Expand Down Expand Up @@ -614,13 +609,6 @@ Resources:
!Ref Environment,
SUPPORTTRIAGEPAGE,
]
- Name: "SUPPORT_WEBCHAT_DEMO"
Value:
!FindInMap [
EnvironmentVariables,
!Ref Environment,
SUPPORTWEBCHATDEMO,
]
- Name: "WEBCHAT_SOURCE_URL"
Value:
!FindInMap [
Expand Down
2 changes: 0 additions & 2 deletions src/app.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export const PATH_DATA: {
SECURITY: { url: "/security" },
YOUR_SERVICES: { url: "/your-services" },
ENTER_PASSWORD: { url: "/enter-password" },
WEBCHAT_DEMO: { url: "/webchat-demo" },
CHANGE_EMAIL: {
url: "/change-email",
event: "VERIFY_CODE_SENT",
Expand Down Expand Up @@ -174,4 +173,3 @@ export type ParamName = keyof QueryParameters;
export const OIDC_ERRORS = {
ACCESS_DENIED: "access_denied",
};

8 changes: 2 additions & 6 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
getSessionSecret,
supportActivityLog,
supportTriagePage,
supportWebchatDemo,
supportWebchatContact,
} from "./config";
import { logErrorMiddleware } from "./middleware/log-error-middleware";
import { pageNotFoundHandler } from "./handlers/page-not-found-handler";
Expand Down Expand Up @@ -57,7 +57,6 @@ import { resendPhoneCodeRouter } from "./components/resend-phone-code/resend-pho
import { redirectsRouter } from "./components/redirects/redirects-routes";
import { contactRouter } from "./components/contact-govuk-one-login/contact-govuk-one-login-routes";
import { getSessionStore } from "./utils/session-store";
import { webchatRouter } from "./components/webchat-demo/webchat-demo-routes";
import { outboundContactUsLinksMiddleware } from "./middleware/outbound-contact-us-links-middleware";
import { trackAndRedirectRouter } from "./components/track-and-redirect/track-and-redirect-route";

Expand Down Expand Up @@ -100,7 +99,7 @@ async function createApp(): Promise<express.Application> {
);

app.use(i18nextMiddleware.handle(i18next));
if (supportWebchatDemo()) {
if (supportWebchatContact()) {
app.use(helmet(webchatHelmetConfiguration));
} else {
app.use(helmet(helmetConfiguration));
Expand Down Expand Up @@ -157,9 +156,6 @@ async function createApp(): Promise<express.Application> {
if (supportTriagePage()) {
app.use(contactRouter);
}
if (supportWebchatDemo()) {
app.use(webchatRouter);
}
app.use(trackAndRedirectRouter);

// Router for all previously used URLs, that we want to redirect on
Expand Down
14 changes: 0 additions & 14 deletions src/components/webchat-demo/index.njk

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions src/components/webchat-demo/webchat-demo-controller.ts

This file was deleted.

9 changes: 0 additions & 9 deletions src/components/webchat-demo/webchat-demo-routes.ts

This file was deleted.

8 changes: 2 additions & 6 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export const getAllowedAccountListClientIDs: string[] = [
"criminalInjuriesCompensation",
"9fduJ6KAE8WwCb1VCKp788BC8mM",
"KiYrXyFTTy0JFZyYJI22WuxPIf8",
"ukmcab"
"ukmcab",
];

export const getAllowedServiceListClientIDs: string[] = [
Expand All @@ -142,7 +142,7 @@ export const getAllowedServiceListClientIDs: string[] = [
"socialWorkEngland",
"dbs",
"vehicleOperatorLicense",
"mortgageDeed"
"mortgageDeed",
];

function getProtocol(): string {
Expand All @@ -163,10 +163,6 @@ export function supportTriagePage(): boolean {
return process.env.SUPPORT_TRIAGE_PAGE === "1";
}

export function supportWebchatDemo(): boolean {
return process.env.SUPPORT_WEBCHAT_DEMO === "1";
}

export function getWebchatUrl(): string {
return process.env.WEBCHAT_SOURCE_URL;
}
Expand Down
Loading