diff --git a/src/common-components/textbox-question/textbox-question.vue b/src/common-components/textbox-question/textbox-question.vue index 00dcdfb88..41c5fc0a7 100644 --- a/src/common-components/textbox-question/textbox-question.vue +++ b/src/common-components/textbox-question/textbox-question.vue @@ -57,8 +57,13 @@ export default { const fieldOptions = { type: "text", value: props.modelValue, + potentialInitialValue: props.modelValue, }; + if (props.modelValue && props.modelValue.length > 0) { + fieldOptions['initialValue'] = fieldOptions.potentialInitialValue; + } + const { errorMessage, handleBlur, @@ -98,10 +103,10 @@ export default { words.forEach(function (word) { const position = 1; word = [word.toString().slice(0, position), noBreakChar, word.toString().slice(position)].join(''); - questionText += `${word} `; - }); - - questionText = questionText.trimEnd(); + questionText += `${word} `; + }); + + questionText = questionText.trimEnd(); } else { questionText = this.questionText.toString(); } diff --git a/src/layouts/license-plate-lookup/license-plate-lookup.vue b/src/layouts/license-plate-lookup/license-plate-lookup.vue index 1db7a57fd..e6ad2bf4b 100644 --- a/src/layouts/license-plate-lookup/license-plate-lookup.vue +++ b/src/layouts/license-plate-lookup/license-plate-lookup.vue @@ -1,35 +1,91 @@ diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue index 4842a8eb6..8a3f28a7d 100644 --- a/src/layouts/vin-lookup/vin-lookup.vue +++ b/src/layouts/vin-lookup/vin-lookup.vue @@ -62,16 +62,9 @@ :manualHeadline="MatchedDifferentVehicleAlertHeader" :manualCopy="MatchedDifferentVehicleAlertBody" v-model="customAlertData" - v-if="matchedDifferentVehicle" + v-if="isCarIdDifferent" alertClass="alert-danger" /> - - 0, }; }, computed: { + perfectMatchNewVinAlert() { + return this.vinPopulatedOnPageLoad && this.vin === this.getVinFromStore(); + }, MatchedDifferentVehicleAlertHeader(){ - let text = this.getCmsContent("MatchedDifferentVehicle", + const text = this.getCmsContent("MatchedDifferentVehicle", "HeadlineText").replaceAll("{custom:damage}", getDamageString()); return text; }, MatchedDifferentVehicleAlertBody(){ - let text = this.getCmsContent("MatchedDifferentVehicle", + const text = this.getCmsContent("MatchedDifferentVehicle", "BodyText").replaceAll("{custom:damage}", getDamageString()).replaceAll("{custom:vinlookupYear}", this.customAlertData?.vehicleInfo?.year).replaceAll("{custom:vinlookupMake}", this.customAlertData?.vehicleInfo?.make).replaceAll("{custom:vinlookupModel}", this.customAlertData?.vehicleInfo?.model); return text; }, NoServiceZipHeader(){ - let text = this.getCmsContent("NoServiceZipWidget", "HeadlineText").replaceAll("{custom:serviceZip}", this.invalidZip); + const text = this.getCmsContent("NoServiceZipWidget", "HeadlineText").replaceAll("{custom:serviceZip}", this.invalidZip); return text; }, @@ -288,7 +269,7 @@ export default { this.isVinValid = true; this.isSelectedGlassAvailableForVehicle = await isGlassAvailableForCarId(vehicleLookup.data.carId); this.$refs.funnelFooter.removeLoader(); - this.matchedDifferentVehicle = true; + this.isCarIdDifferent = true; return; } this.updateStore(vehicleLookup.data); diff --git a/src/router/router-constants/routing-table.js b/src/router/router-constants/routing-table.js index 2d27efcdf..80d7818d1 100644 --- a/src/router/router-constants/routing-table.js +++ b/src/router/router-constants/routing-table.js @@ -102,19 +102,11 @@ const routingTable = [ maps: [ { scenario: navigationScenarios.CLICKED_BACK, - destinationFmgPageValue: fmgPageValues.REVEAL, - }, - { - scenario: navigationScenarios.CLICKED_BACK_WITH_VIN, - destinationFmgPageValue: fmgPageValues.VEHICLE_DAMAGE, - }, - { - scenario: navigationScenarios.VIN_LOOKUP, - destinationFmgPageValue: fmgPageValues.PART_QUESTIONS, + destinationFmgPageValue: fmgPageValues.ESTIMATE, }, { scenario: navigationScenarios.CLICKED_FORWARD, - destinationFmgPageValue: fmgPageValues.ESTIMATE, + destinationFmgPageValue: fmgPageValues.VEHICLE_DAMAGE, } ], }, @@ -157,7 +149,7 @@ const routingTable = [ { scenario: navigationScenarios.CLICKED_FORWARD, destinationFmgPageValue: fmgPageValues.VEHICLE_DAMAGE, - }, + }, ], }, {fmgPageValue: fmgPageValues.ESTIMATE, diff --git a/src/store/index.js b/src/store/index.js index 2c52053bb..75bd4807d 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -144,17 +144,17 @@ export const mutations = { updateRegistrationAddress(state, registrationAddress){ state.order.vehicle.registration.address = registrationAddress; }, - updateServiceLocationZipCode(state, serviceLocationZipCode){ - state.order.serviceLocation.zipCode = serviceLocationZipCode; + updateServiceLocationZip(state, serviceLocationZip){ + state.order.vehicle.registration.zip = serviceLocationZip; }, updateRegistrationCity(state, serviceCity){ - state.order.serviceLocation.city = serviceCity; + state.order.vehicle.registration.city = serviceCity; }, updateRegistrationFirstName(state, firstName){ - state.order.serviceLocation.firstName = firstName; + state.order.vehicle.registration.firstName = firstName; }, updateRegistrationLastName(state, lastName){ - state.order.serviceLocation.lastName = lastName; + state.order.vehicle.registration.lastName = lastName; }, updateCustomerEmailAddress(state, customerEmailAddress){ state.order.customer.emailAddress = customerEmailAddress;