From 4fcfabfc77b079e9a3996ae0b240eef0a20f0fcc Mon Sep 17 00:00:00 2001 From: CarlNation <32103961+CarlNation@users.noreply.github.com> Date: Tue, 5 Mar 2024 14:41:47 -0500 Subject: [PATCH 1/2] CSR-1072 allow end to end insurance local development without having to run heritage locally CSR-1072 allow end to end insurance local development without having to run heritage locally --- src/constants/query-strings.js | 3 +++ src/router/index.js | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/constants/query-strings.js b/src/constants/query-strings.js index 12089fca5..76411c542 100644 --- a/src/constants/query-strings.js +++ b/src/constants/query-strings.js @@ -22,6 +22,9 @@ const queryStrings = { LAST_FOUR: "last_four", DISPLAY_PIA_ALERT: "displayPiaAlert", PAGE_ERROR: "pageerror", + REFERRAL_NUMBER: "rn", + PARENT_ACCOUNT: "pa", + CORRELATION_ID: "ci", }; export { queryStrings }; diff --git a/src/router/index.js b/src/router/index.js index 63904343b..5b4a9adde 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -75,6 +75,20 @@ const routes = [ if (!to.query.fmgPage?.startsWith("payment")) { //payment pages used to return from safelitehop so exclude here // Remove the parameter after quote release + + // for testing end to end locally, see if there is a referralNumber on the querystring + // that could have changed in heritage and then stick it in the store and then update the cookie + // so load-session runs properly. this can be removed when heritage goes away + const referralNumber = getQuerystringParameter(queryStrings.REFERRAL_NUMBER); + const parentAccount = getQuerystringParameter(queryStrings.PARENT_ACCOUNT); + const correlationId = getQuerystringParameter(queryStrings.CORRELATION_ID); + if (referralNumber) { + store.commit(storeMutations.UPDATE_REFERRAL_NUMBER, referralNumber); + store.commit(storeMutations.UPDATE_PARENT_ACCT_NUMBER, parentAccount); + store.commit(storeMutations.UPDATE_REFERRAL_CORRELATION_ID, correlationId); + updateOrCreateFunnelCookie(); + } + const loadSessionResponse = await loadSessionIfPresent( to.query.isInsurance != null ? to.query.isInsurance == "true" From 085534d0fc27ca5ab6a0f6bbc6b441125850bdae Mon Sep 17 00:00:00 2001 From: CarlNation <32103961+CarlNation@users.noreply.github.com> Date: Tue, 5 Mar 2024 14:49:39 -0500 Subject: [PATCH 2/2] CSR-1072 prettier --- src/router/index.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 5b4a9adde..bcc738be3 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -75,17 +75,22 @@ const routes = [ if (!to.query.fmgPage?.startsWith("payment")) { //payment pages used to return from safelitehop so exclude here // Remove the parameter after quote release - + // for testing end to end locally, see if there is a referralNumber on the querystring // that could have changed in heritage and then stick it in the store and then update the cookie // so load-session runs properly. this can be removed when heritage goes away - const referralNumber = getQuerystringParameter(queryStrings.REFERRAL_NUMBER); + const referralNumber = getQuerystringParameter( + queryStrings.REFERRAL_NUMBER + ); const parentAccount = getQuerystringParameter(queryStrings.PARENT_ACCOUNT); const correlationId = getQuerystringParameter(queryStrings.CORRELATION_ID); if (referralNumber) { store.commit(storeMutations.UPDATE_REFERRAL_NUMBER, referralNumber); store.commit(storeMutations.UPDATE_PARENT_ACCT_NUMBER, parentAccount); - store.commit(storeMutations.UPDATE_REFERRAL_CORRELATION_ID, correlationId); + store.commit( + storeMutations.UPDATE_REFERRAL_CORRELATION_ID, + correlationId + ); updateOrCreateFunnelCookie(); }