diff --git a/jest.config.js b/jest.config.js index 0749f4f71..839db4378 100644 --- a/jest.config.js +++ b/jest.config.js @@ -34,7 +34,7 @@ module.exports = { testMatch: ["**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)"], coverageThreshold: { global: { - statements: 85, + statements: 84, // Got the go ahead from Mark to temporarily lower this. Taking out initialize component made the year,make,model and style coverage drop a bit. Once unit tests for license plate lookup, vin lookup and address lookup are in the coverage should go back up to 90 }, }, diff --git a/src/assets/img/FMGTransitionAnimation.svg b/src/assets/img/FMGTransitionAnimation.svg index b3548305d..c1b6c3e8a 100644 --- a/src/assets/img/FMGTransitionAnimation.svg +++ b/src/assets/img/FMGTransitionAnimation.svg @@ -1 +1 @@ -Assessing your damageFinding your glassGenerating your quote \ No newline at end of file +Assessing your damageFinding your glassGenerating your quoteAlmost done...Nearly there...Finishing up... \ No newline at end of file diff --git a/src/assets/img/wiper-loader.gif b/src/assets/img/wiper-loader.gif new file mode 100644 index 000000000..e370b0873 Binary files /dev/null and b/src/assets/img/wiper-loader.gif differ diff --git a/src/common-components/loading-modal/loading-modal.spec.js b/src/common-components/loading-modal/loading-modal.spec.js index 7a500ce73..348604240 100644 --- a/src/common-components/loading-modal/loading-modal.spec.js +++ b/src/common-components/loading-modal/loading-modal.spec.js @@ -13,6 +13,7 @@ jest.mock( jest.mock('@/assets/img/loader.gif', () => 'loader.gif') jest.mock('@/assets/img/windshield.png', () => 'windshield.png') +jest.mock('@/assets/img/wiper-loader.gif', () => 'windshield.png') describe("loadingModal", () => { test("showModal sets modal visible", async () => { diff --git a/src/common-components/loading-modal/loading-modal.vue b/src/common-components/loading-modal/loading-modal.vue index 31058951e..ed3a48ddf 100644 --- a/src/common-components/loading-modal/loading-modal.vue +++ b/src/common-components/loading-modal/loading-modal.vue @@ -1,26 +1,44 @@ @@ -159,6 +164,7 @@ export default { border: 1px solid $gray-500; border-radius: .5rem; min-height: 3rem; + padding: 12px 16px; &::placeholder { color: $gray-500; } diff --git a/src/constants/analytics.js b/src/constants/analytics.js index f6f6ff82e..a3f057150 100644 --- a/src/constants/analytics.js +++ b/src/constants/analytics.js @@ -26,6 +26,7 @@ const GaLabels = { ERROR: 'Error', LICENSE_PLATE_LOOKUP: 'License_Plate_Look_Up', VIN_LOOKUP: 'Vin_Look_Up', + ADDRESS_LOOKUP: 'Address_Look_up', }; diff --git a/src/helpers/damage-helper.js b/src/helpers/damage-helper.js index a3b9a2878..0928a2656 100644 --- a/src/helpers/damage-helper.js +++ b/src/helpers/damage-helper.js @@ -4,10 +4,17 @@ import { storeActions } from "@/constants/store-actions"; export function getDamageString() { const damageLocations = store.getters.damage.glassToReplace; + const isRepair = store.getters.damage.isRepair; + let returnString; if (!damageLocations) { return; } + // If it's a repair it's always a windshield. + if(isRepair){ + return "windshield" + } + if (damageLocations.length > 1) { returnString = "match" } else { diff --git a/src/layouts/address-lookup/address-lookup.vue b/src/layouts/address-lookup/address-lookup.vue index fca2b500c..f6e0d2b3d 100644 --- a/src/layouts/address-lookup/address-lookup.vue +++ b/src/layouts/address-lookup/address-lookup.vue @@ -72,10 +72,8 @@ import alert from "@/ux-components/alert/alert"; import textboxQuestion from "@/common-components/textbox-question/textbox-question"; import loadingModal from '@/common-components/loading-modal/loading-modal.vue'; -import { Form } from "vee-validate"; -import { defineRule } from "vee-validate"; -import { required } from "@/helpers/validation-rules"; -import { regex } from "@/helpers/validation-rules"; +import { Form, defineRule } from "vee-validate"; +import { required, regex } from "@/helpers/validation-rules"; import { errorMessages } from "@/constants/error-messages"; // Supporting files @@ -152,6 +150,16 @@ export default { this.$route ); }, + attachCustomEvents() { + this.prependActionToMethod(this, this.forwardButtonAction, () => { + this.pushEventToGA( + this.$route.query[this.queryStrings.FMG_PAGE], + this.GaActions.SUBMITTED, + this.GaLabels.ADDRESS_LOOKUP, + true + ); + }); + }, getRegistrationAddressFromStore() { return store.getters.vehicle.registration.address; }, @@ -297,8 +305,10 @@ export default { // if multiple cars were found let matchingCars = carsFound.filter(car => car.vehicle.carId === carEntered.carId); if (matchingCars.length === 1) { - // and one and only of them matches the car id entered this.$refs.loadingModal.showModal(); + + // and one and only of them matches the car id entered + const matchingCar = matchingCars[0]; this.updateVehicleInfo(matchingCar.vin, matchingCar.vehicle); navigateAfterSaveToHeritageFunnel(this.$route); } else { @@ -356,6 +366,9 @@ export default { } } }, + mounted() { + this.attachCustomEvents(); + }, computed: { AlertNonServiceableZipHeader(){ const zipCode = this.serviceZipCode ? this.serviceZipCode : this.customerQuestions.addressQuestions.zipCode; @@ -370,13 +383,14 @@ export default { return text; }, AlertMatchedDifferentVehicleBody(){ - let content = this.getCmsContent("AlertMatchedDifferentVehicleWidget", "BodyText"); - content = content.replaceAll("{custom:glassText}", getDamageString()); - 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); + 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}`; + + const content = this.getCmsContent("AlertMatchedDifferentVehicleWidget", "BodyText") + .replaceAll("{custom:glassText}", getDamageString()) + .replaceAll("{custom:vinYmmFound}", vinYmmFound) + .replaceAll("{custom:vinYmmExpected}", vinYmmExpected); return content; }, diff --git a/src/layouts/address-lookup/customer-questions/address-questions/address-questions.vue b/src/layouts/address-lookup/customer-questions/address-questions/address-questions.vue index e4acdcee0..98c0ca927 100644 --- a/src/layouts/address-lookup/customer-questions/address-questions/address-questions.vue +++ b/src/layouts/address-lookup/customer-questions/address-questions/address-questions.vue @@ -1,23 +1,59 @@