From 358895278ce2120411999d54bc48bad37db641c6 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Tue, 3 May 2022 10:21:11 -0400 Subject: [PATCH 1/9] Changed name of naviation scenario 'CLICKED_FORWARD' to 'CONTINUING_WITH_DIFFERENT_GLASS' --- src/layouts/address-lookup/address-lookup.vue | 30 ++++++++----------- .../router-constants/navigation-scenarios.js | 1 + src/router/router-constants/routing-table.js | 2 +- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src/layouts/address-lookup/address-lookup.vue b/src/layouts/address-lookup/address-lookup.vue index c18ee545e..b3701944d 100644 --- a/src/layouts/address-lookup/address-lookup.vue +++ b/src/layouts/address-lookup/address-lookup.vue @@ -81,7 +81,7 @@ import store from "@/store"; import { storeActions } from "@/constants/store-actions"; import { storeMutations } from "@/constants/store-mutations"; import baseMixin from "@/mixins/base-mixin"; -import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper"; +import { navigateAfterSaveToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper"; import { getDamageString, isGlassAvailableForCarId } from "@/helpers/damage-helper"; defineRule("service-zip-required", required(errorMessages.SERVICE_ZIP_REQUIRED)); @@ -203,7 +203,7 @@ export default { this.$refs.funnelFooter.removeLoader(); return; } else if (carsFound.length == 1) { - var carFound = carsFound[0].vehicle; + const carFound = carsFound[0].vehicle; if (carEntered.carId == carFound.carId || carFound.carId == this.previousCarIdFound) { // update data @@ -243,17 +243,14 @@ export default { if (carsFound.length == 1) { // get the damage options for the car that was found const carFound = carsFound[0].vehicle; - const glassOptions = await baseMixin.methods.dispatchNonBlockingStoreAction( - storeActions.GET_DAMAGE_OPTIONS, - { carId: carFound.carId } - ); - // if the car entered is the same as the car found OR the glass options for the found car match the users damage selections + // if the car entered is the same as the car found or the selected glass is available for the car that was found if (carEntered.carId == carFound.carId || isGlassAvailableForCarId(carFound.carId)) { navigateAfterSaveToHeritageFunnel(this.$route); } else { // if not then navigate to the "vehicle-damage" page - this.$router.navigateAfterSave(this.navigationScenarios.CLICKED_FORWARD, this.$route, {}, { displayVehicleChangeAlert: true }, {}); + store.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES); + this.$router.navigateAfterSave(this.navigationScenarios.CONTINUING_WITH_DIFFERENT_GLASS, this.$route, {}, { displayVehicleChangeAlert: true }, {}); } } else if (carsFound.length > 1) { // if multiple cars were found @@ -268,12 +265,12 @@ export default { }, validateZip(zip) { - return baseMixin.methods.dispatchNonBlockingStoreAction( + return baseMixin.methods.dispatchStoreAction( storeActions.VALIDATE_ZIP, { zip }); }, lookupVin(lastName, streetAddress, zip, state) { - return baseMixin.methods.dispatchNonBlockingStoreAction( + return baseMixin.methods.dispatchStoreAction( storeActions.LOOKUP_VIN_BY_ADDRESS, { licenseLastName: lastName, @@ -309,22 +306,22 @@ export default { }, computed: { AlertNonServiceableZipHeader(){ - let zip = this.serviceZip ? this.serviceZip : this.customerQuestions.addressQuestions.zip; - let text = this.getCmsContent("AlertNonServiceableZipWidget", "HeadlineText").replaceAll("{custom:serviceZip}", zip); + const zip = this.serviceZip ? this.serviceZip : this.customerQuestions.addressQuestions.zip; + const text = this.getCmsContent("AlertNonServiceableZipWidget", "HeadlineText").replaceAll("{custom:serviceZip}", zip); return text; }, AlertNonServiceableZipBody(){ return this.getCmsContent("AlertNonServiceableZipWidget", "BodyText"); }, AlertMatchedDifferentVehicleHeader(){ - let text = this.getCmsContent("AlertMatchedDifferentVehicleWidget", "HeadlineText").replaceAll("{custom:glassText}", getDamageString()); + const text = this.getCmsContent("AlertMatchedDifferentVehicleWidget", "HeadlineText").replaceAll("{custom:glassText}", getDamageString()); return text; }, AlertMatchedDifferentVehicleBody(){ let content = this.getCmsContent("AlertMatchedDifferentVehicleWidget", "BodyText"); content = content.replaceAll("{custom:glassText}", getDamageString()); - let vinYmmFound = `${this.customAlertData?.vehicleInfo?.year} ${this.customAlertData?.vehicleInfo?.make} ${this.customAlertData?.vehicleInfo?.model}`; - let vinYmmExpected = `${store.getters.vehicle.year} ${store.getters.vehicle.make} ${store.getters.vehicle.model}`; + const vinYmmFound = `${this.customAlertData?.vehicleInfo?.year} ${this.customAlertData?.vehicleInfo?.make} ${this.customAlertData?.vehicleInfo?.model}`; + const vinYmmExpected = `${store.getters.vehicle.year} ${store.getters.vehicle.make} ${store.getters.vehicle.model}`; content = content.replaceAll("{custom:vinYmmFound}", vinYmmFound); content = content.replaceAll("{custom:vinYmmExpected}", vinYmmExpected); @@ -347,8 +344,7 @@ export default { // if they modify the service zip, then hide the error messageā€ this.displayNonServiceableZipAlert = false; }, - } - + }, }, components: { funnelHeader, diff --git a/src/router/router-constants/navigation-scenarios.js b/src/router/router-constants/navigation-scenarios.js index 5380a3fa7..5e966e326 100644 --- a/src/router/router-constants/navigation-scenarios.js +++ b/src/router/router-constants/navigation-scenarios.js @@ -15,6 +15,7 @@ const navigationScenarios = { CONTINUING_WITH_MULTIPLE_PARTS: "CONTINUING_WITH_MULTIPLE_PARTS", CONTINUING_WITH_SINGLE_PART: "CONTINUING_WITH_SINGLE_PART", CONTINUING_WITH_MULTIPLE_VEHICLES: "CONTINUING_WITH_MULTIPLE_VEHICLES", + CONTINUING_WITH_DIFFERENT_GLASS: "CONTINUING_WITH_DIFFERENT_GLASS", TEMPORARY_TO_ADDRESS_LOOKUP: "TEMPORARY_TO_ADDRESS_LOOKUP", }; diff --git a/src/router/router-constants/routing-table.js b/src/router/router-constants/routing-table.js index 9f412288a..f2c9aef3d 100644 --- a/src/router/router-constants/routing-table.js +++ b/src/router/router-constants/routing-table.js @@ -163,7 +163,7 @@ const routingTable = [ destinationFmgPageValue: fmgPageValues.ADDRESS_VEHICLES, }, { - scenario: navigationScenarios.CLICKED_FORWARD, + scenario: navigationScenarios.CONTINUING_WITH_DIFFERENT_GLASS, destinationFmgPageValue: fmgPageValues.VEHICLE_DAMAGE, }, ], From b5aa014e85ed8ae01caa0f774fcccd72b0abbb4e Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Tue, 3 May 2022 10:59:33 -0400 Subject: [PATCH 2/9] Added 'eager' validation to textbox-question component --- .../textbox-question/textbox-question.vue | 37 ++++++++++++++++--- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/src/common-components/textbox-question/textbox-question.vue b/src/common-components/textbox-question/textbox-question.vue index 00dcdfb88..40e8fb1e6 100644 --- a/src/common-components/textbox-question/textbox-question.vue +++ b/src/common-components/textbox-question/textbox-question.vue @@ -1,8 +1,11 @@ From 16ff2001e5b005275356052b795e0d897befa0f6 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Wed, 4 May 2022 15:13:17 -0400 Subject: [PATCH 3/9] Reverted attempt at using 'eager' validation back to 'lazy' as it was displaying an error about the email format while the user was still entering their email address --- .../textbox-question/textbox-question.vue | 28 ++----------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/src/common-components/textbox-question/textbox-question.vue b/src/common-components/textbox-question/textbox-question.vue index 40e8fb1e6..0c3bda55a 100644 --- a/src/common-components/textbox-question/textbox-question.vue +++ b/src/common-components/textbox-question/textbox-question.vue @@ -2,10 +2,9 @@
{ - // If the field is valid or have not been validated yet - // lazy - if (!errorMessage.value) { - return { - blur: handleChange, - change: handleChange, - // disable `shouldValidate` to avoid validating on input - input: e => handleChange(e, false), - }; - } - // Aggressive - return { - blur: handleChange, - change: handleChange, - input: handleChange, // only switched this - }; - }); - return { errorMessage, handleBlur, @@ -96,7 +73,6 @@ export default { validate, meta, errors, - validationListeners }; }, computed: { From d276a24b87137f4eb25d0453acfb61f057672e2f Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Fri, 6 May 2022 09:38:56 -0400 Subject: [PATCH 4/9] 'Final' check-in before submitting to QA --- .../dropdown-question/dropdown-question.vue | 3 +- .../textbox-question/textbox-question.vue | 3 +- src/layouts/address-lookup/address-lookup.vue | 96 +++++++++++-------- .../address-questions/address-questions.vue | 9 ++ src/store/index.js | 8 +- 5 files changed, 73 insertions(+), 46 deletions(-) diff --git a/src/common-components/dropdown-question/dropdown-question.vue b/src/common-components/dropdown-question/dropdown-question.vue index 7afdc0b38..6d358d1e1 100644 --- a/src/common-components/dropdown-question/dropdown-question.vue +++ b/src/common-components/dropdown-question/dropdown-question.vue @@ -42,7 +42,8 @@ export default { setup(props) { const fieldOptions = { type: "text", - value: props.modelValue, + value: props.modelValue, + initialValue: props.modelValue, }; const { diff --git a/src/common-components/textbox-question/textbox-question.vue b/src/common-components/textbox-question/textbox-question.vue index e35d393ca..0e3176d35 100644 --- a/src/common-components/textbox-question/textbox-question.vue +++ b/src/common-components/textbox-question/textbox-question.vue @@ -15,7 +15,7 @@ :aria-required="isRequired" autocomplete="off" :class="[hasIcon ? 'has-icon' : '', iconRight ? 'icon-right' : '']" - :validationRules="validationRules" + :validationRules="validationRules" />
{{ errorMessage }} @@ -57,6 +57,7 @@ export default { const fieldOptions = { type: "text", value: props.modelValue, + initialValue: props.modelValue, }; const { diff --git a/src/layouts/address-lookup/address-lookup.vue b/src/layouts/address-lookup/address-lookup.vue index c24345038..39137c510 100644 --- a/src/layouts/address-lookup/address-lookup.vue +++ b/src/layouts/address-lookup/address-lookup.vue @@ -1,10 +1,5 @@