From b76811ded01e5f57588498503598a0370aa34f03 Mon Sep 17 00:00:00 2001 From: Donielle Austin Date: Fri, 24 Jun 2022 13:44:03 -0400 Subject: [PATCH] pushing changes csr-439 --- src/constants/store-actions.js | 17 +- .../heritage-integration/navigation-helper.js | 1 - src/layouts/address-lookup/address-lookup.vue | 4 +- .../address-vehicles/address-vehicles.vue | 3 +- .../license-plate-lookup.vue | 2 +- src/layouts/vehicle-damage/vehicle-damage.vue | 4 +- src/layouts/vehicle-make/vehicle-make.vue | 22 +- src/layouts/vehicle-model/vehicle-model.vue | 18 +- src/layouts/vehicle-parts/vehicle-parts.vue | 2 +- src/layouts/vehicle-style/vehicle-style.vue | 13 +- src/layouts/vehicle-year/vehicle-year.vue | 23 +- src/layouts/vin-lookup/vin-lookup.vue | 2 +- src/router/index.js | 16 +- src/store/index.js | 234 +++++++++--------- 14 files changed, 154 insertions(+), 207 deletions(-) diff --git a/src/constants/store-actions.js b/src/constants/store-actions.js index dcf8cc581..1866442f5 100644 --- a/src/constants/store-actions.js +++ b/src/constants/store-actions.js @@ -32,9 +32,20 @@ const storeActions = { RESET_PARTS_STATE_AND_DEPENDENCIES: "resetPartsAndDependencies", RESET_STATE: "resetState", - //RESET STATE - RESET_SAVE_VEHICLE_YEAR: "saveVehicleYear", - RESET_SAVE_VEHICLE_MAKE :"saveVehicleMake" + //RESET COMPONENT STATE + SAVE_VEHICLE_YEAR: "saveVehicleYear", + SAVE_VEHICLE_MAKE:"saveVehicleMake", + SAVE_VEHICLE_MODEL:"saveVehicleModel", + SAVE_VEHICLE_STYLE: "saveVehicleStyle", + SAVE_VEHICLE_DAMAGE: "saveVehicleDamage", + SAVE_VIN_LOOKUP: "saveVinLookup", + SAVE_SERVICE_LOCATION: "saveServiceLocation", + SAVE_EMAIL: "saveEmail", + SAVE_REGISTRATION_LICENSE_PLATE_LOOKUP: "saveRegistrationLicensePlateLookup", + SAVE_VIN: "saveVin", + SAVE_REGISTRATION_ADDRESS_LOOKUP: "saveRegistrationAddressLookup", + SAVE_PARTS_QUESTION_ANSWERS: "savePartQuestionAnswers", + SAVE_GLASS_PARTS: "saveGlassParts", }; export { storeActions }; diff --git a/src/helpers/heritage-integration/navigation-helper.js b/src/helpers/heritage-integration/navigation-helper.js index 9bf69ddcf..22d984530 100644 --- a/src/helpers/heritage-integration/navigation-helper.js +++ b/src/helpers/heritage-integration/navigation-helper.js @@ -56,7 +56,6 @@ export async function navigateToHeritageFunnel() { export async function navigateAfterSaveToHeritageFunnel(currentRoute) { const currentComponent = currentRoute.matched[0].components; - currentComponent.default.methods.resetDependentState(); // Create the order (or save existing order) when navigating to Heritage Funnel. await saveOrder(); diff --git a/src/layouts/address-lookup/address-lookup.vue b/src/layouts/address-lookup/address-lookup.vue index 2e13299de..cfd23f02e 100644 --- a/src/layouts/address-lookup/address-lookup.vue +++ b/src/layouts/address-lookup/address-lookup.vue @@ -288,7 +288,7 @@ export default { // if a different vehicle is found than the one entered and the selected glass // is not available for that vehicle if (this.isCarIdDifferent && !this.isSelectedGlassAvailableForVehicle) { - this.$router.navigateAfterSave( + this.$router.navigate( // then navigate back to "vehicle-damage", and display vehicle changed alert // on that page this.navigationScenarios.CONTINUING_WITH_DIFFERENT_GLASS, @@ -313,7 +313,7 @@ export default { navigateAfterSaveToHeritageFunnel(this.$route); } else { // if there are no matches or there are multiple matches, navigate to "address-vehicles" page - this.$router.navigateAfterSave(this.navigationScenarios.CONTINUING_WITH_MULTIPLE_VEHICLES, this.$route, {}, {}, carsFound); + this.$router.navigate(this.navigationScenarios.CONTINUING_WITH_MULTIPLE_VEHICLES, this.$route, {}, {}, carsFound); } } diff --git a/src/layouts/address-vehicles/address-vehicles.vue b/src/layouts/address-vehicles/address-vehicles.vue index faf71e1fb..4a7a59bcb 100644 --- a/src/layouts/address-vehicles/address-vehicles.vue +++ b/src/layouts/address-vehicles/address-vehicles.vue @@ -180,7 +180,7 @@ export default { }, navigateForward() { if (this.isCarIdDifferent && !this.isSelectedGlassAvailableForVehicle) { - this.$router.navigateAfterSave( + this.$router.navigate( this.navigationScenarios.CLICKED_FORWARD, this.$route, {}, @@ -202,6 +202,7 @@ export default { resetDependentState() { // needed because navigateAfterSaveToHeritageFunnel calls it store.dispatch(storeActions.RESET_PARTS_STATE_AND_DEPENDENCIES); }, + //this.$store.dispatch(storeActions.SAVE_VIN, vin,vehicle), updateCustomerInfo(vin, vehicle) { if (this.isCarIdDifferent && !this.isSelectedGlassAvailableForVehicle) { store.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES); diff --git a/src/layouts/license-plate-lookup/license-plate-lookup.vue b/src/layouts/license-plate-lookup/license-plate-lookup.vue index f3a5d3e83..931dff9c8 100644 --- a/src/layouts/license-plate-lookup/license-plate-lookup.vue +++ b/src/layouts/license-plate-lookup/license-plate-lookup.vue @@ -288,7 +288,7 @@ export default { }, navigateForward() { if (this.isCarIdDifferent && !this.isSelectedGlassAvailableForVehicle) { - this.$router.navigateAfterSave( + this.$router.navigate( this.navigationScenarios.CLICKED_FORWARD, this.$route, {}, diff --git a/src/layouts/vehicle-damage/vehicle-damage.vue b/src/layouts/vehicle-damage/vehicle-damage.vue index 266e2ba1a..056b2a5a9 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.vue +++ b/src/layouts/vehicle-damage/vehicle-damage.vue @@ -301,11 +301,11 @@ export default { // 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); + this.$router.navigate(this.navigationScenarios.CLICKED_FORWARD_WITH_VIN, this.$route); return; } else { - this.$router.navigateAfterSave(this.navigationScenarios.CLICKED_FORWARD_WITHOUT_VIN, this.$route); + this.$router.navigate(this.navigationScenarios.CLICKED_FORWARD_WITHOUT_VIN, this.$route); return; } }, diff --git a/src/layouts/vehicle-make/vehicle-make.vue b/src/layouts/vehicle-make/vehicle-make.vue index 286560b98..60e407a64 100644 --- a/src/layouts/vehicle-make/vehicle-make.vue +++ b/src/layouts/vehicle-make/vehicle-make.vue @@ -82,30 +82,12 @@ export default { } return false; }, - resetDependentState: function(){ - store.dispatch(storeActions.RESET_SAVE_VEHICLE_MAKE); - } - /* resetDependentState() { - // Set - store.commit(storeMutations.UPDATE_MODEL, null); - store.commit(storeMutations.UPDATE_STYLE, null); - store.commit(storeMutations.UPDATE_CAR_ID, null); - store.commit(storeMutations.UPDATE_VEHICLE_CATEGORY, null); - store.commit(storeMutations.UPDATE_VEHICLE_VIN, null); - store.commit(storeMutations.UPDATE_VEHICLE_IMAGE_URL, null); - store.commit(storeMutations.UPDATE_VEHICLE_IMAGE_VIF_NUMBER, null); - store.commit(storeMutations.UPDATE_VEHICLE_IMAGE_COLOR, null); - - // Invokes - store.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES); - store.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES); - }, */ }, watch: { selectedMake(make) { - this.$store.commit(this.storeMutations.UPDATE_MAKE, make); - this.$router.navigateAfterSave( + this.$store.dispatch(storeActions.SAVE_VEHICLE_MAKE, make); + this.$router.navigate( this.navigationScenarios.SELECTED_MAKE, this.$route ); diff --git a/src/layouts/vehicle-model/vehicle-model.vue b/src/layouts/vehicle-model/vehicle-model.vue index c661c824e..27e378d91 100644 --- a/src/layouts/vehicle-model/vehicle-model.vue +++ b/src/layouts/vehicle-model/vehicle-model.vue @@ -83,26 +83,12 @@ export default { } return false; }, - resetDependentState() { - // Set - store.commit(storeMutations.UPDATE_STYLE, null); - store.commit(storeMutations.UPDATE_CAR_ID, null); - store.commit(storeMutations.UPDATE_VEHICLE_CATEGORY, null); - store.commit(storeMutations.UPDATE_VEHICLE_VIN, null); - store.commit(storeMutations.UPDATE_VEHICLE_IMAGE_URL, null); - store.commit(storeMutations.UPDATE_VEHICLE_IMAGE_VIF_NUMBER, null); - store.commit(storeMutations.UPDATE_VEHICLE_IMAGE_COLOR, null); - - // Invokes - store.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES); - store.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES); - }, }, watch: { selectedModel(model) { - this.$store.commit(this.storeMutations.UPDATE_MODEL, model); - this.$router.navigateAfterSave( + this.$store.dispatch(storeActions.SAVE_VEHICLE_MODEL, model); + this.$router.navigate( this.navigationScenarios.SELECTED_MODEL, this.$route ); diff --git a/src/layouts/vehicle-parts/vehicle-parts.vue b/src/layouts/vehicle-parts/vehicle-parts.vue index 842cc0720..74b361a20 100644 --- a/src/layouts/vehicle-parts/vehicle-parts.vue +++ b/src/layouts/vehicle-parts/vehicle-parts.vue @@ -180,7 +180,7 @@ export default { store.commit(storeMutations.UPDATE_PARTS, matchedParts); // Navigate to the next page. - this.$router.navigateAfterSave( + this.$router.navigate( this.navigationScenarios.SELECTED_PARTS, this.$route ); diff --git a/src/layouts/vehicle-style/vehicle-style.vue b/src/layouts/vehicle-style/vehicle-style.vue index c7589d32d..463fc551b 100644 --- a/src/layouts/vehicle-style/vehicle-style.vue +++ b/src/layouts/vehicle-style/vehicle-style.vue @@ -94,22 +94,13 @@ export default { } return false; }, - resetDependentState() { - // Invokes - store.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES); - store.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES); - store.commit(storeMutations.UPDATE_IS_REPAIR, null); - store.commit(storeMutations.UPDATE_NUMBER_OF_CHIPS, null); - store.commit(storeMutations.UPDATE_GLASS_TO_REPLACE, []); - store.commit(storeMutations.UPDATE_VEHICLE_VIN, null); - }, }, watch: { selectedStyle(style) { - this.$store.commit(this.storeMutations.UPDATE_STYLE, style); + this.$store.dispatch(storeActions.SAVE_VEHICLE_STYLE, style); this.setVehicle().then(() => { - this.$router.navigateAfterSave( + this.$router.navigate( this.navigationScenarios.SELECTED_STYLE, this.$route ); diff --git a/src/layouts/vehicle-year/vehicle-year.vue b/src/layouts/vehicle-year/vehicle-year.vue index 18c1822d0..0738c09f7 100644 --- a/src/layouts/vehicle-year/vehicle-year.vue +++ b/src/layouts/vehicle-year/vehicle-year.vue @@ -89,8 +89,8 @@ export default { watch: { selectedYear(year) { const parsedYear = parseInt(year); - this.$store.commit(this.storeMutations.UPDATE_YEAR, parsedYear); - this.$router.navigateAfterSave( + this.$store.dispatch(storeActions.SAVE_VEHICLE_YEAR, parsedYear); + this.$router.navigate( this.navigationScenarios.SELECTED_YEAR, this.$route ); @@ -100,25 +100,6 @@ export default { arePagePrerequisitesValid() { return true; }, - resetDependentState: function(){ - store.dispatch(storeActions.RESET_SAVE_VEHICLE_YEAR); - } - /* resetDependentState() { - // Set - store.commit(storeMutations.UPDATE_MAKE, null); - store.commit(storeMutations.UPDATE_MODEL, null); - store.commit(storeMutations.UPDATE_STYLE, null); - store.commit(storeMutations.UPDATE_CAR_ID, null); - store.commit(storeMutations.UPDATE_VEHICLE_CATEGORY, null); - store.commit(storeMutations.UPDATE_VEHICLE_VIN, null); - store.commit(storeMutations.UPDATE_VEHICLE_IMAGE_URL, null); - store.commit(storeMutations.UPDATE_VEHICLE_IMAGE_VIF_NUMBER, null); - store.commit(storeMutations.UPDATE_VEHICLE_IMAGE_COLOR, null); - - // Invokes - store.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES); - store.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES); - }, */ }, components: { yearQuestion, diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue index 6c0f305b5..59e09ce9e 100644 --- a/src/layouts/vin-lookup/vin-lookup.vue +++ b/src/layouts/vin-lookup/vin-lookup.vue @@ -319,7 +319,7 @@ export default { }, navigateForward(){ if(this.isCarIdDifferent && !this.isSelectedGlassAvailableForVehicle){ - this.$router.navigateAfterSave(this.navigationScenarios.CLICKED_FORWARD, this.$route, {}, { displayVehicleChangeAlert: true }, {}); + this.$router.navigate(this.navigationScenarios.CLICKED_FORWARD, this.$route, {}, { displayVehicleChangeAlert: true }, {}); return; } else { this.$refs.loadingModal.showModal(); diff --git a/src/router/index.js b/src/router/index.js index 74ee110de..2fc79b938 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -139,12 +139,9 @@ router.afterEach(async (to, from) => { }); router.navigate = (scenario, currentRoute, optionalQuery = {}, optionalParams = {}, optionalPageData = {}) => { - navigate(scenario, currentRoute, false, optionalQuery, optionalParams, optionalPageData); + navigate(scenario, currentRoute, optionalQuery, optionalParams, optionalPageData); } -router.navigateAfterSave = (scenario, currentRoute, optionalQuery = {}, optionalParams = {}, optionalPageData = {}) => { - navigate(scenario, currentRoute, true, optionalQuery, optionalParams, optionalPageData); -} router.navigateToExternalUrl = (url, optionalQuery = {}) => { navigateToUrl(url, optionalQuery); @@ -153,7 +150,7 @@ router.navigateToExternalUrl = (url, optionalQuery = {}) => { // PRIVATE FUNCTIONS // Navigate to the next route, depending on the scenario. -async function navigate(scenario, currentRoute, invalidateOnSave, optionalQuery = {}, optionalParams = {}, optionalPageData = {}) { +async function navigate(scenario, currentRoute, optionalQuery = {}, optionalParams = {}, optionalPageData = {}) { if (!scenario) { console.error("No scenario provided. Please review the routing table."); return; @@ -169,10 +166,6 @@ async function navigate(scenario, currentRoute, invalidateOnSave, optionalQuery // If we need to do invalidation const currentComponent = currentRoute.matched[0].components; - if (invalidateOnSave) { - resetDependentState(currentComponent); - } - // Append page data to the store for the NEXT page, if any. It will be an empty object if none is provided. baseMixin.methods.savePageDataToStore(destinationFmgPageValue, optionalPageData); @@ -270,9 +263,4 @@ function arePagePrerequisitesValid(component) { return component.default.methods.arePagePrerequisitesValid(); } -// Reset dependant state on route change. -function resetDependentState(component) { - return component.default.methods.resetDependentState(); -} - export default router; diff --git a/src/store/index.js b/src/store/index.js index a1a0b00da..acf245565 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -4,6 +4,7 @@ import { storeMutations } from "@/constants/store-mutations"; import { getDateForSavedSessionTimeout } from "@/helpers/heritage-integration/session-helper"; import createPersistedState from "vuex-persistedstate"; import globalMethods from "@/global-methods"; +import { storeActions } from "../constants/store-actions"; // Export State const getDefaultState = () => { @@ -620,39 +621,128 @@ export const actions = { }); }, - saveVehicleYear(){ - //NEED TO COMPARE OLDVALUE TO NEW VALUE - console.log(state.order.vehicle.year); - if(state.order.vehicle.year!=null){ - storeMutations.updateMake = null; - storeMutations.updateModel = null; - storeMutations.updateStyle = null; - storeMutations.updateCarId = null; - storeMutations.updateVehicleCategory = null; - storeMutations.updateVehicleVin = null; - storeMutations.updateVehicleImageUrl = null; - storeMutations.updateVehicleImageVifNumber = null; - storeMutations.updateVehicleImageColor = null; - storeMutations.resetDamageAndDependencies; - storeMutations.resetRegistrationAndDependencies; - console.log("save vehicle year!"); - } + saveVehicleYear(context, year){ + + //If different year, reset state dependencies + if(state.order.vehicle.year!==year){ + context.commit(storeMutations.UPDATE_YEAR, null); + context.commit(storeMutations.UPDATE_MAKE, null); + context.commit(storeMutations.UPDATE_MODEL, null); + context.commit(storeMutations.UPDATE_STYLE, null); + context.commit(storeMutations.UPDATE_CAR_ID, null); + context.commit(storeMutations.UPDATE_VEHICLE_CATEGORY, null); + context.commit(storeMutations.UPDATE_VEHICLE_VIN, null); + context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_URL, null); + context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_VIF_NUMBER, null); + context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_COLOR, null); + + context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES); + context.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES); + } + + //Update vehicle year + state.order.vehicle.year = year; }, - saveVehicleMake(){ - if(state.order.vehicle.year!=null && state.order.vehicle.make!=null){ - storeMutations.updateModel = null; - storeMutations.updateStyle = null; - storeMutations.updateCarId = null; - storeMutations.updateVehicleCategory = null; - storeMutations.updateVehicleVin = null; - storeMutations.updateVehicleImageUrl = null; - storeMutations.updateVehicleImageVifNumber = null; - storeMutations.updateVehicleImageColor = null; - storeMutations.resetDamageAndDependencies; - storeMutations.resetRegistrationAndDependencies; - console.log("save vehicle make!"); + saveVehicleMake(context, make){ + //If new make, reset state dependencies + if(state.order.vehicle.make !== make){ + context.commit(storeMutations.UPDATE_MODEL, null); + context.commit(storeMutations.UPDATE_STYLE, null); + context.commit(storeMutations.UPDATE_CAR_ID, null); + context.commit(storeMutations.UPDATE_VEHICLE_CATEGORY, null); + context.commit(storeMutations.UPDATE_VEHICLE_VIN, null); + context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_URL, null); + context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_VIF_NUMBER, null); + context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_COLOR, null); + + // Invokes + context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES); + context.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES); } + //Update vehicle make + state.order.vehicle.make = make; }, + saveVehicleModel(context, model){ + + //If new model, reset state dependencies + if (state.order.vehicle.make !== model) { + context.commit(storeMutations.UPDATE_STYLE, null); + context.commit(storeMutations.UPDATE_CAR_ID, null); + context.commit(storeMutations.UPDATE_VEHICLE_CATEGORY, null); + context.commit(storeMutations.UPDATE_VEHICLE_VIN, null); + context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_URL, null); + context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_VIF_NUMBER, null); + context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_COLOR, null); + + context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES); + context.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES); + } + //Update vehicle model + state.order.vehicle.model = model; + }, + saveVehicleStyle(context, style){ + //If new style, reset state dependencies + if(state.order.vehicle.style !== style){ + context.commit(storeMutations.UPDATE_CAR_ID, null); + context.commit(storeMutations.UPDATE_VEHICLE_CATEGORY, null); + context.commit(storeMutations.UPDATE_VEHICLE_VIN, null); + context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_URL, null); + context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_VIF_NUMBER, null); + context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_COLOR, null); + + context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES); + context.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES); + } + //Update vehicle style + state.order.vehicle.style = style; +}, +saveVehicleDamage(context){ + context.dispatch(storeActions.RESET_PARTS_STATE_AND_DEPENDENCIES); +}, +saveVinLookup(context){ + //if cardId is different AND selected glass part is not available reset damage and dependeices + if(context.isCarIdDifferent && !context.isSelectedGlassAvailableForVehicle){ + context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES); + } + context.dispatch(storeMutations.RESET_REGISTRATION_STATE_AND_DEPENDENCIES); +}, +saveServiceLocation(context){ + // to be implemented +}, +saveEmail(context){ + // to be implemented +}, +saveRegistrationLicensePlateLookup(context){ + //if cardId is different AND selected glass part is not available reset damage and dependeices + if(context.isCarIdDifferent && !context.isSelectedGlassAvailableForVehicle){ + context.dispatch(storeMutations.RESET_DAMAGE_STATE_AND_DEPENDENCIES); + } + context.commit(storeMutations.UPDATE_REGISTRATION_ADDRESS, null); + context.commit(storeMutations.UPDATE_REGISTRATION_CITY, null); + context.commit(storeMutations.UPDATE_REGISTRATION_FIRST_NAME, null); + context.commit(storeMutations.UPDATE_REGISTRATION_LAST_NAME, null); +}, +saveVin(context){ + //if cardId is different AND selected glass part is not available reset damage and dependeices + if(context.isCarIdDifferent && !context.isSelectedGlassAvailableForVehicle){ + context.dispatch(storeMutations.RESET_DAMAGE_STATE_AND_DEPENDENCIES); + } +}, +saveRegistrationAddressLookup(context){ + if(context.isCarIdDifferent && !context.isSelectedGlassAvailableForVehicle){ + storeMutations.RESET_DAMAGE_STATE_AND_DEPENDENCIES; + } + context.commit(storeMutations.UPDATE_REGISTRATION_ADDRESS, null); + context.commit(storeMutations.UPDATE_REGISTRATION_CITY, null); + context.commit(storeMutations.UPDATE_REGISTRATION_FIRST_NAME, null); + context.commit(storeMutations.UPDATE_REGISTRATION_LAST_NAME, null); +}, +savePartQuestionAnswers(context){ + // to be implemented later +}, +saveGlassParts(context){ + // to be implemented later +} } export default createStore({ @@ -668,87 +758,5 @@ export default createStore({ actions, }); -/* export const mutationActions ={ - saveVehicleMake(){ - storeMutations.updateModel = null; - storeMutations.updateStyle = null; - storeMutations.updateCarId = null; - storeMutations.updateVehicleCategory = null; - storeMutations.updateVehicleVin = null; - storeMutations.updateVehicleImageUrl = null; - storeMutations.updateVehicleImageVifNumber = null; - storeMutations.updateVehicleImageColor = null; - storeMutations.resetDamageAndDependencies; - storeMutations.resetRegistrationAndDependencies; - }, - saveVehicleModel(){ - storeMutations.updateStyle = null; - storeMutations.updateCarId = null; - storeMutations.updateVehicleCategory = null; - storeMutations.updateVehicleVin = null; - storeMutations.updateVehicleImageUrl = null; - storeMutations.updateVehicleImageVifNumber = null; - storeMutations.updateVehicleImageColor = null; - storeMutations.resetDamageAndDependencies; - storeMutations.resetRegistrationAndDependencies; - }, - saveVehicleStyle(){ - storeMutations.updateCarId = null; - storeMutations.updateVehicleCategory = null; - storeMutations.updateVehicleVin = null; - storeMutations.updateVehicleImageUrl = null; - storeMutations.updateVehicleImageVifNumber = null; - storeMutations.updateVehicleImageColor = null; - storeMutations.resetDamageAndDependencies; - storeMutations.resetRegistrationAndDependencies; - }, - saveVehicleDamage(){ - storeMutations.resetPartsAndDependencies; - }, - saveVinLookup(carId){ - if(state.carId!=carId && state.payload.glass==false){ - storeMutations.resetDamageAndDependencies; - } - storeMutations.resetRegistrationAndDependencies; - }, - saveServiceLocation(){ - - }, - saveEmail(){ - - }, - saveRegistrationLicensePlateLookup(carId){ - if(state.carId!=carId && state.payload.glass==false){ - storeMutations.resetDamageAndDependencies; - } - storeMutations.registrationAddress = null; - storeMutations.registrationCity = null; - storeMutations.registration.firstName = null; - storeMutations.registration.lastName = null; - }, - saveVin(carId){ - if(state.carId!=carId && state.payload.glass==false){ - storeMutations.resetDamageAndDependencies; - } - }, - saveRegistrationAddressLookup(carId){ - if(state.carId!=carId && state.payload.glass==false){ - storeMutations.resetDamageAndDependencies; - } - storeMutations.registrationAddress = null; - storeMutations.registrationCity = null; - storeMutations.registration.firstName = null; - storeMutations.registration.lastName = null; - }, - savePartQuestionAnswers(){ - - }, - saveGlassParts(){ - - } -} */ - // Private Functions - -//Track state values -const oldValue = state; +