Merge pull request #2497 from Safelite/feature/Digital/CASH-602

CASH-602
This commit is contained in:
hiteshkumar87 2025-05-08 23:16:58 +05:30 committed by GitHub
commit 5dcd3e5847
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 17 additions and 15 deletions

View file

@ -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;
}
},
},

View file

@ -79,6 +79,7 @@
:isServiceableDropoff="isServiceableDropoff"
:isDisplayed="isAppointmentTypeDisplayed"
:mobileFeeApplies="mobileFeeApplies"
:zipCode="zipCode"
ref="appointmentTypeQuestion"
groupName="appointmentTypeQuestion"
cmsWidgetName="AppointmentTypeQuestionWidget"

View file

@ -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: {