CSR-108: few more refactors

This commit is contained in:
Adam Caouette 2022-07-12 16:03:48 -04:00
parent 43c95a81a3
commit 933eb88ecc

View file

@ -82,7 +82,6 @@ export default {
// Call the "next" function to complete the transition to this page. // Call the "next" function to complete the transition to this page.
next((vm) => { next((vm) => {
vm.setCmsContent(resultMap.cmsContent); vm.setCmsContent(resultMap.cmsContent);
// this.partsQuestionsData = resultMap.partsOrQuestionsInitialData;
}); });
}, },
data() { data() {
@ -121,7 +120,7 @@ export default {
}, },
methods: { methods: {
showThisPartQuestionChain(part, i) { showThisPartQuestionChain(part, i) {
if (part.partQuestions?.length < 1) { return false; } if (part.partQuestions?.length < 1) { return false; } // return false if only one partQuestion
if (this.currentPartNum === i || part.answerData?.answerResult.length > 0) { return true; } if (this.currentPartNum === i || part.answerData?.answerResult.length > 0) { return true; }
return false; return false;
}, },
@ -151,9 +150,7 @@ export default {
this.$refs.funnelFooter.removeLoader(); this.$refs.funnelFooter.removeLoader();
}); });
if (!partsLookup) { if (!partsLookup) { return }
return;
}
this.glassNameAndParts = partsLookup.data.glassNameAndParts; this.glassNameAndParts = partsLookup.data.glassNameAndParts;
@ -164,13 +161,14 @@ export default {
const collectedGlassParts = []; const collectedGlassParts = [];
this.glassNameAndParts.forEach((glass) => { this.glassNameAndParts.forEach((glass) => {
if (Array.isArray(glass.parts) && glass.parts.length === 1) { if (Array.isArray(glass.parts) && glass.parts.length === 1) {
const singlePart = glass.parts[0];
collectedGlassParts.push({ collectedGlassParts.push({
"partNumber": glass.parts[0].partNumber, "partNumber": singlePart.partNumber,
"description": glass.parts[0].description, "description": singlePart.description,
"color": glass.parts[0].color, "color": singlePart.color,
"requiresRecalibration": glass.parts[0].requiresRecalibration, "requiresRecalibration": singlePart.requiresRecalibration,
"childParts": glass.parts[0].childParts, "childParts": singlePart.childParts,
"price": glass.parts[0].price, "price": singlePart.price,
}) })
} }
}); });