diff --git a/src/common-components/dropdown-question/dropdown-question.vue b/src/common-components/dropdown-question/dropdown-question.vue index 7afdc0b38..6d358d1e1 100644 --- a/src/common-components/dropdown-question/dropdown-question.vue +++ b/src/common-components/dropdown-question/dropdown-question.vue @@ -42,7 +42,8 @@ export default { setup(props) { const fieldOptions = { type: "text", - value: props.modelValue, + value: props.modelValue, + initialValue: props.modelValue, }; const { diff --git a/src/common-components/textbox-question/textbox-question.vue b/src/common-components/textbox-question/textbox-question.vue index 41c5fc0a7..fed8deea7 100644 --- a/src/common-components/textbox-question/textbox-question.vue +++ b/src/common-components/textbox-question/textbox-question.vue @@ -1,7 +1,8 @@ @@ -306,34 +291,36 @@ export default { this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route); }, async forwardButtonAction() { - const zipValidation = await this.validateZip(this.zip); - if (!zipValidation.data.isServiceable) { + const zipValidation = this.validateZip(this.zip); + const vehicleLookup = this.lookupVehicle(this.vin); + const zipValidationResponse = await zipValidation; + const vehicleLookupResponse = await vehicleLookup.catch(() => { + this.vinNotFound = true; + this.$refs.funnelFooter.removeLoader(); + this.noServiceZip = false; + return; + }); + if (!zipValidationResponse.data.isServiceable) { this.customAlertData.zip = this.zip; this.$refs.funnelFooter.removeLoader(); this.noServiceZip = true; this.invalidZip = this.zip; return; } - const vehicleLookup = await this.lookupVehicle(this.vin).catch(() => { - this.vinNotFound = true; - this.$refs.funnelFooter.removeLoader(); - this.noServiceZip = false; - return; - }); - this.isCarIdDifferent = vehicleLookup.data.carId !== store.getters.vehicle.carId; + this.isCarIdDifferent = vehicleLookupResponse.data.carId !== store.getters.vehicle.carId; - if (this.isCarIdDifferent && (vehicleLookup.data.carId !== this.previouslyEnteredCarId)) { - this.previouslyEnteredCarId = vehicleLookup.data.carId; + if (this.isCarIdDifferent && (vehicleLookupResponse.data.carId !== this.previouslyEnteredCarId)) { + this.previouslyEnteredCarId = vehicleLookupResponse.data.carId; this.noServiceZip = false; - this.customAlertData.vehicleInfo = vehicleLookup.data; - this.$refs.funnelFooter.updateButtonText(`Continue with ${vehicleLookup.data.year} ${vehicleLookup.data.make} ${vehicleLookup.data.model}`); + this.customAlertData.vehicleInfo = vehicleLookupResponse.data; + this.$refs.funnelFooter.updateButtonText(`Continue with ${vehicleLookupResponse.data.year} ${vehicleLookupResponse.data.make} ${vehicleLookupResponse.data.model}`); this.isVinValid = true; - this.isSelectedGlassAvailableForVehicle = await isGlassAvailableForCarId(vehicleLookup.data.carId); + this.isSelectedGlassAvailableForVehicle = await isGlassAvailableForCarId(vehicleLookupResponse.data.carId); this.$refs.funnelFooter.removeLoader(); this.isCarIdDifferent = true; return; } - this.updateStore(vehicleLookup.data); + this.updateStore(vehicleLookupResponse.data); this.navigateForward(); }, navigateForward(){ diff --git a/src/router/router-constants/navigation-scenarios.js b/src/router/router-constants/navigation-scenarios.js index b3ce4d6d7..d7491a6bf 100644 --- a/src/router/router-constants/navigation-scenarios.js +++ b/src/router/router-constants/navigation-scenarios.js @@ -12,6 +12,7 @@ const navigationScenarios = { CONTINUING_WITH_MULTIPLE_PARTS: "CONTINUING_WITH_MULTIPLE_PARTS", CONTINUING_WITH_SINGLE_PART: "CONTINUING_WITH_SINGLE_PART", CONTINUING_WITH_MULTIPLE_VEHICLES: "CONTINUING_WITH_MULTIPLE_VEHICLES", + CONTINUING_WITH_DIFFERENT_GLASS: "CONTINUING_WITH_DIFFERENT_GLASS", 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 84b15d2d5..9404fcfa2 100644 --- a/src/router/router-constants/routing-table.js +++ b/src/router/router-constants/routing-table.js @@ -135,7 +135,7 @@ const routingTable = [ destinationFmgPageValue: fmgPageValues.ADDRESS_VEHICLES, }, { - scenario: navigationScenarios.CLICKED_FORWARD, + scenario: navigationScenarios.CONTINUING_WITH_DIFFERENT_GLASS, destinationFmgPageValue: fmgPageValues.VEHICLE_DAMAGE, }, ], diff --git a/src/store/index.js b/src/store/index.js index d570b5c4e..b1845aa7c 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -135,21 +135,21 @@ export const mutations = { updateRegistrationLicensePlate(state, licensePlate){ state.order.vehicle.registration.licensePlate = licensePlate; }, + 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; }, - updateRegistrationAddress(state, registrationAddress){ - state.order.vehicle.registration.address = registrationAddress; - }, updateServiceLocationZipCode(state, serviceLocationZip){ - state.order.vehicle.registration.zip = serviceLocationZip; + state.order.serviceLocation.zipCode = serviceLocationZip; }, - updateRegistrationCity(state, serviceCity){ - state.order.vehicle.registration.city = serviceCity; - }, updateRegistrationFirstName(state, firstName){ state.order.vehicle.registration.firstName = firstName; },