From 7321e9efcf12418bf399070bf0ed6ce29f6a33f6 Mon Sep 17 00:00:00 2001 From: Katie Date: Tue, 5 Jul 2022 11:51:30 -0400 Subject: [PATCH 1/2] CSR-643 Update validation on input change --- src/layouts/vehicle-damage/vehicle-damage.vue | 2 +- .../list-button-horizontal/list-button-horizontal.vue | 5 +++-- src/ux-components/list-card/list-card.vue | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/layouts/vehicle-damage/vehicle-damage.vue b/src/layouts/vehicle-damage/vehicle-damage.vue index d36247640..8ce4f0574 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.vue +++ b/src/layouts/vehicle-damage/vehicle-damage.vue @@ -397,7 +397,7 @@ export default { return this.$route.params[this.routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]; }, shouldHideBackButton() { - return this.$store.getters.payment.insuranceCoverage.isVerified || getFunnelCookie().HasDelayedClaimRegistration; + return this.$store.getters.payment.insuranceCoverage.isVerified || getFunnelCookie()?.HasDelayedClaimRegistration; } }, diff --git a/src/ux-components/list-button-horizontal/list-button-horizontal.vue b/src/ux-components/list-button-horizontal/list-button-horizontal.vue index e60d0d22c..49978aa1e 100644 --- a/src/ux-components/list-button-horizontal/list-button-horizontal.vue +++ b/src/ux-components/list-button-horizontal/list-button-horizontal.vue @@ -119,14 +119,13 @@ export default { if(!this.selectingInitiatesLoad) { this.handleCheckChange(); } - this.handleChange(this.value); }, triggerButton() { if(this.selectingInitiatesLoad) { this.displayLoader(); this.handleCheckChange(); } - this.handleChange(this.value); + this.pushEventToGA(this.$route.query[queryStrings.FMG_PAGE], this.GaActions.CLICKED, this.value.toString(), true); }, handleCheckChange() { @@ -135,6 +134,8 @@ export default { value: this.value.toString(), buttonId: this.buttonID && this.buttonID.toString(), }; + + this.handleChange(this.value); this.$emit("isCheckedChanged", emitEvent); this.$emit("update:modelValue", emitEvent); } diff --git a/src/ux-components/list-card/list-card.vue b/src/ux-components/list-card/list-card.vue index 84762fc91..97bb9a1d6 100644 --- a/src/ux-components/list-card/list-card.vue +++ b/src/ux-components/list-card/list-card.vue @@ -146,14 +146,13 @@ export default { if(!this.selectingInitiatesLoad) { this.handleCheckChange(); } - this.handleChange(this.value); }, triggerButton() { if(this.selectingInitiatesLoad) { this.displayLoader(); this.handleCheckChange(); } - this.handleChange(this.value); + this.pushEventToGA(this.$route.query[queryStrings.FMG_PAGE], this.GaActions.CLICKED, this.value.toString(), true); }, handleCheckChange() { @@ -162,6 +161,8 @@ export default { value: this.value.toString(), buttonId: this.buttonID && this.buttonID.toString(), }; + + this.handleChange(this.value); this.$emit("isCheckedChanged", emitEvent); this.$emit("update:modelValue", emitEvent); }, From d68f0389c44ae91c75f03886cadd0b5f4a6c8cce Mon Sep 17 00:00:00 2001 From: Mark Harris Date: Tue, 5 Jul 2022 16:32:58 -0400 Subject: [PATCH 2/2] Made mutations conditional --- src/store/index.js | 64 ++++++++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index c03421fa8..4fd62f46e 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -661,10 +661,10 @@ export const actions = { context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES); context.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES); - } - //Save new values - context.commit(storeMutations.UPDATE_YEAR, year); + //Save new values + context.commit(storeMutations.UPDATE_YEAR, year); + } }, saveVehicleMake(context, make) { @@ -681,10 +681,10 @@ export const actions = { context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES); context.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES); - } - //Save new values - context.commit(storeMutations.UPDATE_MAKE, make); + //Save new values + context.commit(storeMutations.UPDATE_MAKE, make); + } }, saveVehicleModel(context, model) { @@ -700,10 +700,10 @@ export const actions = { context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES); context.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES); - } - //Save new values - context.commit(storeMutations.UPDATE_MODEL, model); + //Save new values + context.commit(storeMutations.UPDATE_MODEL, model); + } }, saveVehicleStyle(context, style) { @@ -718,10 +718,10 @@ export const actions = { context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES); context.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES); - } - //Save new values - context.commit(storeMutations.UPDATE_STYLE, style); + //Save new values + context.commit(storeMutations.UPDATE_STYLE, style); + } }, saveVehicleDamage(context, { isWindshieldRepair, selectedGlassToReplace, selectedWindshieldChipCount }) { @@ -752,14 +752,13 @@ export const actions = { if (isCarIdDifferent && !isSelectedGlassAvailableForVehicle) { context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES); } + + //Save new values + context.dispatch(storeActions.SAVE_EMAIL, customerEmail); + context.dispatch(storeActions.SAVE_SERVICE_LOCATION, serviceLocationInfo); + context.commit(storeMutations.UPDATE_VEHICLE, vehicleInfo); + context.commit(storeMutations.UPDATE_REGISTRATION, registrationInfo); } - - //Save new values - context.dispatch(storeActions.SAVE_EMAIL, customerEmail); - context.dispatch(storeActions.SAVE_SERVICE_LOCATION, serviceLocationInfo); - - context.commit(storeMutations.UPDATE_VEHICLE, vehicleInfo); - context.commit(storeMutations.UPDATE_REGISTRATION, registrationInfo); }, saveRegistrationLicensePlateLookup(context, { isCarIdDifferent, isSelectedGlassAvailableForVehicle, vehicleInfo, registrationInfo, serviceLocationInfo, customerEmail }) { //Reset dependent state when changing @@ -770,14 +769,13 @@ export const actions = { if (isCarIdDifferent && !isSelectedGlassAvailableForVehicle) { context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES); } + + //Save new values + context.commit(storeMutations.UPDATE_VEHICLE, vehicleInfo); + context.commit(storeMutations.UPDATE_REGISTRATION, registrationInfo); + context.dispatch(storeActions.SAVE_EMAIL, customerEmail); + context.dispatch(storeActions.SAVE_SERVICE_LOCATION, serviceLocationInfo); } - - //Save new values - context.commit(storeMutations.UPDATE_VEHICLE, vehicleInfo); - context.commit(storeMutations.UPDATE_REGISTRATION, registrationInfo); - - context.dispatch(storeActions.SAVE_EMAIL, customerEmail); - context.dispatch(storeActions.SAVE_SERVICE_LOCATION, serviceLocationInfo); }, saveRegistrationAddressLookup(context, { isCarIdDifferent, isSelectedGlassAvailableForVehicle, vehicleInfo, registrationInfo, serviceLocationInfo, customerEmail }) { //Reset dependent state when changing @@ -788,14 +786,13 @@ export const actions = { if (isCarIdDifferent && !isSelectedGlassAvailableForVehicle) { context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES); } + + //Save new values + context.commit(storeMutations.UPDATE_VEHICLE, vehicleInfo); + context.commit(storeMutations.UPDATE_REGISTRATION, registrationInfo); + context.dispatch(storeActions.SAVE_EMAIL, customerEmail); + context.dispatch(storeActions.SAVE_SERVICE_LOCATION, serviceLocationInfo); } - - //Save new values - context.commit(storeMutations.UPDATE_VEHICLE, vehicleInfo); - context.commit(storeMutations.UPDATE_REGISTRATION, registrationInfo); - - context.dispatch(storeActions.SAVE_EMAIL, customerEmail); - context.dispatch(storeActions.SAVE_SERVICE_LOCATION, serviceLocationInfo); }, // Misc order actions @@ -813,6 +810,7 @@ export const actions = { context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES); } + //Save new values context.commit(storeMutations.UPDATE_VEHICLE, vehicleInfo); } },