From e2bfed2b364309bd49fad845cb8903b8db04d946 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Tue, 15 Feb 2022 16:16:06 -0500 Subject: [PATCH] csr-269 wip --- .../replace-options-question.vue | 8 +- src/layouts/vehicle-damage/vehicle-damage.vue | 40 +++---- .../windshield-options/windshield-options.vue | 106 ++++++++++++------ 3 files changed, 94 insertions(+), 60 deletions(-) diff --git a/src/layouts/vehicle-damage/replace-options-question/replace-options-question.vue b/src/layouts/vehicle-damage/replace-options-question/replace-options-question.vue index 31c739b49..1a21573d1 100644 --- a/src/layouts/vehicle-damage/replace-options-question/replace-options-question.vue +++ b/src/layouts/vehicle-damage/replace-options-question/replace-options-question.vue @@ -30,6 +30,9 @@ defineRule("replace-options-required", (value) => { export default ({ name: "replaceOptionsQuestion", + updated() { + console.log("ro:modelValue=>" + this.modelValue); + }, data(){ return { questionText: String, @@ -48,6 +51,7 @@ export default ({ this.questionText = cmsContent.QuestionText; this.answersFromCms = cmsContent.Answers; this.replaceOptions = replaceOptions; + console.log("ro:" + this.questionText); }, }, computed: { @@ -56,6 +60,7 @@ export default ({ return this.modelValue; }, set: function(newValue) { + console.log("ro:newVal=>" + newValue); this.$emit("update:modelValue", newValue); } }, @@ -64,7 +69,8 @@ export default ({ ? this.answersFromCms.filter(ans => { const name = ans.Name.split('-'); - return this.filterByVehicleCategory ? name[0].toUpperCase() === store.getters.vehicle.category : name[0].toUpperCase() === store.getters.vehicle.category && this.replaceOptions.includes(name[1]) + return this.filterByVehicleCategory ? name[0].toUpperCase() === store.getters.vehicle.category && this.replaceOptions.includes(name[1]) : + this.replaceOptions.includes(ans.Name) }) : []; }, diff --git a/src/layouts/vehicle-damage/vehicle-damage.vue b/src/layouts/vehicle-damage/vehicle-damage.vue index 3bc47570c..1b2ce8ce2 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.vue +++ b/src/layouts/vehicle-damage/vehicle-damage.vue @@ -4,9 +4,12 @@ - + + - @@ -18,7 +21,7 @@ import vehicleBanner from "@/common-components/vehicle-banner/vehicle-banner"; import funnelSubHeader from "@/common-components/funnel-sub-header/funnel-sub-header"; import replaceOptionsQuestion from"@/layouts/vehicle-damage/replace-options-question/replace-options-question"; import damageLocationQuestion from"@/layouts/vehicle-damage/damage-location-question/damage-location-question"; -import windshieldOptions from"@/layouts/vehicle-damage/windshield-options/windshield-options"; +import windshieldOptions from "@/layouts/vehicle-damage/windshield-options/windshield-options"; // Supporting files import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; @@ -30,8 +33,12 @@ import baseMixin from "@/mixins/base-mixin"; export default { name: "vehicle-damage", + updated() { + console.log("vd:selectedWindshieldChipCount=>" + this.selectedWindshieldOptions.selectedWindshieldChipCount); + console.log("vd:selectedWindshieldDamageType=>" + this.selectedWindshieldOptions.selectedWindshieldDamageType); + console.log("vd:selectedWindshieldReplaceOptions=>" + this.selectedWindshieldOptions.selectedWindshieldReplaceOptions); + }, async beforeRouteEnter(to, from, next) { - console.log("vd: beforeRoute"); // Call APIs const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage); const damageOptionsPromise = @@ -52,12 +59,10 @@ export default { }, ]; - console.log("vd: before settle"); const resultMap = await settleAllPromises(promiseResultMap); - console.log("vd: after settle"); + // Call the "next" function to complete the transition to this page. next((vm) => { - console.log("vd: next"); vm.$refs.funnelHeader.initializeComponent( resultMap.cmsContent.FunnelHeaderWidget ); @@ -73,13 +78,12 @@ export default { vm.$refs.damageLocation.initializeComponent( resultMap.cmsContent.DamageLocationQuestion, resultMap.damageOptions ); - vm.$refs.funnelFooter.initializeComponent( - resultMap.cmsContent.FunnelFooterWidget - ); - console.log("vd: initialize wo"); vm.$refs.windshieldOptions.initializeComponent( resultMap.cmsContent.WindshieldDamageTypeQuestion, resultMap.cmsContent.WindshieldChipCountQuestion, - resultMap.cmsContent.WindshieldReplaceOptionsQuestion + resultMap.cmsContent.WindshieldReplaceOptionsQuestion, resultMap.damageOptions.windshieldOptions.availableReplacementOptions + ); + vm.$refs.funnelFooter.initializeComponent( + resultMap.cmsContent.FunnelFooterWidget ); }); }, @@ -87,8 +91,7 @@ export default { return { selectedDamageLocations: [], driverSideOptionsData: [], - selectedWindshieldOptions: [], - selectedChipCount: [] + selectedWindshieldOptions: [] } }, methods: { @@ -107,15 +110,6 @@ export default { ); }, }, - //computed: { - // selectedWindshieldDamageType(){ - // return this.modelValue.some(selectedDamages => - // { - // const categoryAndGlass = selectedDamages.split('-'); //ie: model looks like "Suv-Windshield" so this Splits the answers into [0]"Suv" [1]"Windshield" - // return Boolean(categoryAndGlass[1].toUpperCase() === "WINDSHIELD"); - // }); - // }, - //}, components: { funnelHeader, funnelFooter, diff --git a/src/layouts/vehicle-damage/windshield-options/windshield-options.vue b/src/layouts/vehicle-damage/windshield-options/windshield-options.vue index f5356b4d5..2f480f7bc 100644 --- a/src/layouts/vehicle-damage/windshield-options/windshield-options.vue +++ b/src/layouts/vehicle-damage/windshield-options/windshield-options.vue @@ -1,38 +1,42 @@ - - suppressError: Boolean, \ No newline at end of file + \ No newline at end of file