diff --git a/src/layouts/capability-questions/capability-questions.vue b/src/layouts/capability-questions/capability-questions.vue index 74c79e20a..d5086aaf5 100644 --- a/src/layouts/capability-questions/capability-questions.vue +++ b/src/layouts/capability-questions/capability-questions.vue @@ -62,13 +62,14 @@ import { fmgPageValues } from "@/router/router-constants/fmgPage-values"; import { Form, defineRule } from "vee-validate"; import { required } from "@/helpers/validation-rules"; import { errorMessages } from "@/constants/error-messages"; -import { result } from "lodash"; +import vehicleQuestionsMixin from "@/mixins/vehicle-questions-mixin"; // DEFINE VALIDATION RULES defineRule("questions-required", required(errorMessages.OPTION_REQUIRED)); export default { name: "capability-questions", + mixins: [vehicleQuestionsMixin], async beforeRouteEnter(to, from, next) { // Call APIs const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage); @@ -133,13 +134,13 @@ export default { if (this.currentPartNum === i || part.answerData?.answerResult.length > 0) { return true; } return false; }, - backButtonAction() { - // route to move backwards - this.$router.navigate( - this.navigationScenarios.CLICKED_BACK, - this.$route - ); - }, + // backButtonAction() { + // // route to move backwards + // this.$router.navigate( + // this.navigationScenarios.CLICKED_BACK, + // this.$route + // ); + // }, async forwardButtonAction() { // TODO: TO COME // if questions are answered: diff --git a/src/layouts/part-questions/part-questions.vue b/src/layouts/part-questions/part-questions.vue index 1f8160adf..2d24a3ca9 100644 --- a/src/layouts/part-questions/part-questions.vue +++ b/src/layouts/part-questions/part-questions.vue @@ -123,13 +123,13 @@ export default { if (this.currentPartNum === i || part.answerData?.answerResult?.length > 0) { return true; } return false; }, - backButtonAction() { - // route to move backwards - this.$router.navigate( - this.navigationScenarios.CLICKED_BACK, - this.$route - ); - }, + // backButtonAction() { + // // route to move backwards + // this.$router.navigate( + // this.navigationScenarios.CLICKED_BACK, + // this.$route + // ); + // }, async forwardButtonAction() { const partQuestionAnswersArray = this.partsQuestionsData.map((item) => { return { @@ -155,32 +155,33 @@ export default { }); const glassNameAndPartsForStore = partsLookup.data.glassNameAndParts; - const hasGlassLocationWithMultipleParts = this.hasGlassLocationWithMultipleParts(glassNameAndPartsForStore); - const hasChildPartQuestions = this.hasChildPartQuestions(glassNameAndPartsForStore); - const hasCapabilityQuestions = this.hasCapabilityQuestions(glassNameAndPartsForStore); + this.navigateForward(glassNameAndPartsForStore); + // const hasGlassLocationWithMultipleParts = this.hasGlassLocationWithMultipleParts(glassNameAndPartsForStore); + // const hasChildPartQuestions = this.hasChildPartQuestions(glassNameAndPartsForStore); + // const hasCapabilityQuestions = this.hasCapabilityQuestions(glassNameAndPartsForStore); - // NAVIGATE FORWARD - if (hasGlassLocationWithMultipleParts) { - // if multiple parts on any glass - // go to vehicle-parts page and pass the partsData - this.$router.navigate(this.navigationScenarios.ANSWERED_QUESTIONS_WITH_MULTIPLE_PARTS,this.$route,{},{},{partsOrQuestions: glassNameAndPartsForStore}); - } else if (hasChildPartQuestions) { - // if any childpart questions - // go to molding-questions page and pass the partsData - this.$router.navigate(this.navigationScenarios.HAS_MOLDING_QUESTIONS,this.$route,{},{},{partsOrQuestions: glassNameAndPartsForStore}); - } else if (hasCapabilityQuestions) { - // if has capability questions - // go to capability-questions page and pass the partsData - this.$router.navigate(this.navigationScenarios.HAS_CAPABILITY_QUESTIONS,this.$route,{},{},{partsOrQuestions: glassNameAndPartsForStore}); - } else { - // if single parts only - const collectedGlassParts = this.reducedGlassPartsArray(glassNameAndPartsForStore); - // save to store lineItems.glassParts - this.$store.commit(storeMutations.UPDATE_GLASS_PARTS, collectedGlassParts); - // go to heritage quote page - this.$refs.loadingModal.showModal(); - navigateToHeritageFunnel(); - } + // // NAVIGATE FORWARD + // if (hasGlassLocationWithMultipleParts) { + // // if multiple parts on any glass + // // go to vehicle-parts page and pass the partsData + // this.$router.navigate(this.navigationScenarios.ANSWERED_QUESTIONS_WITH_MULTIPLE_PARTS,this.$route,{},{},{partsOrQuestions: glassNameAndPartsForStore}); + // } else if (hasChildPartQuestions) { + // // if any childpart questions + // // go to molding-questions page and pass the partsData + // this.$router.navigate(this.navigationScenarios.HAS_MOLDING_QUESTIONS,this.$route,{},{},{partsOrQuestions: glassNameAndPartsForStore}); + // } else if (hasCapabilityQuestions) { + // // if has capability questions + // // go to capability-questions page and pass the partsData + // this.$router.navigate(this.navigationScenarios.HAS_CAPABILITY_QUESTIONS,this.$route,{},{},{partsOrQuestions: glassNameAndPartsForStore}); + // } else { + // // if single parts only + // const collectedGlassParts = this.reducedGlassPartsArray(glassNameAndPartsForStore); + // // save to store lineItems.glassParts + // this.$store.commit(storeMutations.UPDATE_GLASS_PARTS, collectedGlassParts); + // // go to heritage quote page + // this.$refs.loadingModal.showModal(); + // navigateToHeritageFunnel(); + // } }, arePagePrerequisitesValid() { const partQuestionsFromPageData = store.getters.pageData(fmgPageValues.PART_QUESTIONS); diff --git a/src/layouts/vehicle-parts/vehicle-parts.vue b/src/layouts/vehicle-parts/vehicle-parts.vue index cd579fdcb..0035131d3 100644 --- a/src/layouts/vehicle-parts/vehicle-parts.vue +++ b/src/layouts/vehicle-parts/vehicle-parts.vue @@ -159,15 +159,15 @@ export default { return store.getters.damage.isRepair != null && store.getters.pageData(fmgPageValues.VEHICLE_PARTS) && Object.keys(store.getters.pageData(fmgPageValues.VEHICLE_PARTS)).length !== 0; }, - backButtonAction() { - const hasPartQuestions = this.hasPartQuestions(this.$store.getters.pageData(fmgPageValues.PART_QUESTIONS)?.partsOrQuestions); - const backNavigationScenario = hasPartQuestions ? this.navigationScenarios.CLICKED_BACK_WITH_PART_QUESTION_ANSWERS : this.navigationScenarios.CLICKED_BACK_WITHOUT_PART_QUESTION_ANSWERS; + // backButtonAction() { + // const hasPartQuestions = this.hasPartQuestions(this.$store.getters.pageData(fmgPageValues.PART_QUESTIONS)?.partsOrQuestions); + // const backNavigationScenario = hasPartQuestions ? this.navigationScenarios.CLICKED_BACK_WITH_PART_QUESTION_ANSWERS : this.navigationScenarios.CLICKED_BACK_WITHOUT_PART_QUESTION_ANSWERS; - this.$router.navigate( - backNavigationScenario, - this.$route - ); - }, + // this.$router.navigate( + // backNavigationScenario, + // this.$route + // ); + // }, async forwardButtonAction() { const matchedParts = []; @@ -192,8 +192,8 @@ export default { } } - const hasChildPartQuestions = this.hasChildPartQuestions(matchedParts); - const hasCapabilityQuestions = this.hasCapabilityQuestions(matchedParts); + // const hasChildPartQuestions = this.hasChildPartQuestions(matchedParts); + // const hasCapabilityQuestions = this.hasCapabilityQuestions(matchedParts); // If no parts could be matched, throw an error (isForwardActionDisabled is based off of matchedParts) if (this.isForwardActionDisabled) { @@ -202,33 +202,34 @@ export default { } // Navigate to the next page - if (hasChildPartQuestions) { - this.$router.navigate( - this.navigationScenarios.HAS_MOLDING_QUESTIONS, - this.$route, - {}, - {}, - {partsOrQuestions: matchedParts} - ); - } else if (hasCapabilityQuestions) { - this.$router.navigate( - this.navigationScenarios.HAS_CAPABILITY_QUESTIONS, - this.$route, - {}, - {}, - {partsOrQuestions: matchedParts} - ); + this.navigateForward(matchedParts); + // if (hasChildPartQuestions) { + // this.$router.navigate( + // this.navigationScenarios.HAS_MOLDING_QUESTIONS, + // this.$route, + // {}, + // {}, + // {partsOrQuestions: matchedParts} + // ); + // } else if (hasCapabilityQuestions) { + // this.$router.navigate( + // this.navigationScenarios.HAS_CAPABILITY_QUESTIONS, + // this.$route, + // {}, + // {}, + // {partsOrQuestions: matchedParts} + // ); - } else { - // if single parts only - const collectedGlassParts = this.reducedGlassPartsArray(matchedParts); - // save to store lineItems.glassParts - this.$store.commit(storeMutations.UPDATE_GLASS_PARTS, collectedGlassParts); + // } else { + // // if single parts only + // const collectedGlassParts = this.reducedGlassPartsArray(matchedParts); + // // save to store lineItems.glassParts + // this.$store.commit(storeMutations.UPDATE_GLASS_PARTS, collectedGlassParts); - // go to heritage quote page - this.$refs.loadingModal.showModal(); - navigateToHeritageFunnel(); - } + // // go to heritage quote page + // this.$refs.loadingModal.showModal(); + // navigateToHeritageFunnel(); + // } }, LoadInitialPartsData() { diff --git a/src/mixins/vehicle-questions-mixin.js b/src/mixins/vehicle-questions-mixin.js index 1a28fe028..6f218f24b 100644 --- a/src/mixins/vehicle-questions-mixin.js +++ b/src/mixins/vehicle-questions-mixin.js @@ -1,5 +1,10 @@ -export default { +import { fmgPageValues } from "@/router/router-constants/fmgPage-values"; +import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper"; +import { storeMutations } from "@/constants/store-mutations.js"; +import { damageLocationsSelected } from "@/constants/damage-locations-selected"; +import { navigationScenarios } from "../router/router-constants/navigation-scenarios"; +export default { methods: { hasPartQuestions(partsOrQuestions) { return partsOrQuestions?.some(pq => pq.partQuestions?.length > 0); @@ -37,7 +42,90 @@ export default { } }); return reducedGlassParts; + }, + comparePageIndices(currentPage, fmgPage) { + const orderedVehicleQuestionPages = [ + fmgPageValues.PART_QUESTIONS, + fmgPageValues.VEHICLE_PARTS, + fmgPageValues.MOLDING_QUESTIONS, + fmgPageValues.CAPABILITY_QUESTIONS, + fmgPageValues.QUOTE + ] + + return orderedVehicleQuestionPages.indexOf(currentPage) - orderedVehicleQuestionPages.indexOf(fmgPage); + }, + currentPageComesBeforePage(currentPage = this.$route.query.fmgPage, fmgPage) { + return this.comparePageIndices(currentPage, fmgPage) < 0; + }, + currentPageComesAfterPage(currentPage = this.$route.query.fmgPage, fmgPage) { + console.log(currentPage) + console.log(fmgPage) + return this.comparePageIndices(currentPage, fmgPage) > 0; + }, + // Can't use `this` because navigateForward is also called from vin-pages-mixin + navigateForward(partsOrQuestions, vm) { + const self = vm ?? this; + const currentPage = self.$route.query.fmgPage; + + const hasPartQuestions = this.hasPartQuestions(partsOrQuestions) + const hasGlassLocationWithMultipleParts = this.hasGlassLocationWithMultipleParts(partsOrQuestions); + const hasChildPartQuestions = this.hasChildPartQuestions(partsOrQuestions); + const hasCapabilityQuestions = this.hasCapabilityQuestions(partsOrQuestions); + + if (hasPartQuestions && this.currentPageComesBeforePage(currentPage, fmgPageValues.PART_QUESTIONS)) { + self.$router.navigate(self.navigationScenarios.HAS_PART_QUESTIONS, self.$route, {}, {}, {partsOrQuestions: partsOrQuestions}); + } + else if (hasGlassLocationWithMultipleParts && this.currentPageComesBeforePage(currentPage, fmgPageValues.VEHICLE_PARTS)) { + // if multiple parts on any glass + // go to vehicle-parts page and pass the partsData + self.$router.navigate(self.navigationScenarios.HAS_MULTIPLE_PARTS_TO_CHOOSE,self.$route,{},{},{partsOrQuestions: partsOrQuestions}); + } else if (hasChildPartQuestions && this.currentPageComesBeforePage(currentPage, fmgPageValues.MOLDING_QUESTIONS)) { + // if any childpart questions + // go to molding-questions page and pass the partsData + self.$router.navigate(self.navigationScenarios.HAS_MOLDING_QUESTIONS,self.$route,{},{},{partsOrQuestions: partsOrQuestions}); + } else if (hasCapabilityQuestions && this.currentPageComesBeforePage(currentPage, fmgPageValues.CAPABILITY_QUESTIONS)) { + // if has capability questions + // go to capability-questions page and pass the partsData + self.$router.navigate(self.navigationScenarios.HAS_CAPABILITY_QUESTIONS, self.$route, {}, {}, { + carId: self.$store.getters.vehicle.carId, + partNumber: partsOrQuestions.filter(x => x.glassLocation === damageLocationsSelected.WINDSHIELD)[0].parts[0].partNumber + }); + } else { + // if single parts only + const collectedGlassParts = this.reducedGlassPartsArray(partsOrQuestions); + // save to store lineItems.glassParts + self.$store.commit(storeMutations.UPDATE_GLASS_PARTS, collectedGlassParts); + // go to heritage quote page + self.$refs.loadingModal.showModal(); + navigateToHeritageFunnel(); + } + }, + backButtonAction() { + const partsOrQuestions = this.$store.getters.pageData(fmgPageValues.PART_QUESTIONS)?.partsOrQuestions; + const hasPartQuestions = this.hasPartQuestions(partsOrQuestions); + const hasGlassLocationWithMultipleParts = this.hasGlassLocationWithMultipleParts(partsOrQuestions); + const hasChildPartQuestions = this.hasChildPartQuestions(partsOrQuestions); + const hasCapabilityQuestions = this.hasCapabilityQuestions(partsOrQuestions); + let backNavigationScenario = navigationScenarios.CLICKED_BACK_TO_GO_TO_VIN_LOOKUP; + + const currentPage = this.$route.query.fmgPage; + if (hasCapabilityQuestions && this.currentPageComesAfterPage(currentPage, fmgPageValues.CAPABILITY_QUESTIONS)) { + backNavigationScenario = navigationScenarios.CLICKED_BACK_TO_GO_TO_CAPABILITY_QUESTIONS; + } + else if (hasChildPartQuestions && this.currentPageComesAfterPage(currentPage, fmgPageValues.MOLDING_QUESTIONS)) { + backNavigationScenario = navigationScenarios.CLICKED_BACK_TO_GO_TO_MOLDING_QUESTIONS; + } + else if (hasGlassLocationWithMultipleParts && this.currentPageComesAfterPage(currentPage, fmgPageValues.VEHICLE_PARTS)) { + backNavigationScenario = navigationScenarios.CLICKED_BACK_TO_GO_TO_VEHICLE_PARTS; + } + else if (hasPartQuestions && this.currentPageComesAfterPage(currentPage, fmgPageValues.PART_QUESTIONS)) { + backNavigationScenario = navigationScenarios.CLICKED_BACK_TO_GO_TO_PART_QUESTIONS; + } + + this.$router.navigate( + backNavigationScenario, + this.$route + ); } } - } \ No newline at end of file diff --git a/src/mixins/vin-pages-mixin.js b/src/mixins/vin-pages-mixin.js index 38f804bc2..8d829dd9f 100644 --- a/src/mixins/vin-pages-mixin.js +++ b/src/mixins/vin-pages-mixin.js @@ -2,7 +2,6 @@ import { storeActions } from "@/constants/store-actions.js"; import { storeMutations } from "@/constants/store-mutations.js"; import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper"; import vehicleQuestionsMixin from "@/mixins/vehicle-questions-mixin"; -import { damageLocationsSelected } from "@/constants/damage-locations-selected"; export default { mixins: [vehicleQuestionsMixin], @@ -11,37 +10,39 @@ export default { const result = await this.dispatchStoreAction(storeActions.GET_PARTS_OR_QUESTIONS); const partsOrQuestions = result.data.partsOrQuestions; + console.log("HI") + vehicleQuestionsMixin.methods.navigateForward(partsOrQuestions, this); - const hasPartsQuestions = this.hasPartQuestions(partsOrQuestions); - const hasGlassLocationWithMultipleParts = this.hasGlassLocationWithMultipleParts(partsOrQuestions); - const hasChildPartQuestions = this.hasChildPartQuestions(partsOrQuestions); - const hasCapabilityQuestions = this.hasCapabilityQuestions(partsOrQuestions); + // const hasPartsQuestions = this.hasPartQuestions(partsOrQuestions); + // const hasGlassLocationWithMultipleParts = this.hasGlassLocationWithMultipleParts(partsOrQuestions); + // const hasChildPartQuestions = this.hasChildPartQuestions(partsOrQuestions); + // const hasCapabilityQuestions = this.hasCapabilityQuestions(partsOrQuestions); - if (hasPartsQuestions) { - this.$router.navigate(this.navigationScenarios.SELECTED_VIN_WITH_PART_QUESTIONS, this.$route, {}, {}, result.data); - } - else if (hasGlassLocationWithMultipleParts) { - this.$router.navigate(this.navigationScenarios.SELECTED_VIN_WITH_MULTIPLE_PARTS, this.$route, {}, {}, result.data); - } - else if (hasChildPartQuestions) { - this.$router.navigate(this.navigationScenarios.SELECTED_VIN_WITH_MOLDING_QUESTIONS, this.$route, {}, {}, result.data); - } - else if (hasCapabilityQuestions) { - this.$router.navigate(this.navigationScenarios.SELECTED_VIN_WITH_CAPABILITY_QUESTIONS, this.$route, {}, {}, { - carId: this.$store.getters.vehicle.carId, - partNumber: result.data.partsOrQuestions.filter(x => x.glassLocation === damageLocationsSelected.WINDSHIELD)[0].parts[0].partNumber - }); - } - else { - // if single parts only - const collectedGlassParts = this.reducedGlassPartsArray(result.data.partsOrQuestions); - // save to store lineItems.glassParts - this.$store.commit(storeMutations.UPDATE_GLASS_PARTS, collectedGlassParts); + // if (hasPartsQuestions) { + // this.$router.navigate(this.navigationScenarios.SELECTED_VIN_WITH_PART_QUESTIONS, this.$route, {}, {}, result.data); + // } + // else if (hasGlassLocationWithMultipleParts) { + // this.$router.navigate(this.navigationScenarios.SELECTED_VIN_WITH_MULTIPLE_PARTS, this.$route, {}, {}, result.data); + // } + // else if (hasChildPartQuestions) { + // this.$router.navigate(this.navigationScenarios.SELECTED_VIN_WITH_MOLDING_QUESTIONS, this.$route, {}, {}, result.data); + // } + // else if (hasCapabilityQuestions) { + // this.$router.navigate(this.navigationScenarios.SELECTED_VIN_WITH_CAPABILITY_QUESTIONS, this.$route, {}, {}, { + // carId: this.$store.getters.vehicle.carId, + // partNumber: result.data.partsOrQuestions.filter(x => x.glassLocation === damageLocationsSelected.WINDSHIELD)[0].parts[0].partNumber + // }); + // } + // else { + // // if single parts only + // const collectedGlassParts = this.reducedGlassPartsArray(result.data.partsOrQuestions); + // // save to store lineItems.glassParts + // this.$store.commit(storeMutations.UPDATE_GLASS_PARTS, collectedGlassParts); - // go to heritage quote page - this.$refs.loadingModal.showModal(); - navigateToHeritageFunnel(); - } + // // go to heritage quote page + // this.$refs.loadingModal.showModal(); + // navigateToHeritageFunnel(); + // } }, } } \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index ea4c5cbcc..ea985c390 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -192,7 +192,9 @@ async function navigate(scenario, currentRoute, optionalQuery = {}, optionalPara // Get navigation map depending on the scenario and the current 'page' you're on. function getNavigationMap(scenario, currentRoute) { + console.log("scenario: ", scenario) const fmgPageValue = currentRoute.query.fmgPage; + console.log(routingTable(store)) const matchedQueryValue = routingTable(store) .filter( (item) => diff --git a/src/router/router-constants/navigation-scenarios.js b/src/router/router-constants/navigation-scenarios.js index 2bd259909..8000f45d7 100644 --- a/src/router/router-constants/navigation-scenarios.js +++ b/src/router/router-constants/navigation-scenarios.js @@ -8,10 +8,10 @@ const navigationScenarios = { CLICKED_FORWARD: "CLICKED_FORWARD", CLICKED_FORWARD_WITH_VIN: "CLICKED_FORWARD_WITH_VIN", SELECTED_PARTS: "SELECTED_PARTS", - SELECTED_VIN_WITH_PART_QUESTIONS: "SELECTED_VIN_WITH_PART_QUESTIONS", - SELECTED_VIN_WITH_MULTIPLE_PARTS: "SELECTED_VIN_WITH_MULTIPLE_PARTS", - SELECTED_VIN_WITH_MOLDING_QUESTIONS: "SELECTED_VIN_WITH_MOLDING_QUESTIONS", - SELECTED_VIN_WITH_CAPABILITY_QUESTIONS: "SELECTED_VIN_WITH_CAPABILITY_QUESTIONS", + SELECTED_VIN_WITH_PART_QUESTIONS: "HAS_PART_QUESTIONS", + SELECTED_VIN_WITH_MULTIPLE_PARTS: "HAS_MULTIPLE_PARTS_TO_CHOOSE", + SELECTED_VIN_WITH_MOLDING_QUESTIONS: "HAS_MOLDING_QUESTIONS", + SELECTED_VIN_WITH_CAPABILITY_QUESTIONS: "HAS_CAPABILITY_QUESTIONS", CONTINUING_WITH_SINGLE_PART: "CONTINUING_WITH_SINGLE_PART", CONTINUING_WITH_MULTIPLE_VEHICLES: "CONTINUING_WITH_MULTIPLE_VEHICLES", SELECTED_VIN_HAS_MISMATCHED_GLASS: "SELECTED_VIN_HAS_MISMATCHED_GLASS", @@ -24,8 +24,14 @@ const navigationScenarios = { SELECTED_PROVIDE_VIN_DIFFERENT_WAY: "SELECTED_PROVIDE_VIN_DIFFERENT_WAY", CLICKED_BACK_WITH_PART_QUESTION_ANSWERS: "CLICKED_BACK_WITH_PART_QUESTION_ANSWERS", CLICKED_BACK_WITHOUT_PART_QUESTION_ANSWERS: "CLICKED_BACK_WITHOUT_PART_QUESTION_ANSWERS", + HAS_PART_QUESTIONS: "HAS_PART_QUESTIONS", + HAS_MULTIPLE_PARTS_TO_CHOOSE: "HAS_MULTIPLE_PARTS_TO_CHOOSE", HAS_MOLDING_QUESTIONS: "HAS_MOLDING_QUESTIONS", HAS_CAPABILITY_QUESTIONS: "HAS_CAPABILITY_QUESTIONS", + CLICKED_BACK_TO_GO_TO_VIN_LOOKUP: "CLICKED_BACK_TO_GO_TO_VIN_LOOKUP", + CLICKED_BACK_TO_GO_TO_PART_QUESTIONS: "CLICKED_BACK_TO_GO_TO_PART_QUESTIONS", + CLICKED_BACK_TO_GO_TO_VEHICLE_PARTS: "CLICKED_BACK_TO_GO_TO_VEHICLE_PARTS", + CLICKED_BACK_TO_GO_TO_MOLDING_QUESTIONS: "CLICKED_BACK_TO_GO_TO_MOLDING_QUESTIONS" }; export { navigationScenarios }; diff --git a/src/router/router-constants/routing-table.js b/src/router/router-constants/routing-table.js index 99b7c0bb1..3e1246250 100644 --- a/src/router/router-constants/routing-table.js +++ b/src/router/router-constants/routing-table.js @@ -69,27 +69,6 @@ const routingTable = function(store) { }, ], }, - { - fmgPageValue: fmgPageValues.VEHICLE_PARTS, - maps: [ - { - scenario: navigationScenarios.SELECTED_PARTS, - destinationFmgPageValue: fmgPageValues.QUOTE, - }, - { - scenario: navigationScenarios.CLICKED_FORWARD, - destinationFmgPageValue: fmgPageValues.REVEAL, - }, - { - scenario: navigationScenarios.CLICKED_BACK_WITH_PART_QUESTION_ANSWERS, - destinationFmgPageValue: fmgPageValues.PART_QUESTIONS, - }, - { - scenario: navigationScenarios.CLICKED_BACK_WITHOUT_PART_QUESTION_ANSWERS, - destinationFmgPageValue: fmgPageValues.VIN_LOOKUP, - }, - ], - }, { fmgPageValue: fmgPageValues.REVEAL, maps: [ @@ -256,11 +235,11 @@ const routingTable = function(store) { fmgPageValue: fmgPageValues.PART_QUESTIONS, maps: [ { - scenario: navigationScenarios.CLICKED_BACK, + scenario: navigationScenarios.CLICKED_BACK_TO_GO_TO_VIN_LOOKUP, destinationFmgPageValue: fmgPageValues.VIN_LOOKUP }, { - scenario: navigationScenarios.ANSWERED_QUESTIONS_WITH_MULTIPLE_PARTS, + scenario: navigationScenarios.HAS_MULTIPLE_PARTS_TO_CHOOSE, destinationFmgPageValue: fmgPageValues.VEHICLE_PARTS }, { @@ -277,26 +256,83 @@ const routingTable = function(store) { }, ] }, + { + fmgPageValue: fmgPageValues.VEHICLE_PARTS, + maps: [ + { + scenario: navigationScenarios.SELECTED_PARTS, + destinationFmgPageValue: fmgPageValues.QUOTE, + }, + { + scenario: navigationScenarios.CLICKED_FORWARD, + destinationFmgPageValue: fmgPageValues.REVEAL, + }, + { + scenario: navigationScenarios.CLICKED_BACK_TO_GO_TO_PART_QUESTIONS, + destinationFmgPageValue: fmgPageValues.PART_QUESTIONS, + }, + { + scenario: navigationScenarios.CLICKED_BACK_TO_GO_TO_VIN_LOOKUP, + destinationFmgPageValue: fmgPageValues.VIN_LOOKUP, + }, + { + scenario: navigationScenarios.HAS_MOLDING_QUESTIONS, + destinationFmgPageValue: fmgPageValues.MOLDING_QUESTIONS, + }, + { + scenario: navigationScenarios.HAS_CAPABILITY_QUESTIONS, + destinationFmgPageValue: fmgPageValues.CAPABILITY_QUESTIONS, + }, + { + scenario: navigationScenarios.ANSWERED_QUESTIONS_WITH_SINGLE_PART, + destinationFmgPageValue: fmgPageValues.QUOTE, + }, + ], + }, { fmgPageValue: fmgPageValues.MOLDING_QUESTIONS, maps: [ { - scenario: navigationScenarios.CLICKED_BACK, + scenario: navigationScenarios.CLICKED_BACK_TO_GO_TO_VIN_LOOKUP, + destinationFmgPageValue: fmgPageValues.VIN_LOOKUP + }, + { + scenario: navigationScenarios.CLICKED_BACK_TO_GO_TO_PART_QUESTIONS, + destinationFmgPageValue: fmgPageValues.PART_QUESTIONS + }, + { + scenario: navigationScenarios.CLICKED_BACK_TO_GO_TO_VEHICLE_PARTS, destinationFmgPageValue: fmgPageValues.VEHICLE_PARTS }, { scenario: navigationScenarios.HAS_CAPABILITY_QUESTIONS, destinationFmgPageValue: fmgPageValues.CAPABILITY_QUESTIONS, }, + { + scenario: navigationScenarios.ANSWERED_QUESTIONS_WITH_SINGLE_PART, + destinationFmgPageValue: fmgPageValues.QUOTE, + } ] }, { fmgPageValue: fmgPageValues.CAPABILITY_QUESTIONS, maps: [ { - scenario: navigationScenarios.CLICKED_BACK, + scenario: navigationScenarios.CLICKED_BACK_TO_GO_TO_VIN_LOOKUP, + destinationFmgPageValue: fmgPageValues.VIN_LOOKUP + }, + { + scenario: navigationScenarios.CLICKED_BACK_TO_GO_TO_PART_QUESTIONS, + destinationFmgPageValue: fmgPageValues.PART_QUESTIONS + }, + { + scenario: navigationScenarios.CLICKED_BACK_TO_GO_TO_VEHICLE_PARTS, destinationFmgPageValue: fmgPageValues.VEHICLE_PARTS }, + { + scenario: navigationScenarios.CLICKED_BACK_TO_GO_TO_MOLDING_QUESTIONS, + destinationFmgPageValue: fmgPageValues.MOLDING_QUESTIONS + }, { scenario: navigationScenarios.CLICKED_FORWARD, destinationFmgPageValue: fmgPageValues.QUOTE