Committing to compare via Draft
This commit is contained in:
parent
457c112243
commit
76f9ec39aa
7 changed files with 24 additions and 23 deletions
|
|
@ -344,9 +344,6 @@ export default {
|
|||
{ [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: true }
|
||||
);
|
||||
} else if (matchingCars.length === 1) {
|
||||
if (await this.handleVinRequiredVehicle(this.vin)) {
|
||||
return;
|
||||
}
|
||||
await this.navigateForwardWithSingleCarMatch();
|
||||
} else {
|
||||
this.$router.navigate(
|
||||
|
|
|
|||
|
|
@ -232,9 +232,6 @@ export default {
|
|||
},
|
||||
async forwardButtonAction() {
|
||||
this.mainStore.resetBailout();
|
||||
if (await this.handleVinRequiredVehicle(this.vin)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const vinLookup = await useMainStore().lookupVehicleByVin(this.selectedVehicle.vin);
|
||||
if (!vinLookup) {
|
||||
|
|
@ -276,9 +273,6 @@ export default {
|
|||
{ [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: true }
|
||||
);
|
||||
} else {
|
||||
if (await this.handleVinRequiredVehicle(this.vin)) {
|
||||
return;
|
||||
}
|
||||
await this.navigateForwardWithSingleCarMatch();
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -305,11 +305,6 @@ export default {
|
|||
}
|
||||
});
|
||||
|
||||
const ymmsBailoutEnabled = this.getSettingValue(experimentSettings.ISS_YMMS_VIN_REQUIRED_BAILOUT_ENABLED) === 'true';
|
||||
if (ymmsBailoutEnabled && this.mainStore.order.vehicle.vinRequired) {
|
||||
return this.$router.navigateBailout(bailoutMessage.YMMNotFound());
|
||||
}
|
||||
|
||||
return this.navigateForward();
|
||||
},
|
||||
async navigateForward() {
|
||||
|
|
|
|||
|
|
@ -428,9 +428,19 @@ export default {
|
|||
this.$route
|
||||
);
|
||||
} else if (this.mainStore.order.vehicle.vin || !this.isWindshieldReplace) {
|
||||
let partsOrQuestionsResponse;
|
||||
const isVinRequired = this.mainStore.order.vehicle.vinRequired;
|
||||
if (isVinRequired) {
|
||||
this.mainStore.resetBailout();
|
||||
partsOrQuestionsResponse = await this.getPartsOrQuestionsV2();
|
||||
if (partsOrQuestionsResponse.data.partsOrQuestions.length === 0) {
|
||||
this.navigateBailout(bailoutMessage.YMMNotFound('No Parts Returned'));
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
// If vin already exists or not replacing windshield, get parts/questions and navigate forward
|
||||
|
||||
const partsOrQuestionsResponse = await this.getPartsOrQuestions();
|
||||
partsOrQuestionsResponse = await this.getPartsOrQuestions();
|
||||
}
|
||||
|
||||
// Comes from vehicleQuestionsMixin.navigateForward()
|
||||
await this.navigateForward(
|
||||
|
|
|
|||
|
|
@ -67,9 +67,9 @@ export default {
|
|||
answers.splice(homeAddressIndex, 1);
|
||||
}
|
||||
|
||||
const ymmsBailoutEnabled = this.getSettingValue(experimentSettings.ISS_YMMS_VIN_REQUIRED_BAILOUT_ENABLED) === 'true';
|
||||
const ymmsPageEnabled = this.getSettingValue(experimentSettings.ISS_YMMS_VIN_REQUIRED_PAGE_ENABLED) === 'true';
|
||||
const isVinRequired = useMainStore().order.vehicle.vinRequired;
|
||||
if (isVinRequired && ymmsBailoutEnabled) {
|
||||
if (isVinRequired && ymmsPageEnabled) {
|
||||
const vinIndex = answers.findIndex(answer => answer.Name === vinLookupMethodSelections.NOVIN);
|
||||
if (vinIndex >= 0) {
|
||||
answers.splice(vinIndex, 1);
|
||||
|
|
|
|||
|
|
@ -137,8 +137,9 @@ export default {
|
|||
return vinYmmFound.toLowerCase() === vinYmmExpected.toLowerCase();
|
||||
},
|
||||
vinMask() {
|
||||
const vinRequired = this.mainStore.order.vehicle.vinRequired === true;
|
||||
// TODO: Side effects in computed.
|
||||
if (this.vinPopulatedOnPageLoad) {
|
||||
if (this.vinPopulatedOnPageLoad && !vinRequired) {
|
||||
// TODO: Modify to remove side effects in computed
|
||||
this.activeVehicleLookupAlertType = vehicleLookupAlertTypes.PERFECT_MATCH;
|
||||
this.needToLookupVehicle = false;
|
||||
|
|
|
|||
|
|
@ -6,9 +6,13 @@ import bailoutMessage from '@/constants/bailoutMessage';
|
|||
export default {
|
||||
methods: {
|
||||
async navigateForwardWithSingleCarMatch() {
|
||||
const result = await useMainStore().getPartsOrQuestions();
|
||||
let result;
|
||||
if (this.mainStore.order.vehicle.vinRequired) {
|
||||
result = await useMainStore().getPartsOrQuestionsV2();
|
||||
} else {
|
||||
result = await useMainStore().getPartsOrQuestions();
|
||||
}
|
||||
const { partsOrQuestions } = result.data;
|
||||
|
||||
vehicleQuestionsMixin.methods.navigateForward(partsOrQuestions, this);
|
||||
},
|
||||
async handleVinRequiredVehicle(vin) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue