Differentiate skipvin vs. declinevin scenarios for back-nav

This commit is contained in:
Chloe Herd 2024-06-14 10:47:29 -04:00
parent 7b5b58de2d
commit e5561e0c05
3 changed files with 18 additions and 2 deletions

View file

@ -157,9 +157,20 @@ export default {
// TODO: REASSESS
return store.getters.damage.isRepair || store.getters.damage.glassToReplace?.length > 0;
},
backButtonAction() {
async backButtonAction() {
const skipVin = await skipVinLookup();
// route to move backwards
this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route);
if (skipVin) {
this.$router.navigateWithoutSaving(
this.navigationScenarios.CLICKED_BACK_WITH_SKIP_VIN,
this.$route
);
} else {
this.$router.navigateWithoutSaving(
this.navigationScenarios.CLICKED_BACK,
this.$route
);
}
},
async forwardButtonAction() {
const zipCodeData = await this.getZipCodeData(this.serviceZipCode);

View file

@ -15,6 +15,7 @@ const navigationScenarios = {
// Vin selection
CLICKED_BACK_WITH_VIN: "CLICKED_BACK_WITH_VIN",
CLICKED_BACK_WITH_SKIP_VIN: "CLICKED_BACK_WITH_SKIP_VIN",
CLICKED_FORWARD_WITH_VIN: "CLICKED_FORWARD_WITH_VIN",
CLICKED_FORWARD_WITH_REPAIR_AND_VERIFIED_INSURANCE:
"CLICKED_FORWARD_WITH_REPAIR_AND_VERIFIED_INSURANCE",

View file

@ -255,6 +255,10 @@ const routingTable = function (store) {
maps: [
{
scenario: navigationScenarios.CLICKED_BACK,
destinationFmgPageValue: fmgPageValues.ESTIMATE,
},
{
scenario: navigationScenarios.CLICKED_BACK_WITH_SKIP_VIN,
destinationFmgPageValue: fmgPageValues.VEHICLE_DAMAGE,
},
{