Merge pull request #1777 from Safelite/feature/CSR-1855
Feature/csr 1855
This commit is contained in:
commit
b080fc97c5
3 changed files with 38 additions and 5 deletions
|
|
@ -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 };
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
// 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) {
|
||||
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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue