From 641bbb03dca39d6d3484be76057864363b48c5ef Mon Sep 17 00:00:00 2001 From: Donielle Austin Date: Tue, 3 May 2022 08:14:40 -0400 Subject: [PATCH 1/7] estimate page --- src/constants/error-messages.js | 1 + src/constants/vin-lookup-method-selections.js | 7 + .../heritage-integration/navigation-helper.js | 4 +- src/layouts/estimate/estimate.vue | 159 +++++++++++++++++- src/layouts/vehicle-damage/vehicle-damage.vue | 7 +- .../router-constants/navigation-scenarios.js | 4 + src/router/router-constants/routing-table.js | 28 +++ 7 files changed, 198 insertions(+), 12 deletions(-) create mode 100644 src/constants/vin-lookup-method-selections.js diff --git a/src/constants/error-messages.js b/src/constants/error-messages.js index 17012ab68..963ba0b5d 100644 --- a/src/constants/error-messages.js +++ b/src/constants/error-messages.js @@ -21,6 +21,7 @@ const errorMessages = { SERVICE_ZIP_FORMAT: "Please enter a valid Service ZIP", VIN_REQUIRED: "Please enter your VIN", VIN_FORMAT: "Please enter a valid VIN", + OPTION_REQUIRED: "Please select an option", }; export { errorMessages }; diff --git a/src/constants/vin-lookup-method-selections.js b/src/constants/vin-lookup-method-selections.js new file mode 100644 index 000000000..46f1e2044 --- /dev/null +++ b/src/constants/vin-lookup-method-selections.js @@ -0,0 +1,7 @@ +const vinLookupMethodSelections = { + MANUALVIN: "ManualVin", + LICENSEPLATE: "LicensePlate", + HOMEADDRESS: "HomeAddress", +}; + +export { vinLookupMethodSelections }; \ No newline at end of file diff --git a/src/helpers/heritage-integration/navigation-helper.js b/src/helpers/heritage-integration/navigation-helper.js index 49c4ab354..61c07203d 100644 --- a/src/helpers/heritage-integration/navigation-helper.js +++ b/src/helpers/heritage-integration/navigation-helper.js @@ -93,9 +93,9 @@ async function getLatestPageForRedirection() { return fmgPageValues.VEHICLE_DAMAGE; } else { if (store.getters.vehicle.vin) { - return fmgPageValues.LICENSE_PLATE_LOOKUP; - } else { return fmgPageValues.VIN_LOOKUP; + } else { + return fmgPageValues.ESTIMATE; } } } diff --git a/src/layouts/estimate/estimate.vue b/src/layouts/estimate/estimate.vue index 0e41b24ed..2e395aa0b 100644 --- a/src/layouts/estimate/estimate.vue +++ b/src/layouts/estimate/estimate.vue @@ -1,13 +1,156 @@ + + \ No newline at end of file diff --git a/src/layouts/vehicle-damage/vehicle-damage.vue b/src/layouts/vehicle-damage/vehicle-damage.vue index 862abaced..7b44517fc 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.vue +++ b/src/layouts/vehicle-damage/vehicle-damage.vue @@ -309,8 +309,11 @@ export default { } // If vin already exists, navigate directly to vin-lookup - if(this.$store.getters.vehicle.vin){ - this.$router.navigate(this.navigationScenarios.CLICKED_FORWARD_WITH_VIN, this.$route); + if(store.getters.vehicle.vin){ + this.$router.navigateAfterSave(this.navigationScenarios.CLICKED_FORWARD_WITH_VIN, this.$route, {}, {}, partsData.data); + return; + }if(store.getters.vehicle.vin == null){ + this.$router.navigateAfterSave(this.navigationScenarios.CLICKED_FORWARD_WITHOUT_VIN, this.$route, {}, {}, partsData.data); return; } diff --git a/src/router/router-constants/navigation-scenarios.js b/src/router/router-constants/navigation-scenarios.js index 5380a3fa7..d579046fd 100644 --- a/src/router/router-constants/navigation-scenarios.js +++ b/src/router/router-constants/navigation-scenarios.js @@ -16,6 +16,10 @@ const navigationScenarios = { CONTINUING_WITH_SINGLE_PART: "CONTINUING_WITH_SINGLE_PART", CONTINUING_WITH_MULTIPLE_VEHICLES: "CONTINUING_WITH_MULTIPLE_VEHICLES", TEMPORARY_TO_ADDRESS_LOOKUP: "TEMPORARY_TO_ADDRESS_LOOKUP", + CLICKED_FORWARD_WITHOUT_VIN: "CLICKED_FORWARD_WITHOUT_VIN", + SELECTED_MANUAL_VIN: "SELECTED_MANUAL_VIN", + SELECTED_LICENSE_PLATE: "SELECTED_LICENSE_PLATE", + SELECTED_HOME_ADDRESS: "SELECTED_HOME_ADDRESS", }; export { navigationScenarios }; diff --git a/src/router/router-constants/routing-table.js b/src/router/router-constants/routing-table.js index 3290c43eb..cd204edd6 100644 --- a/src/router/router-constants/routing-table.js +++ b/src/router/router-constants/routing-table.js @@ -77,6 +77,14 @@ const routingTable = [ scenario: navigationScenarios.TEMPORARY_TO_ADDRESS_LOOKUP, destinationFmgPageValue: fmgPageValues.ADDRESS_LOOKUP, //This will be temporary }, + { + scenario: navigationScenarios.CLICKED_FORWARD_WITH_VIN, + destinationFmgPageValue: fmgPageValues.VIN_LOOKUP, + }, + { + scenario: navigationScenarios.CLICKED_FORWARD_WITHOUT_VIN, + destinationFmgPageValue: fmgPageValues.ESTIMATE, + }, ], }, { @@ -172,6 +180,26 @@ const routingTable = [ }, ], }, + {fmgPageValue: fmgPageValues.ESTIMATE, + maps: [ + { + scenario: navigationScenarios.CLICKED_BACK, + destinationFmgPageValue: fmgPageValues.VEHICLE_DAMAGE, + }, + { + scenario: navigationScenarios.SELECTED_MANUAL_VIN, + destinationFmgPageValue: fmgPageValues.VIN_LOOKUP, + }, + { + scenario: navigationScenarios.SELECTED_LICENSE_PLATE, + destinationFmgPageValue: fmgPageValues.LICENSE_PLATE_LOOKUP, + }, + { + scenario: navigationScenarios.SELECTED_HOME_ADDRESS, + destinationFmgPageValue: fmgPageValues.ADDRESS_LOOKUP, + }, + ], + }, ]; export { routingTable }; From d42a8b4af2f41111911a27d338ea340163fe4d91 Mon Sep 17 00:00:00 2001 From: Mark Harris Date: Tue, 3 May 2022 09:18:15 -0400 Subject: [PATCH 2/7] nav updates (to remove temp hacks) --- src/layouts/vehicle-damage/vehicle-damage.vue | 52 +++---------------- .../router-constants/navigation-scenarios.js | 4 -- src/router/router-constants/routing-table.js | 20 ------- 3 files changed, 7 insertions(+), 69 deletions(-) diff --git a/src/layouts/vehicle-damage/vehicle-damage.vue b/src/layouts/vehicle-damage/vehicle-damage.vue index 7b44517fc..6bc9da3ef 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.vue +++ b/src/layouts/vehicle-damage/vehicle-damage.vue @@ -287,58 +287,20 @@ export default { store.commit(this.storeMutations.UPDATE_GLASS_TO_REPLACE, this.selectedGlassToReplace()); - const partsData = await baseMixin.methods.dispatchStoreAction(this.storeActions.GET_PARTS_OR_QUESTIONS, - { carId: store.getters.vehicle.carId, glassArray: this.selectedGlassToReplace()}, false); - - this.navigateForward(partsData); + this.navigateForward(); }, - navigateForward(partsData){ - - // Temporary easter egg to navigate to heritage funnel. - const vehicleYearsToShowHeritageFunnel = [ 2001, 2002, 2010, 2016 ]; - if (vehicleYearsToShowHeritageFunnel.includes(store.getters.vehicle.year)) { - navigateToHeritageFunnel(); - return; - } - - // Temporary easter egg to navigate to address-lookup. - if (store.getters.vehicle.year === 2014) { - this.$router.navigateAfterSave(this.navigationScenarios.TEMPORARY_TO_ADDRESS_LOOKUP, this.$route, {}, {}, partsData.data); - return; - } + navigateForward(){ // If vin already exists, navigate directly to vin-lookup - if(store.getters.vehicle.vin){ - this.$router.navigateAfterSave(this.navigationScenarios.CLICKED_FORWARD_WITH_VIN, this.$route, {}, {}, partsData.data); + if(store.getters.vehicle.vin) { + this.$router.navigateAfterSave(this.navigationScenarios.CLICKED_FORWARD_WITH_VIN, this.$route); return; - }if(store.getters.vehicle.vin == null){ - this.$router.navigateAfterSave(this.navigationScenarios.CLICKED_FORWARD_WITHOUT_VIN, this.$route, {}, {}, partsData.data); + } + else { + this.$router.navigateAfterSave(this.navigationScenarios.CLICKED_FORWARD_WITHOUT_VIN, this.$route); return; } - - //found problem questions - if (partsData.data.partsOrQuestions.some(pq => pq.partQuestions != null && pq.partQuestions.length > 0)){ - this.$router.navigateAfterSave(this.navigationScenarios.SELECTED_DAMAGE_WITH_PART_QUESTIONS, this.$route, {}, {}, partsData.data); - return; - } - - //found multiple parts for a single glass location (Windshield, Driver, Passenger, Rear) - if (partsData.data.partsOrQuestions){ - for (var i = 0; i < partsData.data.partsOrQuestions.length; i++){ - if (partsData.data.partsOrQuestions[i].parts != null && partsData.data.partsOrQuestions[i].parts.length > 1){ - this.$router.navigateAfterSave(this.navigationScenarios.SELECTED_DAMAGE_WITH_MULTIPLE_PARTS, this.$route, {}, {}, partsData.data); - return; - } - } - } - - //if not a repair then there should only be 1 part and no problem questions at this point so save the part to the store. - if (!this.isWindshieldRepair){ - store.commit(this.storeMutations.UPDATE_PARTS, partsData.data.partsOrQuestions[0].parts); - } - - this.$router.navigate(this.navigationScenarios.SELECTED_DAMAGE_WITH_SINGLE_PART, this.$route); }, selectedGlassToReplace() { diff --git a/src/router/router-constants/navigation-scenarios.js b/src/router/router-constants/navigation-scenarios.js index d579046fd..b3ce4d6d7 100644 --- a/src/router/router-constants/navigation-scenarios.js +++ b/src/router/router-constants/navigation-scenarios.js @@ -8,14 +8,10 @@ const navigationScenarios = { CLICKED_FORWARD: "CLICKED_FORWARD", CLICKED_FORWARD_WITH_VIN: "CLICKED_FORWARD_WITH_VIN", SELECTED_PARTS: "SELECTED_PARTS", - SELECTED_DAMAGE_WITH_SINGLE_PART: "SELECTED_DAMAGE_WITH_SINGLE_PART", - SELECTED_DAMAGE_WITH_MULTIPLE_PARTS: "SELECTED_DAMAGE_WITH_MULTIPLE_PARTS", - SELECTED_DAMAGE_WITH_PART_QUESTIONS: "SELECTED_DAMAGE_WITH_PART_QUESTIONS", CONTINUING_WITH_PARTS_QUESTION: "CONTINUING_WITH_PARTS_QUESTION", CONTINUING_WITH_MULTIPLE_PARTS: "CONTINUING_WITH_MULTIPLE_PARTS", CONTINUING_WITH_SINGLE_PART: "CONTINUING_WITH_SINGLE_PART", CONTINUING_WITH_MULTIPLE_VEHICLES: "CONTINUING_WITH_MULTIPLE_VEHICLES", - TEMPORARY_TO_ADDRESS_LOOKUP: "TEMPORARY_TO_ADDRESS_LOOKUP", CLICKED_FORWARD_WITHOUT_VIN: "CLICKED_FORWARD_WITHOUT_VIN", SELECTED_MANUAL_VIN: "SELECTED_MANUAL_VIN", SELECTED_LICENSE_PLATE: "SELECTED_LICENSE_PLATE", diff --git a/src/router/router-constants/routing-table.js b/src/router/router-constants/routing-table.js index cd204edd6..2d27efcdf 100644 --- a/src/router/router-constants/routing-table.js +++ b/src/router/router-constants/routing-table.js @@ -57,26 +57,6 @@ const routingTable = [ scenario: navigationScenarios.CLICKED_BACK, destinationFmgPageValue: fmgPageValues.VEHICLE_STYLE, }, - { - scenario: navigationScenarios.CLICKED_FORWARD_WITH_VIN, - destinationFmgPageValue: fmgPageValues.LICENSE_PLATE_LOOKUP, - }, - { - scenario: navigationScenarios.SELECTED_DAMAGE_WITH_SINGLE_PART, - destinationFmgPageValue: fmgPageValues.LICENSE_PLATE_LOOKUP, - }, - { - scenario: navigationScenarios.SELECTED_DAMAGE_WITH_MULTIPLE_PARTS, - destinationFmgPageValue: fmgPageValues.VIN_LOOKUP, - }, - { - scenario: navigationScenarios.SELECTED_DAMAGE_WITH_PART_QUESTIONS, - destinationFmgPageValue: fmgPageValues.LICENSE_PLATE_LOOKUP,//This might be temporary - }, - { - scenario: navigationScenarios.TEMPORARY_TO_ADDRESS_LOOKUP, - destinationFmgPageValue: fmgPageValues.ADDRESS_LOOKUP, //This will be temporary - }, { scenario: navigationScenarios.CLICKED_FORWARD_WITH_VIN, destinationFmgPageValue: fmgPageValues.VIN_LOOKUP, From e86085e9d3bb4e29eff6c612adb0c35a86390526 Mon Sep 17 00:00:00 2001 From: Mark Harris Date: Tue, 3 May 2022 09:28:43 -0400 Subject: [PATCH 3/7] Fixed unit tests for changed functionality. --- .../navigation-helper.spec.js | 4 +- .../vehicle-damage/vehicle-damage.spec.js | 102 ------------------ 2 files changed, 2 insertions(+), 104 deletions(-) diff --git a/src/helpers/heritage-integration/navigation-helper.spec.js b/src/helpers/heritage-integration/navigation-helper.spec.js index de5df0239..3d9164f62 100644 --- a/src/helpers/heritage-integration/navigation-helper.spec.js +++ b/src/helpers/heritage-integration/navigation-helper.spec.js @@ -175,7 +175,7 @@ describe("getPageToRouteExistingOrderTo", () => { expect(result).toBe('vehicle-damage'); }); - test("getPageToRouteExistingOrderTo, should return license-plate-lookup", async () => { + test("getPageToRouteExistingOrderTo, should return vin-lookup", async () => { // Arrange const toRoute = { query: {} @@ -228,7 +228,7 @@ describe("getPageToRouteExistingOrderTo", () => { const result = await getPageToRouteExistingOrderTo(toRoute, false); //Assert - expect(result).toBe('license-plate-lookup'); + expect(result).toBe('vin-lookup'); }); test("getPageToRouteExistingOrderTo, should return estimate", async () => { diff --git a/src/layouts/vehicle-damage/vehicle-damage.spec.js b/src/layouts/vehicle-damage/vehicle-damage.spec.js index 9a9f7e6d7..b722fccbf 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.spec.js +++ b/src/layouts/vehicle-damage/vehicle-damage.spec.js @@ -182,66 +182,6 @@ describe("vehicle-damage.vue", () => { }); }); -describe("vehicle-damage.vue", () => { - test("Windshield replace with single part on ForwardButtonAction triggers a router.navigate and saves selections to store", async () => { - //Arrange - const partsData = { partsOrQuestions: [ - { - glassLocation: "Windshield", - glassName: "Single", - partQuestions: null, - parts: [ - { - color: "Green Tint, Green Shade", - description: "rain sensor, solar", - partNumber: "FW02728GGYN", - requiresCapabilityQuestions: false, - requiresRecalibration: false - } - ]}]}; - - const { wrapper } = setupMocks({ - pageHeaderWidgetHeaderText: "", - mountOptionsMockData: { - router: { navigate: jest.fn(), }, - actionList: [{ actionName: storeActions.GET_PARTS_OR_QUESTIONS, data: partsData, },], - store: { - getters: { - vehicle: {}, - payment: { insuranceCoverage: { isVerified: false } }, - }, - }, - }, - }); - - wrapper.vm.selectedDamageLocations = ["Windshield"]; - wrapper.vm.selectedWindshieldOptions = { - selectedWindshieldChipCount : null, - selectedWindshieldReplaceOptions : ["Single"], - selectedWindshieldDamageType: ["Replace"] - }; - - const expectedGlassToReplace = [{location: "Windshield", name: "Single"},]; - - //Act - vehicleDamage.beforeRouteEnter.call( - wrapper.vm, - { query: { fmgPage: "vehicle-damage" } }, - undefined, - (c) => c(wrapper.vm) - ); - - await wrapper.vm.forwardButtonAction(); - - //Assert - expect(wrapper.vm.$router.navigate).toHaveBeenCalled(); - expect(wrapper.vm.selectedGlassToReplace()).toEqual(expectedGlassToReplace); - expect(store.commit).toBeCalledWith(storeMutations.UPDATE_IS_REPAIR, false); - expect(store.commit).toBeCalledWith(storeMutations.UPDATE_GLASS_TO_REPLACE, expectedGlassToReplace); - expect(store.commit).toBeCalledWith(storeMutations.UPDATE_PARTS, partsData.partsOrQuestions[0].parts); - }); -}); - describe("vehicle-damage.vue", () => { test("Windshield replace with multiple parts on ForwardButtonAction triggers a router.navigateAfterSave and saves selections to store", async () => { //Arrange @@ -332,48 +272,6 @@ describe("vehicle-damage.vue", () => { }); }); - -describe("vehicle-damage.vue", () => { - test("Windshield repair on ForwardButtonAction triggers a router.navigate and saves selection to store", async () => { - //Arrange - const partsData = { partsOrQuestions: []}; - const { wrapper } = setupMocks({ - pageHeaderWidgetHeaderText: "", - mountOptionsMockData: { - router: { navigate: jest.fn(), }, - actionList: [{ actionName: storeActions.GET_PARTS_OR_QUESTIONS, data: partsData, },], - store: { - getters: { - vehicle: {}, - payment: { insuranceCoverage: { isVerified: false } }, - }, - }, - }, - }); - - wrapper.vm.selectedDamageLocations = ["Windshield"]; - wrapper.vm.selectedWindshieldOptions = { - selectedWindshieldChipCount : [2], - selectedWindshieldDamageType: ["Repair"] - }; - - //Act - vehicleDamage.beforeRouteEnter.call( - wrapper.vm, - { query: { fmgPage: "vehicle-damage" } }, - undefined, - (c) => c(wrapper.vm) - ); - - await wrapper.vm.forwardButtonAction(); - - //Assert - expect(wrapper.vm.$router.navigate).toHaveBeenCalled(); - expect(store.commit).toBeCalledWith(storeMutations.UPDATE_IS_REPAIR, true); - expect(store.commit).toBeCalledWith(storeMutations.UPDATE_NUMBER_OF_CHIPS, 2); - }); -}); - describe("vehicle-damage.vue", () => { test("isWindshieldDamageLocation is true when windshield is selected", async () => { From 5ddc7c7f4fda7ef699863bd0a39ad9130223ef5d Mon Sep 17 00:00:00 2001 From: Mark Harris Date: Tue, 3 May 2022 09:31:34 -0400 Subject: [PATCH 4/7] Fixed unit tests for changed functionality. --- src/helpers/heritage-integration/navigation-helper.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/heritage-integration/navigation-helper.spec.js b/src/helpers/heritage-integration/navigation-helper.spec.js index 3d9164f62..fd06920c2 100644 --- a/src/helpers/heritage-integration/navigation-helper.spec.js +++ b/src/helpers/heritage-integration/navigation-helper.spec.js @@ -283,7 +283,7 @@ describe("getPageToRouteExistingOrderTo", () => { const result = await getPageToRouteExistingOrderTo(toRoute, false); //Assert - expect(result).toBe('vin-lookup'); + expect(result).toBe('estimate'); }); test("getPageToRouteExistingOrderTo, existing order, should return heritage", async () => { From 3a5725360af9c83212e8aa5515c240c4acf711af Mon Sep 17 00:00:00 2001 From: Mark Harris Date: Tue, 3 May 2022 11:43:57 -0400 Subject: [PATCH 5/7] Updated service "zip" to "zipCode" to stay consistent with registration zipCode. --- src/constants/store-mutations.js | 2 +- src/layouts/address-lookup/address-lookup.vue | 4 ++-- .../license-plate-lookup/license-plate-lookup.spec.js | 2 +- src/layouts/license-plate-lookup/license-plate-lookup.vue | 4 ++-- src/layouts/vin-lookup/vin-lookup.vue | 2 +- src/store/index.js | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/constants/store-mutations.js b/src/constants/store-mutations.js index 3f42f9a5f..65f4719ec 100644 --- a/src/constants/store-mutations.js +++ b/src/constants/store-mutations.js @@ -22,7 +22,7 @@ const storeMutations = { UPDATE_REGISTRATION_ZIP_CODE: "updateRegistrationZipCode", UPDATE_REGISTRATION_FIRST_NAME: "updateRegistrationFirstName", UPDATE_REGISTRATION_LAST_NAME: "updateRegistrationLastName", - UPDATE_SERVICE_LOCATION_ZIP: "updateServiceLocationZip", + UPDATE_SERVICE_LOCATION_ZIP_CODE: "updateServiceLocationZipCode", UPDATE_CUSTOMER_EMAIL_ADDRESS: "updateCustomerEmailAddress", // ORDER MUTATIONS diff --git a/src/layouts/address-lookup/address-lookup.vue b/src/layouts/address-lookup/address-lookup.vue index 895148575..951744eb8 100644 --- a/src/layouts/address-lookup/address-lookup.vue +++ b/src/layouts/address-lookup/address-lookup.vue @@ -167,7 +167,7 @@ export default { return store.getters.order.customer.emailAddress; }, getServiceZipFromStore() { - return store.getters.order.serviceLocation.zip; + return store.getters.order.serviceLocation.zipCode; }, async forwardButtonAction() { this.resetWarningsAndErrors(); @@ -302,7 +302,7 @@ export default { store.commit(storeMutations.UPDATE_REGISTRATION_ZIP_CODE, this.customerQuestions.addressQuestions.zipCode); store.commit(storeMutations.UPDATE_REGISTRATION_FIRST_NAME, this.customerQuestions.firstName); store.commit(storeMutations.UPDATE_REGISTRATION_LAST_NAME, this.customerQuestions.lastName); - store.commit(storeMutations.UPDATE_SERVICE_LOCATION_ZIP, this.serviceZip); + store.commit(storeMutations.UPDATE_SERVICE_LOCATION_ZIP_CODE, this.serviceZip); store.commit(storeMutations.UPDATE_CUSTOMER_EMAIL_ADDRESS, this.customerQuestions.email); }, 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 533a8e38d..6e6de9349 100644 --- a/src/layouts/license-plate-lookup/license-plate-lookup.spec.js +++ b/src/layouts/license-plate-lookup/license-plate-lookup.spec.js @@ -33,7 +33,7 @@ jest.mock("@/store", () => ({ emailAddress: "test@test.com" }, serviceLocation: { - zip: "43443" + zipCode: "43443" } }, vehicle: { diff --git a/src/layouts/license-plate-lookup/license-plate-lookup.vue b/src/layouts/license-plate-lookup/license-plate-lookup.vue index 59be19cbd..374d36ffa 100644 --- a/src/layouts/license-plate-lookup/license-plate-lookup.vue +++ b/src/layouts/license-plate-lookup/license-plate-lookup.vue @@ -168,7 +168,7 @@ export default { return store.getters.order.customer.emailAddress }, getServiceZipFromStore(){ - return store.getters.order.serviceLocation.zip + return store.getters.order.serviceLocation.zipCode }, backButtonAction() { this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route); @@ -257,7 +257,7 @@ export default { store.commit(storeMutations.UPDATE_REGISTRATION_LICENSE_PLATE, this.licensePlate); store.commit(storeMutations.UPDATE_REGISTRATION_STATE, registrationState); store.commit(storeMutations.UPDATE_REGISTRATION_ZIP_CODE, this.registrationZip); - store.commit(storeMutations.UPDATE_SERVICE_LOCATION_ZIP, this.serviceZip); + store.commit(storeMutations.UPDATE_SERVICE_LOCATION_ZIP_CODE, this.serviceZip); store.commit(storeMutations.UPDATE_CUSTOMER_EMAIL_ADDRESS, this.email); }, }, diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue index 36dfaf137..07bd749ec 100644 --- a/src/layouts/vin-lookup/vin-lookup.vue +++ b/src/layouts/vin-lookup/vin-lookup.vue @@ -282,7 +282,7 @@ export default { store.commit(storeMutations.UPDATE_VEHICLE_IMAGE_URL, carInfo.imageUrl); store.commit(storeMutations.UPDATE_VEHICLE_IMAGE_VIF_NUMBER, carInfo.imageVifNumber); store.commit(storeMutations.UPDATE_VEHICLE_IMAGE_COLOR, carInfo.imageVifNumber); - store.commit(storeMutations.UPDATE_SERVICE_LOCATION_ZIP, this.zip); + store.commit(storeMutations.UPDATE_SERVICE_LOCATION_ZIP_CODE, this.zip); store.commit(storeMutations.UPDATE_CUSTOMER_EMAIL_ADDRESS, this.email); }, }, diff --git a/src/store/index.js b/src/store/index.js index 66005abd5..dfeb4fdf2 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -31,7 +31,7 @@ const getDefaultState = () => { }, }, serviceLocation: { - zip: null, + zipCode: null, }, customer: { emailAddress: null, @@ -144,8 +144,8 @@ export const mutations = { updateRegistrationAddress(state, registrationAddress){ state.order.vehicle.registration.address = registrationAddress; }, - updateServiceLocationZip(state, serviceLocationZip){ - state.order.serviceLocation.zip = serviceLocationZip; + updateServiceLocationZipCode(state, serviceLocationZipCode){ + state.order.serviceLocation.zipCode = serviceLocationZipCode; }, updateRegistrationCity(state, serviceCity){ state.order.serviceLocation.city = serviceCity; From a6481307f7105ae9e084bbb48cd9d1aadea87e33 Mon Sep 17 00:00:00 2001 From: Donielle Austin Date: Tue, 3 May 2022 14:49:12 -0400 Subject: [PATCH 6/7] estimate page edits --- src/layouts/estimate/estimate.vue | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/src/layouts/estimate/estimate.vue b/src/layouts/estimate/estimate.vue index 2e395aa0b..f77f30f8e 100644 --- a/src/layouts/estimate/estimate.vue +++ b/src/layouts/estimate/estimate.vue @@ -13,8 +13,8 @@ cmsWidgetName="VinLookupMethod" class="button-question-overflow" :questionText="questionText" - :answers="answersToDisplay" - :groupName="groupName" + :answers="answersFromCms" + groupName="vinLookupMethodOption" buttonType="listButton" v-model="selectedValues" isRequired @@ -53,13 +53,10 @@ export default { name: "estimate", data() { return { - groupName: "vinLookupMethodOptions", selectedValues: [], }; }, - props: { - name: String, - }, + async beforeRouteEnter(to, from, next) { //Call APIs const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage); @@ -128,21 +125,6 @@ export default { HomeAddress: true, }; }, - answersToDisplay() { - const filteredAnswers = Array.isArray(this.answersFromCms) - ? this.answersFromCms.filter((ans) => { - const name = ans.Name.split("-"); - return name[0]; - }) - : []; - return filteredAnswers.map((ans) => { - const newName = ans.Name.includes("-") - ? ans.Name.split("-")[1] - : ans.Name; - ans.Name = newName; - return ans; - }); - }, }, components: { funnelHeader, From b5b40d2c5c05f8d3af747f9197a2ae1a70f89250 Mon Sep 17 00:00:00 2001 From: Donielle Austin Date: Tue, 3 May 2022 15:15:34 -0400 Subject: [PATCH 7/7] estimate page --- src/layouts/estimate/estimate.vue | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/layouts/estimate/estimate.vue b/src/layouts/estimate/estimate.vue index f77f30f8e..b46c38801 100644 --- a/src/layouts/estimate/estimate.vue +++ b/src/layouts/estimate/estimate.vue @@ -118,13 +118,6 @@ export default { answersFromCms() { return this.getCmsContent("VinLookupMethod", "Answers"); }, - vinLookupMethodOptionsMap() { - return { - ManualVin: true, - LicensePlate: true, - HomeAddress: true, - }; - }, }, components: { funnelHeader,