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,
|
||||
isServiceableDropoff: Boolean,
|
||||
mobileFeeApplies: Boolean,
|
||||
zipCode: String,
|
||||
},
|
||||
computed: {
|
||||
questionText() {
|
||||
|
|
@ -47,6 +48,7 @@ export default {
|
|||
const shouldShowInshop = this.isServiceableInshop;
|
||||
const shouldShowDropoff =
|
||||
this.isServiceableDropoff && !this.$store.getters.damage.isRepair;
|
||||
const zipCode = this.zipCode;
|
||||
|
||||
var answers = this.answersFromCms
|
||||
? this.answersFromCms.filter((answer) => {
|
||||
|
|
@ -87,12 +89,15 @@ export default {
|
|||
watch: {
|
||||
answersToDisplay: {
|
||||
handler(newValue) {
|
||||
// If there is only one option to display and that option is 'Mobile' then select it
|
||||
if (
|
||||
newValue.length == 1 &&
|
||||
newValue.findIndex((answer) => answer.Name == "Mobile") != -1
|
||||
) {
|
||||
this.selectedValue = "Mobile";
|
||||
// If there is only one option to display and that option is 'Mobile' or 'Inshop' then select it
|
||||
if (newValue.length == 1) {
|
||||
const name = newValue[0].Name;
|
||||
if (
|
||||
name === AppointmentTypeStrings.MOBILE ||
|
||||
name === AppointmentTypeStrings.IN_SHOP
|
||||
) {
|
||||
this.selectedValue = name;
|
||||
}
|
||||
}
|
||||
},
|
||||
immediate: true,
|
||||
|
|
@ -100,14 +105,14 @@ export default {
|
|||
isMobileOnly: {
|
||||
handler(newValue) {
|
||||
if (newValue) {
|
||||
this.selectedValue = "Mobile";
|
||||
this.selectedValue = AppointmentTypeStrings.MOBILE;
|
||||
}
|
||||
},
|
||||
},
|
||||
isInshopOnly: {
|
||||
handler(newValue) {
|
||||
if (newValue) {
|
||||
this.selectedValue = "Inshop";
|
||||
this.selectedValue = AppointmentTypeStrings.IN_SHOP;
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@
|
|||
:isServiceableDropoff="isServiceableDropoff"
|
||||
:isDisplayed="isAppointmentTypeDisplayed"
|
||||
:mobileFeeApplies="mobileFeeApplies"
|
||||
:zipCode="zipCode"
|
||||
ref="appointmentTypeQuestion"
|
||||
groupName="appointmentTypeQuestion"
|
||||
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
|
||||
// up the component initialization on page load.
|
||||
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
|
||||
if (!this.isInshopOnly) {
|
||||
this.resetAnswers();
|
||||
|
||||
await nextTick();
|
||||
this.getNextShopsFromList();
|
||||
}
|
||||
await nextTick();
|
||||
this.resetAnswers();
|
||||
this.getNextShopsFromList();
|
||||
},
|
||||
},
|
||||
shopProviders: {
|
||||
|
|
|
|||
Loading…
Reference in a new issue