diff --git a/src/layouts/molding-questions/molding-questions.vue b/src/layouts/molding-questions/molding-questions.vue index 0cbe8ed2b..d2b469a36 100644 --- a/src/layouts/molding-questions/molding-questions.vue +++ b/src/layouts/molding-questions/molding-questions.vue @@ -159,7 +159,7 @@ export default { this.$router.navigate(this.navigationScenarios.HAS_CAPABILITY_QUESTIONS,this.$route,{},{},{partsOrQuestions: glassNameAndPartsForStore}); } else { // if single parts only - const collectedGlassParts = this.reduceGlassPartsArray(glassNameAndPartsForStore); + const collectedGlassParts = this.reducedGlassPartsArray(glassNameAndPartsForStore); // save to store lineItems.glassParts this.$store.commit(storeMutations.UPDATE_GLASS_PARTS, collectedGlassParts); // go to heritage quote page diff --git a/src/layouts/part-questions/part-questions.vue b/src/layouts/part-questions/part-questions.vue index 4fc2c58c2..db237ce2b 100644 --- a/src/layouts/part-questions/part-questions.vue +++ b/src/layouts/part-questions/part-questions.vue @@ -166,7 +166,7 @@ export default { this.$router.navigate(this.navigationScenarios.HAS_CAPABILITY_QUESTIONS,this.$route,{},{},{partsOrQuestions: glassNameAndPartsForStore}); } else { // if single parts only - const collectedGlassParts = this.reduceGlassPartsArray(glassNameAndPartsForStore); + const collectedGlassParts = this.reducedGlassPartsArray(glassNameAndPartsForStore); // save to store lineItems.glassParts this.$store.commit(storeMutations.UPDATE_GLASS_PARTS, collectedGlassParts); // go to heritage quote page diff --git a/src/layouts/vehicle-parts/vehicle-parts.vue b/src/layouts/vehicle-parts/vehicle-parts.vue index c81364341..290910217 100644 --- a/src/layouts/vehicle-parts/vehicle-parts.vue +++ b/src/layouts/vehicle-parts/vehicle-parts.vue @@ -221,7 +221,7 @@ export default { } else { // if single parts only - const collectedGlassParts = this.reduceGlassPartsArray(matchedParts); + const collectedGlassParts = this.reducedGlassPartsArray(matchedParts); // save to store lineItems.glassParts this.$store.commit(storeMutations.UPDATE_GLASS_PARTS, collectedGlassParts); diff --git a/src/mixins/vehicle-questions-mixin.js b/src/mixins/vehicle-questions-mixin.js index 5490ea7bf..7a86066a8 100644 --- a/src/mixins/vehicle-questions-mixin.js +++ b/src/mixins/vehicle-questions-mixin.js @@ -19,20 +19,20 @@ export default { }, // method to only include keys listed for lineItems.glassParts in // https://safelite.atlassian.net/wiki/spaces/DC/pages/17137665/Catalog+Front-End+State#glassParts - reduceGlassPartsArray(glassParts) { + reducedGlassPartsArray(glassParts) { const reducedGlassParts = []; glassParts.forEach((glass) => { if (Array.isArray(glass.parts) && glass.parts.length === 1) { const singlePart = glass.parts[0]; reducedGlassParts.push({ - "partNumber": singlePart.partNumber, - "description": singlePart.description, - "color": singlePart.color, - "requiresRecalibration": singlePart.requiresRecalibration, - "requiresCapabilityQuestions": singlePart.requiresCapabilityQuestions, - "recalibrationType": singlePart.recalibrationType, - "childParts": singlePart.childParts, - "price": singlePart.price, + partNumber: singlePart.partNumber, + description: singlePart.description, + color: singlePart.color, + requiresRecalibration: singlePart.requiresRecalibration, + requiresCapabilityQuestions: singlePart.requiresCapabilityQuestions, + recalibrationType: singlePart.recalibrationType, + childParts: singlePart.childParts, + price: singlePart.price, }); } }); diff --git a/src/mixins/vin-pages-mixin.js b/src/mixins/vin-pages-mixin.js index b021e0297..a7ba799a2 100644 --- a/src/mixins/vin-pages-mixin.js +++ b/src/mixins/vin-pages-mixin.js @@ -16,8 +16,6 @@ export default { const hasChildPartQuestions = this.hasChildPartQuestions(partsOrQuestions); const hasCapabilityQuestions = this.hasCapabilityQuestions(partsOrQuestions); - // TODO - ADD CHECK FOR CAPABILITY QUESTIONS TO SEE IF NAVIGATE TO CAPABILITY-QUESTIONS - if (hasPartsQuestions) { this.$router.navigate(this.navigationScenarios.SELECTED_VIN_WITH_PART_QUESTIONS, this.$route, {}, {}, result.data); } @@ -32,7 +30,7 @@ export default { } else { // if single parts only - const collectedGlassParts = this.reduceGlassPartsArray(result.data.partsOrQuestions); + const collectedGlassParts = this.reducedGlassPartsArray(result.data.partsOrQuestions); // save to store lineItems.glassParts this.$store.commit(storeMutations.UPDATE_GLASS_PARTS, collectedGlassParts); diff --git a/src/mixins/vin-pages-mixin.spec.js b/src/mixins/vin-pages-mixin.spec.js index 49503d9dc..c7a6b3ea2 100644 --- a/src/mixins/vin-pages-mixin.spec.js +++ b/src/mixins/vin-pages-mixin.spec.js @@ -866,7 +866,7 @@ describe("vin-pages-mixin", () => { wrapper.vm.$store.commit = jest.fn(); - const collectedGlassParts = wrapper.vm.reduceGlassPartsArray(partsOrQuestions); + const collectedGlassParts = wrapper.vm.reducedGlassPartsArray(partsOrQuestions); // Act await wrapper.vm.navigateForwardWithSingleCarMatch();