Merge pull request #406 from Safelite/CSR-101-updates
CSR-101-updates consolidate code.
This commit is contained in:
commit
adb07c12c8
1 changed files with 24 additions and 37 deletions
|
|
@ -57,14 +57,6 @@
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<alert
|
|
||||||
class="my-3"
|
|
||||||
:manualHeadline="MatchedDifferentVehicleAlertHeader"
|
|
||||||
:manualCopy="MatchedDifferentVehicleAlertBody"
|
|
||||||
v-model="customAlertData"
|
|
||||||
v-if="matchedDifferentVehicle"
|
|
||||||
alertClass="alert-danger"
|
|
||||||
/>
|
|
||||||
<alert
|
<alert
|
||||||
class="my-3"
|
class="my-3"
|
||||||
v-model="customAlertData"
|
v-model="customAlertData"
|
||||||
|
|
@ -80,13 +72,6 @@
|
||||||
v-if="noServiceZip"
|
v-if="noServiceZip"
|
||||||
alertClass="alert-warning"
|
alertClass="alert-warning"
|
||||||
/>
|
/>
|
||||||
<alert
|
|
||||||
class="my-3"
|
|
||||||
v-model="customAlertData"
|
|
||||||
v-if="foundWindshieldAlert"
|
|
||||||
alertClass="alert-warning"
|
|
||||||
cmsWidgetName="FoundWindshieldAlert"
|
|
||||||
/>
|
|
||||||
<alert
|
<alert
|
||||||
class="my-3"
|
class="my-3"
|
||||||
v-model="customAlertData"
|
v-model="customAlertData"
|
||||||
|
|
@ -109,13 +94,6 @@
|
||||||
v-if="isVinFieldReadOnly"
|
v-if="isVinFieldReadOnly"
|
||||||
alertClass="alert-success"
|
alertClass="alert-success"
|
||||||
/>
|
/>
|
||||||
<funnelFooter
|
|
||||||
cmsWidgetName="FunnelFooterWidget"
|
|
||||||
ref="funnelFooter"
|
|
||||||
:isForwardActionDisabled="!meta.valid"
|
|
||||||
@back-clicked="backButtonAction"
|
|
||||||
@ForwardClicked="forwardButtonAction"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<alert
|
<alert
|
||||||
class="my-3"
|
class="my-3"
|
||||||
|
|
@ -147,6 +125,13 @@
|
||||||
alertClass="alert-success"
|
alertClass="alert-success"
|
||||||
cmsWidgetName="PerfectMatchNewVinAlert"
|
cmsWidgetName="PerfectMatchNewVinAlert"
|
||||||
/>
|
/>
|
||||||
|
<funnelFooter
|
||||||
|
cmsWidgetName="FunnelFooterWidget"
|
||||||
|
ref="funnelFooter"
|
||||||
|
:isForwardActionDisabled="!meta.valid"
|
||||||
|
@back-clicked="backButtonAction"
|
||||||
|
@ForwardClicked="forwardButtonAction"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -306,34 +291,36 @@ export default {
|
||||||
this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route);
|
this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route);
|
||||||
},
|
},
|
||||||
async forwardButtonAction() {
|
async forwardButtonAction() {
|
||||||
const zipValidation = await this.validateZip(this.zip);
|
const zipValidation = this.validateZip(this.zip);
|
||||||
if (!zipValidation.data.isServiceable) {
|
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.customAlertData.zip = this.zip;
|
||||||
this.$refs.funnelFooter.removeLoader();
|
this.$refs.funnelFooter.removeLoader();
|
||||||
this.noServiceZip = true;
|
this.noServiceZip = true;
|
||||||
this.invalidZip = this.zip;
|
this.invalidZip = this.zip;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const vehicleLookup = await this.lookupVehicle(this.vin).catch(() => {
|
this.isCarIdDifferent = vehicleLookupResponse.data.carId !== store.getters.vehicle.carId;
|
||||||
this.vinNotFound = true;
|
|
||||||
this.$refs.funnelFooter.removeLoader();
|
|
||||||
this.noServiceZip = false;
|
|
||||||
return;
|
|
||||||
});
|
|
||||||
this.isCarIdDifferent = vehicleLookup.data.carId !== store.getters.vehicle.carId;
|
|
||||||
|
|
||||||
if (this.isCarIdDifferent && (vehicleLookup.data.carId !== this.previouslyEnteredCarId)) {
|
if (this.isCarIdDifferent && (vehicleLookupResponse.data.carId !== this.previouslyEnteredCarId)) {
|
||||||
this.previouslyEnteredCarId = vehicleLookup.data.carId;
|
this.previouslyEnteredCarId = vehicleLookupResponse.data.carId;
|
||||||
this.noServiceZip = false;
|
this.noServiceZip = false;
|
||||||
this.customAlertData.vehicleInfo = vehicleLookup.data;
|
this.customAlertData.vehicleInfo = vehicleLookupResponse.data;
|
||||||
this.$refs.funnelFooter.updateButtonText(`Continue with ${vehicleLookup.data.year} ${vehicleLookup.data.make} ${vehicleLookup.data.model}`);
|
this.$refs.funnelFooter.updateButtonText(`Continue with ${vehicleLookupResponse.data.year} ${vehicleLookupResponse.data.make} ${vehicleLookupResponse.data.model}`);
|
||||||
this.isVinValid = true;
|
this.isVinValid = true;
|
||||||
this.isSelectedGlassAvailableForVehicle = await isGlassAvailableForCarId(vehicleLookup.data.carId);
|
this.isSelectedGlassAvailableForVehicle = await isGlassAvailableForCarId(vehicleLookupResponse.data.carId);
|
||||||
this.$refs.funnelFooter.removeLoader();
|
this.$refs.funnelFooter.removeLoader();
|
||||||
this.isCarIdDifferent = true;
|
this.isCarIdDifferent = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.updateStore(vehicleLookup.data);
|
this.updateStore(vehicleLookupResponse.data);
|
||||||
this.navigateForward();
|
this.navigateForward();
|
||||||
},
|
},
|
||||||
navigateForward(){
|
navigateForward(){
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue