INSR-8455: Skip vehicle-lookup on back navigation when appropriate

This commit is contained in:
Alex Humphries 2026-02-13 17:27:28 -05:00
parent e2f624b4b4
commit 916f56a50e
4 changed files with 17 additions and 0 deletions

View file

@ -90,6 +90,15 @@ export function getGlassList(glassPieces) {
return names.toLowerCase();
}
export function includesWindshieldReplacement() {
const mainStore = useMainStore();
const windshieldMatches =
mainStore.damage.glassToReplace?.filter(
(glassToReplace) => glassToReplace.glassLocation === damageLocationsSelected.WINDSHIELD
) ?? [];
return windshieldMatches.length > 0;
}
/**
* Commented code are copied directly from DigitalConsumer.FixMyGlass
* and have not been adjusted for ISS.

View file

@ -1,3 +1,4 @@
import { includesWindshieldReplacement } from '@/helpers/damage-helper';
import issPageValues from '@/router/router-constants/issPage-values';
import navigationScenarios from '@/router/router-constants/navigation-scenarios';
import { useMainStore } from '@/store';
@ -457,6 +458,8 @@ export default {
let backNavigationScenario = '';
if (self.mainStore.order.damage.isRepair) {
backNavigationScenario = navigationScenarios.CLICKED_BACK_WITH_REPAIR;
} else if (!includesWindshieldReplacement()) {
backNavigationScenario = navigationScenarios.CLICKED_BACK_WITH_SKIP_VIN_AND_NO_MORE_QUESTIONS;
} else {
backNavigationScenario = self.mainStore.vehicle.vin
? navigationScenarios.CLICKED_BACK_WITH_VIN_AND_NO_MORE_QUESTIONS

View file

@ -61,6 +61,7 @@ const navigationScenarios = Object.freeze({
CLICKED_BACK_WITH_MOLDING_QUESTIONS: 'CLICKED_BACK_WITH_MOLDING_QUESTIONS',
CLICKED_BACK_WITH_CAPABILITY_QUESTIONS: 'CLICKED_BACK_WITH_CAPABILITY_QUESTIONS',
CLICKED_BACK_WITH_VIN_AND_NO_MORE_QUESTIONS: 'CLICKED_BACK_WITH_VIN_AND_NO_MORE_QUESTIONS',
CLICKED_BACK_WITH_SKIP_VIN_AND_NO_MORE_QUESTIONS: 'CLICKED_BACK_WITH_SKIP_VIN_AND_NO_MORE_QUESTIONS',
CLICKED_BACK_WITH_NO_VIN_NOR_QUESTIONS: 'CLICKED_BACK_WITH_NO_VIN_NOR_QUESTIONS',
// Schedule

View file

@ -536,6 +536,10 @@ const routingTable = () => [
scenario: navigationScenarios.CLICKED_BACK_WITH_VIN_AND_NO_MORE_QUESTIONS,
destinationIssPageValue: issPageValues.VEHICLE_DAMAGE
},
{
scenario: navigationScenarios.CLICKED_BACK_WITH_SKIP_VIN_AND_NO_MORE_QUESTIONS,
destinationIssPageValue: issPageValues.VEHICLE_DAMAGE
},
{
scenario: navigationScenarios.CLICKED_BACK_WITH_NO_VIN_NOR_QUESTIONS,
destinationIssPageValue: issPageValues.VEHICLE_LOOKUP