From 926089272728da423ad26470baa8019d9378aa46 Mon Sep 17 00:00:00 2001 From: CarlNation <32103961+CarlNation@users.noreply.github.com> Date: Wed, 28 Feb 2024 09:21:02 -0500 Subject: [PATCH 1/3] CSR-1855 CSR-1855 hold off on bailout page. Instead, route to vehicle page with a querystring parm that will clear state if the error occurs more than once. --- src/constants/query-strings.js | 1 + src/router/index.js | 36 ++++++++++++++++++++++++++++++---- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/src/constants/query-strings.js b/src/constants/query-strings.js index 5e12b0d9d..12089fca5 100644 --- a/src/constants/query-strings.js +++ b/src/constants/query-strings.js @@ -21,6 +21,7 @@ const queryStrings = { TRANS_REFERENCE_NUMBER: "auth_trans_ref_no", LAST_FOUR: "last_four", DISPLAY_PIA_ALERT: "displayPiaAlert", + PAGE_ERROR: "pageerror", }; export { queryStrings }; diff --git a/src/router/index.js b/src/router/index.js index e489cbfca..415683af3 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -335,6 +335,7 @@ async function navigate( const hasZip = getQuerystringParameter(queryStrings.ZIP_CODE); const zip = getQuerystringParameter(queryStrings.ZIP_CODE); const promo = getQuerystringParameter(queryStrings.PROMO); + const pageError = getQuerystringParameter(queryStrings.PAGE_ERROR); if ( hasZip && @@ -350,6 +351,10 @@ async function navigate( queryStringsObject[queryStrings.PROMO] = promo; } + if (pageError) { + queryStringsObject[queryStrings.PAGE_ERROR] = pageError; + } + router.push({ name: "root", query: Object.assign(optionalQuery, queryStringsObject), @@ -442,10 +447,33 @@ async function DisplayPageError() { ); baseMixin.methods.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE); - router.push({ - path: "/", - query: { fmgPage: "bailout" }, - }); + const pageError = getQuerystringParameter(queryStrings.PAGE_ERROR); + + if (pageError) { + var errorCount = Number(pageError); + if (errorCount > 1) { + deleteFunnelCookie(); + await baseMixin.methods.dispatchStoreAction(storeActions.RESET_STATE); + + router.push({ + path: "/", + query: { fmgPage: "vehicle" }, + }); + } + else { + errorCount++; + router.push({ + path: "/", + query: { fmgPage: "vehicle", pageError: errorCount }, + }); + } + } + else { + router.push({ + path: "/", + query: { fmgPage: "vehicle", pageError: "1" }, + }); + } } function isExistingFmgPageName(pageName) { From 3c8147081faaa4dcdfc1f63a2d5227df8baf2e3a Mon Sep 17 00:00:00 2001 From: CarlNation <32103961+CarlNation@users.noreply.github.com> Date: Wed, 28 Feb 2024 09:48:19 -0500 Subject: [PATCH 2/3] CSR-1855 CSR-1855 allow 404s to skip page error logic for no wipers or no promo --- src/global-methods.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/global-methods.js b/src/global-methods.js index c5e6102dc..bd0ea36db 100644 --- a/src/global-methods.js +++ b/src/global-methods.js @@ -61,7 +61,11 @@ export default { ); } - router.navigateError(); + // do not route to error logic when no wipers found or no promo found (404s) + if (error.response.status != "404") { + router.navigateError(); + } + return reject(error.response); } ); From 0c8ff997265eabc30ee8d374b32bc0be2141ffbc Mon Sep 17 00:00:00 2001 From: CarlNation <32103961+CarlNation@users.noreply.github.com> Date: Wed, 28 Feb 2024 09:53:38 -0500 Subject: [PATCH 3/3] CSR-1855 prettier --- src/router/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 415683af3..1b4166922 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -448,7 +448,9 @@ async function DisplayPageError() { baseMixin.methods.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE); const pageError = getQuerystringParameter(queryStrings.PAGE_ERROR); - + + // we use the pageError querystring as a counter to how many times a user has experienced an error and been routed here. + // once they receive more than 1 pageerrors, we'll reset their state to hopefully correct any issues they may be having. if (pageError) { var errorCount = Number(pageError); if (errorCount > 1) { @@ -459,16 +461,14 @@ async function DisplayPageError() { path: "/", query: { fmgPage: "vehicle" }, }); - } - else { + } else { errorCount++; router.push({ path: "/", query: { fmgPage: "vehicle", pageError: errorCount }, }); } - } - else { + } else { router.push({ path: "/", query: { fmgPage: "vehicle", pageError: "1" },