vinPagesMixin, navigation scenarios

This commit is contained in:
Kroell 2023-01-16 16:02:48 -05:00
parent 919b7af58f
commit 214b510d31
2 changed files with 23 additions and 7 deletions

View file

@ -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() {

View file

@ -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,
},
],
},
{