From 214b510d3158746e062663c2c15e41626dd347d5 Mon Sep 17 00:00:00 2001 From: Kroell Date: Mon, 16 Jan 2023 16:02:48 -0500 Subject: [PATCH] vinPagesMixin, navigation scenarios --- .../license-plate-lookup.vue | 12 ++++++------ src/router/router-constants/routing-table.js | 18 +++++++++++++++++- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/layouts/license-plate-lookup/license-plate-lookup.vue b/src/layouts/license-plate-lookup/license-plate-lookup.vue index c6d561ac..3d6111ba 100644 --- a/src/layouts/license-plate-lookup/license-plate-lookup.vue +++ b/src/layouts/license-plate-lookup/license-plate-lookup.vue @@ -55,6 +55,7 @@ import { routerParams } from '@/router/router-params.js' // Import Component import baseFormMixin from '@/mixins/base-form-mixin'; +import vinPagesMixin from '@/mixins/vin-pages-mixin'; import { Form } from 'vee-validate'; import siteFooter from '@/common-components/site-footer/site-footer.vue'; import siteHeader from '@/common-components/site-header/site-header.vue'; @@ -70,7 +71,7 @@ defineRule("zip-format", regex(/(^\d{5}$)|(^\d{5}-\d{4}$)/, errorMessages.SERVIC export default { name: 'license-plate-lookup', - mixins: [baseFormMixin], + mixins: [baseFormMixin, vinPagesMixin], components: { Form, siteFooter, @@ -169,18 +170,17 @@ export default { }, async navigateForward() { + // If a different vehicle is found than the one entered and the selected glass is not available for that vehicle then navigate back to "vehicle-damage" + // display vehicle changed alert on that page. if (this.isCarIdDifferentFromTheStore && !this.isSelectedGlassAvailableForVehicle) { this.$router.navigate( - this.navigationScenarios.CLICKED_FORWARD, + this.navigationScenarios.SELECTED_VIN_WITH_MISMATCHED_GLASS, this.$route, {}, { [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: true } ); } else { - await this.$router.navigate( - this.navigationScenarios.CLICKED_FORWARD_WITH_NO_MORE_QUESTIONS, - this.$route - ); + await this.navigateForwardWithSingleCarMatch(); } }, resetActiveAlert() { diff --git a/src/router/router-constants/routing-table.js b/src/router/router-constants/routing-table.js index 2f7cd6f5..b832bbab 100644 --- a/src/router/router-constants/routing-table.js +++ b/src/router/router-constants/routing-table.js @@ -117,7 +117,23 @@ const routingTable = function(store) { { scenario: navigationScenarios.CLICKED_FORWARD_WITH_NO_MORE_QUESTIONS, destinationIssPageValue: issPageValues.COVERAGE_STATEMENT, - }, + }, + { + scenario: navigationScenarios.CLICKED_FORWARD_WITH_PART_QUESTIONS, + destinationIssPageValue: issPageValues.PART_QUESTIONS, + }, + { + scenario: navigationScenarios.CLICKED_FORWARD_WITH_MULTIPLE_PARTS_TO_CHOOSE, + destinationIssPageValue: issPageValues.VEHICLE_PARTS, + }, + { + scenario: navigationScenarios.CLICKED_FORWARD_WITH_MOLDING_QUESTIONS, + destinationIssPageValue: issPageValues.MOLDING_QUESTIONS, + }, + { + scenario: navigationScenarios.CLICKED_FORWARD_WITH_CAPABILITY_QUESTIONS, + destinationIssPageValue: issPageValues.CAPABILITY_QUESTIONS, + }, ], }, {