CSR-111 Cleanup

This commit is contained in:
Katie 2022-08-24 15:39:47 -04:00
parent 6626122b1e
commit 76077d7793
3 changed files with 3 additions and 117 deletions

View file

@ -147,29 +147,6 @@ export default {
partsOrQuestions.find(partOrQuestion => partOrQuestion.glassLocation === answer.glassLocation).parts = partFromCapabilityQuestionAnswer;
}
console.log(partsOrQuestions)
// const glassNameAndPartsForStore = partsLookup.data.glassNameAndParts;
// this.navigateForward(glassNameAndPartsForStore);
// const selectedAnswerResult1 = this.selectedAnswer.answerResult;
// const selectedAnswerResult2 = this.pageData.capabilityQuestions[0].answers.find(x => x.answerResult1 === selectedAnswerResult1).answerResult2;
// this.dispatchStoreAction(storeActions.SAVE_CAPABILITY_QUESTION_ANSWERS, {
// glassName: this.windshieldPart.glassName,
// glassLocation: this.windshieldPart.glassLocation,
// result1: selectedAnswerResult1,
// result2: selectedAnswerResult2
// });
// const partFromCapabilityQuestionAnswer = (await this.dispatchStoreAction(storeActions.GET_PART_FROM_CAPABILITY_QUESTION_ANSWER)).data;
// let partsOrQuestions = this.pageData.partsOrQuestions;
// partsOrQuestions.find(partOrQuestion => partOrQuestion.glassLocation === damageLocationsSelected.WINDSHIELD).parts = partFromCapabilityQuestionAnswer;
this.navigateForward(partsOrQuestions);
},
handleAnswerUpdates(answer) {
@ -356,22 +333,11 @@ export default {
// Update the key to re-render this part's question-chain component
this.capabilityQuestionsData[gpIndex].key = this.capabilityQuestionsData[gpIndex].glassLocation + this.capabilityQuestionsData[gpIndex].glassName + Date.now().toString();
console.log("rerendering")
console.log(this.capabilityQuestionsData[gpIndex])
}
});
});
// Need to clear questions for subsequent glassParts as well
console.log(this.capabilityQuestionsData)
// for (let i = currentQuestionChainIndex; i < this.capabilityQuestionsData.length; i++) {
// this.capabilityQuestionsData.map(data => ({
// ...data,
// }))
// }
// DETERMINE ANSWERED QUESTIONS LIST FOR THIS GLASS PART
// look through all (this part's) part questions for any duplicates that were suppressed;
@ -421,7 +387,6 @@ export default {
});
});
console.log(this.capabilityQuestionsData[1].capabilityQuestions[0].answerSelected)
// make sure there are no duplicated dupes in the list...
const foundInCompleteAnsweredQuestions = new Set();
let filteredCompleteAnsweredQuestions = completeAnsweredQuestions.filter(el => {
@ -442,8 +407,6 @@ export default {
answeredQuestions: filteredCompleteAnsweredQuestions,
}
console.log(this.capabilityQuestionsData[1].capabilityQuestions[0].answerSelected)
// this part has been fully answered, so advance to next part's question chain
for (let i = answer.partIndex + 1; i < this.capabilityQuestionsData.length; i++) {
// if this part has not yet been fully answered, then make it the current part
@ -452,7 +415,6 @@ export default {
break;
}
}
console.log(this.capabilityQuestionsData[1].capabilityQuestions[0].answerSelected)
},
// TODO I'm sure there's a better/simplier way to do this that I'm missing but my brain's fried
// Find the part that has some answer that has an answerResult matching the selected answerResult, then get the corresponding answerResult2
@ -499,7 +461,6 @@ export default {
// mark this partQuestion as answered (question-chain will read this)
part.capabilityQuestions[aq.questionNum - 1].answerSelected = answerString;
console.log("answerSelected set")
// mark this partQuestion as duplicate if it is (question-chain will read this)
if (aq.suppressQuestion) {
part.capabilityQuestions[aq.questionNum - 1].suppressQuestion = true;
@ -520,8 +481,6 @@ export default {
});
console.log("AHHHHH", this.capabilityQuestionsData[1].capabilityQuestions[0].answerSelected)
// Set up watch for each set of part questions, which gets updated when all questions for a part have been answered
this.$watch("selectedAnswers." + part.key, (newValue) => {
if (newValue) {

View file

@ -90,62 +90,6 @@ export default {
} else if (hasCapabilityQuestions && this.currentPageComesBeforePage(currentPage, fmgPageValues.CAPABILITY_QUESTIONS)) {
// if has capability questions
// go to capability-questions page and pass the partsData
// partsOrQuestions = [
// {
// "glassName": "Single",
// "glassLocation": "Windshield",
// "parts": [
// {
// "partNumber": "A",
// "description": "rain sensor, solar, 3rd visor band, soundproofing, high beam sensor",
// "color": "Green Tint, Blue Shade",
// "requiresRecalibration": true,
// "requiresCapabilityQuestions": true,
// "recalibrationType": null,
// "childParts": null,
// "childPartQuestions": []
// },
// ],
// "partQuestions": null
// },
// {
// "glassName": "Front",
// "glassLocation": "Driver",
// "parts": [
// {
// "partNumber": "B",
// "description": "rain sensor, solar, 3rd visor band, soundproofing, high beam sensor",
// "color": "Green Tint, Blue Shade",
// "requiresRecalibration": true,
// "requiresCapabilityQuestions": true,
// "recalibrationType": null,
// "childParts": null,
// "childPartQuestions": []
// },
// ],
// "partQuestions": null
// },
// {
// "glassName": "Rear",
// "glassLocation": "Driver",
// "parts": [
// {
// "partNumber": "C",
// "description": "rain sensor, solar, 3rd visor band, soundproofing, high beam sensor",
// "color": "Green Tint, Blue Shade",
// "requiresRecalibration": true,
// "requiresCapabilityQuestions": false,
// "recalibrationType": null,
// "childParts": null,
// "childPartQuestions": []
// },
// ],
// "partQuestions": null
// }
// ]
partsOrQuestions = [
{
"glassName": "Single",
@ -243,7 +187,7 @@ export default {
"partQuestions": null
}
]
for (let partOrQuestion of partsOrQuestions) {
if (this.hasCapabilityQuestions([partOrQuestion])) {
let capabilityQuestionsForGlassLocation = (await baseMixin.methods.dispatchStoreAction(storeActions.GET_CAPABILITY_QUESTIONS, {
@ -264,8 +208,6 @@ export default {
}
}
partsOrQuestions = [
{
"glassName": "Single",
@ -371,11 +313,6 @@ export default {
}],
})
self.$router.navigateWithSaving(self.navigationScenarios.HAS_CAPABILITY_QUESTIONS, self.$route, {}, {}, { partsOrQuestions });
} else {
// if single parts only
@ -383,11 +320,8 @@ export default {
// save to store lineItems.glassParts
self.$store.commit(storeMutations.UPDATE_GLASS_PARTS, collectedGlassParts);
// self.$refs.loadingModal.showModal();
// navigateToHeritageFunnel();
// For quote pages MVP release
// self.$router.navigate(self.navigationScenarios.HAS_NO_MORE_QUESTIONS, self.$route);
self.$refs.loadingModal.showModal();
navigateToHeritageFunnel();
}
},
backButtonAction() {

View file

@ -91,7 +91,6 @@ export default {
},
mounted() {
if (Array.isArray(this.validateValue)) {
console.log("LB mounted array")
this.checkValue = this.isValueSelectedByArray(this.selectedValues);
const isSelectedByValidator = this.isValueSelectedByArray(this.validateValue);
@ -100,10 +99,7 @@ export default {
}
}
else {
console.log("LB mounted NOT ")
console.log("selectedValues: ", this.selectedValues)
this.checkValue = this.selectedValues == this.value;
console.log(this.checkValue)
}
},
methods: {
@ -139,9 +135,6 @@ export default {
buttonId: this.buttonID && this.buttonID.toString(),
};
console.log("handleCheckChange: ", emitEvent)
console.log("selectedValues: ", this.selectedValues)
this.handleChange(this.value);
this.$emit("isCheckedChanged", emitEvent);
this.$emit("update:modelValue", emitEvent);