CSR-111 Cleanup
This commit is contained in:
parent
d3f7ad68f2
commit
4fa36a1100
6 changed files with 2 additions and 115 deletions
|
|
@ -117,8 +117,6 @@ export default {
|
|||
return capabilityQuestionsPageData && Object.keys(capabilityQuestionsPageData).length > 0;
|
||||
},
|
||||
async forwardButtonAction() {
|
||||
console.log(this.windshieldPartInfo);
|
||||
console.log(this.selectedAnswer)
|
||||
const selectedAnswerResult1 = this.selectedAnswer.answerResult;
|
||||
const selectedAnswerResult2 = this.pageData.capabilityQuestions[0].answers.find(x => x.answerResult1 === selectedAnswerResult1).answerResult2;
|
||||
|
||||
|
|
|
|||
|
|
@ -123,13 +123,6 @@ 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
|
||||
// );
|
||||
// },
|
||||
async forwardButtonAction() {
|
||||
const partQuestionAnswersArray = this.partsQuestionsData.map((item) => {
|
||||
return {
|
||||
|
|
@ -156,32 +149,6 @@ export default {
|
|||
|
||||
const glassNameAndPartsForStore = partsLookup.data.glassNameAndParts;
|
||||
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();
|
||||
// }
|
||||
},
|
||||
arePagePrerequisitesValid() {
|
||||
const partQuestionsFromPageData = store.getters.pageData(fmgPageValues.PART_QUESTIONS);
|
||||
|
|
|
|||
|
|
@ -159,15 +159,6 @@ 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;
|
||||
|
||||
// this.$router.navigate(
|
||||
// backNavigationScenario,
|
||||
// this.$route
|
||||
// );
|
||||
// },
|
||||
async forwardButtonAction() {
|
||||
const matchedParts = [];
|
||||
|
||||
|
|
@ -191,10 +182,6 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 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) {
|
||||
this.$refs.funnelFooter.removeLoader();
|
||||
|
|
@ -203,33 +190,6 @@ export default {
|
|||
|
||||
// Navigate to the next page
|
||||
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);
|
||||
|
||||
// // go to heritage quote page
|
||||
// this.$refs.loadingModal.showModal();
|
||||
// navigateToHeritageFunnel();
|
||||
// }
|
||||
},
|
||||
|
||||
LoadInitialPartsData() {
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ export default {
|
|||
return pq.parts?.some(part => part.requiresCapabilityQuestions === true);
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
// method to only include keys listed for lineItems.glassParts in
|
||||
// https://safelite.atlassian.net/wiki/spaces/DC/pages/17137665/Catalog+Front-End+State#glassParts
|
||||
reducedGlassPartsArray(glassParts) {
|
||||
|
|
@ -61,8 +61,6 @@ export default {
|
|||
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
|
||||
|
|
|
|||
|
|
@ -1,47 +1,13 @@
|
|||
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";
|
||||
|
||||
export default {
|
||||
methods: {
|
||||
async navigateForwardWithSingleCarMatch() {
|
||||
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);
|
||||
|
||||
// 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();
|
||||
// }
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
@ -192,9 +192,7 @@ 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) =>
|
||||
|
|
|
|||
Loading…
Reference in a new issue