Merge pull request #534 from Safelite/feature/digital/SSR-792.2
Prepopulating vehicle selection page with content from store
This commit is contained in:
commit
82de91ab35
2 changed files with 19 additions and 8 deletions
|
|
@ -32,9 +32,9 @@ export default {
|
||||||
get() {
|
get() {
|
||||||
return this.selectedIndex?.toString();
|
return this.selectedIndex?.toString();
|
||||||
},
|
},
|
||||||
set(newValue) {
|
set(newIndex) {
|
||||||
this.selectedIndex = newValue;
|
this.selectedIndex = newIndex;
|
||||||
newValue = newValue != null && newValue > -1 ? this.values[newValue] : null;
|
const newValue = newIndex != null && newIndex > -1 ? this.values[newIndex] : null;
|
||||||
this.$emit('update:modelValue', newValue);
|
this.$emit('update:modelValue', newValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -46,7 +46,8 @@ export default {
|
||||||
if (this.values.length === 1) {
|
if (this.values.length === 1) {
|
||||||
this.selectedValue = 0;
|
this.selectedValue = 0;
|
||||||
} else {
|
} else {
|
||||||
this.selectedValue = null;
|
const valueIndex = this.values.indexOf(this.modelValue);
|
||||||
|
this.selectedValue = valueIndex === -1 ? null : valueIndex;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
clearValues() {
|
clearValues() {
|
||||||
|
|
|
||||||
|
|
@ -134,11 +134,12 @@ export default {
|
||||||
validationRules: String
|
validationRules: String
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
const { year, make, model, style } = useMainStore().order.vehicle;
|
||||||
return {
|
return {
|
||||||
selectedYear: null,
|
selectedYear: year,
|
||||||
selectedMake: null,
|
selectedMake: make,
|
||||||
selectedModel: null,
|
selectedModel: model,
|
||||||
selectedStyle: null
|
selectedStyle: style
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -176,6 +177,15 @@ export default {
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.$refs.vehicleYearQuestion.getNewValues();
|
this.$refs.vehicleYearQuestion.getNewValues();
|
||||||
|
if (this.selectedYear) {
|
||||||
|
this.$refs.vehicleMakeQuestion.getNewValues();
|
||||||
|
}
|
||||||
|
if (this.selectedMake) {
|
||||||
|
this.$refs.vehicleModelQuestion.getNewValues();
|
||||||
|
}
|
||||||
|
if (this.selectedModel) {
|
||||||
|
this.$refs.vehicleStyleQuestion.getNewValues();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
arePagePrerequisitesValid() {
|
arePagePrerequisitesValid() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue