Merge pull request #2497 from Safelite/feature/Digital/CASH-602
CASH-602
This commit is contained in:
commit
5dcd3e5847
3 changed files with 17 additions and 15 deletions
|
|
@ -34,6 +34,7 @@ export default {
|
||||||
isServiceableInshop: Boolean,
|
isServiceableInshop: Boolean,
|
||||||
isServiceableDropoff: Boolean,
|
isServiceableDropoff: Boolean,
|
||||||
mobileFeeApplies: Boolean,
|
mobileFeeApplies: Boolean,
|
||||||
|
zipCode: String,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
questionText() {
|
questionText() {
|
||||||
|
|
@ -47,6 +48,7 @@ export default {
|
||||||
const shouldShowInshop = this.isServiceableInshop;
|
const shouldShowInshop = this.isServiceableInshop;
|
||||||
const shouldShowDropoff =
|
const shouldShowDropoff =
|
||||||
this.isServiceableDropoff && !this.$store.getters.damage.isRepair;
|
this.isServiceableDropoff && !this.$store.getters.damage.isRepair;
|
||||||
|
const zipCode = this.zipCode;
|
||||||
|
|
||||||
var answers = this.answersFromCms
|
var answers = this.answersFromCms
|
||||||
? this.answersFromCms.filter((answer) => {
|
? this.answersFromCms.filter((answer) => {
|
||||||
|
|
@ -87,12 +89,15 @@ export default {
|
||||||
watch: {
|
watch: {
|
||||||
answersToDisplay: {
|
answersToDisplay: {
|
||||||
handler(newValue) {
|
handler(newValue) {
|
||||||
// If there is only one option to display and that option is 'Mobile' then select it
|
// If there is only one option to display and that option is 'Mobile' or 'Inshop' then select it
|
||||||
if (
|
if (newValue.length == 1) {
|
||||||
newValue.length == 1 &&
|
const name = newValue[0].Name;
|
||||||
newValue.findIndex((answer) => answer.Name == "Mobile") != -1
|
if (
|
||||||
) {
|
name === AppointmentTypeStrings.MOBILE ||
|
||||||
this.selectedValue = "Mobile";
|
name === AppointmentTypeStrings.IN_SHOP
|
||||||
|
) {
|
||||||
|
this.selectedValue = name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
immediate: true,
|
immediate: true,
|
||||||
|
|
@ -100,14 +105,14 @@ export default {
|
||||||
isMobileOnly: {
|
isMobileOnly: {
|
||||||
handler(newValue) {
|
handler(newValue) {
|
||||||
if (newValue) {
|
if (newValue) {
|
||||||
this.selectedValue = "Mobile";
|
this.selectedValue = AppointmentTypeStrings.MOBILE;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
isInshopOnly: {
|
isInshopOnly: {
|
||||||
handler(newValue) {
|
handler(newValue) {
|
||||||
if (newValue) {
|
if (newValue) {
|
||||||
this.selectedValue = "Inshop";
|
this.selectedValue = AppointmentTypeStrings.IN_SHOP;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,7 @@
|
||||||
:isServiceableDropoff="isServiceableDropoff"
|
:isServiceableDropoff="isServiceableDropoff"
|
||||||
:isDisplayed="isAppointmentTypeDisplayed"
|
:isDisplayed="isAppointmentTypeDisplayed"
|
||||||
:mobileFeeApplies="mobileFeeApplies"
|
:mobileFeeApplies="mobileFeeApplies"
|
||||||
|
:zipCode="zipCode"
|
||||||
ref="appointmentTypeQuestion"
|
ref="appointmentTypeQuestion"
|
||||||
groupName="appointmentTypeQuestion"
|
groupName="appointmentTypeQuestion"
|
||||||
cmsWidgetName="AppointmentTypeQuestionWidget"
|
cmsWidgetName="AppointmentTypeQuestionWidget"
|
||||||
|
|
|
||||||
|
|
@ -234,13 +234,9 @@ export default {
|
||||||
// nothing to do with this component. We could mitigate this by showing / hiding this component with v-if but that messes
|
// nothing to do with this component. We could mitigate this by showing / hiding this component with v-if but that messes
|
||||||
// up the component initialization on page load.
|
// up the component initialization on page load.
|
||||||
async handler() {
|
async handler() {
|
||||||
//We do not need to run this handler in case of Inshop only else it will ended running twice function getNextShopsFromList and will cause pagination
|
await nextTick();
|
||||||
if (!this.isInshopOnly) {
|
this.resetAnswers();
|
||||||
this.resetAnswers();
|
this.getNextShopsFromList();
|
||||||
|
|
||||||
await nextTick();
|
|
||||||
this.getNextShopsFromList();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
shopProviders: {
|
shopProviders: {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue