Merge branch 'release/2025.05.22' into feature/CASH-532v2

This commit is contained in:
Johnny Shultz 2025-05-19 09:16:54 -04:00 committed by GitHub
commit b9d28a6ec0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 24 additions and 21 deletions

View file

@ -1001,6 +1001,7 @@ export default {
min-width: 2.5rem; min-width: 2.5rem;
width: 2.5rem; width: 2.5rem;
height: 2.5rem; height: 2.5rem;
border: 2px solid transparent;
span { span {
&.small { &.small {

View file

@ -452,12 +452,6 @@ export default {
this.loadGooglePlacesAutocompleteScript(); this.loadGooglePlacesAutocompleteScript();
} }
}, },
beforeUpdate() {
// It is necessary to set focus on the street address on this lifecycle hook when this component is used in a modal.
if (!this.addressField1.matches(":focus")) {
this.addressField1.focus();
}
},
unmounted() { unmounted() {
this.unloadAutocomplete(); this.unloadAutocomplete();
}, },

View file

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

View file

@ -355,6 +355,7 @@ describe("service-location.vue", () => {
zipCode: "61606", zipCode: "61606",
}, },
isVehicleProtected: null, isVehicleProtected: null,
isMobileSelected: false,
}; };
// Act // Act
@ -468,6 +469,7 @@ describe("service-location.vue", () => {
zipCode: "43054", zipCode: "43054",
}, },
isVehicleProtected: true, isVehicleProtected: true,
isMobileSelected: false,
}; };
//wrapper.vm.closeModalAction = jest.fn(); //wrapper.vm.closeModalAction = jest.fn();

View file

@ -175,12 +175,12 @@ const MOBILE_FEE_PART_TYPE = "MOBILE FEE";
// DEFINE VALIDATION RULES // DEFINE VALIDATION RULES
defineRule("mobile-location-required", (value) => { defineRule("mobile-location-required", (value) => {
if ( if (
value.isMobileSelected &&
(!value.addressQuestions.streetAddress || (!value.addressQuestions.streetAddress ||
!value.addressQuestions.city || !value.addressQuestions.city ||
!value.addressQuestions.state || !value.addressQuestions.state ||
!value.addressQuestions.zipCode || !value.addressQuestions.zipCode ||
!value.isVehicleProtected) && !value.isVehicleProtected)
value.isMobileSelected
) { ) {
return errorMessages.MOBILE_LOCATION_REQUIRED; return errorMessages.MOBILE_LOCATION_REQUIRED;
} }
@ -305,6 +305,9 @@ export default {
zipCode: this.zipCode, zipCode: this.zipCode,
}, },
isVehicleProtected: this.isVehicleProtected, isVehicleProtected: this.isVehicleProtected,
isMobileSelected:
this.selectedAppointmentType == AppointmentTypeStrings.MOBILE &&
!this.getIsMobileLocationOpened(),
}; };
}, },
}, },
@ -523,6 +526,7 @@ export default {
} }
if (this.isServiceableMobile) { if (this.isServiceableMobile) {
this.setMobileLocation(newValue); this.setMobileLocation(newValue);
this.setMobileLocationInValid(false);
} else { } else {
await getZipCodeData(newZipCode).then((zipCodeData) => { await getZipCodeData(newZipCode).then((zipCodeData) => {
this.serviceZipCodeQuestion = { this.serviceZipCodeQuestion = {
@ -751,13 +755,18 @@ export default {
setMobileLocationInValid(isMobileLocationInValid) { setMobileLocationInValid(isMobileLocationInValid) {
this.isMobileAddressValid = !isMobileLocationInValid; this.isMobileAddressValid = !isMobileLocationInValid;
}, },
displayMobileAddressQuestion(openMobileLocation) { displayMobileAddressQuestion() {
var mobileLocationQuestionsRef = this.$refs.mobileLocationQuestions; var mobileLocationQuestionsRef = this.$refs.mobileLocationQuestions;
var isMobileAddressComplete = mobileLocationQuestionsRef.isMobileAddressComplete; var isMobileAddressComplete = mobileLocationQuestionsRef?.isMobileAddressComplete;
if (isMobileAddressComplete) { if (isMobileAddressComplete?.()) {
mobileLocationQuestionsRef.isMobileLocationOpened = openMobileLocation; mobileLocationQuestionsRef.isMobileLocationOpened = false;
} else {
mobileLocationQuestionsRef.isMobileLocationOpened = true;
} }
}, },
getIsMobileLocationOpened() {
return this.$refs.mobileLocationQuestions?.isMobileLocationOpened;
},
}, },
watch: { watch: {
zipCode: { zipCode: {
@ -769,10 +778,8 @@ export default {
this.selectedProvider = new Provider( this.selectedProvider = new Provider(
this.shopProviderData.mobileProviderNumber this.shopProviderData.mobileProviderNumber
); );
this.displayMobileAddressQuestion(true);
} else { } else {
this.selectedProvider = new Provider(); this.selectedProvider = new Provider();
this.displayMobileAddressQuestion(false);
} }
}); });
} }
@ -784,10 +791,9 @@ export default {
this.selectedProvider = new Provider( this.selectedProvider = new Provider(
this.shopProviderData.mobileProviderNumber this.shopProviderData.mobileProviderNumber
); );
this.displayMobileAddressQuestion(true); this.displayMobileAddressQuestion();
} else { } else {
this.selectedProvider = new Provider(); this.selectedProvider = new Provider();
this.displayMobileAddressQuestion(false);
} }
}, },
}, },