From 7a9ac690e565f3212bb7d7d04660c8a1520a7917 Mon Sep 17 00:00:00 2001 From: hiteshkumar87 Date: Tue, 13 May 2025 11:56:30 +0530 Subject: [PATCH] CASH-502 show mobile location question on mobile service selected --- .../service-location/service-location.vue | 31 +++++++++++-------- .../shop-question/shop-question.vue | 1 - 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 07f33809d..752d0c4c9 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -114,8 +114,7 @@ :selectedAppointmentType="selectedAppointmentType" :shopProviderData="shopProviderData" :isDisplayed="isShopQuestionDisplayed" - cmsWidgetName="ShopQuestionWidget" - :isInshopOnly="isInshopOnly" /> + cmsWidgetName="ShopQuestionWidget" /> @@ -176,11 +175,12 @@ const MOBILE_FEE_PART_TYPE = "MOBILE FEE"; // DEFINE VALIDATION RULES defineRule("mobile-location-required", (value) => { if ( - !value.addressQuestions.streetAddress || - !value.addressQuestions.city || - !value.addressQuestions.state || - !value.addressQuestions.zipCode || - !value.isVehicleProtected + (!value.addressQuestions.streetAddress || + !value.addressQuestions.city || + !value.addressQuestions.state || + !value.addressQuestions.zipCode || + !value.isVehicleProtected) && + value.isMobileSelected ) { return errorMessages.MOBILE_LOCATION_REQUIRED; } @@ -754,6 +754,13 @@ export default { setMobileLocationInValid(isMobileLocationInValid) { this.isMobileAddressValid = !isMobileLocationInValid; }, + displayMobileAddressQuestion(openMobileLocation) { + var mobileLocationQuestionsRef = this.$refs.mobileLocationQuestions; + var isMobileAddressComplete = mobileLocationQuestionsRef.isMobileAddressComplete; + if (isMobileAddressComplete) { + mobileLocationQuestionsRef.isMobileLocationOpened = openMobileLocation; + } + }, }, watch: { zipCode: { @@ -765,8 +772,10 @@ export default { this.selectedProvider = new Provider( this.shopProviderData.mobileProviderNumber ); + this.displayMobileAddressQuestion(true); } else { this.selectedProvider = new Provider(); + this.displayMobileAddressQuestion(false); } }); } @@ -778,14 +787,10 @@ export default { this.selectedProvider = new Provider( this.shopProviderData.mobileProviderNumber ); - var mobileLocationQuestionsRef = this.$refs.mobileLocationQuestions; - var isMobileAddressComplete = - mobileLocationQuestionsRef.isMobileAddressComplete; - if (isMobileAddressComplete) { - mobileLocationQuestionsRef.isMobileLocationOpened = true; - } + this.displayMobileAddressQuestion(true); } else { this.selectedProvider = new Provider(); + this.displayMobileAddressQuestion(false); } }, }, diff --git a/src/layouts/service-location/shop-question/shop-question.vue b/src/layouts/service-location/shop-question/shop-question.vue index 5e85b752b..72862440b 100644 --- a/src/layouts/service-location/shop-question/shop-question.vue +++ b/src/layouts/service-location/shop-question/shop-question.vue @@ -77,7 +77,6 @@ export default { cmsWidgetName: String, validationRules: String, isDisplayed: Boolean, - isInshopOnly: Boolean, }, computed: { questionText() {