From 0fbb6d67cae025195679569c0f7136eaa72a7add Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Wed, 9 Aug 2023 08:32:03 -0400 Subject: [PATCH 001/122] Commit Leah's changes to avoid later conflicts. --- src/layouts/payment-method/payment-method.vue | 211 ++++++++++++++++-- 1 file changed, 196 insertions(+), 15 deletions(-) diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index ff5cb0e35..a7a8ed89a 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -2,10 +2,57 @@
+ - -
+ + + + + + +
+ +
+ + +
+ + + +
+ + + +
+ + +
+ { vm.setCmsContent(resultMap.cmsContent); + vm.pricedGlassParts = clonedGlassParts; + vm.supportingItems = resultMap.supportingItems; + vm.availableLineItems = pricingResults; + vm.isInsuranceSelected = vm.getDefaultIsInsuranceSelectedValue(vm.availableLineItems); }); }, data() { - return {}; + return { + isInsuranceSelected: null, + selectedVaps: null, + availableLineItems: null, + supportingItems: null, + pricedGlassParts: null, + }; }, methods: { arePagePrerequisitesValid() { - // TODO - return true; + return ( + store.getters.order.serviceLocation.zipCode && + store.getters.order.serviceLocation.zipCodeCtu && + (store.getters.order.damage.isRepair || + (store.getters.order.lineItems?.glassParts != null && + store.getters.order.lineItems.glassParts.length > 0)) && + store.getters.order.referralNumber?.length !== 6 + ); + }, + getDefaultIsInsuranceSelectedValue(availableLineItems) { + // Override if coming back from QuoteDetails. Remove override after Quote release + const isInsuranceOverrideValue = this.$route.query?.isInsurance; + + const defaultIsInsuranceSelectedValue = this.$store.getters.order.payment.isInsurance; + if (isInsuranceOverrideValue != null) { + return isInsuranceOverrideValue == "true"; + } else if (defaultIsInsuranceSelectedValue != null) { + return defaultIsInsuranceSelectedValue; + } else { + return availableLineItems + ? baseMixin.methods.getTierOnePackagePrice( + baseMixin.methods.filterOutFees(availableLineItems) + ) > 300 + : null; + } + }, + vapsItemsSelectedAction(vapsItemsSelected) { + this.selectedVaps = vapsItemsSelected; + }, + backButtonAction() { + vehicleQuestionsMixin.methods.navigateBack(this); + }, + forwardButtonAction() { + this.dispatchStoreAction( + this.storeActions.SAVE_PAYMENT_TYPE, + this.isInsuranceSelected, + false + ); + + if (!this.isInsuranceSelected) { + this.dispatchStoreAction( + this.storeActions.SAVE_PARENT_ACCOUNT_NUMBER, + applicationConfig.CASH_PARENT_ACCOUNT_NUMBER, + false + ); + } + + if ( + this.$store.getters.order.payment.parentAccountNumber != + applicationConfig.CASH_PARENT_ACCOUNT_NUMBER + ) { + this.supportingItems = this.filterOutFees(this.supportingItems); + } + + if (this.pricedGlassParts.length > 0) { + this.dispatchStoreAction( + this.storeActions.SAVE_GLASS_PART_PRICES, + this.pricedGlassParts, + false + ); + } + + this.dispatchStoreAction( + this.storeActions.SAVE_SUPPORTING_ITEMS, + this.supportingItems, + false + ); + + this.dispatchStoreAction(this.storeActions.SAVE_VAPS, this.selectedVaps, false); + + const payment = this.$store.getters.payment; + if (payment.isInsurance) { + navigateToHeritageFunnel({ loadingModal: this.$refs.loadingModal }); + } else { + this.$router.navigateWithSaving( + this.navigationScenarios.CLICKED_FORWARD_WITH_CASH, + this.$route + ); + } }, - backButtonAction() {}, - forwardButtonAction() {}, }, components: { funnelHeader, funnelFooter, + vehicleBanner, funnelSubHeader, Form, + loadingModal, }, }; - - + From f2f791baef3689acefd0e7e25d14c8c9c255236e Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Wed, 9 Aug 2023 14:08:29 -0400 Subject: [PATCH 002/122] Add cart to payment-method. --- src/fmg-components/cart/cart.vue | 131 ++++++++++++++++++ .../funnel-header/funnel-header.vue | 5 +- .../funnel-header/menu-modal/menu-modal.vue | 6 +- src/layouts/payment-method/payment-method.vue | 55 ++++++-- 4 files changed, 178 insertions(+), 19 deletions(-) create mode 100644 src/fmg-components/cart/cart.vue diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue new file mode 100644 index 000000000..4c456a32b --- /dev/null +++ b/src/fmg-components/cart/cart.vue @@ -0,0 +1,131 @@ + + + + + diff --git a/src/fmg-components/funnel-header/funnel-header.vue b/src/fmg-components/funnel-header/funnel-header.vue index acfacd709..aa1d5722a 100644 --- a/src/fmg-components/funnel-header/funnel-header.vue +++ b/src/fmg-components/funnel-header/funnel-header.vue @@ -63,11 +63,12 @@ export default { From ad4b53a4b752a105cefeb07f18ab4afa97a7472a Mon Sep 17 00:00:00 2001 From: CarlNation <32103961+CarlNation@users.noreply.github.com> Date: Wed, 13 Sep 2023 10:38:32 -0400 Subject: [PATCH 024/122] CSR-1654 only save customer name on address lookup if it's not already in the store --- src/layouts/address-lookup/address-lookup.vue | 2 +- src/store/index.js | 29 ++++++++++++++----- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/layouts/address-lookup/address-lookup.vue b/src/layouts/address-lookup/address-lookup.vue index 48ab0dd08..f0bf91325 100644 --- a/src/layouts/address-lookup/address-lookup.vue +++ b/src/layouts/address-lookup/address-lookup.vue @@ -320,7 +320,7 @@ export default { Object.keys(vehicleInfoToCommit).length === 0 ? this.$store.getters.vehicle : vehicleInfoToCommit, - registrationInfo: { + customerInfo: { firstName: this.customerQuestions.firstName, lastName: this.customerQuestions.lastName, }, diff --git a/src/store/index.js b/src/store/index.js index 976ef0d2e..95a028aae 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -234,8 +234,6 @@ export const mutations = { }, updateRegistration(state, registrationInfo) { state.order.vehicle.registration.licensePlate = registrationInfo?.licensePlate; - state.order.customer.firstName = registrationInfo?.firstName; - state.order.customer.lastName = registrationInfo?.lastName; }, updateServiceZip(state, serviceZipInfo) { state.order.serviceLocation.state = serviceZipInfo.state; @@ -1662,15 +1660,25 @@ export const actions = { context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES); } - //Save new values context.commit(storeMutations.UPDATE_VEHICLE, vehicleInfo); - context.commit(storeMutations.UPDATE_REGISTRATION, registrationInfo); + + if (registrationInfo) { + context.commit(storeMutations.UPDATE_REGISTRATION, registrationInfo); + + // only update name information if there isn't a value in state already + if (!context.getters.order.customer.firstName) { + context.commit(storeMutations.UPDATE_CUSTOMER_DETAILS, { + firstName: registrationInfo.firstName, + lastName: registrationInfo.lastName, + }); + } + } } }, saveRegistrationAddressLookup( context, - { isSelectedGlassAvailableForVehicle, vehicleInfo, registrationInfo } + { isSelectedGlassAvailableForVehicle, vehicleInfo, customerInfo } ) { //Reset dependent state when changing if (vehicleInfo.vin !== context.state.order.vehicle.vin) { @@ -1681,9 +1689,14 @@ export const actions = { } } - if (registrationInfo) { - context.commit(storeMutations.UPDATE_VEHICLE, vehicleInfo); - context.commit(storeMutations.UPDATE_REGISTRATION, registrationInfo); + context.commit(storeMutations.UPDATE_VEHICLE, vehicleInfo); + + // only update name information if there isn't a value in state already + if (!context.getters.order.customer.firstName && customerInfo) { + context.commit(storeMutations.UPDATE_CUSTOMER_DETAILS, { + firstName: customerInfo.firstName, + lastName: customerInfo.lastName, + }); } }, From cd1354bc6dbada3a684e62ccd70d89a0e03b818d Mon Sep 17 00:00:00 2001 From: CarlNation Date: Wed, 13 Sep 2023 13:37:51 -0400 Subject: [PATCH 025/122] CSR-1564 tests --- src/store/store.spec.js | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/store/store.spec.js b/src/store/store.spec.js index ded194ba8..947299ff8 100644 --- a/src/store/store.spec.js +++ b/src/store/store.spec.js @@ -1492,9 +1492,18 @@ describe("Actions", () => { licensePlate: "ABC123", }, }, + customer: { + firstName: "test", + lastName: "test", + }, }, }; + context.getters = { + ...getters, + order: getters.order(context), + }; + const commit = jest.fn(); const dispatch = jest.fn(); @@ -1538,9 +1547,18 @@ describe("Actions", () => { address: "123 Main St", }, }, + customer: { + firstName: "test", + lastName: "test", + }, }, }; + context.getters = { + ...getters, + order: getters.order(context), + }; + const commit = jest.fn(); const dispatch = jest.fn(); @@ -1552,7 +1570,7 @@ describe("Actions", () => { isCarIdDifferent: true, isSelectedGlassAvailableForVehicle: false, vehicleInfo: { carId: "C010101", vin: "XXXXX" }, - registrationInfo: { firstName: "abc", lastName: "123" }, + customerInfo: { firstName: "abc", lastName: "123" }, serviceLocationInfo: { state: "CO" }, customerEmail: "test@safelite.com", }; @@ -1570,7 +1588,6 @@ describe("Actions", () => { ); expect(commit).toBeCalledWith(storeMutations.UPDATE_VEHICLE, payload.vehicleInfo); - expect(commit).toBeCalledWith(storeMutations.UPDATE_REGISTRATION, payload.registrationInfo); }); it("saveVehicle, should save vehicle info", () => { From 73f0a808df9b6e76130c58689579cbeeefc06e30 Mon Sep 17 00:00:00 2001 From: sheena Date: Thu, 14 Sep 2023 14:21:54 +0530 Subject: [PATCH 026/122] CSR-1631 Fixed the margin to 24px --- src/layouts/vehicle/vehicle.vue | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/layouts/vehicle/vehicle.vue b/src/layouts/vehicle/vehicle.vue index 8cc3f8e88..82e7ac8a4 100644 --- a/src/layouts/vehicle/vehicle.vue +++ b/src/layouts/vehicle/vehicle.vue @@ -3,7 +3,6 @@
-
@@ -67,8 +66,7 @@ ref="funnelFooter" />
-
-
+
@@ -402,10 +400,6 @@ export default { + const payment = this.$store.getters.payment; + if (payment.isInsurance) { + navigateToHeritageFunnel({ + shouldSaveSession: true, + loadingModal: this.$refs.loadingModal, + }); + } else { + this.$router.navigateWithSaving( + this.navigationScenarios.CLICKED_FORWARD_WITH_CASH, + this.$route + ); + } + }, + }, + components: { + funnelHeader, + navbar, + vehicleBanner, + funnelSubHeader, + Form, + textBlock, + cashOrInsuranceQuestion, + servicePackageQuestion, + contentGroupModal, + loadingModal, + }, + }; + + diff --git a/src/layouts/review/review.vue b/src/layouts/review/review.vue index 2fb033ea3..592654db1 100644 --- a/src/layouts/review/review.vue +++ b/src/layouts/review/review.vue @@ -1,105 +1,116 @@ diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index e49cd295c..b5ceb81dd 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -1,87 +1,109 @@ @@ -95,7 +117,7 @@ import appointmentTypeQuestion from "@/layouts/service-location/appointment-type import shopQuestion from "@/layouts/service-location/shop-question/shop-question"; import funnelHeader from "@/fmg-components/funnel-header/funnel-header"; -import funnelFooter from "@/fmg-components/funnel-footer/funnel-footer"; +import navbar from "@/fmg-components/nav-bar/nav-bar"; import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header"; import loadingModal from "@/fmg-components/loading-modal/loading-modal.vue"; import { Form } from "vee-validate"; @@ -240,7 +262,7 @@ export default { set: function (newValue) { this.streetAddress = newValue.addressQuestions.streetAddress; this.apartmentNumberOrBusinessName = - newValue.addressQuestions.apartmentNumberOrBusinessName; + newValue.addressQuestions.apartmentNumberOrBusinessName; this.city = newValue.addressQuestions.city; this.state = newValue.addressQuestions.state; this.zipCode = newValue.addressQuestions.zipCode; @@ -369,10 +391,10 @@ export default { setServiceabilityDetails(serviceabilityDetails) { this.isGlassServiceableInshop = serviceabilityDetails.isGlassServiceableInshop; this.isRecalibrationServiceableInshop = - serviceabilityDetails.isRecalibrationServiceableInshop; + serviceabilityDetails.isRecalibrationServiceableInshop; this.isGlassServiceableMobile = serviceabilityDetails.isGlassServiceableMobile; this.isRecalibrationServiceableMobile = - serviceabilityDetails.isRecalibrationServiceableMobile; + serviceabilityDetails.isRecalibrationServiceableMobile; }, backButtonAction() { this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route); @@ -456,7 +478,7 @@ export default { appointmentTypeQuestion, mobileLocationModalQuestions, funnelHeader, - funnelFooter, + navbar, funnelSubHeader, Form, loadingModal, diff --git a/src/layouts/vehicle-damage/vehicle-damage.vue b/src/layouts/vehicle-damage/vehicle-damage.vue index c03fabda1..e27d398a4 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.vue +++ b/src/layouts/vehicle-damage/vehicle-damage.vue @@ -1,65 +1,81 @@ - + const payment = this.$store.getters.payment; + if (payment.isInsurance) { + navigateToHeritageFunnel({ + shouldSaveSession: true, + loadingModal: this.$refs.loadingModal, + }); + } else { + this.$router.navigateWithSaving( + this.navigationScenarios.CLICKED_FORWARD_WITH_CASH, + this.$route + ); + } + }, + }, + components: { + funnelHeader, + navbar, + vehicleBanner, + funnelSubHeader, + Form, + textBlock, + cashOrInsuranceQuestion, + servicePackageQuestion, + contentGroupModal, + loadingModal, + }, +}; + + diff --git a/src/layouts/review/review.vue b/src/layouts/review/review.vue index 592654db1..c7112fb00 100644 --- a/src/layouts/review/review.vue +++ b/src/layouts/review/review.vue @@ -8,7 +8,7 @@
-
 
+
 
- -
-
 
+
 
+ diff --git a/src/layouts/schedule/schedule.vue b/src/layouts/schedule/schedule.vue index 23564a4c7..59d8e932a 100644 --- a/src/layouts/schedule/schedule.vue +++ b/src/layouts/schedule/schedule.vue @@ -1,63 +1,66 @@ diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index b5ceb81dd..aed00e644 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -8,101 +8,100 @@
-
 
+
 
+ v-model="serviceZipCodeQuestion" + ref="serviceZipCodeQuestion" + :mobileFeePart="mobileFeePart" + @updated-mobile-fee-part="setMobileFeePart" + @updated-serviceability="setServiceabilityDetails" + @updated-contains-military-base="setContainsMilitaryBase" + linkWidgetName="ServiceZipLinkWidget" + modalWidgetName="ServiceZipModalWidget" + :onZipUpdateCallback="reloadShopData" /> + ref="alertMilitaryBaseZip" + class="my-5" + cmsWidgetName="AlertMilitaryBaseZipWidget" + v-if="displayMilitaryZipAlert" + alertClass="alert-warning" /> + ref="alertMobileOnly" + class="my-5" + cmsWidgetName="AlertMobileOnlyWidget" + v-if="displayServiceableMobileOnly" + alertClass="alert-warning" /> + ref="alertRecalNoMobile" + class="my-5" + cmsWidgetName="AlertRecalNoMobileWidget" + v-if="displayRecalibrationWarning" + @text-link-clicked="openModalAction" + alertClass="alert-warning" /> + ref="alertInshopOnly" + class="my-5" + cmsWidgetName="AlertInshopOnlyWidget" + v-if="displayServiceableInshopOnly" + alertClass="alert-warning" /> + ref="alertNoShops" + class="my-5" + cmsWidgetName="AlertNoShopsWidget" + v-if="displayNoShopsAlert" + alertClass="alert-warning" /> + v-model="selectedAppointmentType" + v-show="isAppointmentTypeDisplayed" + :isServiceableMobile="isServiceableMobile" + :isServiceableInshop="isServiceableInshop" + :isDisplayed="isAppointmentTypeDisplayed" + ref="appointmentTypeQuestion" + groupName="appointmentTypeQuestion" + cmsWidgetName="AppointmentTypeQuestionWidget" + validationRules="option-required" /> + customComponentId="mobileLocationQuestions" + v-if="selectedAppointmentType === 'Mobile'" + v-model="mobileLocationQuestions" + :mobileFeePart="mobileFeePart" + @updated-mobile-fee-part="setMobileFeePart" + @updated-serviceability="setServiceabilityDetails" + @updated-contains-military-base="setContainsMilitaryBase" + validationRules="mobile-location-required" + ref="mobileLocationQuestions" + linkWidgetName="MobileLocationLinkWidget" + modalWidgetName="MobileLocationModalWidget" + :onZipUpdateCallback="reloadShopData" /> + ref="shopQuestion" + v-show="isShopQuestionDisplayed" + v-model="selectedProvider" + :selectedAppointmentType="selectedAppointmentType" + :isDisplayed="isShopQuestionDisplayed" + cmsWidgetName="ShopQuestionWidget" /> - + cmsWidgetName="FunnelFooterWidget" + ref="navbar" + :isForwardActionDisabled="!meta.valid || displayNoShopsAlert" + @back-clicked="backButtonAction" + @ForwardClicked="forwardButtonAction" />
-
 
+
 
@@ -262,7 +261,7 @@ export default { set: function (newValue) { this.streetAddress = newValue.addressQuestions.streetAddress; this.apartmentNumberOrBusinessName = - newValue.addressQuestions.apartmentNumberOrBusinessName; + newValue.addressQuestions.apartmentNumberOrBusinessName; this.city = newValue.addressQuestions.city; this.state = newValue.addressQuestions.state; this.zipCode = newValue.addressQuestions.zipCode; @@ -391,10 +390,10 @@ export default { setServiceabilityDetails(serviceabilityDetails) { this.isGlassServiceableInshop = serviceabilityDetails.isGlassServiceableInshop; this.isRecalibrationServiceableInshop = - serviceabilityDetails.isRecalibrationServiceableInshop; + serviceabilityDetails.isRecalibrationServiceableInshop; this.isGlassServiceableMobile = serviceabilityDetails.isGlassServiceableMobile; this.isRecalibrationServiceableMobile = - serviceabilityDetails.isRecalibrationServiceableMobile; + serviceabilityDetails.isRecalibrationServiceableMobile; }, backButtonAction() { this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route); diff --git a/src/layouts/vehicle-damage/vehicle-damage.vue b/src/layouts/vehicle-damage/vehicle-damage.vue index e27d398a4..9670ec48c 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.vue +++ b/src/layouts/vehicle-damage/vehicle-damage.vue @@ -6,16 +6,16 @@ -
-
 
-
- +
 
+
+ - + - - - - - - - -
-
 
+
 
+ @@ -235,7 +235,7 @@ export default { }) ) { windShieldOptions.selectedWindshieldDamageType = - damageLocationsSelected.REPLACE; + damageLocationsSelected.REPLACE; windShieldOptions.selectedWindshieldReplaceOptions.push( damageLocationsSelected.SINGLE ); @@ -250,7 +250,7 @@ export default { }) ) { windShieldOptions.selectedWindshieldDamageType = - damageLocationsSelected.REPLACE; + damageLocationsSelected.REPLACE; windShieldOptions.selectedWindshieldReplaceOptions.push( damageLocationsSelected.DRIVER ); @@ -265,7 +265,7 @@ export default { }) ) { windShieldOptions.selectedWindshieldDamageType = - damageLocationsSelected.REPLACE; + damageLocationsSelected.REPLACE; windShieldOptions.selectedWindshieldReplaceOptions.push( damageLocationsSelected.PASSENGER ); @@ -335,7 +335,7 @@ export default { isWindshieldRepair: this.isWindshieldRepair, selectedGlassToReplace: this.selectedGlassToReplace(), selectedWindshieldChipCount: - this.selectedWindshieldOptions.selectedWindshieldChipCount, + this.selectedWindshieldOptions.selectedWindshieldChipCount, }, false ); @@ -358,9 +358,9 @@ export default { const payment = this.$store.getters.payment; const vehicleChangedDuringPolicyLookupInHeritage = - payment.isInsurance && - payment.insuranceCoverage.coverageStatus && - payment.insuranceCoverage.coverageStatus !== ""; + payment.isInsurance && + payment.insuranceCoverage.coverageStatus && + payment.insuranceCoverage.coverageStatus !== ""; if (vehicleChangedDuringPolicyLookupInHeritage) { if (store.getters.damage.isRepair) { this.$router.navigateWithSaving( @@ -370,7 +370,7 @@ export default { } else { this.$router.navigateWithSaving( this.navigationScenarios - .CLICKED_FORWARD_WITH_REPLACE_AND_VERIFIED_INSURANCE, + .CLICKED_FORWARD_WITH_REPLACE_AND_VERIFIED_INSURANCE, this.$route ); } @@ -452,7 +452,7 @@ export default { return ( this.isWindshieldDamageLocation && this.selectedWindshieldOptions.selectedWindshieldDamageType === - damageLocationsSelected.REPAIR + damageLocationsSelected.REPAIR ); }, isDriverSideReplace() { @@ -480,10 +480,10 @@ export default { if ( !this.selectedDamageLocations?.includes("Windshield") || this.selectedWindshieldOptions.selectedWindshieldDamageType === - damageLocationsSelected.REPAIR || + damageLocationsSelected.REPAIR || !this.selectedWindshieldOptions.selectedWindshieldReplaceOptions ) - return false; + return false; return ( this.selectedWindshieldOptions.selectedWindshieldReplaceOptions?.some( @@ -502,14 +502,14 @@ export default { ); } ) || - this.selectedWindshieldOptions.selectedWindshieldReplaceOptions?.some( - (selectedPassengerWindshield) => { - return ( - selectedPassengerWindshield.toUpperCase() === - damageLocationsSelected.PASSENGER.toUpperCase() - ); - } - )) + this.selectedWindshieldOptions.selectedWindshieldReplaceOptions?.some( + (selectedPassengerWindshield) => { + return ( + selectedPassengerWindshield.toUpperCase() === + damageLocationsSelected.PASSENGER.toUpperCase() + ); + } + )) ); }, shouldDisplayVehicleChangeAlert() { diff --git a/src/layouts/vehicle-parts/vehicle-parts.vue b/src/layouts/vehicle-parts/vehicle-parts.vue index c34223b88..5ad44d3e0 100644 --- a/src/layouts/vehicle-parts/vehicle-parts.vue +++ b/src/layouts/vehicle-parts/vehicle-parts.vue @@ -9,44 +9,48 @@
-
 
+
 
- -
-
-
- -
+ +
+
+
+
-
- -
- -
- +
+
+ +
+ +
+
-
 
+
 
diff --git a/src/layouts/vehicle/vehicle.vue b/src/layouts/vehicle/vehicle.vue index 92f1e7ea6..8743ef284 100644 --- a/src/layouts/vehicle/vehicle.vue +++ b/src/layouts/vehicle/vehicle.vue @@ -7,7 +7,7 @@
-
 
+
 
-
 
+
 
diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue index dfb254dc9..fe25fa403 100644 --- a/src/layouts/vin-lookup/vin-lookup.vue +++ b/src/layouts/vin-lookup/vin-lookup.vue @@ -8,126 +8,122 @@
-
 
+
 
+ cmsWidgetName="VehicleBannerWidget" + :displayGenericVehicleImage="false" /> + cmsWidgetName="VinNumberQuestionWidget" + v-model="vin" + customInputId="vin" + isRequired + :validationRules="!vinPopulatedOnPageLoad ? 'vin-required|vin-format' : ''" + :isDisabled="vinPopulatedOnPageLoad" + maxLength="17" + :mask="vinMask" + includeImageQuestion + :imageQuestionSubmitHandler="getVinFromImage" + :maxFileSize="imageUploadMaxFileSize" + @image-lookup-error="displayVinScanAlert" + @image-validity-error="displayVinScanAlert" + data-test="vin-lookup-field" + ref="vinLookupQuestion" /> + cmsWidgetName="AlertVinScanFailed" + v-if="displayVinScanFailedAlert" + alertClass="alert-danger" /> + cmsWidgetName="ServiceZipQuestionWidget" + v-model="serviceZipCode" + customInputId="serviceZipCode" + mask="#####" + isRequired + validationRules="zip-required|zip-format" /> + cmsWidgetName="EmailAddressQuestionWidget" + v-model="emailAddress" + customInputId="emailAddress" + isRequired + validationRules="email-address-required|email-address-format" /> + ref="alertInvalidZip" + v-if="displayInvalidZipAlert" + class="my-4" + cmsWidgetName="AlertInvalidZipWidget" + alertClass="alert-danger" + v-bind:isDismissible="false" /> + class="my-4" + :manualHeadline="AlertPerfectMatchInsuranceVerifiedHeader" + :manualCopy="AlertPerfectMatchInsuranceVerifiedBody" + v-model="customAlertData" + v-if=" + vinPopulatedOnPageLoad && + isInsuranceVerified && + !displayInvalidZipAlert && + !displayNonServiceableZipAlert + " + alertClass="alert-success" /> + class="my-4" + :manualHeadline="AlertMatchedDifferentVehicleHeader" + :manualCopy="AlertMatchedDifferentVehicleBody" + v-model="customAlertData" + v-if="displayMatchedDifferentVehicleAlert" + alertClass="alert-warning" /> + class="my-4" + :manualHeadline="AlertNonServiceableZipHeader" + :manualCopy="AlertNonServiceableZipBody" + v-model="customAlertData" + v-if="displayNonServiceableZipAlert" + alertClass="alert-danger" /> + class="my-4" + v-model="customAlertData" + v-if="displayVinNotFoundAlert" + alertClass="alert-danger" + cmsWidgetName="AlertVinNotFoundWidget" /> + class="my-4" + :manualHeadline="AlertPerfectMatchInsuranceNotVerifiedHeader" + :manualCopy="AlertPerfectMatchInsuranceNotVerifiedBody" + v-model="customAlertData" + v-if=" + vinPopulatedOnPageLoad && + !isInsuranceVerified && + !displayInvalidZipAlert && + !displayNonServiceableZipAlert + " + alertClass="alert-success" /> - + cmsWidgetName="FunnelFooterWidget" + ref="navbar" + :isForwardActionDisabled="!meta.valid" + @back-clicked="backButtonAction" + @ForwardClicked="forwardButtonAction" />
-
 
+
 
- @@ -300,7 +296,7 @@ export default { // Check if the CarId is different from the lookup vs what is in state currently. this.isCarIdDifferent = - resultMap.vehicleLookupResponse.carId !== this.$store.getters.vehicle.carId; + resultMap.vehicleLookupResponse.carId !== this.$store.getters.vehicle.carId; if ( this.isCarIdDifferent && @@ -400,16 +396,16 @@ export default { getVinFromImage(image) { return new Promise((resolve, reject) => { this.dispatchStoreAction(storeActions.LOOKUP_VIN_BY_IMAGE, image) - .then((response) => { - if (response.data.length > 0) { - resolve(response.data[0]); - } else { - reject("No VINs detected."); - } - }) - .catch(() => { - reject("An error occurred during the lookup."); - }); + .then((response) => { + if (response.data.length > 0) { + resolve(response.data[0]); + } else { + reject("No VINs detected."); + } + }) + .catch(() => { + reject("An error occurred during the lookup."); + }); }); }, resetAlerts() { @@ -432,10 +428,10 @@ export default { }, AlertMatchedDifferentVehicleBody() { return this.getCmsContent("AlertMatchedDifferentVehicleWidget", "BodyText") - .replaceAll("{custom:damage}", getDamageString()) - .replaceAll("{custom:vinlookupYear}", this.customAlertData?.vehicleInfo?.year) - .replaceAll("{custom:vinlookupMake}", this.customAlertData?.vehicleInfo?.make) - .replaceAll("{custom:vinlookupModel}", this.customAlertData?.vehicleInfo?.model); + .replaceAll("{custom:damage}", getDamageString()) + .replaceAll("{custom:vinlookupYear}", this.customAlertData?.vehicleInfo?.year) + .replaceAll("{custom:vinlookupMake}", this.customAlertData?.vehicleInfo?.make) + .replaceAll("{custom:vinlookupModel}", this.customAlertData?.vehicleInfo?.model); }, AlertNonServiceableZipHeader() { return this.getCmsContent("AlertNonServiceableZipWidget", "HeadlineText").replaceAll( From efd0edc1e9f451ee821536fbc4ecde99834c5358 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Tue, 19 Sep 2023 11:16:32 -0400 Subject: [PATCH 041/122] WIP grid tweaks for list-card. --- .../button-question/button-question.vue | 4 +- src/layouts/vehicle-damage/vehicle-damage.vue | 116 +++++++++--------- 2 files changed, 60 insertions(+), 60 deletions(-) diff --git a/src/digital-components/button-question/button-question.vue b/src/digital-components/button-question/button-question.vue index 13c81f815..9636d1d25 100644 --- a/src/digital-components/button-question/button-question.vue +++ b/src/digital-components/button-question/button-question.vue @@ -192,9 +192,9 @@ export default { classes = "d-flex flex-row p-0"; break; case "listCard": - classes = "row g-2 justify-content-center mb-1"; + classes = "row g-2 g-md-5 justify-content-center mb-1"; if (this.isWide) { - classes += " flex-column"; + classes += "flex-column"; } break; case "radio": diff --git a/src/layouts/vehicle-damage/vehicle-damage.vue b/src/layouts/vehicle-damage/vehicle-damage.vue index 9670ec48c..e5583d986 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.vue +++ b/src/layouts/vehicle-damage/vehicle-damage.vue @@ -10,61 +10,61 @@
 
+ cmsWidgetName="VehicleBannerWidget" + :displayGenericVehicleImage="false" /> + ref="vehicleChangeAlert" + v-if="shouldDisplayVehicleChangeAlert" + class="mt-5 mb-0" + cmsWidgetName="VehicleChangeAlert" + alertClass="alert-warning" + :isDismissible="false" /> + ref="damageLocation" + cmsWidgetName="DamageLocationQuestion" + v-model="selectedDamageLocations" + groupName="DamageLocationQuestion" /> + ref="windshieldOptions" + v-model="selectedWindshieldOptions" + :hasRepairReplaceConflict="hasRepairReplaceConflict" + :hasSplitSingleConflict="hasSplitSingleConflict" + :selectedDamageLocations="selectedDamageLocations" /> + v-if="hasRepairReplaceConflict" + class="my-5" + cmsWidgetName="HasReplacementConflict" + alertClass="alert-danger" + :isDismissible="false" /> + ref="sideDoorOptions" + cmsWidgetName="SideDoorSideQuestion" + groupName="SideDoorSideQuestion" + v-model="sideDoorOptionsData" + v-show="!hasRepairReplaceConflict" + :selectedDamageLocations="selectedDamageLocations" /> + ref="backGlassOptions" + cmsWidgetName="RearReplaceOptionsQuestion" + :isAvailable="isRearWindowDamageLocation && !hasRepairReplaceConflict" + v-model="selectedRearReplaceOptions" + groupName="BackGlassReplaceOptionsQuestion" + validationRules="replace-options-required" /> + cmsWidgetName="FunnelFooterWidget" + :isForwardActionDisabled="!meta.valid" + :isBackButtonHidden="shouldHideBackButton" + @back-clicked="backButtonAction" + @ForwardClicked="forwardButtonAction" />
 
@@ -235,7 +235,7 @@ export default { }) ) { windShieldOptions.selectedWindshieldDamageType = - damageLocationsSelected.REPLACE; + damageLocationsSelected.REPLACE; windShieldOptions.selectedWindshieldReplaceOptions.push( damageLocationsSelected.SINGLE ); @@ -250,7 +250,7 @@ export default { }) ) { windShieldOptions.selectedWindshieldDamageType = - damageLocationsSelected.REPLACE; + damageLocationsSelected.REPLACE; windShieldOptions.selectedWindshieldReplaceOptions.push( damageLocationsSelected.DRIVER ); @@ -265,7 +265,7 @@ export default { }) ) { windShieldOptions.selectedWindshieldDamageType = - damageLocationsSelected.REPLACE; + damageLocationsSelected.REPLACE; windShieldOptions.selectedWindshieldReplaceOptions.push( damageLocationsSelected.PASSENGER ); @@ -335,7 +335,7 @@ export default { isWindshieldRepair: this.isWindshieldRepair, selectedGlassToReplace: this.selectedGlassToReplace(), selectedWindshieldChipCount: - this.selectedWindshieldOptions.selectedWindshieldChipCount, + this.selectedWindshieldOptions.selectedWindshieldChipCount, }, false ); @@ -358,9 +358,9 @@ export default { const payment = this.$store.getters.payment; const vehicleChangedDuringPolicyLookupInHeritage = - payment.isInsurance && - payment.insuranceCoverage.coverageStatus && - payment.insuranceCoverage.coverageStatus !== ""; + payment.isInsurance && + payment.insuranceCoverage.coverageStatus && + payment.insuranceCoverage.coverageStatus !== ""; if (vehicleChangedDuringPolicyLookupInHeritage) { if (store.getters.damage.isRepair) { this.$router.navigateWithSaving( @@ -370,7 +370,7 @@ export default { } else { this.$router.navigateWithSaving( this.navigationScenarios - .CLICKED_FORWARD_WITH_REPLACE_AND_VERIFIED_INSURANCE, + .CLICKED_FORWARD_WITH_REPLACE_AND_VERIFIED_INSURANCE, this.$route ); } @@ -452,7 +452,7 @@ export default { return ( this.isWindshieldDamageLocation && this.selectedWindshieldOptions.selectedWindshieldDamageType === - damageLocationsSelected.REPAIR + damageLocationsSelected.REPAIR ); }, isDriverSideReplace() { @@ -480,10 +480,10 @@ export default { if ( !this.selectedDamageLocations?.includes("Windshield") || this.selectedWindshieldOptions.selectedWindshieldDamageType === - damageLocationsSelected.REPAIR || + damageLocationsSelected.REPAIR || !this.selectedWindshieldOptions.selectedWindshieldReplaceOptions ) - return false; + return false; return ( this.selectedWindshieldOptions.selectedWindshieldReplaceOptions?.some( @@ -502,14 +502,14 @@ export default { ); } ) || - this.selectedWindshieldOptions.selectedWindshieldReplaceOptions?.some( - (selectedPassengerWindshield) => { - return ( - selectedPassengerWindshield.toUpperCase() === - damageLocationsSelected.PASSENGER.toUpperCase() - ); - } - )) + this.selectedWindshieldOptions.selectedWindshieldReplaceOptions?.some( + (selectedPassengerWindshield) => { + return ( + selectedPassengerWindshield.toUpperCase() === + damageLocationsSelected.PASSENGER.toUpperCase() + ); + } + )) ); }, shouldDisplayVehicleChangeAlert() { From 5ff14add7bbaa0a815737b28411ea6fb30dd0179 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Tue, 19 Sep 2023 12:22:56 -0400 Subject: [PATCH 042/122] Lookup Pages --- src/helpers/damage-helper.js | 7 ++--- src/helpers/damage-helper.spec.js | 11 ++++++-- src/helpers/unit-test-helper.js | 21 +++++++++++++++ .../address-lookup/address-lookup.spec.js | 13 +++++++--- src/layouts/address-lookup/address-lookup.vue | 26 +++++++++++++------ .../address-vehicles/address-vehicles.vue | 13 +++++++--- .../license-plate-lookup.spec.js | 14 +++++----- .../license-plate-lookup.vue | 21 ++++++++++----- src/layouts/vin-lookup/vin-lookup.vue | 14 +++++++--- src/mixins/base-mixin.js | 7 +++-- src/store/index.js | 25 ++++++++++++++---- src/store/store.spec.js | 19 +++++++++++--- 12 files changed, 141 insertions(+), 50 deletions(-) diff --git a/src/helpers/damage-helper.js b/src/helpers/damage-helper.js index 727825d9d..13defa5df 100644 --- a/src/helpers/damage-helper.js +++ b/src/helpers/damage-helper.js @@ -54,10 +54,11 @@ export function includesWindshieldReplacement() { return windshieldMatches.length > 0; } -export async function isGlassAvailableForCarId(carId) { - const newGlassOptions = await baseMixin.methods.dispatchStoreAction( +export async function isGlassAvailableForCarId(carId, pageNameToLog) { + const newGlassOptions = await baseMixin.methods.dispatchStoreActionWithLogging( storeActions.GET_DAMAGE_OPTIONS, - { carId: carId } + { carId: carId }, + pageNameToLog ); const currentGlassOptions = store.getters.damage.glassToReplace; diff --git a/src/helpers/damage-helper.spec.js b/src/helpers/damage-helper.spec.js index 73215b9c7..1b4bd9261 100644 --- a/src/helpers/damage-helper.spec.js +++ b/src/helpers/damage-helper.spec.js @@ -11,6 +11,13 @@ jest.mock("@/mixins/base-mixin.js", () => ({ }, }; }), + dispatchStoreActionWithLogging: jest.fn().mockImplementation(() => { + return { + data: { + windshieldOptions: { availableReplacementOptions: ["windshield"] }, + }, + }; + }), }, })); @@ -77,7 +84,7 @@ describe("damage-helper.js", () => { ]; // Act - const isGlassAvailable = await isGlassAvailableForCarId(); + const isGlassAvailable = await isGlassAvailableForCarId("id", "testName"); // Assert expect(isGlassAvailable).toEqual(true); @@ -91,7 +98,7 @@ describe("damage-helper.js", () => { { glassLocation: "Windshield", glassName: "sideWindow" }, ]; - const isGlassAvailable = await isGlassAvailableForCarId(); + const isGlassAvailable = await isGlassAvailableForCarId("id", "testName"); // Assert expect(isGlassAvailable).toEqual(false); diff --git a/src/helpers/unit-test-helper.js b/src/helpers/unit-test-helper.js index 1210f119c..467b38c2b 100644 --- a/src/helpers/unit-test-helper.js +++ b/src/helpers/unit-test-helper.js @@ -44,6 +44,16 @@ export function getMountOptions(mockData) { }); } }); + mocks.dispatchStoreActionWithLogging = jest.fn(); + mocks.dispatchStoreActionWithLogging.mockImplementation((actionName) => { + let actionFilterResult = mockData.actionList?.filter((x) => x.actionName == actionName); + + if (actionFilterResult?.length === 1) { + return Promise.resolve({ + data: actionFilterResult[0].data, + }); + } + }); // Mock const files mocks.storeActions = storeActions; @@ -141,5 +151,16 @@ function setupBaseMixinDispatchStoreAction(mockData) { }); } }); + + baseMixin.methods.dispatchStoreActionWithLogging = jest.fn(); + baseMixin.methods.dispatchStoreActionWithLogging.mockImplementation((actionName) => { + let actionFilterResult = mockData.actionList.filter((x) => x.actionName == actionName); + + if (actionFilterResult.length > 0 && actionFilterResult.length === 1) { + return Promise.resolve({ + data: actionFilterResult[0].data, + }); + } + }); } } diff --git a/src/layouts/address-lookup/address-lookup.spec.js b/src/layouts/address-lookup/address-lookup.spec.js index 63847588b..624fb175b 100644 --- a/src/layouts/address-lookup/address-lookup.spec.js +++ b/src/layouts/address-lookup/address-lookup.spec.js @@ -471,7 +471,7 @@ describe("address-lookup.vue", () => { await wrapper.vm.forwardButtonAction(); // Assert - expect(wrapper.vm.dispatchStoreAction).toHaveBeenCalledWith( + expect(wrapper.vm.dispatchStoreActionWithLogging).toHaveBeenCalledWith( "lookupVinByAddress", { licenseLastName: undefined, @@ -479,12 +479,17 @@ describe("address-lookup.vue", () => { licenseStreetAddress: "1234 Main St", licenseZip: "43215", }, + "address-lookup", false ); - expect(wrapper.vm.dispatchStoreAction).toHaveBeenCalledWith("validateZip", { - zip: "43215", - }); + expect(wrapper.vm.dispatchStoreActionWithLogging).toHaveBeenCalledWith( + "validateZip", + { + zip: "43215", + }, + "address-lookup" + ); }); }); diff --git a/src/layouts/address-lookup/address-lookup.vue b/src/layouts/address-lookup/address-lookup.vue index f0bf91325..b95be8e83 100644 --- a/src/layouts/address-lookup/address-lookup.vue +++ b/src/layouts/address-lookup/address-lookup.vue @@ -207,7 +207,7 @@ export default { // Vehicle info change in the flow, use a variable to keep track and commit to state at the end. let vehicleInfoToCommit = {}; - const vinLookupResponse = this.dispatchStoreAction( + const vinLookupResponse = this.dispatchStoreActionWithLogging( storeActions.LOOKUP_VIN_BY_ADDRESS, { licenseLastName: this.customerQuestions.lastName, @@ -215,6 +215,7 @@ export default { licenseZip: this.customerQuestions.addressQuestions.zipCode, licenseState: this.customerQuestions.addressQuestions.state, }, + "address-lookup", false ); @@ -227,12 +228,20 @@ export default { { resultKey: "serviceZipValidationResponse", promise: this.serviceZipCode - ? this.dispatchStoreAction(storeActions.VALIDATE_ZIP, { - zip: this.serviceZipCode, - }) - : this.dispatchStoreAction(storeActions.VALIDATE_ZIP, { - zip: this.customerQuestions.addressQuestions.zipCode, - }), + ? this.dispatchStoreActionWithLogging( + storeActions.VALIDATE_ZIP, + { + zip: this.serviceZipCode, + }, + "address-lookup" + ) + : this.dispatchStoreActionWithLogging( + storeActions.VALIDATE_ZIP, + { + zip: this.customerQuestions.addressQuestions.zipCode, + }, + "address-lookup" + ), }, ]; @@ -267,7 +276,8 @@ export default { this.displayMatchedDifferentVehicleAlert = true; this.isSelectedGlassAvailableForVehicle = await isGlassAvailableForCarId( - carFound.carId + carFound.carId, + "address-lookup" ); // Update button "Continue with..." diff --git a/src/layouts/address-vehicles/address-vehicles.vue b/src/layouts/address-vehicles/address-vehicles.vue index de1fa9999..f7af34ec9 100644 --- a/src/layouts/address-vehicles/address-vehicles.vue +++ b/src/layouts/address-vehicles/address-vehicles.vue @@ -162,9 +162,13 @@ export default { this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route); }, async forwardButtonAction() { - const vinLookup = await this.dispatchStoreAction(storeActions.LOOKUP_VEHICLE_BY_VIN, { - vin: this.selectedVehicle.vin, - }).catch(() => { + const vinLookup = await this.dispatchStoreActionWithLogging( + storeActions.LOOKUP_VEHICLE_BY_VIN, + { + vin: this.selectedVehicle.vin, + }, + "address-vehicles" + ).catch(() => { this.$refs.funnelFooter.removeLoader(); }); @@ -173,7 +177,8 @@ export default { } this.isSelectedGlassAvailableForVehicle = await isGlassAvailableForCarId( - vinLookup.data.carId + vinLookup.data.carId, + "address-vehicles" ); await this.dispatchStoreAction( diff --git a/src/layouts/license-plate-lookup/license-plate-lookup.spec.js b/src/layouts/license-plate-lookup/license-plate-lookup.spec.js index bf5751637..2fa11b776 100644 --- a/src/layouts/license-plate-lookup/license-plate-lookup.spec.js +++ b/src/layouts/license-plate-lookup/license-plate-lookup.spec.js @@ -120,7 +120,7 @@ describe("license-plate-lookup.vue", () => { wrapper.vm.getCmsContent = jest.fn().mockImplementation(() => ""); wrapper.vm.navigateForward = jest.fn(); - wrapper.vm.dispatchStoreAction = jest.fn().mockImplementation(() => + wrapper.vm.dispatchStoreActionWithLogging = jest.fn().mockImplementation(() => Promise.resolve({ data: { vehicle: { @@ -157,7 +157,7 @@ describe("license-plate-lookup.vue", () => { }); // Mock store action call - wrapper.vm.dispatchStoreAction = jest.fn().mockImplementation(() => + wrapper.vm.dispatchStoreActionWithLogging = jest.fn().mockImplementation(() => Promise.resolve({ data: { vehicle: { @@ -201,7 +201,7 @@ describe("license-plate-lookup.vue", () => { wrapper.vm.navigateForward = jest.fn(); // Mock store action call - wrapper.vm.dispatchStoreAction = jest.fn().mockImplementation(() => + wrapper.vm.dispatchStoreActionWithLogging = jest.fn().mockImplementation(() => Promise.resolve({ data: { vehicle: { @@ -242,7 +242,7 @@ describe("license-plate-lookup.vue", () => { wrapper.vm.getCmsContent = jest.fn().mockImplementation(() => { return ""; }); - wrapper.vm.dispatchStoreAction = jest.fn(); + wrapper.vm.dispatchStoreActionWithLogging = jest.fn(); await wrapper.vm.navigateForward(); @@ -379,7 +379,7 @@ describe("license-plate-lookup.vue", () => { return { data: { vehicle: { carId: "C00000" } } }; }); - wrapper.vm.dispatchStoreAction = jest.fn().mockImplementation(() => + wrapper.vm.dispatchStoreActionWithLogging = jest.fn().mockImplementation(() => Promise.resolve({ data: { vehicle: { @@ -417,7 +417,7 @@ describe("license-plate-lookup.vue", () => { await wrapper.setData({ registrationZip: "00000" }); navigateToHeritage.navigateToHeritageFunnel = jest.fn(); - wrapper.vm.dispatchStoreAction = jest.fn().mockImplementation(() => + wrapper.vm.dispatchStoreActionWithLogging = jest.fn().mockImplementation(() => Promise.resolve({ data: { vehicle: { @@ -449,7 +449,7 @@ describe("license-plate-lookup.vue", () => { await wrapper.setData({ registrationZipCode: "00000" }); navigateToHeritage.navigateToHeritageFunnel = jest.fn(); - wrapper.vm.dispatchStoreAction = jest.fn().mockImplementation(() => + wrapper.vm.dispatchStoreActionWithLogging = jest.fn().mockImplementation(() => Promise.resolve({ data: { vehicle: { diff --git a/src/layouts/license-plate-lookup/license-plate-lookup.vue b/src/layouts/license-plate-lookup/license-plate-lookup.vue index 326215243..abd49c91a 100644 --- a/src/layouts/license-plate-lookup/license-plate-lookup.vue +++ b/src/layouts/license-plate-lookup/license-plate-lookup.vue @@ -199,9 +199,10 @@ export default { async forwardButtonAction() { this.resetWarningsAndErrors(); - const registrationZipValidationResponse = this.dispatchStoreAction( + const registrationZipValidationResponse = this.dispatchStoreActionWithLogging( storeActions.VALIDATE_ZIP, - { zip: this.registrationZipCode } + { zip: this.registrationZipCode }, + "license-plate-lookup" ); // Settle promises and get results @@ -214,9 +215,13 @@ export default { // If serviceZipCode is not set, then sets the response to the registrationZipValidationResponse. Calls VALIDATE_ZIP if the serviceZipCode is set. resultKey: "serviceZipValidationResponse", promise: this.serviceZipCode - ? this.dispatchStoreAction(storeActions.VALIDATE_ZIP, { - zip: this.serviceZipCode, - }) + ? this.dispatchStoreActionWithLogging( + storeActions.VALIDATE_ZIP, + { + zip: this.serviceZipCode, + }, + "license-plate-lookup" + ) : registrationZipValidationResponse, }, ]; @@ -260,7 +265,8 @@ export default { this.displayMatchedDifferentVehicleAlert = true; this.isSelectedGlassAvailableForVehicle = await isGlassAvailableForCarId( - vinLookup.data.vehicle.carId + vinLookup.data.vehicle.carId, + "license-plate-lookup" ); // Update button "Continue with..." @@ -312,9 +318,10 @@ export default { return await this.navigateForward(); }, lookupVin(plate, state) { - return this.dispatchStoreAction( + return this.dispatchStoreActionWithLogging( storeActions.LOOKUP_VIN_BY_PLATE, { licensePlate: plate, licenseState: state }, + "license-plate-lookup", false ); }, diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue index c0b1f1788..3103ac4e1 100644 --- a/src/layouts/vin-lookup/vin-lookup.vue +++ b/src/layouts/vin-lookup/vin-lookup.vue @@ -255,9 +255,10 @@ export default { // If this is a new VIN Lookup, do both a Vehicle Lookup and a Zip Validation if (!this.vinPopulatedOnPageLoad) { - const vehicleLookupResponse = this.dispatchStoreAction( + const vehicleLookupResponse = this.dispatchStoreActionWithLogging( storeActions.LOOKUP_VEHICLE_BY_VIN, - { vin: this.vin } + { vin: this.vin }, + "vin-lookup" ); // Settle promises and get results @@ -311,7 +312,8 @@ export default { this.displayMatchedDifferentVehicleAlert = true; this.isSelectedGlassAvailableForVehicle = await isGlassAvailableForCarId( - resultMap.vehicleLookupResponse.carId + resultMap.vehicleLookupResponse.carId, + "vin-lookup" ); // Update button "Continue with..." @@ -399,7 +401,11 @@ export default { }, getVinFromImage(image) { return new Promise((resolve, reject) => { - this.dispatchStoreAction(storeActions.LOOKUP_VIN_BY_IMAGE, image) + this.dispatchStoreActionWithLogging( + storeActions.LOOKUP_VIN_BY_IMAGE, + image, + "vin-lookup" + ) .then((response) => { if (response.data.length > 0) { resolve(response.data[0]); diff --git a/src/mixins/base-mixin.js b/src/mixins/base-mixin.js index 6ad522fc8..c38836dfb 100644 --- a/src/mixins/base-mixin.js +++ b/src/mixins/base-mixin.js @@ -64,9 +64,12 @@ export default { return footerInfoBox ? footerInfoBox.offsetHeight : 0; }, async getZipCodeData(zipCode) { - const serviceZipValidationResponse = await this.dispatchStoreAction( + const pageName = this.$options?.name; + + const serviceZipValidationResponse = await this.dispatchStoreActionWithLogging( storeActions.VALIDATE_ZIP, - { zip: zipCode } + { zip: zipCode }, + pageName ); return { diff --git a/src/store/index.js b/src/store/index.js index 87c6b95cd..a8cfe77fd 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -661,17 +661,19 @@ export const actions = { }); }, - lookupVehicleByVin(context, { vin }) { + lookupVehicleByVin(context, { payload: { vin }, pageNameToLog }) { return globalMethods.callHttpClient({ method: endpoints.LookupVehicleByVin.method, endpoint: endpoints.LookupVehicleByVin.url, payload: { vin: vin, // EX "1J4GW58S4XC541166" }, + logApiCall: true, + pageNameToLog: pageNameToLog, }); }, - lookupVinByPlate(context, { licensePlate, licenseState }) { + lookupVinByPlate(context, { payload: { licensePlate, licenseState }, pageNameToLog }) { return globalMethods.callHttpClient({ method: endpoints.LookupVinByPlate.method, endpoint: endpoints.LookupVinByPlate.url, @@ -679,12 +681,17 @@ export const actions = { licensePlate: licensePlate, licenseState: licenseState, }, + logApiCall: true, + pageNameToLog: pageNameToLog, }); }, lookupVinByAddress( context, - { licenseLastName, licenseStreetAddress, licenseZip, licenseState } + { + payload: { licenseLastName, licenseStreetAddress, licenseZip, licenseState }, + pageNameToLog, + } ) { return globalMethods.callHttpClient({ method: endpoints.LookupVinByAddress.method, @@ -695,10 +702,14 @@ export const actions = { licenseZip: licenseZip, licenseState: licenseState, }, + logApiCall: true, + pageNameToLog: pageNameToLog, }); }, - lookupVinByImage(context, image) { + lookupVinByImage(context, { payload, pageNameToLog }) { + const image = payload; + return new Promise((resolve, reject) => { let reader = new FileReader(); reader.onload = (e) => { @@ -720,6 +731,8 @@ export const actions = { method: endpoints.LookupVinByImage.method, endpoint: endpoints.LookupVinByImage.url, payload: data, + logApiCall: true, + pageNameToLog: pageNameToLog, }); }); }, @@ -790,10 +803,12 @@ export const actions = { }); }, - validateZip(context, { zip }) { + validateZip(context, { payload: { zip }, pageNameToLog }) { return globalMethods.callHttpClient({ methods: endpoints.ValidateZip.method, endpoint: `${endpoints.ValidateZip.url}/${zip}`, + logApiCall: true, + pageNameToLog: pageNameToLog, }); }, diff --git a/src/store/store.spec.js b/src/store/store.spec.js index 75ebacc51..a0491f47c 100644 --- a/src/store/store.spec.js +++ b/src/store/store.spec.js @@ -428,7 +428,10 @@ describe("Actions", () => { }); // Assert - const response = await actions.lookupVinByPlate(context, "12345678901234567"); + const response = await actions.lookupVinByPlate(context, { + payload: { licensePlate: "12345678901234567", licenseState: "OH" }, + pageNameToLog: "test", + }); expect(response.data).toEqual({ carId: "C00000001" }); }); @@ -445,7 +448,10 @@ describe("Actions", () => { }); // Act - const response = await actions.lookupVinByImage(context, image); + const response = await actions.lookupVinByImage(context, { + payload: image, + pageNameToLog: "test", + }); // Assert expect(response.data).toEqual(["1C6JJTAG3NL134044"]); @@ -465,7 +471,9 @@ describe("Actions", () => { // Act // Assert - await expect(actions.lookupVinByImage(context, image)).rejects.toEqual("An error occurred"); + await expect( + actions.lookupVinByImage(context, { payload: image, pageNameToLog: "test" }) + ).rejects.toEqual("An error occurred"); }); it("getVehicleMakes action, should return makes list", async () => { @@ -574,7 +582,10 @@ describe("Actions", () => { }); }); - const response = await actions.validateZip(context, "43212"); + const response = await actions.validateZip(context, { + payload: { zip: "43212" }, + pageNameToLog: "test", + }); // Assert expect(response.data).toEqual({ From e4d98521d8cbb9155e0d25e45fb9fb4e470b9d77 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Tue, 19 Sep 2023 12:49:51 -0400 Subject: [PATCH 043/122] Test fix --- src/mixins/base-mixin.spec.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mixins/base-mixin.spec.js b/src/mixins/base-mixin.spec.js index b768b67d5..2ef76315e 100644 --- a/src/mixins/base-mixin.spec.js +++ b/src/mixins/base-mixin.spec.js @@ -101,8 +101,8 @@ describe("baseMixin.js", () => { test("getZipCodeData calls dispatch", () => { const mixIn = getMixInInstance({}); - mixIn.methods.dispatchStoreAction = jest.fn(); - mixIn.methods.dispatchStoreAction.mockReturnValue({ + mixIn.methods.dispatchStoreActionWithLogging = jest.fn(); + mixIn.methods.dispatchStoreActionWithLogging.mockReturnValue({ data: { isValid: true, isServiceable: true, state: "OH" }, }); const type = ""; @@ -118,7 +118,7 @@ describe("baseMixin.js", () => { mixIn.methods.getZipCodeData(type, payload); - expect(mixIn.methods.dispatchStoreAction).toBeCalled(); + expect(mixIn.methods.dispatchStoreActionWithLogging).toBeCalled(); }); }); From 7aa61e89982438931a984e00e8bca2ce8bbe740f Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Tue, 19 Sep 2023 12:50:09 -0400 Subject: [PATCH 044/122] Runexperiments --- src/router/index.js | 28 ++++++++++++++++++---------- src/store/index.js | 7 ++++++- src/store/store.spec.js | 10 ++++++++-- 3 files changed, 32 insertions(+), 13 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index e8fbf4d26..b49b38d9f 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -394,18 +394,26 @@ function arePagePrerequisitesValid(component) { // Run SiteEntry and PageEntry triggers for experiments async function runExperiments(nextPage) { if (!store.getters.applicationUser.triggeredSiteEntry) { - await baseMixin.methods.dispatchStoreAction(storeActions.RUN_EXPERIMENTS_FOR_TRIGGER, { - userId: getDeviceIdValue(), - triggerEvent: experimentTriggers.SITE_ENTRY, - triggerValue: applicationConfig.SITE_ENTRY_TRIGGER_VALUE, - }); + await baseMixin.methods.dispatchStoreActionWithLogging( + storeActions.RUN_EXPERIMENTS_FOR_TRIGGER, + { + userId: getDeviceIdValue(), + triggerEvent: experimentTriggers.SITE_ENTRY, + triggerValue: applicationConfig.SITE_ENTRY_TRIGGER_VALUE, + }, + nextPage + ); } - await baseMixin.methods.dispatchStoreAction(storeActions.RUN_EXPERIMENTS_FOR_TRIGGER, { - userId: getDeviceIdValue(), - triggerEvent: experimentTriggers.PAGE_ENTRY, - triggerValue: nextPage, - }); + await baseMixin.methods.dispatchStoreActionWithLogging( + storeActions.RUN_EXPERIMENTS_FOR_TRIGGER, + { + userId: getDeviceIdValue(), + triggerEvent: experimentTriggers.PAGE_ENTRY, + triggerValue: nextPage, + }, + nextPage + ); } export default router; diff --git a/src/store/index.js b/src/store/index.js index a8cfe77fd..50124bee7 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1083,7 +1083,10 @@ export const actions = { }); }, - async runExperimentsForTrigger(context, { userId, triggerEvent, triggerValue }) { + async runExperimentsForTrigger( + context, + { payload: { userId, triggerEvent, triggerValue }, pageNameToLog } + ) { if (triggerEvent == experimentTriggers.SITE_ENTRY) { context.commit(storeMutations.UPDATE_TRIGGERED_SITE_ENTRY, true); } @@ -1100,6 +1103,8 @@ export const actions = { method: endpoints.RunExperimentsForTrigger.method, endpoint: endpoints.RunExperimentsForTrigger.url, payload: payload, + logApiCall: true, + pageNameToLog: pageNameToLog, }); context.commit(storeMutations.UPDATE_EXPERIMENTS, response.data.experiments); diff --git a/src/store/store.spec.js b/src/store/store.spec.js index a0491f47c..611341aa7 100644 --- a/src/store/store.spec.js +++ b/src/store/store.spec.js @@ -1751,7 +1751,10 @@ describe("Actions", () => { // Act await actions.runExperimentsForTrigger(context, { - triggerEvent: experimentTriggers.SITE_ENTRY, + payload: { + triggerEvent: experimentTriggers.SITE_ENTRY, + }, + pageNameToLog: "test", }); // Assert @@ -1785,7 +1788,10 @@ describe("Actions", () => { // Act await actions.runExperimentsForTrigger(context, { - triggerEvent: "NotSiteEntry", + payload: { + triggerEvent: "NotSiteEntry", + }, + pageNameToLog: "test", }); // Assert From c5162483f423213aed030c0f62ddd401f1f4f10a Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Tue, 19 Sep 2023 14:33:44 -0400 Subject: [PATCH 045/122] WIP grid and style updates. --- src/layouts/address-lookup/address-lookup.vue | 6 ++---- .../customer-details/customer-details.vue | 6 ++---- src/layouts/estimate/estimate.vue | 6 ++---- .../license-plate-lookup.vue | 6 ++---- src/layouts/quote/quote.vue | 6 ++---- src/layouts/review/review.vue | 6 ++---- src/layouts/schedule/schedule.vue | 6 ++---- .../service-location/service-location.vue | 6 ++---- src/layouts/vehicle-damage/vehicle-damage.vue | 16 ++++++++++++---- src/layouts/vehicle-parts/vehicle-parts.vue | 16 ++++++++++++---- src/layouts/vehicle/vehicle.vue | 6 ++---- src/layouts/vin-lookup/vin-lookup.vue | 6 ++---- 12 files changed, 44 insertions(+), 48 deletions(-) diff --git a/src/layouts/address-lookup/address-lookup.vue b/src/layouts/address-lookup/address-lookup.vue index faae41388..34b111d15 100644 --- a/src/layouts/address-lookup/address-lookup.vue +++ b/src/layouts/address-lookup/address-lookup.vue @@ -7,9 +7,8 @@ -
-
 
-
+
+
-
 
diff --git a/src/layouts/customer-details/customer-details.vue b/src/layouts/customer-details/customer-details.vue index ebdd4c7a6..03de9ff97 100644 --- a/src/layouts/customer-details/customer-details.vue +++ b/src/layouts/customer-details/customer-details.vue @@ -6,9 +6,8 @@
-
-
 
-
+
+
-
 
diff --git a/src/layouts/estimate/estimate.vue b/src/layouts/estimate/estimate.vue index d6308f444..f27f833a0 100644 --- a/src/layouts/estimate/estimate.vue +++ b/src/layouts/estimate/estimate.vue @@ -7,9 +7,8 @@
-
-
 
-
+
+
@@ -80,7 +79,6 @@ @ForwardClicked="forwardButtonAction" />
-
 
diff --git a/src/layouts/license-plate-lookup/license-plate-lookup.vue b/src/layouts/license-plate-lookup/license-plate-lookup.vue index c9e3d248e..31ca3fec7 100644 --- a/src/layouts/license-plate-lookup/license-plate-lookup.vue +++ b/src/layouts/license-plate-lookup/license-plate-lookup.vue @@ -6,9 +6,8 @@
-
-
 
-
+
+
@@ -85,7 +84,6 @@ @back-clicked="backButtonAction" @ForwardClicked="forwardButtonAction" />
-
 
diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue index 357bd7c14..46f573144 100644 --- a/src/layouts/quote/quote.vue +++ b/src/layouts/quote/quote.vue @@ -7,9 +7,8 @@
-
-
 
-
+
+
@@ -52,7 +51,6 @@ @back-clicked="backButtonAction" @ForwardClicked="forwardButtonAction" />
-
 
diff --git a/src/layouts/review/review.vue b/src/layouts/review/review.vue index c7112fb00..639fd0fd5 100644 --- a/src/layouts/review/review.vue +++ b/src/layouts/review/review.vue @@ -7,9 +7,8 @@
-
-
 
-
+
+
@@ -101,7 +100,6 @@ @back-clicked="backButtonAction" @ForwardClicked="forwardButtonAction" />
-
 
diff --git a/src/layouts/schedule/schedule.vue b/src/layouts/schedule/schedule.vue index 59d8e932a..f276ea1cd 100644 --- a/src/layouts/schedule/schedule.vue +++ b/src/layouts/schedule/schedule.vue @@ -7,9 +7,8 @@
-
-
 
-
+
+