diff --git a/src/iss-components/vehicle-question/vehicle-question.vue b/src/iss-components/vehicle-question/vehicle-question.vue new file mode 100644 index 00000000..b599d138 --- /dev/null +++ b/src/iss-components/vehicle-question/vehicle-question.vue @@ -0,0 +1,48 @@ + + + diff --git a/src/layouts/vehicle-selection/make-question/make-question.vue b/src/layouts/vehicle-selection/make-question/make-question.vue deleted file mode 100644 index 1ab0e45d..00000000 --- a/src/layouts/vehicle-selection/make-question/make-question.vue +++ /dev/null @@ -1,76 +0,0 @@ - - - diff --git a/src/layouts/vehicle-selection/model-question/model-question.vue b/src/layouts/vehicle-selection/model-question/model-question.vue deleted file mode 100644 index e1cb2a75..00000000 --- a/src/layouts/vehicle-selection/model-question/model-question.vue +++ /dev/null @@ -1,77 +0,0 @@ - - - diff --git a/src/layouts/vehicle-selection/style-question/style-question.vue b/src/layouts/vehicle-selection/style-question/style-question.vue deleted file mode 100644 index b957d923..00000000 --- a/src/layouts/vehicle-selection/style-question/style-question.vue +++ /dev/null @@ -1,76 +0,0 @@ - - - diff --git a/src/layouts/vehicle-selection/vehicle-selection.vue b/src/layouts/vehicle-selection/vehicle-selection.vue index cb53c2ea..736d4520 100644 --- a/src/layouts/vehicle-selection/vehicle-selection.vue +++ b/src/layouts/vehicle-selection/vehicle-selection.vue @@ -8,12 +8,12 @@
- - - - - - + + + + + + { - vm.years = resultMap.yearQuestionInitialData; + next((vm) => { vm.setCmsContent(resultMap.cmsContent); - vm.$refs.yearQuestion.initializeComponent( - resultMap.yearQuestionInitialData - ); - vm.$refs.makeQuestion.initializeComponent( - resultMap.makeQuestionInitialData - ); - - vm.$refs.modelQuestion.initializeComponent( - resultMap.modelQuestionInitialData - ); - vm.$refs.styleQuestion.initializeComponent( - resultMap.styleQuestionInitialData - ); }); }, watch: { selectedYear(yearIndex) { - const parsedYearIndex = parseInt(yearIndex); - this.mainStore.updateVehicleYear( this.years[parsedYearIndex] ); - - this.$refs["makeQuestion"].getNewValues(); - + const parsedYearIndex = parseInt(yearIndex); + this.mainStore.updateVehicleYear(this.Years.values[parsedYearIndex]); + this.Makes.getNewValues(); }, - selectedMake(make) { - this.mainStore.updateVehicleMake( make ); - this.$refs["modelQuestion"].getNewValues(); + selectedMake(makeIndex) { + const parsedMakeIndex = parseInt(makeIndex); + this.mainStore.updateVehicleMake(this.Makes.values[parsedMakeIndex]); + this.Models.getNewValues(); }, - selectedModel(model) { - this.mainStore.updateVehicleModel( model ); - this.$refs["styleQuestion"].getNewValues(); + selectedModel(modelIndex) { + const parsedModelIndex = parseInt(modelIndex); + this.mainStore.updateVehicleModel(this.Models.values[parsedModelIndex]); + this.Styles.getNewValues(); }, - selectedStyle(style) { - this.mainStore.updateVehicleStyle( style ); + selectedStyle(styleIndex) { + const parsedStyleIndex = parseInt(styleIndex); + this.mainStore.updateVehicleStyle(this.Styles.values[parsedStyleIndex]); }, }, +computed:{ + Years(){ + return this.$refs["vehicleYearQuestion"]; + }, + Makes(){ + return this.$refs["vehicleMakeQuestion"]; + }, + Models(){ + return this.$refs["vehicleModelQuestion"]; + }, + Styles(){ + return this.$refs["vehicleStyleQuestion"]; + } +}, methods: { arePagePrerequisitesValid() { - return true; }, backButtonAction() { @@ -156,6 +148,9 @@ export default { this.$route ); }); + }, + async updateYearValues() { + return await useMainStore().getVehicleYears(); }, async updateMakeValues() { return await this.mainStore.getVehicleMakes(); @@ -165,19 +160,15 @@ export default { }, async updateStyleValues() { return await this.mainStore.getVehicleStyles(); - } - }, - + }, + }, components: { - yearQuestion, - makeQuestion, - modelQuestion, siteHeader, siteSubHeader, vehicleBanner, siteFooter, Form, - styleQuestion, + vehicleQuestion }, }; diff --git a/src/layouts/vehicle-selection/year-question/year-question.vue b/src/layouts/vehicle-selection/year-question/year-question.vue deleted file mode 100644 index 97ba0090..00000000 --- a/src/layouts/vehicle-selection/year-question/year-question.vue +++ /dev/null @@ -1,63 +0,0 @@ - - - \ No newline at end of file