From 930ba9c3a02297b6546787582569130d51ece074 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Wed, 12 Jun 2024 13:47:49 -0400 Subject: [PATCH 01/35] Add first WIP --- src/layouts/service-zip/service-zip.spec.js | 0 src/layouts/service-zip/service-zip.vue | 288 ++++++++++++++++++ src/router/router-constants/fmgPage-values.js | 1 + .../router-constants/navigation-scenarios.js | 2 + src/router/router-constants/routing-table.js | 2 +- 5 files changed, 292 insertions(+), 1 deletion(-) create mode 100644 src/layouts/service-zip/service-zip.spec.js create mode 100644 src/layouts/service-zip/service-zip.vue diff --git a/src/layouts/service-zip/service-zip.spec.js b/src/layouts/service-zip/service-zip.spec.js new file mode 100644 index 000000000..e69de29bb diff --git a/src/layouts/service-zip/service-zip.vue b/src/layouts/service-zip/service-zip.vue new file mode 100644 index 000000000..91b0f9b19 --- /dev/null +++ b/src/layouts/service-zip/service-zip.vue @@ -0,0 +1,288 @@ + + + + + diff --git a/src/router/router-constants/fmgPage-values.js b/src/router/router-constants/fmgPage-values.js index 356fbf2c1..6b4ec77ea 100644 --- a/src/router/router-constants/fmgPage-values.js +++ b/src/router/router-constants/fmgPage-values.js @@ -9,6 +9,7 @@ const fmgPageValues = { CAPABILITY_QUESTIONS: "capability-questions", LICENSE_PLATE_LOOKUP: "license-plate-lookup", ESTIMATE: "estimate", + SERVICE_ZIP: "service-zip", ADDRESS_VEHICLES: "address-vehicles", QUOTE: "quote", INSURANCE_COMPANY: "insurance-company", diff --git a/src/router/router-constants/navigation-scenarios.js b/src/router/router-constants/navigation-scenarios.js index a765f3391..4cb7d72ed 100644 --- a/src/router/router-constants/navigation-scenarios.js +++ b/src/router/router-constants/navigation-scenarios.js @@ -21,11 +21,13 @@ const navigationScenarios = { CLICKED_FORWARD_WITH_REPLACE_AND_VERIFIED_INSURANCE: "CLICKED_FORWARD_WITH_REPLACE_AND_VERIFIED_INSURANCE", CLICKED_FORWARD_WITHOUT_VIN: "CLICKED_FORWARD_WITHOUT_VIN", + CLICKED_FORWARD_WITH_SKIP_VIN: "CLICKED_FORWARD_WITH_SKIP_VIN", CLICKED_FORWARD_WITH_MULTIPLE_VEHICLES: "CLICKED_FORWARD_WITH_MULTIPLE_VEHICLES", SELECTED_VIN_WITH_MISMATCHED_GLASS: "SELECTED_VIN_WITH_MISMATCHED_GLASS", SELECTED_MANUAL_VIN: "SELECTED_MANUAL_VIN", SELECTED_LICENSE_PLATE: "SELECTED_LICENSE_PLATE", SELECTED_HOME_ADDRESS: "SELECTED_HOME_ADDRESS", + SELECTED_NO_VIN: "SELECTED_NO_VIN", CLICKED_FORWARD_WITH_NO_QUESTIONS: "CLICKED_FORWARD_WITH_NO_QUESTIONS", CLICKED_VIN_RETRY: "CLICKED_VIN_RETRY", diff --git a/src/router/router-constants/routing-table.js b/src/router/router-constants/routing-table.js index afa6baf82..c337276f3 100644 --- a/src/router/router-constants/routing-table.js +++ b/src/router/router-constants/routing-table.js @@ -27,7 +27,7 @@ const routingTable = function (store) { }, { scenario: navigationScenarios.CLICKED_FORWARD_WITHOUT_VIN, - destinationFmgPageValue: fmgPageValues.ESTIMATE, + destinationFmgPageValue: fmgPageValues.SERVICE_ZIP, }, { scenario: From c5838a0184cd8cd599862b08ef3aab5f0b1b65fb Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Thu, 13 Jun 2024 15:45:17 -0400 Subject: [PATCH 02/35] Add service-zip to repair/skipvin flow --- src/layouts/service-zip/service-zip.vue | 5 -- src/layouts/vehicle-damage/vehicle-damage.vue | 11 ++-- src/router/router-constants/routing-table.js | 51 +++++++++++++++++-- 3 files changed, 54 insertions(+), 13 deletions(-) diff --git a/src/layouts/service-zip/service-zip.vue b/src/layouts/service-zip/service-zip.vue index 91b0f9b19..d15b06dcb 100644 --- a/src/layouts/service-zip/service-zip.vue +++ b/src/layouts/service-zip/service-zip.vue @@ -1,5 +1,4 @@ @@ -33,6 +29,7 @@ export default { type: String, default: null, }, + isRecal: Boolean, }, computed: { ModalName() { @@ -84,9 +81,20 @@ export default { .modal-dialog { .modal-content { .modal-body { - .recal-header { - line-height: 32px; - text-align: center; + .recal-modal { + display: flex; + flex-direction: column; + h5 { + text-align: center; + line-height: 32px; + order: 1; + } + p { + order: 3; + } + img { + order: 2; + } } .modal-sub-body { color: $gray-600; diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue index c01a894ca..93c2cecb6 100644 --- a/src/layouts/quote/quote.vue +++ b/src/layouts/quote/quote.vue @@ -67,7 +67,7 @@ - + Date: Fri, 21 Jun 2024 14:50:53 +0530 Subject: [PATCH 14/35] Update content-group-modal.vue --- src/fmg-components/content-group-modal/content-group-modal.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fmg-components/content-group-modal/content-group-modal.vue b/src/fmg-components/content-group-modal/content-group-modal.vue index 9003ad3c4..fa64fd069 100644 --- a/src/fmg-components/content-group-modal/content-group-modal.vue +++ b/src/fmg-components/content-group-modal/content-group-modal.vue @@ -4,7 +4,7 @@ :modalId="ModalName" :footerButtonText="ModalCloseButtonText" @footer-button-event="footerButtonClick"> -
+

From b5cf4e9bcefdffe24bd0e3e6ea94b86e79bb57b2 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Mon, 24 Jun 2024 10:51:05 -0400 Subject: [PATCH 15/35] Moved the code that appends the google autocomplete dropdown to the first keydown event --- src/fmg-components/address-questions/address-questions.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/fmg-components/address-questions/address-questions.vue b/src/fmg-components/address-questions/address-questions.vue index dfbbb7c52..66ce8e1e6 100644 --- a/src/fmg-components/address-questions/address-questions.vue +++ b/src/fmg-components/address-questions/address-questions.vue @@ -243,11 +243,11 @@ export default { this.fillInAddress ); - // When the Street Address textbox receives focus, + // When the Street Address textbox receives input for the first time, // append the search results list container to the bottom of the textbox // and disable browser autofill this.addressField1.addEventListener( - "focus", + "keydown", (e) => { // Make place results box stick to the input on scroll const streetAddressField = document.getElementById("streetAddressField"); @@ -276,6 +276,7 @@ export default { const addressFields = document.querySelectorAll( ".address-questions input, .address-questions select" ); + for (let addressField of addressFields) { addressField.addEventListener("input", (e) => { switch (e.inputType) { @@ -433,6 +434,7 @@ export default { (this.addressModel.zipCode ?? "") !== ""; if (!this.showAddressFields) { + console.log("loading autocomplete"); this.loadGooglePlacesAutocompleteScript(); } }, From ce25a957594a93711363902f349494aab039edc4 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Mon, 24 Jun 2024 10:59:34 -0400 Subject: [PATCH 16/35] Removed console log that was left in --- src/fmg-components/address-questions/address-questions.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/fmg-components/address-questions/address-questions.vue b/src/fmg-components/address-questions/address-questions.vue index 66ce8e1e6..7acd0f4f0 100644 --- a/src/fmg-components/address-questions/address-questions.vue +++ b/src/fmg-components/address-questions/address-questions.vue @@ -434,7 +434,6 @@ export default { (this.addressModel.zipCode ?? "") !== ""; if (!this.showAddressFields) { - console.log("loading autocomplete"); this.loadGooglePlacesAutocompleteScript(); } }, From 2e12fb3c90c6da7e79db3f0317610c162f80165e Mon Sep 17 00:00:00 2001 From: hiteshkumar87 Date: Tue, 25 Jun 2024 18:26:02 +0530 Subject: [PATCH 17/35] CSR-2087 Custom query strings --- src/constants/query-strings.js | 8 ++ src/constants/store-actions.js | 1 + src/constants/store-mutations.js | 1 + src/layouts/estimate/estimate.spec.js | 27 ++++ src/layouts/estimate/estimate.vue | 7 + .../insurance-company/insurance-company.vue | 4 + src/layouts/part-questions/part-questions.vue | 6 + src/layouts/quote/quote.spec.js | 112 ++++++++++++++- src/layouts/quote/quote.vue | 11 ++ src/layouts/service-zip/service-zip.spec.js | 56 +++++++- src/layouts/service-zip/service-zip.vue | 24 +++- .../vehicle-damage/vehicle-damage.spec.js | 53 ++++++++ src/layouts/vehicle-damage/vehicle-damage.vue | 11 ++ src/layouts/vehicle/vehicle.spec.js | 128 ++++++++++++++++-- src/layouts/vehicle/vehicle.vue | 14 +- src/mixins/base-mixin.js | 4 + src/router/index.js | 75 +++++++++- src/store/index.js | 17 ++- 18 files changed, 537 insertions(+), 22 deletions(-) diff --git a/src/constants/query-strings.js b/src/constants/query-strings.js index 76411c542..a3b3c732c 100644 --- a/src/constants/query-strings.js +++ b/src/constants/query-strings.js @@ -25,6 +25,14 @@ const queryStrings = { REFERRAL_NUMBER: "rn", PARENT_ACCOUNT: "pa", CORRELATION_ID: "ci", + VEHICLE_YEAR: "vehicleyear", + VEHICLE_MAKE: "vehiclemake", + VEHICLE_MODEL: "vehiclemodel", + VEHICLE_STYLE: "vehiclestyle", + VEHICLE_DAMAGE: "vehicledamage", + SERVICE_ZIP: "servicezip", + EMAIL: "email", + IS_INSURANCE: "isinsurance", }; export { queryStrings }; diff --git a/src/constants/store-actions.js b/src/constants/store-actions.js index bd772cafe..0001daf6a 100644 --- a/src/constants/store-actions.js +++ b/src/constants/store-actions.js @@ -96,6 +96,7 @@ const storeActions = { CREATE_SUBMITTED_ORDER: "createSubmittedOrder", RESET_SUBMITTED_ORDER: "resetSubmittedOrder", + RESET_IS_LEAD_GEN: "resetIsLeadGen", }; export { storeActions }; diff --git a/src/constants/store-mutations.js b/src/constants/store-mutations.js index 8d23f50ab..f78b970c3 100644 --- a/src/constants/store-mutations.js +++ b/src/constants/store-mutations.js @@ -60,6 +60,7 @@ const storeMutations = { Customer_Portal_Login_Token: "updateCustomerPortalLoginToken", LOCK_TOKEN: "updateLockToken", UPDATE_SETTLED_TENDER_AMOUNT: "updateSettledTenderAmount", + UPDATE_IS_LEAD_GEN: "updateIsLeadGen", // EVENT BUS MUTATIONS ADD_EVENT_TO_BUS: "addEventToBus", diff --git a/src/layouts/estimate/estimate.spec.js b/src/layouts/estimate/estimate.spec.js index a81ead0c3..14752e171 100644 --- a/src/layouts/estimate/estimate.spec.js +++ b/src/layouts/estimate/estimate.spec.js @@ -212,6 +212,33 @@ describe("estimate.vue", () => { }); }); +describe("estimate.vue", () => { + test("should call forwardButtonAction if isLeadGen is true", async () => { + // update store with isLeadGen as true + store.commit(storeMutations.UPDATE_IS_LEAD_GEN, true); + + // Set up the component + const { wrapper } = setupMocks({}); + wrapper.vm.forwardButtonAction = jest.fn(); + const nextFunction = jest.fn((c) => { + c(wrapper.vm); + }); + + // Set selectedVinLookupMethod to decline + wrapper.setData({ selectedVinLookupMethod: vinLookupMethodSelections.DECLINE }); + + // Call the method that contains the if-else logic + await estimate.beforeRouteEnter.call( + wrapper.vm, + { query: { fmgPage: "estimate" } }, + undefined, + nextFunction + ); + expect(nextFunction).toHaveBeenCalled(); + expect(wrapper.vm.forwardButtonAction).toHaveBeenCalled(); + }); +}); + function setupMocks({ groupName = "estimate", skipVin = false, diff --git a/src/layouts/estimate/estimate.vue b/src/layouts/estimate/estimate.vue index 4f7c44cdd..913520626 100644 --- a/src/layouts/estimate/estimate.vue +++ b/src/layouts/estimate/estimate.vue @@ -145,6 +145,13 @@ export default { } vm.setCmsContent(resultMap.cmsContent); + if (store.getters.isLeadGen) { + vm.selectedVinLookupMethod = vinLookupMethodSelections.DECLINE; + vm.forwardButtonAction(); + } else { + baseMixin.methods.dispatchStoreAction(storeActions.RESET_IS_LEAD_GEN); + baseMixin.methods.hideFmgLoadingModal(); + } }); }, methods: { diff --git a/src/layouts/insurance-company/insurance-company.vue b/src/layouts/insurance-company/insurance-company.vue index a15de8311..8cdec3afa 100644 --- a/src/layouts/insurance-company/insurance-company.vue +++ b/src/layouts/insurance-company/insurance-company.vue @@ -76,6 +76,10 @@ export default { next((vm) => { vm.setCmsContent(resultMap.cmsContent); vm.originalList = resultMap.insuranceCompanyList; + if (store.getters.isLeadGen) { + baseMixin.methods.dispatchStoreAction(storeActions.RESET_IS_LEAD_GEN); + baseMixin.methods.hideFmgLoadingModal(); + } }); }, data() { diff --git a/src/layouts/part-questions/part-questions.vue b/src/layouts/part-questions/part-questions.vue index 9f4a13902..9249a5a57 100644 --- a/src/layouts/part-questions/part-questions.vue +++ b/src/layouts/part-questions/part-questions.vue @@ -29,6 +29,8 @@ import { Form, defineRule } from "vee-validate"; import { required } from "@/helpers/validation-rules"; import { errorMessages } from "@/constants/error-messages"; import vehicleQuestionsMixin from "@/mixins/vehicle-questions-mixin"; +import baseMixin from "@/mixins/base-mixin.js"; +import { storeActions } from "@/constants/store-actions"; // DEFINE VALIDATION RULES defineRule("questions-required", required(errorMessages.OPTION_REQUIRED)); @@ -53,6 +55,10 @@ export default { // Call the "next" function to complete the transition to this page. next((vm) => { vm.setCmsContent(resultMap.cmsContent); + if (store.getters.isLeadGen) { + baseMixin.methods.dispatchStoreAction(storeActions.RESET_IS_LEAD_GEN); + baseMixin.methods.hideFmgLoadingModal(); + } }); }, data() { diff --git a/src/layouts/quote/quote.spec.js b/src/layouts/quote/quote.spec.js index b54f5d0fb..9fd4153f7 100644 --- a/src/layouts/quote/quote.spec.js +++ b/src/layouts/quote/quote.spec.js @@ -640,12 +640,122 @@ describe("quote.vue", () => { ); }); }); +describe("quote.vue", () => { + test("should call forwardButtonAction if isLeadGen is true and Insurance is true", async () => { + // Set up the store with isLeadGen as true + + store.getters = { + lineItems: { + glassParts: ["item", "item2"], + }, + order: { + lineItems: { + glassParts: ["item", "item2"], + }, + serviceLocation: { + zipCode: "12345", + zipCodeCtu: "value", + }, + damage: { + isRepair: false, + }, + referralNumber: "1234567", + payment: { + isInsurance: true, + inactivePromos: [], + }, + }, + isLeadGen: true, + payment: { + isInsurance: true, + inactivePromos: [], + }, + vehicle: { + cardId: "123", + }, + experimentSettings: { + settingName: "SERVICE_PACKAGE_DISCOUNT", + }, + }; + + // Set up the component + const { wrapper } = setupMocks({}); + wrapper.vm.$route = { query: null }; + wrapper.vm.forwardButtonAction = jest.fn(); + const nextFunction = jest.fn((c) => { + c(wrapper.vm); + }); + + // Call the method that contains the if-else logic + await quote.beforeRouteEnter.call( + wrapper.vm, + { query: { fmgPage: "quote" } }, + undefined, + nextFunction + ); + expect(nextFunction).toHaveBeenCalled(); + expect(wrapper.vm.forwardButtonAction).toHaveBeenCalled(); + }); + test("should not call forwardButtonAction if isLeadGen is true and Insurance is false", async () => { + // Set up the store with isLeadGen as true + store.getters = { + lineItems: { + glassParts: ["item", "item2"], + }, + order: { + lineItems: { + glassParts: ["item", "item2"], + }, + serviceLocation: { + zipCode: "12345", + zipCodeCtu: "value", + }, + damage: { + isRepair: false, + }, + referralNumber: "1234567", + payment: { + isInsurance: null, + inactivePromos: [], + }, + }, + isLeadGen: true, + payment: { + isInsurance: null, + inactivePromos: [], + }, + vehicle: { + cardId: "123", + }, + experimentSettings: { + settingName: "SERVICE_PACKAGE_DISCOUNT", + }, + }; + + // Set up the component + const { wrapper } = setupMocks({}); + wrapper.vm.$route = { query: null }; + wrapper.vm.forwardButtonAction = jest.fn(); + const nextFunction = jest.fn((c) => { + c(wrapper.vm); + }); + + // Call the method that contains the if-else logic + await quote.beforeRouteEnter.call( + wrapper.vm, + { query: { fmgPage: "quote" } }, + undefined, + nextFunction + ); + expect(wrapper.vm.forwardButtonAction).not.toHaveBeenCalled(); + }); +}); function setupMocks({ customMountOptions }) { const mountOptions = getMountOptions({ ...customMountOptions, }); - + baseMixin.methods.hideFmgLoadingModal = jest.fn(); mountOptions.global.mocks["$store"] = store; mountOptions["attachTo"] = document.body; diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue index 93c2cecb6..4477d4d0f 100644 --- a/src/layouts/quote/quote.vue +++ b/src/layouts/quote/quote.vue @@ -252,6 +252,17 @@ export default { validateAlerts[0].shouldAutoFade ); } + if (store.getters.isLeadGen) { + if (store.getters.order.payment.isInsurance == true) { + vm.forwardButtonAction(); + } else { + baseMixin.methods.dispatchStoreAction(storeActions.RESET_IS_LEAD_GEN); + baseMixin.methods.hideFmgLoadingModal(); + } + } else { + baseMixin.methods.dispatchStoreAction(storeActions.RESET_IS_LEAD_GEN); + baseMixin.methods.hideFmgLoadingModal(); + } }); }, data() { diff --git a/src/layouts/service-zip/service-zip.spec.js b/src/layouts/service-zip/service-zip.spec.js index 5341f2b8a..6b1597da7 100644 --- a/src/layouts/service-zip/service-zip.spec.js +++ b/src/layouts/service-zip/service-zip.spec.js @@ -390,12 +390,66 @@ describe("service-zip.vue", () => { }); }); +describe("service-zip.vue", () => { + test("should call forwardButtonAction if isLeadGen is true and form is valid", async () => { + // Set up the store with isLeadGen as true + store.getters.isLeadGen = true; + + // Set up the component + const wrapper = setupMocks({}); + wrapper.vm.forwardButtonAction = jest.fn(); + const nextFunction = jest.fn((c) => { + c(wrapper.vm); + }); + + // Mock the isFormValid method + wrapper.vm.isFormValid = jest.fn().mockImplementation(() => { + return true; + }); + + // Call the method that contains the if-else logic + await serviceZip.beforeRouteEnter.call( + wrapper.vm, + { query: { fmgPage: "service-zip" } }, + undefined, + nextFunction + ); + expect(nextFunction).toHaveBeenCalled(); + expect(wrapper.vm.forwardButtonAction).toHaveBeenCalled(); + }); + test("should not call forwardButtonAction if isLeadGen is true and form is invalid", async () => { + // Set up the store with isLeadGen as true + store.getters.isLeadGen = true; + + // Set up the component + const wrapper = setupMocks({}); + wrapper.vm.forwardButtonAction = jest.fn(); + const nextFunction = jest.fn((c) => { + c(wrapper.vm); + }); + + // Mock the isFormValid method + wrapper.vm.isFormValid = jest.fn().mockImplementation(() => { + return false; + }); + + // Call the method that contains the if-else logic + await serviceZip.beforeRouteEnter.call( + wrapper.vm, + { query: { fmgPage: "service-zip" } }, + undefined, + nextFunction + ); + expect(wrapper.vm.forwardButtonAction).not.toHaveBeenCalled(); + }); +}); + function setupMocks({ customMountOptions, customZipQuery, customZipDataResponse }) { const route = { query: { fmgPage: "service-zip" }, params: {} }; if (customZipQuery) { route.query.zipcode = customZipQuery; } - + baseMixin.methods.hideFmgLoadingModal = jest.fn(); const mountOptions = getMountOptions({ ...customMountOptions, route: route, diff --git a/src/layouts/service-zip/service-zip.vue b/src/layouts/service-zip/service-zip.vue index e0bb3730b..ac2cd2905 100644 --- a/src/layouts/service-zip/service-zip.vue +++ b/src/layouts/service-zip/service-zip.vue @@ -131,8 +131,17 @@ export default { const resultMap = await settleAllPromises(promiseResultMap); - next((vm) => { + next(async (vm) => { vm.setCmsContent(resultMap.cmsContent); + if (store.getters.isLeadGen) { + const isValid = await vm.isFormValid(); + if (isValid) { + vm.forwardButtonAction(); + } else { + baseMixin.methods.dispatchStoreAction(storeActions.RESET_IS_LEAD_GEN); + baseMixin.methods.hideFmgLoadingModal(); + } + } }); }, methods: { @@ -175,12 +184,20 @@ export default { if (!zipCodeData.isValid) { this.displayInvalidZipAlert = true; + if (store.getters.isLeadGen) { + baseMixin.methods.dispatchStoreAction(storeActions.RESET_IS_LEAD_GEN); + baseMixin.methods.hideFmgLoadingModal(); + } return this.$refs.navbar.removeLoader(); } this.displayInvalidZipAlert = false; if (!zipCodeData.isServiceable) { this.displayNonServiceableZipAlert = true; + if (store.getters.isLeadGen) { + baseMixin.methods.dispatchStoreAction(storeActions.RESET_IS_LEAD_GEN); + baseMixin.methods.hideFmgLoadingModal(); + } return this.$refs.navbar.removeLoader(); } this.displayNonServiceableZipAlert = false; @@ -233,6 +250,11 @@ export default { await this.navigateForwardWithSingleCarMatch(); } }, + async isFormValid() { + const form = this.$refs.theForm; + const formValidateResponse = await form.validate(); + return formValidateResponse?.valid; + }, }, computed: { AlertNonServiceableZipHeader() { diff --git a/src/layouts/vehicle-damage/vehicle-damage.spec.js b/src/layouts/vehicle-damage/vehicle-damage.spec.js index e0450fd80..2bb761d5d 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.spec.js +++ b/src/layouts/vehicle-damage/vehicle-damage.spec.js @@ -66,6 +66,7 @@ jest.mock("@/store", () => ({ glassToReplace: [], }, }, + isLeadGen: false, }, })); @@ -760,6 +761,56 @@ describe("vehicle-damage.vue", () => { expect(wrapper.vm.shouldHideBackButton).toBeFalsy(); }); }); + + describe("vehicle-damage.vue", () => { + test("should call forwardButtonAction if isLeadGen is true and selectedDamageLocations is not empty", async () => { + // Set up the store with isLeadGen as true + store.getters.isLeadGen = true; + + // Set up the component + const { wrapper } = setupMocks({}); + wrapper.vm.forwardButtonAction = jest.fn(); + const nextFunction = jest.fn((c) => { + c(wrapper.vm); + }); + + // Set selectedDamageLocations + wrapper.setData({ selectedDamageLocations: ["windshield"] }); + + // Call the method that contains the if-else logic + await vehicleDamage.beforeRouteEnter.call( + wrapper.vm, + { query: { fmgPage: "vehicle-damage" } }, + undefined, + nextFunction + ); + expect(nextFunction).toHaveBeenCalled(); + expect(wrapper.vm.forwardButtonAction).toHaveBeenCalled(); + }); + test("should not call forwardButtonAction if isLeadGen is true and selectedDamageLocations is empty", async () => { + // Set up the store with isLeadGen as true + store.getters.isLeadGen = true; + + // Set up the component + const { wrapper } = setupMocks({}); + wrapper.vm.forwardButtonAction = jest.fn(); + const nextFunction = jest.fn((c) => { + c(wrapper.vm); + }); + + // Set selectedDamageLocations to empty + wrapper.setData({ selectedDamageLocations: [] }); + + // Call the method that contains the if-else logic + await vehicleDamage.beforeRouteEnter.call( + wrapper.vm, + { query: { fmgPage: "vehicle-damage" } }, + undefined, + nextFunction + ); + expect(wrapper.vm.forwardButtonAction).not.toHaveBeenCalled(); + }); + }); }); function setupMocks({ pageHeaderWidgetHeaderText, mountOptionsMockData, funnelCookie = {} }) { @@ -783,6 +834,7 @@ function setupMocks({ pageHeaderWidgetHeaderText, mountOptionsMockData, funnelCo isVerified: false, }, }, + isLeadGen: false, }, }, }; @@ -795,6 +847,7 @@ function setupMocks({ pageHeaderWidgetHeaderText, mountOptionsMockData, funnelCo //Mock api responses baseMixin.methods.dispatchStoreAction = jest.fn(); baseMixin.methods.dispatchStoreActionWithLogging = jest.fn(); + baseMixin.methods.hideFmgLoadingModal = jest.fn(); const apiResponses = { cmsContent: { FunnelSubHeaderWidget: pageHeaderWidgetHeaderText, diff --git a/src/layouts/vehicle-damage/vehicle-damage.vue b/src/layouts/vehicle-damage/vehicle-damage.vue index 20125506d..602960931 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.vue +++ b/src/layouts/vehicle-damage/vehicle-damage.vue @@ -149,6 +149,17 @@ export default { vm.$refs.backGlassOptions.initializeComponent( resultMap.damageOptions.backGlassOptions.availableReplacementOptions ); + if (store.getters.isLeadGen) { + if (vm.selectedDamageLocations?.length > 0) { + vm.forwardButtonAction(); + } else { + baseMixin.methods.dispatchStoreAction(storeActions.RESET_IS_LEAD_GEN); + baseMixin.methods.hideFmgLoadingModal(); + } + } else { + baseMixin.methods.dispatchStoreAction(storeActions.RESET_IS_LEAD_GEN); + baseMixin.methods.hideFmgLoadingModal(); + } }); }, data() { diff --git a/src/layouts/vehicle/vehicle.spec.js b/src/layouts/vehicle/vehicle.spec.js index 99f96564d..0d34a9bf7 100644 --- a/src/layouts/vehicle/vehicle.spec.js +++ b/src/layouts/vehicle/vehicle.spec.js @@ -2,11 +2,13 @@ import vehicle from "@/layouts/vehicle/vehicle.vue"; // Supporting Files +import store from "@/store"; import { shallowMount } from "@vue/test-utils"; import { nextTick } from "vue"; import { getMountOptions } from "@/helpers/unit-test-helper.js"; import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; import baseMixin from "../../mixins/base-mixin"; +import { settleAllPromises } from "@/helpers/layout-helper.js"; // Mock our module for promises. jest.mock("@/helpers/layout-helper.js", () => ({ @@ -18,6 +20,32 @@ jest.mock("@/helpers/cms-content-helper", () => ({ fetchCmsContentForPage: jest.fn(), })); +// Mock Store +jest.mock("@/store", () => ({ + commit: jest.fn(), + dispatch: jest.fn(), + getters: { + applicationUser: { + experiments: [{ universeName: "ConceptFunnel" }], + }, + isLeadGen: false, + vehicle: { + carId: "C00000000", + image: "test.jpg", + }, + order: { + vehicle: { + year: 2018, + make: "Honda", + model: "Accord", + style: "4 door sedan", + carId: "C00000000", + image: "test.jpg", + }, + }, + }, +})); + describe("vehicle.vue", () => { test("arePagePrerequisitesValid should be true ", async () => { //Arrange @@ -58,25 +86,101 @@ describe("vehicle.vue", () => { }); }); -function setupMocks() { - const mountOptions = getMountOptions({ - router: { - navigate: jest.fn(), - navigate: jest.fn(), - navigateWithSaving: jest.fn(), - navigateWithoutSaving: jest.fn(), - }, - }); +describe("vehicle.vue", () => { + test("should call forwardButtonAction if isLeadGen is true and displayNoServiceAlert is false", async () => { + // Set up the store with isLeadGen as true + store.getters.isLeadGen = true; + // Set up the component + const { wrapper } = setupMocks(); + wrapper.vm.forwardButtonAction = jest.fn(); + const nextFunction = jest.fn((c) => { + c(wrapper.vm); + }); + + // Set displayNoServiceAlert to false + wrapper.setData({ displayNoServiceAlert: false }); + + // Mock the getVehicleDetails method + wrapper.vm.getVehicleDetails = jest.fn(); + + // Call the method that contains the if-else logic + await vehicle.beforeRouteEnter.call( + wrapper.vm, + { query: { fmgPage: "vehicle" } }, + undefined, + nextFunction + ); + expect(nextFunction).toHaveBeenCalled(); + expect(wrapper.vm.forwardButtonAction).toHaveBeenCalled(); + }); + test("should not call forwardButtonAction if isLeadGen is true and displayNoServiceAlert is true", async () => { + // Set up the store with isLeadGen as true + store.getters.isLeadGen = true; + + // Set up the component + const { wrapper } = setupMocks(); + wrapper.vm.forwardButtonAction = jest.fn(); + const nextFunction = jest.fn((c) => { + c(wrapper.vm); + }); + + // Set displayNoServiceAlert to false + wrapper.setData({ displayNoServiceAlert: true }); + + // Mock the getVehicleDetails method + wrapper.vm.getVehicleDetails = jest.fn(); + + // Call the method that contains the if-else logic + await vehicle.beforeRouteEnter.call( + wrapper.vm, + { query: { fmgPage: "vehicle" } }, + undefined, + nextFunction + ); + expect(wrapper.vm.forwardButtonAction).not.toHaveBeenCalled(); + }); +}); + +function setupMocks() { + const groupName = "vehicle"; + const cmsQuestionText = "Vehicle Year"; + const cmsAnswers = [{ Name: "Vehicle year" }]; + const FunnelFooterWidget = { ForwardButtonText: "vehicle button" }; + + //Mock CMS Content + const cmsContent = { + groupName: groupName, + QuestionText: cmsQuestionText, + Answers: cmsAnswers, + FunnelFooterWidget: FunnelFooterWidget, + }; //Mock props const mockMixin = { methods: { getCmsContent: jest.fn(), }, }; + const mountOptionsMockData = { + router: { + navigate: jest.fn(), + navigateWithSaving: jest.fn(), + navigateWithoutSaving: jest.fn(), + }, + route: { + query: {}, + }, + }; + const apiPromise = Promise.resolve({ cmsContent }); + settleAllPromises.mockImplementation(() => apiPromise); + + const mountOptions = getMountOptions({ + ...mountOptionsMockData, + mixins: [baseMixin, mockMixin], + }); + mountOptions["attachTo"] = document.body; - mountOptions.mixins = [mockMixin]; const wrapper = shallowMount(vehicle, mountOptions); - - return { wrapper }; + wrapper.vm.isDisabled = jest.fn(); + return { wrapper, apiPromise }; } diff --git a/src/layouts/vehicle/vehicle.vue b/src/layouts/vehicle/vehicle.vue index 82dc54f22..2b9b02863 100644 --- a/src/layouts/vehicle/vehicle.vue +++ b/src/layouts/vehicle/vehicle.vue @@ -218,7 +218,7 @@ export default { let resultMap = await settleAllPromises(promiseResultMap); // Call the "next" function to complete the transition to this page. - next((vm) => { + next(async (vm) => { vm.setCmsContent(resultMap.cmsContent); vm.initializeYearComponent(resultMap.yearQuestionInitialData); @@ -232,6 +232,18 @@ export default { resultMap.modelQuestionInitialData, resultMap.styleQuestionInitialData ); + if (store.getters.isLeadGen) { + await vm.getVehicleDetails(); + if (!vm.displayNoServiceAlert) { + vm.forwardButtonAction(); + } else { + baseMixin.methods.dispatchStoreAction(storeActions.RESET_IS_LEAD_GEN); + baseMixin.methods.hideFmgLoadingModal(); + } + } else { + baseMixin.methods.dispatchStoreAction(storeActions.RESET_IS_LEAD_GEN); + baseMixin.methods.hideFmgLoadingModal(); + } }); }, diff --git a/src/mixins/base-mixin.js b/src/mixins/base-mixin.js index f01b0fe1f..90a6a7838 100644 --- a/src/mixins/base-mixin.js +++ b/src/mixins/base-mixin.js @@ -7,6 +7,7 @@ import { routerParams } from "@/router/router-constants/router-params"; import { queryStrings } from "@/constants/query-strings"; import { dynamicStrings } from "@/constants/dynamic-strings"; import { partTypeStrings } from "../constants/part-type-strings"; +import { showFmgLoadingModal } from "@/helpers/loading-modal-helper"; export default { data() { @@ -192,6 +193,9 @@ export default { const container = document.getElementsByClassName("page-container-grouped-styles")[0]; container.scrollTo({ top: container.scrollHeight, left: 0, behavior: "smooth" }); }, + hideFmgLoadingModal() { + showFmgLoadingModal(false); + }, }, computed: { storeActions() { diff --git a/src/router/index.js b/src/router/index.js index 2ce833135..db28a5ef1 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -84,6 +84,14 @@ const routes = [ ); const parentAccount = getQuerystringParameter(queryStrings.PARENT_ACCOUNT); const correlationId = getQuerystringParameter(queryStrings.CORRELATION_ID); + const vehicleYear = getQuerystringParameter(queryStrings.VEHICLE_YEAR); + const vehicleMake = getQuerystringParameter(queryStrings.VEHICLE_MAKE); + const vehicleModel = getQuerystringParameter(queryStrings.VEHICLE_MODEL); + const vehicleStyle = getQuerystringParameter(queryStrings.VEHICLE_STYLE); + const vehicleDamage = getQuerystringParameter(queryStrings.VEHICLE_DAMAGE); + const serviceZip = getQuerystringParameter(queryStrings.SERVICE_ZIP); + const email = getQuerystringParameter(queryStrings.EMAIL); + const isInsurance = getQuerystringParameter(queryStrings.IS_INSURANCE); if (referralNumber) { store.commit(storeMutations.UPDATE_REFERRAL_NUMBER, referralNumber); store.commit(storeMutations.UPDATE_PARENT_ACCT_NUMBER, parentAccount); @@ -93,6 +101,50 @@ const routes = [ ); updateOrCreateFunnelCookie(); } + if ( + vehicleYear && + vehicleMake && + vehicleModel && + vehicleStyle && + vehicleDamage && + serviceZip && + email && + isInsurance + ) { + if (!store.getters.applicationUser.triggeredSiteEntry) { + store.commit(storeMutations.UPDATE_YEAR, vehicleYear); + store.commit(storeMutations.UPDATE_MAKE, vehicleMake); + store.commit(storeMutations.UPDATE_MODEL, vehicleModel); + store.commit(storeMutations.UPDATE_STYLE, vehicleStyle); + store.commit(storeMutations.UPDATE_IS_LEAD_GEN, true); + if (vehicleDamage == "windshieldReplace") { + store.commit(storeMutations.UPDATE_IS_REPAIR, false); + store.commit(storeMutations.UPDATE_NUMBER_OF_CHIPS, null); + const glassToReplace = [ + { glassLocation: "Windshield", glassName: "Single" }, + ]; + store.commit( + storeMutations.UPDATE_GLASS_TO_REPLACE, + glassToReplace + ); + } else if (vehicleDamage == "windshieldRepair") { + store.commit(storeMutations.UPDATE_IS_REPAIR, true); + store.commit(storeMutations.UPDATE_NUMBER_OF_CHIPS, 1); + } + const serviceZipInfo = { + state: null, + zipCode: serviceZip, + zipCodeCtu: null, + }; + store.commit(storeMutations.UPDATE_SERVICE_ZIP, serviceZipInfo); + store.commit(storeMutations.UPDATE_CUSTOMER_EMAIL_ADDRESS, email); + if (isInsurance == "true") { + store.commit(storeMutations.UPDATE_IS_INSURANCE, true); + } else { + store.commit(storeMutations.UPDATE_IS_INSURANCE, null); + } + } + } const loadSessionResponse = await loadSessionIfPresent( to.query.isInsurance != null @@ -234,6 +286,22 @@ router.beforeEach(async (to, from, next) => { const notToPIAReturn = toQueryPage != fmgPageValues.PAYMENT_PIA_RETURN; const isInIframe = window !== window.top; + if (store.getters.isLeadGen) { + // Check if alert event is on the bus + const alertEvent = eventBus.readEventFromBus( + globalEvents.Categories.GLOBAL_ALERT, + globalEvents.SubCategories.PAGE_NOT_FOUND + ); + //Uknown alerts most likely were added by a failed api call in global-methods + const unknownAlertEvent = eventBus.readEventFromBus( + globalEvents.Categories.GLOBAL_ALERT, + globalEvents.SubCategories.UNKNOWN_ERROR + ); + // If alert event is on the bus, then display the alert + if (alertEvent !== undefined || unknownAlertEvent !== undefined) { + store.commit(storeMutations.UPDATE_IS_LEAD_GEN, false); + } + } // fromPaymentToConfirmation workaround for navigating from an iframe but // isInIframe evaluates to false for some reason when navigating from payment to confirmation const fromPaymentToConfirmation = @@ -265,8 +333,9 @@ router.afterEach(async (to, from) => { await saveSession({ pageNameToLog: to.query.fmgPage }); } } - - showFmgLoadingModal(false); + if (!store.getters.isLeadGen) { + showFmgLoadingModal(false); + } // Push page view to GA analyticsMixin.methods.pushPageViewToGA(); @@ -487,7 +556,7 @@ async function DisplayPageError() { type: globalEventTypes.Danger, } ); - + store.commit(storeMutations.UPDATE_IS_LEAD_GEN, false); baseMixin.methods.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE); const pageError = getQuerystringParameter(queryStrings.PAGE_ERROR); diff --git a/src/store/index.js b/src/store/index.js index 3ccfa4c01..c449a61c5 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -160,6 +160,7 @@ const getDefaultState = () => { customerPortalLoginToken: null, lockToken: null, settledTenderAmount: 0, + isLeadGen: false, }, applicationUser: { eventBus: [], @@ -294,6 +295,9 @@ export const mutations = { updateSettledTenderAmount(state, settledTenderAmount) { state.order.settledTenderAmount = settledTenderAmount; }, + updateIsLeadGen(state, isLeadGen) { + state.order.isLeadGen = isLeadGen; + }, updateCCToken(state, ccToken) { state.order.payment.ccToken.subscriptionId = ccToken.subscriptionId; state.order.payment.ccToken.expMonth = ccToken.expMonth; @@ -674,6 +678,7 @@ export const getters = { isOvernightDropOffAppointment: (state) => { return state.order.schedule.routeCode?.includes(RouteCodeFlags.OVERNIGHT_DROP_OFF); }, + isLeadGen: (state) => state.order.isLeadGen, isRecalibrationOnOrder: (state) => { return getHasRecalibrationPart(state); }, @@ -1927,10 +1932,13 @@ export const actions = { context.state.order.vehicle.year != year || context.state.order.vehicle.make != make || context.state.order.vehicle.model != model || - context.state.order.vehicle.style != style + context.state.order.vehicle.style != style || + context.state.order.isLeadGen ) { - context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES); - context.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES); + if (!context.state.order.isLeadGen) { + context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES); + context.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES); + } context.commit(storeMutations.UPDATE_VEHICLE_VIN, null); context.commit(storeMutations.UPDATE_YEAR, year); context.commit(storeMutations.UPDATE_MAKE, make); @@ -2701,6 +2709,9 @@ export const actions = { // clear from local storage window.sessionStorage.removeItem("submittedOrder"); }, + resetIsLeadGen(context) { + context.commit(storeMutations.UPDATE_IS_LEAD_GEN, false); + }, }; export default createStore({ From 9d3a6c9c821a1ecdf429b8149f0d87f72f94d298 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Wed, 26 Jun 2024 06:16:35 -0400 Subject: [PATCH 18/35] Corrected logic for whether to display PIA message --- src/layouts/payment-method/payment-method.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index 29f36306d..32a6185a7 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -51,7 +51,7 @@ validationRules="option-required" /> 0; } else { isEnabled = piaExperience === "PIA Optional" || piaExperience === "PIA Required"; } From 7d410749492727d4b92a5a019d53a5bb5b177e54 Mon Sep 17 00:00:00 2001 From: Sneha Date: Wed, 26 Jun 2024 17:45:28 +0530 Subject: [PATCH 19/35] CSR-2128 --- src/fmg-components/cart/cart.spec.js | 43 ------------------- src/fmg-components/cart/cart.vue | 41 ------------------ .../service-package-question.vue | 2 +- .../mobile-location-modal-questions.vue | 21 --------- .../service-location/service-location.vue | 10 ++++- 5 files changed, 10 insertions(+), 107 deletions(-) diff --git a/src/fmg-components/cart/cart.spec.js b/src/fmg-components/cart/cart.spec.js index 10207c8bb..3e1e9760f 100644 --- a/src/fmg-components/cart/cart.spec.js +++ b/src/fmg-components/cart/cart.spec.js @@ -263,49 +263,6 @@ describe("cart.vue", () => { expect(found).toBe(true); }); - // Mobile Fee Cart Item - test("if there is mobile fee on the order, a mobile fee cart item should be added to the cart", () => { - // Arrange - const lineItems = { - glassParts: [], - supportingItems: [ - { - description: null, - id: "9ff98501-03a4-432b-884e-e4e28f884a2f", - kitPrice: 0, - laborAmount: 34.98, - partNumber: "MOBILE FEE", - partType: "MOBILE FEE", - salesTax: 2.62, - sellingPrice: 0, - }, - ], - vaps: [], - promos: [], - }; - - const availableVaps = []; - - // Act - const { wrapper } = setupMocks({ - props: { - modelValue: lineItems, - availableVaps: availableVaps, - }, - }); - - // Assert - expect(wrapper.vm.mobileFeeCartItem).not.toBeNull(); - expect(wrapper.vm.mobileFeeCartItem.subTotal).toEqual(34.98); - expect(wrapper.vm.mobileFeeCartItem.salesTax).toEqual(2.62); - - const found = - wrapper.vm.cartItems.findIndex( - (cartItem) => cartItem == wrapper.vm.mobileFeeCartItem - ) >= 0; - expect(found).toBe(true); - }); - // Service package discount Fee Cart Item test("if there is service package discount fee on the order, a service package discount cart item should be added to the cart", () => { // Arrange diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index 649dc2db0..33090f172 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -376,9 +376,6 @@ export default { cartItems.push(this.suppliesRepairCartItem); } - if (this.mobileFeeCartItem) { - cartItems.push(this.mobileFeeCartItem); - } if (this.servicePackageDiscountCartItem) { cartItems.push(this.servicePackageDiscountCartItem); } @@ -744,44 +741,6 @@ export default { return cartItem; }, - mobileFeeCartItemName() { - return this.getCmsContent("MobileServiceTextWidget", "Text"); - }, - mobileFeeCartItem() { - let cartItem = null; - - const mobileFeeLineItem = this.supportingItems.find( - (lineItem) => lineItem.partType == partTypeStrings.MOBILE_FEE - ); - - if (mobileFeeLineItem) { - cartItem = { - name: this.mobileFeeCartItemName, - category: cartItemCategories.SUPPORTING_ITEMS, - cartItemType: cartItemTypes.MOBILE_FEE, - isDisplayed: true, - isRemovable: false, - subTotal: 0, - salesTax: 0, - lineItems: [], - isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes( - cartItemTypes.MOBILE_FEE - ), - }; - - mobileFeeLineItem.cartItemType = cartItem.cartItemType; - cartItem.lineItems.push(mobileFeeLineItem); - - cartItem.subTotal += - (mobileFeeLineItem.kitPrice ?? 0) + - (mobileFeeLineItem.laborAmount ?? 0) + - (mobileFeeLineItem.sellingPrice ?? 0); - - cartItem.salesTax += mobileFeeLineItem.salesTax ?? 0; - } - - return cartItem; - }, servicePackageDiscountCartItemName() { return this.getCmsContent("ServicePackageDiscountTextWidget", "Text"); }, diff --git a/src/layouts/quote/service-package-question/service-package-question.vue b/src/layouts/quote/service-package-question/service-package-question.vue index 5f72d6d16..1bd1302c3 100644 --- a/src/layouts/quote/service-package-question/service-package-question.vue +++ b/src/layouts/quote/service-package-question/service-package-question.vue @@ -235,7 +235,7 @@ export default { getPackagePrice(packageName, { discountedPrice = false, servicePackageDiscount = false }) { var lineItemsToPrice = [...this.nullSafeAvailableLineItems]; if (this.isRecalibrationOnOrder) { - lineItemsToPrice = this.nullSafeAvailableLineItems.filter((item) => { + lineItemsToPrice = lineItemsToPrice.filter((item) => { return item.partType != partTypeStrings.RECALIBRATION; }); } diff --git a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue index 4558c3294..96b12d240 100644 --- a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue +++ b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue @@ -24,11 +24,6 @@ {{ errorMessage }}
-
+
@@ -81,7 +87,6 @@ v-if="selectedAppointmentType === 'Mobile'" v-model="mobileLocationQuestions" :mobileFeePart="mobileFeePart" - :mobileFeeApplies="mobileFeeApplies" @updated-mobile-fee-part="setMobileFeePart" @updated-serviceability="setServiceabilityDetails" @updated-contains-military-base="setContainsMilitaryBase" @@ -355,6 +360,9 @@ export default { recalibrationInformationModal() { return this.$refs.recalibrationInformationModal; }, + isInsurance() { + return store.getters.payment.isInsurance; + }, }, methods: { arePagePrerequisitesValid() { From 00b1fa463ebc252b3ed403345b7115a70aba8299 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Thu, 27 Jun 2024 21:48:38 -0400 Subject: [PATCH 20/35] CSR-2118 always use cash account calling pricing from quote CSR-2118 always use cash account calling pricing from quote --- src/layouts/quote/quote.vue | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue index 4477d4d0f..bad345022 100644 --- a/src/layouts/quote/quote.vue +++ b/src/layouts/quote/quote.vue @@ -192,6 +192,18 @@ export default { ...servicePackageDiscountPart, ]; + // When calling pricing from the quote page, always use the cash parent account + baseMixin.methods.dispatchStoreAction( + storeActions.SAVE_PARENT_ACCOUNT_NUMBER, + applicationConfig.CASH_PARENT_ACCOUNT_NUMBER, + false + ); + baseMixin.methods.dispatchStoreAction( + storeActions.SAVE_BILL_TO_ACCOUNT_NUMBER, + applicationConfig.CASH_DEFAULT_BILL_TO_ACCOUNT_NUMBER, + false + ); + const pricingResults = await baseMixin.methods.dispatchStoreActionWithLogging( storeActions.PRICE_ORDER_ITEMS_AND_SAVE_SERVER_DATA, { From e6b296b3a1a080011d1c0e97ba7a739fabc98620 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Fri, 28 Jun 2024 08:20:38 -0400 Subject: [PATCH 21/35] Updated logic for displaying PIA options or alert for time of service --- src/layouts/payment-method/payment-method.vue | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index 32a6185a7..2bc25609e 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -22,6 +22,7 @@
0; + return piaInsurance === "true"; } else { - isEnabled = piaExperience === "PIA Optional" || piaExperience === "PIA Required"; + return piaExperience === "PIA Optional" || piaExperience === "PIA Required"; } + // if (this.totalAmountDue > 0.00) { - return !isEnabled; + // } + + //return false; }, paymentMethod() { if (this.isPiaDisabled) { @@ -643,7 +651,7 @@ export default { }, }, components: { - funnelHeader, + funnelHeader, navbar, funnelSubHeader, Form, From c428852f4b11ed61e4c2c3f3a56c9629667396ca Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Fri, 28 Jun 2024 08:23:01 -0400 Subject: [PATCH 22/35] Removed unwanted comment --- src/layouts/payment-method/payment-method.vue | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index 2bc25609e..b351c0d23 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -586,11 +586,6 @@ export default { } else { return piaExperience === "PIA Optional" || piaExperience === "PIA Required"; } - // if (this.totalAmountDue > 0.00) { - - // } - - //return false; }, paymentMethod() { if (this.isPiaDisabled) { From 1a1575ad4313f0f5dd20edce20dc25110f6161cd Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Fri, 28 Jun 2024 08:24:35 -0400 Subject: [PATCH 23/35] Prettified --- src/layouts/payment-method/payment-method.vue | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index b351c0d23..bb12cf8ef 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -47,12 +47,12 @@
Date: Mon, 1 Jul 2024 06:22:34 -0400 Subject: [PATCH 24/35] Temp to merge develop --- src/layouts/payment-method/payment-method.spec.js | 8 ++++++++ src/layouts/payment-method/payment-method.vue | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/layouts/payment-method/payment-method.spec.js b/src/layouts/payment-method/payment-method.spec.js index ab0a0df99..16b64a58b 100644 --- a/src/layouts/payment-method/payment-method.spec.js +++ b/src/layouts/payment-method/payment-method.spec.js @@ -51,6 +51,14 @@ function setupMocks() { order: { payment: { isPia: false, + insuranceCoverage: { + isVerified: true, + }, + }, + policy: { + currentDeductible: 123, + isNoComp: false, + isItac: false, }, }, policy: { diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index bb12cf8ef..b1563b424 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -581,7 +581,7 @@ export default { var isEnabled = false; if (this.isInsurance) { - return piaInsurance === "true"; + return piaInsurance === "true" && this.currentDeductible > 0; } else { return piaExperience === "PIA Optional" || piaExperience === "PIA Required"; } From 76c602ade729116b5e88e8b6ea8ddc77e679a6d2 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Mon, 1 Jul 2024 14:48:09 -0400 Subject: [PATCH 25/35] Recycle Fee 0 --- src/fmg-components/cart/cart.vue | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index 33090f172..dccaec0bd 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -666,13 +666,27 @@ export default { recycleFeeCartItemName() { return this.getCmsContent("RecycleFeeTextWidget", "Text"); }, + requiresRecycleFeeCartItem() { + return !this.isRepair; + }, recycleFeeCartItem() { let cartItem = null; - const recycleFeeLineItem = this.supportingItems.find( + let recycleFeeLineItem = this.supportingItems.find( (supportingItem) => supportingItem.partType == partTypeStrings.REPLACE_FEE ); + if (!recycleFeeLineItem && this.requiresRecycleFeeCartItem) { + recycleFeeLineItem = { + partNumber: partTypeStrings.REPLACE_FEE, + partType: partTypeStrings.REPLACE_FEE, + laborAmount: 0, + kitPrice: 0, + sellingPrice: 0, + salesTax: 0, + }; + } + if (recycleFeeLineItem) { cartItem = { name: this.recycleFeeCartItemName, From 1999d7dbc4fc4830a0f60288373abfeb6f968f25 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Mon, 1 Jul 2024 14:49:34 -0400 Subject: [PATCH 26/35] Part number change --- src/fmg-components/cart/cart.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index dccaec0bd..c19dae63a 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -678,7 +678,7 @@ export default { if (!recycleFeeLineItem && this.requiresRecycleFeeCartItem) { recycleFeeLineItem = { - partNumber: partTypeStrings.REPLACE_FEE, + partNumber: partTypeStrings.RECYCLE_FEE, partType: partTypeStrings.REPLACE_FEE, laborAmount: 0, kitPrice: 0, From fc9fd857efe59615ebb9560f710262a4a03eae61 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Tue, 2 Jul 2024 06:15:32 -0400 Subject: [PATCH 27/35] Restored check for current deductable for ins PIA availability --- src/layouts/payment-method/payment-method.vue | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index b1563b424..89867b5da 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -47,12 +47,12 @@ 0; } else { @@ -587,7 +586,7 @@ export default { } }, paymentMethod() { - if (this.isPiaDisabled) { + if (!this.isPiaEnabled) { return paymentMethods.LATER; } From d5b600a8c0136c126a68cc4d8713a045c7fabc23 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Tue, 2 Jul 2024 06:17:52 -0400 Subject: [PATCH 28/35] Prettified --- src/layouts/payment-method/payment-method.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index 89867b5da..d423525ab 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -578,7 +578,7 @@ export default { isPiaEnabled() { const piaExperience = this.getSettingValue(experimentSettings.PIA_EXPERIENCE); const piaInsurance = this.getSettingValue(experimentSettings.PIA_INSURANCE); - + if (this.isInsurance) { return piaInsurance === "true" && this.currentDeductible > 0; } else { From ed9f85c18a6e7d2433673f8e191fab6691530631 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Wed, 3 Jul 2024 14:02:37 -0400 Subject: [PATCH 29/35] WIP desktop updates of service packages on quote page. --- .../button-question/button-question.vue | 4 ++-- src/layouts/quote/quote.vue | 12 +++++++++--- .../service-package-radio/service-package-radio.vue | 13 ++++++++++++- src/styles/common-styles.scss | 12 ++++++++++++ 4 files changed, 35 insertions(+), 6 deletions(-) diff --git a/src/digital-components/button-question/button-question.vue b/src/digital-components/button-question/button-question.vue index 24a8b8f41..2bb4bec7f 100644 --- a/src/digital-components/button-question/button-question.vue +++ b/src/digital-components/button-question/button-question.vue @@ -213,7 +213,7 @@ export default { classes = "ui-checkbox d-flex"; break; case "servicePackageRadio": - classes = "package-main"; + classes = "package-main d-md-flex justify-content-center"; break; } return classes; @@ -226,7 +226,7 @@ export default { if (this.buttonTypeString == "radio") { classes += " radio-button-container"; } else if (this.buttonTypeString == "servicePackageRadio") { - classes = "package-wrapper"; + classes = "package-wrapper col-md-4"; } if (this.buttonTypeString == "listCard" && this.buttonsInfo.length > 2) { diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue index bad345022..14cdcecc4 100644 --- a/src/layouts/quote/quote.vue +++ b/src/layouts/quote/quote.vue @@ -1,7 +1,7 @@