From 00ea7562f0952a19ff91b11bf1a5ab645019216f Mon Sep 17 00:00:00 2001 From: CarlNation Date: Wed, 30 Oct 2024 15:58:00 -0400 Subject: [PATCH 1/3] CSR-2298 hide tax when 0 / verifying insurance --- src/fmg-components/cart/cart.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index f2799d7be..67bc9f961 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -110,7 +110,7 @@ {{ subtotalText }} {{ getLineItemAmount(subTotal, showCoverageAsPending) }} -
+
{{ salesTaxText }} {{ getLineItemAmount(salesTax) }}
@@ -318,6 +318,10 @@ export default { showCoverageAsVerified() { return this.showInsuranceCoverageAs === coverageStatus.VERIFIED; }, + showSalesTax() { + const tax = parseFloat(this.salesTax).toFixed(2); + return tax > 0; + }, currentDeductible() { const deductible = this.insuranceDeductible; if (!(deductible === 0 || deductible > 0)) { From c10780fc1019f00ab57861653572a44be98f5b9a Mon Sep 17 00:00:00 2001 From: CarlNation Date: Thu, 31 Oct 2024 08:31:08 -0400 Subject: [PATCH 2/3] CSR-2299 multiple leadgen CSR-2299 if a customer uses browser back buttons to restart their leadgen session from the content site, the load session would prevent us from persisting any new data they may have changed on the LeadGen content site. So moved the updateExternalParams to after the load and then cleared any items that may need reset. --- src/router/index.js | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 218e32d35..243442c6c 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -97,8 +97,6 @@ const routes = [ ); updateOrCreateFunnelCookie(); } - //Update external parameter state - updateExternalParameterState(); //Affiliate Cookies const affiliateCookies = getAffiliateCookies(); @@ -115,12 +113,14 @@ const routes = [ to.query.fmgPage ); + //Update external parameter state + updateExternalParameterState(); + // clear part related state because heritage selected a new vehicle if ( to.query.fmgPage === fmgPageValues.VEHICLE && eval(getFunnelCookie()?.HasDelayedClaimRegistration) ) { - console.log(new Date() + "Router: Policy Vehicle Changed"); store.commit(storeMutations.RESET_GLASS_PARTS_STATE); } @@ -634,6 +634,24 @@ function getRedirectedStartPage() { } function updateExternalParameterState() { + // if there is an existing external parameter state then they have already been through from an external source(LeadGen) and + // are returning. clear out prior related things that need to be selected again like parts and damage type. + if ( + store.getters.externalParameterState?.isExternalParameter == + externalParameterStatus.INACTIVE + ) { + store.commit(storeMutations.RESET_VEHICLE_STATE); + store.commit(storeMutations.UPDATE_SERVICE_ZIP, { + state: null, + zipCode: null, + zipCodeCtu: null, + }); + store.commit(storeMutations.UPDATE_CUSTOMER_EMAIL_ADDRESS, null); + store.commit(storeMutations.UPDATE_NUMBER_OF_CHIPS, null); + store.commit(storeMutations.RESET_DAMAGE_STATE); + store.commit(storeMutations.RESET_GLASS_PARTS_STATE); + } + const externalParameterYear = getQuerystringParameter(queryStrings.VEHICLE_YEAR); const externalParameterMake = getQuerystringParameter(queryStrings.VEHICLE_MAKE); const externalParameterModel = getQuerystringParameter(queryStrings.VEHICLE_MODEL); From fa52ee0b3d38d70b27353297ca3843940b342c8f Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Thu, 31 Oct 2024 12:23:18 -0400 Subject: [PATCH 3/3] Use set/reset actions instead of directly calling mutations --- src/constants/store-actions.js | 1 + src/router/index.js | 10 ++++------ src/store/index.js | 6 ++++++ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/constants/store-actions.js b/src/constants/store-actions.js index 185d3d369..c9592c315 100644 --- a/src/constants/store-actions.js +++ b/src/constants/store-actions.js @@ -57,6 +57,7 @@ const storeActions = { GET_RECAL_PARTS_AND_SAVE_TO_LINE_ITEMS: "getRecalPartsAndSaveToLineItems", // DEPENDENCY MUTATIONS + RESET_VEHICLE_STATE_AND_DEPENDENCIES: "resetVehicleStateAndDependencies", RESET_DAMAGE_STATE_AND_DEPENDENCIES: "resetDamageAndDependencies", RESET_REGISTRATION_STATE_AND_DEPENDENCIES: "resetRegistrationAndDependencies", RESET_PARTS_STATE_AND_DEPENDENCIES: "resetPartsAndDependencies", diff --git a/src/router/index.js b/src/router/index.js index 243442c6c..a3584b442 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -640,16 +640,14 @@ function updateExternalParameterState() { store.getters.externalParameterState?.isExternalParameter == externalParameterStatus.INACTIVE ) { - store.commit(storeMutations.RESET_VEHICLE_STATE); - store.commit(storeMutations.UPDATE_SERVICE_ZIP, { + store.dispatch(storeActions.RESET_VEHICLE_STATE_AND_DEPENDENCIES); + store.dispatch(storeActions.SAVE_SERVICE_ZIP_CODE_INFO, { state: null, zipCode: null, zipCodeCtu: null, }); - store.commit(storeMutations.UPDATE_CUSTOMER_EMAIL_ADDRESS, null); - store.commit(storeMutations.UPDATE_NUMBER_OF_CHIPS, null); - store.commit(storeMutations.RESET_DAMAGE_STATE); - store.commit(storeMutations.RESET_GLASS_PARTS_STATE); + store.dispatch(storeActions.SAVE_EMAIL, null); + store.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES); } const externalParameterYear = getQuerystringParameter(queryStrings.VEHICLE_YEAR); diff --git a/src/store/index.js b/src/store/index.js index ea025f1d4..ac69e4eb4 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1153,6 +1153,12 @@ export const actions = { }, // Dependency Actions + resetVehicleStateAndDependencies(context) { + context.commit(storeMutations.RESET_VEHICLE_STATE); + + context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES); + }, + resetDamageAndDependencies(context) { context.commit(storeMutations.RESET_DAMAGE_STATE);