From 3cf505f69759fd7b7df38f59a43db55eac10b924 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Tue, 9 May 2023 07:30:21 -0400 Subject: [PATCH] WIP --- .../mobile-location-modal-questions.vue | 7 +++ .../service-location/service-location.vue | 21 +++++--- .../service-zip-modal-question.vue | 7 +++ .../shop-question/shop-question.vue | 53 ++++++++----------- 4 files changed, 51 insertions(+), 37 deletions(-) diff --git a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue index b92c14bc9..424e7cf2b 100644 --- a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue +++ b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue @@ -137,6 +137,9 @@ export default { alertInvalidZipWidgetName: String, customComponentId: String, validationRules: String, + optionalCallback: { + type: Function, + }, }, computed: { mobileLocationLinkPromptText() { @@ -257,6 +260,10 @@ export default { // Update the page level model this.$emit("update:modelValue", this.internalModel); + if (this.optionalCallback) { + await this.optionalCallback(serviceZipCode); + } + this.closeModal(); } }, diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 3033e91a1..921a279b7 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -12,7 +12,8 @@ @updated-serviceability="setServiceabilityDetails" @updated-contains-military-base="setContainsMilitaryBase" linkWidgetName="ServiceZipLinkWidget" - modalWidgetName="ServiceZipModalWidget" /> + modalWidgetName="ServiceZipModalWidget" + :optionalCallback="reloadShopData" /> + modalWidgetName="MobileLocationModalWidget" + :optionalCallback="reloadShopData" /> @@ -268,6 +268,12 @@ export default { return this.isGlassServiceableInshop; } }, + isShopQuestionDisplayed() { + return ( + this.selectedAppointmentType === "Inshop" || + this.selectedAppointmentType === "Dropoff" + ); + }, // Specifically check for isRecalibrationServiceableMobile === false, not null or true. requiresInshopRecalibration() { return ( @@ -364,6 +370,9 @@ export default { openModalAction(modalName) { this.$refs[modalName].openModal(); }, + async reloadShopData() { + await this.$refs.shopQuestion.reloadShopData(this.zipCode); + }, }, components: { alert, diff --git a/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.vue b/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.vue index 0698fc340..39703c311 100644 --- a/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.vue +++ b/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.vue @@ -69,6 +69,9 @@ export default { }, linkWidgetName: String, modalWidgetName: String, + optionalCallback: { + type: Function, + }, }, setup() { const textboxQuestionWidgetName = "ServiceZipQuestionWidget"; @@ -161,6 +164,10 @@ export default { // Update the page level model this.$emit("update:modelValue", this.internalModel); + if (this.optionalCallback) { + await this.optionalCallback(serviceZipCode); + } + this.closeModal(); } } else { diff --git a/src/layouts/service-location/shop-question/shop-question.vue b/src/layouts/service-location/shop-question/shop-question.vue index ce3ee3355..97524c1a4 100644 --- a/src/layouts/service-location/shop-question/shop-question.vue +++ b/src/layouts/service-location/shop-question/shop-question.vue @@ -1,6 +1,6 @@