diff --git a/public/static/assets/Urbanist-Regular.woff b/public/static/assets/Urbanist-Regular.woff new file mode 100644 index 00000000..7efe9bc4 Binary files /dev/null and b/public/static/assets/Urbanist-Regular.woff differ diff --git a/public/static/assets/Urbanist-SemiBold.woff b/public/static/assets/Urbanist-SemiBold.woff new file mode 100644 index 00000000..92949770 Binary files /dev/null and b/public/static/assets/Urbanist-SemiBold.woff differ diff --git a/public/static/assets/logo.svg b/public/static/assets/logo.svg new file mode 100644 index 00000000..8f739ca1 --- /dev/null +++ b/public/static/assets/logo.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/public/static/error/index.html b/public/static/error/index.html new file mode 100644 index 00000000..509b04dd --- /dev/null +++ b/public/static/error/index.html @@ -0,0 +1,435 @@ + + + + + Error - Safelite + + + +
+
+ +
+
+

+ We're not able to schedule at this time. We apologize for the inconvenience +

+

+ We encountered an error while processing your appointment. You can return to our site and try scheduling again at a later time. +

+
+ +
+
+

+ Bailout Information: +

+
+ +
+
+
+ + + \ No newline at end of file diff --git a/src/global-methods.js b/src/global-methods.js index 7c0f3541..c85b0079 100644 --- a/src/global-methods.js +++ b/src/global-methods.js @@ -7,6 +7,8 @@ import headerKeys from '@/constants/header-keys'; import axiosResponseInterceptorMessages from '@/constants/axios-response-interceptor-messages.js'; import { getSessionKeyValue } from '@/helpers/cookie-helper'; import endpoints from "@/constants/endpoints"; +import queryStrings from '@/constants/query-strings'; +import issPageValues from '@/router/router-constants/issPage-values'; // Add a response interceptor for global axios error handing. axios.interceptors.response.use( @@ -48,9 +50,19 @@ axios.interceptors.response.use( ); export default { + getPageNameByQueryString() { + const params = new URLSearchParams(location.search); + + if (params.has(queryStrings.ISS_PAGE)) { + return params.get(queryStrings.ISS_PAGE); + } + return ''; + }, + callHttpClient({ method, endpoint, payload, logApiCall = true, bailoutOnError = true }) { return new Promise((resolve, reject) => { const store = useMainStore(); + const currentPageName = this.getPageNameByQueryString().toLowerCase(); const cfDistroUrl = applicationConfig.CONSUMER_CF_DISTRO; const payloadAndAnalyticsData = { ...payload, AppName: 'ISS' }; const sessionKey = getSessionKeyValue(); @@ -103,11 +115,20 @@ export default { } if (error.response.status !== 404) { + console.error("http call error - page: " + currentPageName + " - bailoutonError: " + bailoutOnError); const errorData = { method, url, payload, error }; global.$logger.logError(`${method}: ${endpoint}`, errorData); - if (bailoutOnError && global.bailoutOnAxiosError !== undefined) - { - global.bailoutOnAxiosError(errorData); + + if (bailoutOnError && global.bailoutOnAxiosError !== undefined ) { + // Check for bailout or entry page here ... if we are on these pages we cannot bailout. + if ( currentPageName != issPageValues.ENTRY_PAGE && currentPageName != issPageValues.BAILOUT_PAGE) { + global.bailoutOnAxiosError(errorData); + } + else { + console.error("Fatal - Unable to bailout on the entry page or bailout page."); + // Redirect to a generic static error page on fatal error on entry and bailout page. + window.top.location = '/static/error'; + } } } return reject(error.response); diff --git a/src/helpers/logger.js b/src/helpers/logger.js index fc22939a..620f3bd0 100644 --- a/src/helpers/logger.js +++ b/src/helpers/logger.js @@ -48,6 +48,15 @@ export class Logger { const store = useMainStore(); const sessionKey = getSessionKeyValue(); + // TODO: Work in progress. +/* + if ( store.applicationUser.logErrorCalls> 10 ) { + console.error("Exceeded maximum log error calls for this session. Further logging will be suppressed to prevent potential infinite loops."); + return; + } + + store.applicationUser.logErrorCalls += 1; +*/ return new Promise((resolve, reject) => { // If running locally or in the Dev environment show the log entries in the console. if ( diff --git a/src/router/index.js b/src/router/index.js index 2a332ab6..75dbf883 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -38,7 +38,7 @@ const routes = [ await analyticsMixin.methods.validateSession(); // Do not run these for the main entry page - as it is not part of the user flow. - if (issPageToUse !== issPageValues.ENTRY_PAGE) { + if (issPageToUse !== issPageValues.ENTRY_PAGE && issPageToUse !== issPageValues.BAILOUT_PAGE) { try { await runExperiments(issPageToUse); } catch (error) { @@ -82,7 +82,14 @@ const routes = [ return next({name: issPageToUse, query: to.query, params: to.params}); } - const routeData = await GetRouteInfoFromPageName(issPageToUse); + var routeData = []; + + try { + routeData = await GetRouteInfoFromPageName(issPageToUse); + } + catch ( error ) { + window.top.location = '/static/error'; + } if (routeData[0].name.toLowerCase() === 'error') { throw new Error('Page not found!'); @@ -284,6 +291,8 @@ function navigate( // Match our maps up and navigate if we have a destination. let matchingScenarioMap = getNavigationMap(scenario, currentRoute); if (!matchingScenarioMap && scenario === navigationScenarios.BAILOUT) { + // TODO: Send to static error page here? + //console.error("No matching map for bailout page - forced bailout page map"); matchingScenarioMap = { destinationIssPageValue: issPageValues.BAILOUT_PAGE } } diff --git a/src/store/index.js b/src/store/index.js index 6733cf7d..cd4216ba 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -245,6 +245,7 @@ export const getDefaultState = () => ({ duplicateOrders: [], hasSentSaveQuoteEmail: null, coverageLookupAttempts: 0, + //logErrorCalls: 0, firstHit: true }, issConfig: {