Merge pull request #2529 from Safelite/feature/Digital/CASH-712

CASH-712
This commit is contained in:
hiteshkumar87 2025-05-19 15:58:15 +05:30 committed by GitHub
commit 672912b1f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 10 deletions

View file

@ -236,12 +236,12 @@ export default {
},
async setMobileLocation() {
this.resetAlerts();
this.setMobileLocationInvalid(true);
// Validate the Zip Code
if (
this.internalModel.addressQuestions.zipCode === "" ||
this.internalModel.addressQuestions.zipCode.length !== 5
) {
this.setMobileLocationInvalid(true);
return;
}
const zipCodeData = await this.getZipCodeData(
@ -251,11 +251,9 @@ export default {
if (!zipCodeData.isValid) {
this.displayInvalidZipAlert = true;
this.setMobileLocationInvalid(true);
return;
} else if (zipCodeData.state != this.internalModel.addressQuestions.state) {
this.displayMismatchStateAndZipAlert = true;
this.setMobileLocationInvalid(true);
return;
} else if (
this.internalModel.addressQuestions.zipCode !==
@ -295,7 +293,6 @@ export default {
}
// update the page level model
this.$emit("setMobileLocation", this.internalModel);
this.setMobileLocationInvalid(false);
},
toggleMobileLocation() {
this.isMobileLocationOpened = !this.isMobileLocationOpened;

View file

@ -526,6 +526,7 @@ export default {
}
if (this.isServiceableMobile) {
this.setMobileLocation(newValue);
this.setMobileLocationInValid(false);
} else {
await getZipCodeData(newZipCode).then((zipCodeData) => {
this.serviceZipCodeQuestion = {
@ -754,13 +755,13 @@ export default {
setMobileLocationInValid(isMobileLocationInValid) {
this.isMobileAddressValid = !isMobileLocationInValid;
},
displayMobileAddressQuestion(openMobileLocation) {
displayMobileAddressQuestion() {
var mobileLocationQuestionsRef = this.$refs.mobileLocationQuestions;
var isMobileAddressComplete = mobileLocationQuestionsRef?.isMobileAddressComplete;
if (isMobileAddressComplete?.()) {
mobileLocationQuestionsRef.isMobileLocationOpened = false;
} else {
mobileLocationQuestionsRef.isMobileLocationOpened = openMobileLocation;
mobileLocationQuestionsRef.isMobileLocationOpened = true;
}
},
getIsMobileLocationOpened() {
@ -777,10 +778,8 @@ export default {
this.selectedProvider = new Provider(
this.shopProviderData.mobileProviderNumber
);
this.displayMobileAddressQuestion(true);
} else {
this.selectedProvider = new Provider();
this.displayMobileAddressQuestion(false);
}
});
}
@ -792,10 +791,9 @@ export default {
this.selectedProvider = new Provider(
this.shopProviderData.mobileProviderNumber
);
this.displayMobileAddressQuestion(true);
this.displayMobileAddressQuestion();
} else {
this.selectedProvider = new Provider();
this.displayMobileAddressQuestion(false);
}
},
},