From 59d9199e38667e056873a9b78c4074570e647713 Mon Sep 17 00:00:00 2001 From: bmauger Date: Wed, 9 Mar 2022 17:12:58 -0500 Subject: [PATCH 01/13] WIP Do not merge. --- src/layouts/vin-lookup/vin-lookup.spec.js | 0 src/layouts/vin-lookup/vin-lookup.vue | 62 +++++++++++++++++++ src/router/router-constants/fmgPage-values.js | 3 +- src/router/router-constants/routing-table.js | 2 +- 4 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 src/layouts/vin-lookup/vin-lookup.spec.js create mode 100644 src/layouts/vin-lookup/vin-lookup.vue diff --git a/src/layouts/vin-lookup/vin-lookup.spec.js b/src/layouts/vin-lookup/vin-lookup.spec.js new file mode 100644 index 000000000..e69de29bb diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue new file mode 100644 index 000000000..26e451d72 --- /dev/null +++ b/src/layouts/vin-lookup/vin-lookup.vue @@ -0,0 +1,62 @@ + + + + + diff --git a/src/router/router-constants/fmgPage-values.js b/src/router/router-constants/fmgPage-values.js index 770c1f7b6..b648ae047 100644 --- a/src/router/router-constants/fmgPage-values.js +++ b/src/router/router-constants/fmgPage-values.js @@ -4,9 +4,10 @@ const fmgPageValues = { VEHICLE_MODEL: "vehicle-model", VEHICLE_STYLE: "vehicle-style", VEHICLE_DAMAGE: "vehicle-damage", + VIN_LOOKUP: "vin-lookup", VEHICLE_PARTS: "vehicle-parts", PART_QUESTIONS: "part-questions", REVEAL : "reveal", }; -export { fmgPageValues }; \ No newline at end of file +export { fmgPageValues }; diff --git a/src/router/router-constants/routing-table.js b/src/router/router-constants/routing-table.js index c9dc7ba4d..9333d7c6c 100644 --- a/src/router/router-constants/routing-table.js +++ b/src/router/router-constants/routing-table.js @@ -59,7 +59,7 @@ const routingTable = [ }, { scenario: navigationScenarios.SELECTED_DAMAGE_WITH_SINGLE_PART, - destinationFmgPageValue: fmgPageValues.REVEAL, + destinationFmgPageValue: fmgPageValues.VIN_LOOKUP, }, { scenario: navigationScenarios.SELECTED_DAMAGE_WITH_MULTIPLE_PARTS, From 2a8680914cd1e7a9bfcf597846fefcc2419e031a Mon Sep 17 00:00:00 2001 From: bmauger Date: Thu, 10 Mar 2022 15:22:12 -0500 Subject: [PATCH 02/13] WIP --- src/layouts/vehicle-damage/vehicle-damage.vue | 8 --- src/layouts/vin-lookup/vin-lookup.vue | 67 +++++++++++++++---- src/styles/common-styles.scss | 8 ++- 3 files changed, 60 insertions(+), 23 deletions(-) diff --git a/src/layouts/vehicle-damage/vehicle-damage.vue b/src/layouts/vehicle-damage/vehicle-damage.vue index 0eb11fbf0..20318695b 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.vue +++ b/src/layouts/vehicle-damage/vehicle-damage.vue @@ -408,11 +408,3 @@ export default { }, }; - - diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue index 26e451d72..d5acbb1b2 100644 --- a/src/layouts/vin-lookup/vin-lookup.vue +++ b/src/layouts/vin-lookup/vin-lookup.vue @@ -1,7 +1,7 @@ diff --git a/src/styles/common-styles.scss b/src/styles/common-styles.scss index 561b05b76..35a337103 100644 --- a/src/styles/common-styles.scss +++ b/src/styles/common-styles.scss @@ -35,4 +35,10 @@ body { overflow: hidden; } } -// Hide horizontal scrollbar + +//Applies to
used for validation. Keeps footer stuck to the bottom. +.vehicle-damage-form { + display: flex; + flex-direction: column; + height: 100%; +} From 27ff640529056d060001cce806d7ad5e0df82d4b Mon Sep 17 00:00:00 2001 From: bmauger Date: Thu, 10 Mar 2022 15:23:10 -0500 Subject: [PATCH 03/13] Update vin-lookup.vue --- src/layouts/vin-lookup/vin-lookup.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue index d5acbb1b2..3df005c30 100644 --- a/src/layouts/vin-lookup/vin-lookup.vue +++ b/src/layouts/vin-lookup/vin-lookup.vue @@ -3,6 +3,7 @@ +

VIN Lookup Placeholder Page

Date: Thu, 10 Mar 2022 15:25:19 -0500 Subject: [PATCH 04/13] Add empty unit test. WIP --- src/layouts/vin-lookup/vin-lookup.spec.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/layouts/vin-lookup/vin-lookup.spec.js b/src/layouts/vin-lookup/vin-lookup.spec.js index e69de29bb..3d0843e10 100644 --- a/src/layouts/vin-lookup/vin-lookup.spec.js +++ b/src/layouts/vin-lookup/vin-lookup.spec.js @@ -0,0 +1 @@ +test.todo("some test to be written in the future"); From d65a38b85a44191a798c346089c76b62dcb5f205 Mon Sep 17 00:00:00 2001 From: bmauger Date: Thu, 10 Mar 2022 15:30:18 -0500 Subject: [PATCH 05/13] Code format. --- src/layouts/vin-lookup/vin-lookup.vue | 52 +++++++++++++-------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue index 3df005c30..6b86ec4f5 100644 --- a/src/layouts/vin-lookup/vin-lookup.vue +++ b/src/layouts/vin-lookup/vin-lookup.vue @@ -5,20 +5,20 @@

VIN Lookup Placeholder Page

- - + + From c19bb1cf7969ade99d069fb0dc85e69170fea8d2 Mon Sep 17 00:00:00 2001 From: bmauger Date: Thu, 10 Mar 2022 15:42:17 -0500 Subject: [PATCH 06/13] Add classes inline, remove from global. --- src/layouts/vin-lookup/vin-lookup.vue | 2 +- src/styles/common-styles.scss | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue index 6b86ec4f5..aa179439a 100644 --- a/src/layouts/vin-lookup/vin-lookup.vue +++ b/src/layouts/vin-lookup/vin-lookup.vue @@ -9,7 +9,7 @@ @invalid-submit="onInvalidSubmit" ref="theForm" v-slot="{ meta }" - class="vehicle-damage-form" + class="d-flex flex-column h-100" > used for validation. Keeps footer stuck to the bottom. -.vehicle-damage-form { - display: flex; - flex-direction: column; - height: 100%; -} From 98e3b7026a9879bfd222948d3671070cec0a7575 Mon Sep 17 00:00:00 2001 From: bmauger Date: Thu, 10 Mar 2022 15:56:32 -0500 Subject: [PATCH 07/13] Update route per Carl's comment. --- src/router/router-constants/routing-table.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/router/router-constants/routing-table.js b/src/router/router-constants/routing-table.js index 9333d7c6c..3bd937c41 100644 --- a/src/router/router-constants/routing-table.js +++ b/src/router/router-constants/routing-table.js @@ -59,7 +59,7 @@ const routingTable = [ }, { scenario: navigationScenarios.SELECTED_DAMAGE_WITH_SINGLE_PART, - destinationFmgPageValue: fmgPageValues.VIN_LOOKUP, + destinationFmgPageValue: fmgPageValues.REVEAL, }, { scenario: navigationScenarios.SELECTED_DAMAGE_WITH_MULTIPLE_PARTS, @@ -84,6 +84,19 @@ const routingTable = [ }, ], }, + { + fmgPageValue: fmgPageValues.REVEAL, + maps: [ + { + scenario: navigationScenarios.CLICKED_BACK, + destinationFmgPageValue: fmgPageValues.VEHICLE_DAMAGE, + }, + { + scenario: navigationScenarios.SELECTED_PARTS, + destinationFmgPageValue: fmgPageValues.VIN_LOOKUP, + }, + ], + }, ]; export { routingTable }; From 5370e1ce86b3a707b8354f918256f4e0767cab13 Mon Sep 17 00:00:00 2001 From: bmauger Date: Thu, 10 Mar 2022 16:10:20 -0500 Subject: [PATCH 08/13] Update routing. --- src/router/router-constants/routing-table.js | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/router/router-constants/routing-table.js b/src/router/router-constants/routing-table.js index 3bd937c41..c9dc7ba4d 100644 --- a/src/router/router-constants/routing-table.js +++ b/src/router/router-constants/routing-table.js @@ -84,19 +84,6 @@ const routingTable = [ }, ], }, - { - fmgPageValue: fmgPageValues.REVEAL, - maps: [ - { - scenario: navigationScenarios.CLICKED_BACK, - destinationFmgPageValue: fmgPageValues.VEHICLE_DAMAGE, - }, - { - scenario: navigationScenarios.SELECTED_PARTS, - destinationFmgPageValue: fmgPageValues.VIN_LOOKUP, - }, - ], - }, ]; export { routingTable }; From 1d12c6a325e4d568609ee0802d8896e22320fa00 Mon Sep 17 00:00:00 2001 From: bmauger Date: Thu, 10 Mar 2022 16:20:04 -0500 Subject: [PATCH 09/13] Update routing table. --- src/router/router-constants/routing-table.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/router/router-constants/routing-table.js b/src/router/router-constants/routing-table.js index c9dc7ba4d..3bd937c41 100644 --- a/src/router/router-constants/routing-table.js +++ b/src/router/router-constants/routing-table.js @@ -84,6 +84,19 @@ const routingTable = [ }, ], }, + { + fmgPageValue: fmgPageValues.REVEAL, + maps: [ + { + scenario: navigationScenarios.CLICKED_BACK, + destinationFmgPageValue: fmgPageValues.VEHICLE_DAMAGE, + }, + { + scenario: navigationScenarios.SELECTED_PARTS, + destinationFmgPageValue: fmgPageValues.VIN_LOOKUP, + }, + ], + }, ]; export { routingTable }; From 2ffc311f22d01bf3b1cb3b36aa041d1b402901c3 Mon Sep 17 00:00:00 2001 From: bmauger Date: Fri, 11 Mar 2022 16:03:38 -0500 Subject: [PATCH 10/13] Update vin-lookup page. --- src/layouts/vin-lookup/vin-lookup.vue | 17 +++++++++ src/router/router-constants/routing-table.js | 13 +++++++ src/store/index.js | 38 +++++++++++++++++++- 3 files changed, 67 insertions(+), 1 deletion(-) diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue index aa179439a..635f0aef5 100644 --- a/src/layouts/vin-lookup/vin-lookup.vue +++ b/src/layouts/vin-lookup/vin-lookup.vue @@ -33,6 +33,7 @@ import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; import { settleAllPromises } from "@/helpers/layout-helper"; import { storeActions } from "@/constants/store-actions"; import store from "@/store"; +import { storeMutations } from "@/constants/store-mutations"; import baseMixin from "@/mixins/base-mixin"; import { Form, defineRule } from "vee-validate"; import { required } from "@/helpers/validation-rules"; @@ -86,6 +87,22 @@ export default { arePagePrerequisitesValid() { return true; }, + resetDependentState() { + store.commit(storeMutations.UPDATE_REGISTRATION_ADDRESS, null); + store.commit(storeMutations.UPDATE_REGISTRATION_CITY, null); + store.commit(storeMutations.UPDATE_REGISTRATION_STATE, null); + store.commit(storeMutations.UPDATE_REGISTRATION_ZIP_CODE, null); + store.commit(storeMutations.UPDATE_REGISTRATION_FIRST_NAME, null); + store.commit(storeMutations.UPDATE_REGISTRATION_LAST_NAME, null); + store.commit(storeMutations.UPDATE_REGISTRATION_LICENSE_PLATE, null); + }, + backButtonAction() { + // route to move backwards + this.$router.navigate( + this.navigationScenarios.CLICKED_BACK, + this.$route + ); + }, }, components: { funnelHeader, diff --git a/src/router/router-constants/routing-table.js b/src/router/router-constants/routing-table.js index 3bd937c41..584796a61 100644 --- a/src/router/router-constants/routing-table.js +++ b/src/router/router-constants/routing-table.js @@ -97,6 +97,19 @@ const routingTable = [ }, ], }, + { + fmgPageValue: fmgPageValues.VIN_LOOKUP, + maps: [ + { + scenario: navigationScenarios.CLICKED_BACK, + destinationFmgPageValue: fmgPageValues.VEHICLE_DAMAGE, + }, + { + scenario: navigationScenarios.VIN_LOOKUP, + destinationFmgPageValue: fmgPageValues.PART_QUESTIONS, + }, + ], + }, ]; export { routingTable }; diff --git a/src/store/index.js b/src/store/index.js index a00f550be..5ffdc168a 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -19,6 +19,15 @@ export const state = { imageUrl: null, imageVifNumber: null, imageColor: null, + registration: { + licensePlate: null, + address: null, + city: null, + state: null, + zipCode: null, + firstName: null, + lastName: null, + }, }, damage: { isRepair: null, @@ -81,6 +90,33 @@ export const mutations = { updatePageData(state, pageData){ state.applicationUser.pageData[pageData.page] = pageData.data; }, + updateRegistrationAddress(state, registrationAddress){ + state.order.vehicle.registration.address = registrationAddress; + }, + updateRegistrationCity(state, registrationCity){ + state.order.vehicle.registration.city = registrationCity; + }, + updateRegistrationState(state, registrationState){ + state.order.vehicle.registration.state = registrationState; + }, + updateRegistrationZipCode(state, registrationZipCode){ + state.order.vehicle.registration.zipCode = registrationZipCode; + }, + updateRegistrationFirstName(state, registrationFirstName){ + state.order.vehicle.registration.firstName = registrationFirstName; + }, + updateRegistrationLastName(state, registrationLastName){ + state.order.vehicle.registration.lastName = registrationLastName; + }, + updateRegistrationLicensePlate(state, registrationLicensePlate){ + state.order.vehicle.registration.licensePlate = registrationLicensePlate; + }, + updateServiceLocationZip(state, ServiceLocationZip){ + state.order.vehicle.serviceLocation.zip = ServiceLocationZip; + }, + updateCustomerEmailAddress(state, CustomerEmailAddress){ + state.order.vehicle.customer.emailAddress = CustomerEmailAddress; + }, // EVENT BUS MUTATIONS addEventToBus(state, event) { @@ -288,4 +324,4 @@ export default createStore({ mutations, getters, actions, -}); \ No newline at end of file +}); From 21597f3f750114806856fe23afa32fffa34cb4e7 Mon Sep 17 00:00:00 2001 From: bmauger Date: Fri, 11 Mar 2022 16:12:21 -0500 Subject: [PATCH 11/13] Change to camelCase. --- src/store/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index 5ffdc168a..2eead09e1 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -112,10 +112,10 @@ export const mutations = { state.order.vehicle.registration.licensePlate = registrationLicensePlate; }, updateServiceLocationZip(state, ServiceLocationZip){ - state.order.vehicle.serviceLocation.zip = ServiceLocationZip; + state.order.vehicle.serviceLocation.zip = serviceLocationZip; }, updateCustomerEmailAddress(state, CustomerEmailAddress){ - state.order.vehicle.customer.emailAddress = CustomerEmailAddress; + state.order.vehicle.customer.emailAddress = customerEmailAddress; }, // EVENT BUS MUTATIONS From 4a32ca1f981ffb14af7f4cf128348cc51e0ff5d8 Mon Sep 17 00:00:00 2001 From: bmauger Date: Mon, 14 Mar 2022 13:55:46 -0400 Subject: [PATCH 12/13] Update unit test. --- src/layouts/vin-lookup/vin-lookup.spec.js | 168 +++++++++++++++++++++- src/layouts/vin-lookup/vin-lookup.vue | 26 ++-- src/store/index.js | 8 +- 3 files changed, 184 insertions(+), 18 deletions(-) diff --git a/src/layouts/vin-lookup/vin-lookup.spec.js b/src/layouts/vin-lookup/vin-lookup.spec.js index 3d0843e10..1db5c18a6 100644 --- a/src/layouts/vin-lookup/vin-lookup.spec.js +++ b/src/layouts/vin-lookup/vin-lookup.spec.js @@ -1 +1,167 @@ -test.todo("some test to be written in the future"); +// Components +import vinLookup from "@/layouts/vin-lookup/vin-lookup.vue"; +import vehicleDamage from "@/layouts/vehicle-damage/vehicle-damage.vue"; +import funnelHeader from "@/common-components/funnel-header/funnel-header"; +import funnelFooter from "@/common-components/funnel-footer/funnel-footer"; +import vehicleBanner from "@/common-components/vehicle-banner/vehicle-banner"; +import funnelSubHeader from "@/common-components/funnel-sub-header/funnel-sub-header"; +import sideDoorOptions from "@/layouts/vehicle-damage/side-door-options/side-door-options"; +import damageLocationQuestion from "@/layouts/vehicle-damage/damage-location-question/damage-location-question"; +import windshieldOptions from "@/layouts/vehicle-damage/windshield-options/windshield-options"; +import replaceOptionsQuestion from "@/layouts/vehicle-damage/replace-options-question/replace-options-question"; + +// Supporting Files +import { settleAllPromises } from "@/helpers/layout-helper.js"; +import baseMixin from "@/mixins/base-mixin"; +import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; +import { mount, flushPromises } from "@vue/test-utils"; +import { getMountOptions } from "@/helpers/unit-test-helper.js"; +import { nextTick } from "vue"; +import { storeActions } from "@/constants/store-actions"; +import { storeMutations } from "@/constants/store-mutations"; +import store from "@/store"; +import { validate } from "vee-validate"; +import { damageLocationsSelected } from "@/constants/damage-locations-selected.js"; + +// Mock our module for promises. +jest.mock("@/helpers/layout-helper.js", () => ({ + settleAllPromises: jest.fn(), +})); + +// Mock fetchCmsContentForPage +jest.mock("@/helpers/cms-content-helper", () => ({ + fetchCmsContentForPage: jest.fn(), +})); + +// Mock Store +jest.mock("@/store", () => ({ + commit: jest.fn(), + dispatch: jest.fn(), + getters: { + vehicle: { + carId: "C00000000", + image: "test.jpg", + }, + eventBusItem: jest.fn(), + damage: { + glassToReplace: [] + }, + }, +})); + +describe("vin-lookup.vue", () => { + + test("Call resetDependentState", async() => { + const {wrapper} = setupMocks({}); + wrapper.vm.resetDependentState(); + expect(store.dispatch).toBeCalledWith(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES); + }); + +}); + +// TEMP +function setupMocks({ + pageHeaderWidgetHeaderText = {}, + mountOptionsMockData = { + router: { + navigate: jest.fn(), + }, + store: { + getters: { + vehicle: {}, + }, + }, + }, +}) { + //Mock api responses + baseMixin.methods.dispatchNonBlockingStoreAction = jest.fn(); + const apiResponses = { + cmsContent: { + FunnelSubHeaderWidget: pageHeaderWidgetHeaderText, + VehicleBannerWidget: { + GenericVehicleImage: + "https://digitalconsumercms-dev.safelite.com/images/default-source/default-album/blurred-image.jpg?sfvrsn=a6ce3034_3", + }, + FunnelHeaderWidget: { + LogoImage: + "https://digitalconsumercms-dev.safelite.com/images/default-source/default-album/safelite-logo.svg?sfvrsn=45e7ed06_3", + }, + }, + damageOptions: { + driverSideOptions: { + availableReplacementOptions: ["Front", "Back", "Side"], + }, + passengerSideOptions: { + availableReplacementOptions: ["Front", "Back", "Side"], + }, + windshieldOptions: { + availableReplacementOptions: ["Single", "Driver", "Passenger"], + }, + backGlassOptions: { + availableReplacementOptions: ["Front", "Back", "Side"], + }, + }, + }; + + const apiPromise = Promise.resolve(apiResponses); + + settleAllPromises.mockImplementation(() => apiPromise); + fetchCmsContentForPage.mockImplementation(() => Promise.resolve()); + + //Mock damage initialize methods + funnelHeader.methods = { + initializeComponent: jest.fn(), + }; + + vehicleBanner.methods = { + initializeComponent: jest.fn(), + }; + + funnelSubHeader.methods = { + initializeComponent: jest.fn(), + }; + + damageLocationQuestion.methods = { + initializeComponent: jest.fn(), + }; + + sideDoorOptions.methods = { + initializeComponent: jest.fn(), + }; + + windshieldOptions.methods = { + initializeComponent: jest.fn(), + }; + + replaceOptionsQuestion.methods = { + initializeComponent: jest.fn(), + updateSelectedValues: jest.fn(), + }; + + funnelFooter.methods = { + initializeComponent: jest.fn(), + } + + const mountOptions = getMountOptions(mountOptionsMockData); + mountOptions['attachTo'] = document.body; // append wrapper to document.body to test DOM methods + + const wrapper = mount(vinLookup, mountOptions); + + const funnelHeaderWrapper = wrapper.findComponent({ name: "funnelHeader" }); + funnelHeaderWrapper.vm.initializeComponent = + funnelHeader.methods.initializeComponent; + + const vehicleBannerWrapper = wrapper.findComponent({ name: "vehicleBanner" }); + vehicleBannerWrapper.vm.initializeComponent = + vehicleBanner.methods.initializeComponent; + + const funnelSubHeaderWrapper = wrapper.findComponent({ name: "funnelSubHeader" }); + funnelSubHeaderWrapper.vm.initializeComponent = + funnelSubHeader.methods.initializeComponent; + + const funnelFooterWrapper = wrapper.findComponent({ name: "funnelFooter" }); + funnelFooterWrapper.vm.initializeComponent = + funnelFooter.methods.initializeComponent; + + return { wrapper, apiPromise }; +} diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue index 635f0aef5..8dbb6cdc9 100644 --- a/src/layouts/vin-lookup/vin-lookup.vue +++ b/src/layouts/vin-lookup/vin-lookup.vue @@ -5,17 +5,17 @@

VIN Lookup Placeholder Page

@@ -88,13 +88,7 @@ export default { return true; }, resetDependentState() { - store.commit(storeMutations.UPDATE_REGISTRATION_ADDRESS, null); - store.commit(storeMutations.UPDATE_REGISTRATION_CITY, null); - store.commit(storeMutations.UPDATE_REGISTRATION_STATE, null); - store.commit(storeMutations.UPDATE_REGISTRATION_ZIP_CODE, null); - store.commit(storeMutations.UPDATE_REGISTRATION_FIRST_NAME, null); - store.commit(storeMutations.UPDATE_REGISTRATION_LAST_NAME, null); - store.commit(storeMutations.UPDATE_REGISTRATION_LICENSE_PLATE, null); + store.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES); }, backButtonAction() { // route to move backwards diff --git a/src/store/index.js b/src/store/index.js index 2eead09e1..65e5a06c7 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -151,7 +151,13 @@ export const mutations = { state.order.damage.glassToReplace = null; }, resetRegistrationState(state) { - + state.order.vehicle.registration.licensePlate = null; + state.order.vehicle.registration.address = null; + state.order.vehicle.registration.city = null; + state.order.vehicle.registration.state = null; + state.order.vehicle.registration.zipCode = null; + state.order.vehicle.registration.firstName = null; + state.order.vehicle.registration.lastName = null; }, resetPartsState(state) { state.order.lineItems.glassParts = null; From 735902c4fa9b07013a8459d5937eaaa29bc76796 Mon Sep 17 00:00:00 2001 From: bmauger Date: Mon, 14 Mar 2022 15:33:40 -0400 Subject: [PATCH 13/13] Fix error. --- src/store/index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index 65e5a06c7..53e977114 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -29,6 +29,12 @@ export const state = { lastName: null, }, }, + serviceLocation: { + zip: null, + }, + customer: { + emailAddress: null, + }, damage: { isRepair: null, numberOfChips: null, @@ -111,10 +117,10 @@ export const mutations = { updateRegistrationLicensePlate(state, registrationLicensePlate){ state.order.vehicle.registration.licensePlate = registrationLicensePlate; }, - updateServiceLocationZip(state, ServiceLocationZip){ + updateServiceLocationZip(state, serviceLocationZip){ state.order.vehicle.serviceLocation.zip = serviceLocationZip; }, - updateCustomerEmailAddress(state, CustomerEmailAddress){ + updateCustomerEmailAddress(state, customerEmailAddress){ state.order.vehicle.customer.emailAddress = customerEmailAddress; },