From 44644c9ed301ff967ef00ee1935a824533079492 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Mon, 6 Mar 2023 13:18:12 -0500 Subject: [PATCH 01/78] Added initial stub for service-type-question --- .../service-type-question.spec.js | 1 + .../service-type-question.vue | 50 +++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 src/layouts/service-location/service-type-question/service-type-question.spec.js create mode 100644 src/layouts/service-location/service-type-question/service-type-question.vue diff --git a/src/layouts/service-location/service-type-question/service-type-question.spec.js b/src/layouts/service-location/service-type-question/service-type-question.spec.js new file mode 100644 index 000000000..66012402c --- /dev/null +++ b/src/layouts/service-location/service-type-question/service-type-question.spec.js @@ -0,0 +1 @@ +test.todo("some test to be written in the future"); \ No newline at end of file diff --git a/src/layouts/service-location/service-type-question/service-type-question.vue b/src/layouts/service-location/service-type-question/service-type-question.vue new file mode 100644 index 000000000..2a3cdfe22 --- /dev/null +++ b/src/layouts/service-location/service-type-question/service-type-question.vue @@ -0,0 +1,50 @@ + + + From eea249d3c27436e7d8fb91877cfd612162293c16 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Tue, 7 Mar 2023 14:04:28 -0500 Subject: [PATCH 02/78] Created service-type-question component --- .../service-type-question.spec.js | 2 +- .../service-type-question.vue | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/layouts/service-location/service-type-question/service-type-question.spec.js b/src/layouts/service-location/service-type-question/service-type-question.spec.js index 66012402c..3d0843e10 100644 --- a/src/layouts/service-location/service-type-question/service-type-question.spec.js +++ b/src/layouts/service-location/service-type-question/service-type-question.spec.js @@ -1 +1 @@ -test.todo("some test to be written in the future"); \ No newline at end of file +test.todo("some test to be written in the future"); diff --git a/src/layouts/service-location/service-type-question/service-type-question.vue b/src/layouts/service-location/service-type-question/service-type-question.vue index 2a3cdfe22..359e44547 100644 --- a/src/layouts/service-location/service-type-question/service-type-question.vue +++ b/src/layouts/service-location/service-type-question/service-type-question.vue @@ -1,6 +1,6 @@ @@ -29,11 +38,15 @@ // Components import serviceZipModalQuestion from "@/layouts/service-location/service-zip-modal-question/service-zip-modal-question"; import mobileLocationModalQuestions from "@/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions"; +import serviceTypeQuestion from "@/layouts/service-location/service-type-question/service-type-question"; import funnelHeader from "@/fmg-components/funnel-header/funnel-header"; import funnelFooter from "@/fmg-components/funnel-footer/funnel-footer"; import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header"; import loadingModal from "@/fmg-components/loading-modal/loading-modal.vue"; -import { Form } from "vee-validate"; +import { Form, defineRule } from "vee-validate"; +import { required, regex } from "@/helpers/validation-rules"; +import { errorMessages } from "@/constants/error-messages"; + import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; import { settleAllPromises } from "@/helpers/layout-helper"; import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper"; @@ -53,6 +66,7 @@ export default { isZipServiceableMobile: null, isZipServiceableInShop: null, mobileFeePart: null, + selectedServiceType: null }; }, async beforeRouteEnter(to, from, next) { @@ -129,11 +143,12 @@ export default { }, methods: { arePagePrerequisitesValid() { - return ( - store.getters.lineItems.supportingItems !== null && - store.getters.order.serviceLocation.zipCode !== null && - store.getters.payment.isInsurance !== null - ); + return true; + // return ( + // store.getters.lineItems.supportingItems !== null && + // store.getters.order.serviceLocation.zipCode !== null && + // store.getters.payment.isInsurance !== null + // ); }, setData(mobileFeePart) { if (mobileFeePart) { @@ -179,6 +194,7 @@ export default { }, components: { serviceZipModalQuestion, + serviceTypeQuestion, mobileLocationModalQuestions, funnelHeader, funnelFooter, @@ -188,3 +204,11 @@ export default { }, }; + + \ No newline at end of file From 732672c105822a234525c0aa80ccbdab1372bf89 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Tue, 7 Mar 2023 14:13:09 -0500 Subject: [PATCH 04/78] Updated styling on vehicle-protected-question to ensure proper alignment --- .../vehicle-protected-question.vue | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/layouts/service-location/mobile-location-modal-questions/vehicle-protected-question/vehicle-protected-question.vue b/src/layouts/service-location/mobile-location-modal-questions/vehicle-protected-question/vehicle-protected-question.vue index f5754ea06..c1484500b 100644 --- a/src/layouts/service-location/mobile-location-modal-questions/vehicle-protected-question/vehicle-protected-question.vue +++ b/src/layouts/service-location/mobile-location-modal-questions/vehicle-protected-question/vehicle-protected-question.vue @@ -51,14 +51,11 @@ export default { From 04efdfcd0f031667f272c04816d4643f40ed8265 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Wed, 8 Mar 2023 10:11:48 -0500 Subject: [PATCH 05/78] temp chkin --- .../mobile-location-modal-questions.vue | 1 - .../service-location/service-location.vue | 24 +++++++++++-------- .../service-type-question.vue | 13 ++++++++-- 3 files changed, 25 insertions(+), 13 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 0aa64594d..598af5438 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 @@ -130,7 +130,6 @@ export default { modalFooterText() { return this.getCmsContent(this.modalWidgetName, "FooterText"); }, - addressModel: { get: function () { return this.modelValue.addressQuestions; diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index e274c120b..37a79d9c8 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -13,10 +13,11 @@ modalWidgetName="ServiceZipModalWidget" /> - + - @@ -43,9 +43,7 @@ import funnelHeader from "@/fmg-components/funnel-header/funnel-header"; import funnelFooter from "@/fmg-components/funnel-footer/funnel-footer"; import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header"; import loadingModal from "@/fmg-components/loading-modal/loading-modal.vue"; -import { Form, defineRule } from "vee-validate"; -import { required, regex } from "@/helpers/validation-rules"; -import { errorMessages } from "@/constants/error-messages"; +import { Form } from "vee-validate"; import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; import { settleAllPromises } from "@/helpers/layout-helper"; @@ -66,7 +64,7 @@ export default { isZipServiceableMobile: null, isZipServiceableInShop: null, mobileFeePart: null, - selectedServiceType: null + selectedServiceType: null, }; }, async beforeRouteEnter(to, from, next) { @@ -113,6 +111,8 @@ export default { this.state = newValue.state; this.zipCode = newValue.zipCode; this.isServiceable = newValue.isServiceable; + + console.log(this); }, }, mobileLocationQuestions: { @@ -176,6 +176,10 @@ export default { }); }, resetMobileLocation(updatedServiceZipCode) { + if (!this.$refs.mobileLocationModalQuestions) { + return; + } + this.streetAddress = ""; this.apartmentNumberOrBusinessName = ""; this.city = ""; @@ -210,5 +214,5 @@ export default { & > span { text-align: center; } -} - \ No newline at end of file +} + diff --git a/src/layouts/service-location/service-type-question/service-type-question.vue b/src/layouts/service-location/service-type-question/service-type-question.vue index 359e44547..528f7487b 100644 --- a/src/layouts/service-location/service-type-question/service-type-question.vue +++ b/src/layouts/service-location/service-type-question/service-type-question.vue @@ -17,6 +17,8 @@ + + From 6039bacf0da8765f0223d20b8f078bf42262397c Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Mon, 20 Mar 2023 09:34:31 -0400 Subject: [PATCH 21/78] Added SERVCE_ADDRESS_REQUIRED Error Msg --- src/constants/error-messages.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/constants/error-messages.js b/src/constants/error-messages.js index 739698861..5631b44c7 100644 --- a/src/constants/error-messages.js +++ b/src/constants/error-messages.js @@ -18,7 +18,6 @@ const errorMessages = { LAST_NAME_REQUIRED: "Please enter your last name", EMAIL_ADDRESS_REQUIRED: "Please enter your email address", EMAIL_ADDRESS_FORMAT: "Please enter a valid email address", - SERVICE_ADDRESS_REQUIRED: "Please enter your service address", SERVICE_ZIP_REQUIRED: "Please enter your service ZIP", SERVICE_ZIP_FORMAT: "Please enter a valid service ZIP", VIN_REQUIRED: "Please enter your VIN", From 0a78965a3772642813a105f543d16ec54f4e0c9f Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Mon, 20 Mar 2023 09:34:31 -0400 Subject: [PATCH 22/78] Revert "Added SERVCE_ADDRESS_REQUIRED Error Msg" This reverts commit 6039bacf0da8765f0223d20b8f078bf42262397c. --- src/constants/error-messages.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/constants/error-messages.js b/src/constants/error-messages.js index 5631b44c7..739698861 100644 --- a/src/constants/error-messages.js +++ b/src/constants/error-messages.js @@ -18,6 +18,7 @@ const errorMessages = { LAST_NAME_REQUIRED: "Please enter your last name", EMAIL_ADDRESS_REQUIRED: "Please enter your email address", EMAIL_ADDRESS_FORMAT: "Please enter a valid email address", + SERVICE_ADDRESS_REQUIRED: "Please enter your service address", SERVICE_ZIP_REQUIRED: "Please enter your service ZIP", SERVICE_ZIP_FORMAT: "Please enter a valid service ZIP", VIN_REQUIRED: "Please enter your VIN", From 80d5f9597077f64afba637883283b1fcf37e1092 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Mon, 20 Mar 2023 09:50:05 -0400 Subject: [PATCH 23/78] Clean up --- .../mobile-location-modal-questions.vue | 40 ----------------- .../service-location/service-location.vue | 45 +++---------------- 2 files changed, 6 insertions(+), 79 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 46cb51d13..586e1c6de 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 @@ -22,9 +22,6 @@ cmsWidgetName="MobileFeeDisclaimerWidget" typeStyle="caption" /> -
- {{ errorMessage }} -
+ modalWidgetName="MobileLocationModalWidget" /> @@ -43,7 +42,7 @@ import funnelHeader from "@/fmg-components/funnel-header/funnel-header"; import funnelFooter from "@/fmg-components/funnel-footer/funnel-footer"; import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header"; import loadingModal from "@/fmg-components/loading-modal/loading-modal.vue"; -import { Form, defineRule } from "vee-validate"; +import { Form } from "vee-validate"; // Supporting files import baseMixin from "@/mixins/base-mixin.js"; @@ -51,24 +50,8 @@ import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; import { settleAllPromises } from "@/helpers/layout-helper"; import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper"; import { getPricedMobileFeePart } from "@/layouts/service-location/helpers/service-location-helper/service-location-helper"; -import { errorMessages } from "@/constants/error-messages"; import store from "@/store"; -defineRule("service-address-required", (value) => { - const isValid = - value.addressQuestions.streetAddress !== "" && - value.addressQuestions.city !== "" && - value.addressQuestions.state !== "" && - value.addressQuestions.zipCode !== "" && - value.isVehicleProtected !== null; - - if (!isValid) { - return errorMessages.SERVICE_ADDRESS_REQUIRED; - } - - return isValid; -}); - export default { name: "service-location", data() { @@ -156,12 +139,6 @@ export default { this.state = newValue.addressQuestions.state; this.zipCode = newValue.addressQuestions.zipCode; this.isVehicleProtected = newValue.isVehicleProtected; - - // setErrors({ - // mobileLocationQuestions: "" - // }); - - //this.$refs.theForm.setTouched({}); }, }, shouldDisableForwardAction() { @@ -170,7 +147,6 @@ export default { }, methods: { arePagePrerequisitesValid() { - return ( store.getters.lineItems.supportingItems !== null && store.getters.order.serviceLocation.zipCode !== null && @@ -212,9 +188,9 @@ export default { }, }, watch: { - zipCode(newValue, oldValue) { - if (newValue !== oldValue) { - baseMixin.methods.getZipCodeData(newValue).then((r) => { + zipCode(current, previous) { + if (current !== previous) { + baseMixin.methods.getZipCodeData(current).then((r) => { this.zipContainsMilitaryBase = r.containsMilitaryBase; }); } @@ -232,12 +208,3 @@ export default { }, }; - - From 1bc00e31e713cfef5f0e928c269713237aeacab1 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Mon, 20 Mar 2023 09:50:05 -0400 Subject: [PATCH 24/78] Revert "Clean up" This reverts commit 80d5f9597077f64afba637883283b1fcf37e1092. --- .../mobile-location-modal-questions.vue | 40 +++++++++++++++++ .../service-location/service-location.vue | 45 ++++++++++++++++--- 2 files changed, 79 insertions(+), 6 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 586e1c6de..46cb51d13 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 @@ -22,6 +22,9 @@ cmsWidgetName="MobileFeeDisclaimerWidget" typeStyle="caption" /> +
+ {{ errorMessage }} +
+ modalWidgetName="MobileLocationModalWidget" + validationRules="service-address-required"/> @@ -42,7 +43,7 @@ import funnelHeader from "@/fmg-components/funnel-header/funnel-header"; import funnelFooter from "@/fmg-components/funnel-footer/funnel-footer"; import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header"; import loadingModal from "@/fmg-components/loading-modal/loading-modal.vue"; -import { Form } from "vee-validate"; +import { Form, defineRule } from "vee-validate"; // Supporting files import baseMixin from "@/mixins/base-mixin.js"; @@ -50,8 +51,24 @@ import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; import { settleAllPromises } from "@/helpers/layout-helper"; import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper"; import { getPricedMobileFeePart } from "@/layouts/service-location/helpers/service-location-helper/service-location-helper"; +import { errorMessages } from "@/constants/error-messages"; import store from "@/store"; +defineRule("service-address-required", (value) => { + const isValid = + value.addressQuestions.streetAddress !== "" && + value.addressQuestions.city !== "" && + value.addressQuestions.state !== "" && + value.addressQuestions.zipCode !== "" && + value.isVehicleProtected !== null; + + if (!isValid) { + return errorMessages.SERVICE_ADDRESS_REQUIRED; + } + + return isValid; +}); + export default { name: "service-location", data() { @@ -139,6 +156,12 @@ export default { this.state = newValue.addressQuestions.state; this.zipCode = newValue.addressQuestions.zipCode; this.isVehicleProtected = newValue.isVehicleProtected; + + // setErrors({ + // mobileLocationQuestions: "" + // }); + + //this.$refs.theForm.setTouched({}); }, }, shouldDisableForwardAction() { @@ -147,6 +170,7 @@ export default { }, methods: { arePagePrerequisitesValid() { + return ( store.getters.lineItems.supportingItems !== null && store.getters.order.serviceLocation.zipCode !== null && @@ -188,9 +212,9 @@ export default { }, }, watch: { - zipCode(current, previous) { - if (current !== previous) { - baseMixin.methods.getZipCodeData(current).then((r) => { + zipCode(newValue, oldValue) { + if (newValue !== oldValue) { + baseMixin.methods.getZipCodeData(newValue).then((r) => { this.zipContainsMilitaryBase = r.containsMilitaryBase; }); } @@ -208,3 +232,12 @@ export default { }, }; + + From be31530bfa9990cae45781afa51714f775742936 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Mon, 20 Mar 2023 09:50:05 -0400 Subject: [PATCH 25/78] Revert "Revert "Clean up"" This reverts commit 1bc00e31e713cfef5f0e928c269713237aeacab1. --- .../mobile-location-modal-questions.vue | 40 ----------------- .../service-location/service-location.vue | 45 +++---------------- 2 files changed, 6 insertions(+), 79 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 46cb51d13..586e1c6de 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 @@ -22,9 +22,6 @@ cmsWidgetName="MobileFeeDisclaimerWidget" typeStyle="caption" /> -
- {{ errorMessage }} -
+ modalWidgetName="MobileLocationModalWidget" /> @@ -43,7 +42,7 @@ import funnelHeader from "@/fmg-components/funnel-header/funnel-header"; import funnelFooter from "@/fmg-components/funnel-footer/funnel-footer"; import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header"; import loadingModal from "@/fmg-components/loading-modal/loading-modal.vue"; -import { Form, defineRule } from "vee-validate"; +import { Form } from "vee-validate"; // Supporting files import baseMixin from "@/mixins/base-mixin.js"; @@ -51,24 +50,8 @@ import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; import { settleAllPromises } from "@/helpers/layout-helper"; import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper"; import { getPricedMobileFeePart } from "@/layouts/service-location/helpers/service-location-helper/service-location-helper"; -import { errorMessages } from "@/constants/error-messages"; import store from "@/store"; -defineRule("service-address-required", (value) => { - const isValid = - value.addressQuestions.streetAddress !== "" && - value.addressQuestions.city !== "" && - value.addressQuestions.state !== "" && - value.addressQuestions.zipCode !== "" && - value.isVehicleProtected !== null; - - if (!isValid) { - return errorMessages.SERVICE_ADDRESS_REQUIRED; - } - - return isValid; -}); - export default { name: "service-location", data() { @@ -156,12 +139,6 @@ export default { this.state = newValue.addressQuestions.state; this.zipCode = newValue.addressQuestions.zipCode; this.isVehicleProtected = newValue.isVehicleProtected; - - // setErrors({ - // mobileLocationQuestions: "" - // }); - - //this.$refs.theForm.setTouched({}); }, }, shouldDisableForwardAction() { @@ -170,7 +147,6 @@ export default { }, methods: { arePagePrerequisitesValid() { - return ( store.getters.lineItems.supportingItems !== null && store.getters.order.serviceLocation.zipCode !== null && @@ -212,9 +188,9 @@ export default { }, }, watch: { - zipCode(newValue, oldValue) { - if (newValue !== oldValue) { - baseMixin.methods.getZipCodeData(newValue).then((r) => { + zipCode(current, previous) { + if (current !== previous) { + baseMixin.methods.getZipCodeData(current).then((r) => { this.zipContainsMilitaryBase = r.containsMilitaryBase; }); } @@ -232,12 +208,3 @@ export default { }, }; - - From 521937c388c2805f05a1539a4c45a89f03c9da5e Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Mon, 20 Mar 2023 09:34:31 -0400 Subject: [PATCH 26/78] Revert "Revert "Added SERVCE_ADDRESS_REQUIRED Error Msg"" This reverts commit 0a78965a3772642813a105f543d16ec54f4e0c9f. --- src/constants/error-messages.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/constants/error-messages.js b/src/constants/error-messages.js index 739698861..5631b44c7 100644 --- a/src/constants/error-messages.js +++ b/src/constants/error-messages.js @@ -18,7 +18,6 @@ const errorMessages = { LAST_NAME_REQUIRED: "Please enter your last name", EMAIL_ADDRESS_REQUIRED: "Please enter your email address", EMAIL_ADDRESS_FORMAT: "Please enter a valid email address", - SERVICE_ADDRESS_REQUIRED: "Please enter your service address", SERVICE_ZIP_REQUIRED: "Please enter your service ZIP", SERVICE_ZIP_FORMAT: "Please enter a valid service ZIP", VIN_REQUIRED: "Please enter your VIN", From 2e7de50c967ca5c457ddac2081fa5417f2e1b8c5 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Mon, 20 Mar 2023 09:34:31 -0400 Subject: [PATCH 27/78] Revert "Added SERVCE_ADDRESS_REQUIRED Error Msg" This reverts commit 6039bacf0da8765f0223d20b8f078bf42262397c. --- src/constants/error-messages.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/constants/error-messages.js b/src/constants/error-messages.js index 5631b44c7..739698861 100644 --- a/src/constants/error-messages.js +++ b/src/constants/error-messages.js @@ -18,6 +18,7 @@ const errorMessages = { LAST_NAME_REQUIRED: "Please enter your last name", EMAIL_ADDRESS_REQUIRED: "Please enter your email address", EMAIL_ADDRESS_FORMAT: "Please enter a valid email address", + SERVICE_ADDRESS_REQUIRED: "Please enter your service address", SERVICE_ZIP_REQUIRED: "Please enter your service ZIP", SERVICE_ZIP_FORMAT: "Please enter a valid service ZIP", VIN_REQUIRED: "Please enter your VIN", From a0ab81acaad470453cd77a618029a22123c16a09 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Fri, 17 Mar 2023 14:42:28 -0400 Subject: [PATCH 28/78] Revert "WIP" This reverts commit d4a938f3c3f540c3ef6b81671d0ca799bdb42fd3. --- src/constants/error-messages.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/constants/error-messages.js b/src/constants/error-messages.js index 739698861..5631b44c7 100644 --- a/src/constants/error-messages.js +++ b/src/constants/error-messages.js @@ -18,7 +18,6 @@ const errorMessages = { LAST_NAME_REQUIRED: "Please enter your last name", EMAIL_ADDRESS_REQUIRED: "Please enter your email address", EMAIL_ADDRESS_FORMAT: "Please enter a valid email address", - SERVICE_ADDRESS_REQUIRED: "Please enter your service address", SERVICE_ZIP_REQUIRED: "Please enter your service ZIP", SERVICE_ZIP_FORMAT: "Please enter a valid service ZIP", VIN_REQUIRED: "Please enter your VIN", From 4c60dc054f40b8e241a16ac26762460a34d25df4 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Mon, 20 Mar 2023 10:30:36 -0400 Subject: [PATCH 29/78] Added autocomplete and city reset for validation --- .../mobile-location-modal-questions.vue | 4 ++++ 1 file changed, 4 insertions(+) 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 586e1c6de..9ba81f14a 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 @@ -158,6 +158,8 @@ export default { // on the service-zip-modal-question component this.$refs[this.modalName].form.resetForm({ values: { + autocomplete: updatedServiceZipCodeInfo.streetAddress, + city: updatedServiceZipCodeInfo.city, state: updatedServiceZipCodeInfo.state, zipCode: updatedServiceZipCodeInfo.zipCode, isVehicleProtected: updatedServiceZipCodeInfo.isVehicleProtected, @@ -197,6 +199,8 @@ export default { this.internalModel = deepClone(newValue); this.resetComponent({ + autocomplete: updatedServiceZipCodeInfo.streetAddress, + city: updatedServiceZipCodeInfo.city, state: newValue.addressQuestions.state, zipCode: newValue.addressQuestions.zipCode, isVehicleProtected: newValue.isVehicleProtected, From 14541d110c0ddcd0216eb76e4ea6ba4a61dfcdbf Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Thu, 16 Mar 2023 16:00:08 -0400 Subject: [PATCH 30/78] Updates for emitting contains military zip --- .../service-location/service-location.spec.js | 12 ++++++---- .../service-location/service-location.vue | 22 +++++++------------ .../service-zip-modal-question.vue | 3 +++ 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/src/layouts/service-location/service-location.spec.js b/src/layouts/service-location/service-location.spec.js index 0653e91f0..b48fa2f06 100644 --- a/src/layouts/service-location/service-location.spec.js +++ b/src/layouts/service-location/service-location.spec.js @@ -319,11 +319,15 @@ describe("service-location.vue", () => { state: "OH", }; - // Assert - wrapper.setData({ zipCode: newServiceZipCodeQuestion.zipCode }); - wrapper.vm.$nextTick(() => { - expect(wrapper.vm.zipContainsMilitaryBase).toBe(true); + const serviceZipCodeComponent = wrapper.findComponent({ + ref: "serviceZipCodeQuestion", }); + + // Act + serviceZipCodeComponent.vm.$emit("updated-contains-military-base", true); + + // Assert + expect(wrapper.vm.zipContainsMilitaryBase).toBe(true); }); }); diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 58f440708..732b0f0b1 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -10,7 +10,8 @@ :mobileFeePart="mobileFeePart" @updated-mobile-fee-part="setMobileFeePart" linkWidgetName="ServiceZipLinkWidget" - modalWidgetName="ServiceZipModalWidget" /> + modalWidgetName="ServiceZipModalWidget" + @updated-contains-military-base="setContainsMilitaryBase" /> @@ -141,9 +142,6 @@ export default { this.isVehicleProtected = newValue.isVehicleProtected; }, }, - shouldDisableForwardAction() { - return this.zipContainsMilitaryBase; - }, }, methods: { arePagePrerequisitesValid() { @@ -158,6 +156,11 @@ export default { this.mobileFeePart = mobileFeePart; } }, + setContainsMilitaryBase(val) { + if (this.zipContainsMilitaryBase !== val) { + this.zipContainsMilitaryBase = val; + } + }, getServiceAddressFromStore() { return store.getters.order.serviceLocation.address; }, @@ -187,15 +190,6 @@ export default { navigateToHeritageFunnel({ loadingModal: this.$refs.loadingModal }); }, }, - watch: { - zipCode(current, previous) { - if (current !== previous) { - baseMixin.methods.getZipCodeData(current).then((r) => { - this.zipContainsMilitaryBase = r.containsMilitaryBase; - }); - } - }, - }, components: { alert, serviceZipModalQuestion, 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 0d2c35000..1b665b5d5 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 @@ -44,6 +44,7 @@ import { getPricedMobileFeePart } from "@/layouts/service-location/helpers/servi export default { name: "service-zip-modal-question", emits: ["update:modelValue", "updated-mobile-fee-part"], + emits: ["updated-contains-military-base"], data() { return { internalModel: this.copyModel(this.modelValue), @@ -160,6 +161,8 @@ export default { // Update the page level model this.$emit("update:modelValue", this.internalModel); + this.$emit("updated-contains-military-base", zipCodeData.containsMilitaryBase); + this.closeModal(); } }, From 12c5d684d800df90f87a9e4aabb6c64160413573 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Mon, 20 Mar 2023 10:46:02 -0400 Subject: [PATCH 31/78] Minor correction to previous commit --- .../mobile-location-modal-questions.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 9ba81f14a..2974254b3 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 @@ -199,7 +199,7 @@ export default { this.internalModel = deepClone(newValue); this.resetComponent({ - autocomplete: updatedServiceZipCodeInfo.streetAddress, + streetAddress: updatedServiceZipCodeInfo.streetAddress, city: updatedServiceZipCodeInfo.city, state: newValue.addressQuestions.state, zipCode: newValue.addressQuestions.zipCode, From c4f0624f10783aef909cd85a9b557229460b106d Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Thu, 16 Mar 2023 16:49:14 -0400 Subject: [PATCH 32/78] Contains Military zip emit on Location questions modal --- .../mobile-location-modal-questions.vue | 2 ++ src/layouts/service-location/service-location.vue | 13 ++++++++++--- 2 files changed, 12 insertions(+), 3 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 586e1c6de..78d1cc672 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 @@ -65,6 +65,7 @@ import { getPricedMobileFeePart } from "@/layouts/service-location/helpers/servi export default { name: "mobile-location-modal-questions", emits: ["update:modelValue", "updated-mobile-fee-part"], + emits: ["update:modelValue", "updated-zip-code", "updated-contains-military-base"], // The component emits an event data() { return { internalModel: deepClone(this.modelValue), @@ -187,6 +188,7 @@ export default { // Update the page level model this.$emit("update:modelValue", this.internalModel); + this.$emit("updated-contains-military-base", zipCodeData.containsMilitaryBase); this.closeModal(); } }, diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 732b0f0b1..5969ac216 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -10,12 +10,12 @@ :mobileFeePart="mobileFeePart" @updated-mobile-fee-part="setMobileFeePart" linkWidgetName="ServiceZipLinkWidget" - modalWidgetName="ServiceZipModalWidget" + modalWidgetName="ServiceZipModalWidget" @updated-contains-military-base="setContainsMilitaryBase" /> + modalWidgetName="MobileLocationModalWidget" + @updated-contains-military-base="setContainsMilitaryBase" /> Date: Mon, 20 Mar 2023 10:49:12 -0400 Subject: [PATCH 33/78] Updates after merge --- .../mobile-location-modal-questions.vue | 3 +-- .../service-zip-modal-question/service-zip-modal-question.vue | 3 +-- 2 files changed, 2 insertions(+), 4 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 78d1cc672..8773b5daf 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 @@ -64,8 +64,7 @@ import { getPricedMobileFeePart } from "@/layouts/service-location/helpers/servi export default { name: "mobile-location-modal-questions", - emits: ["update:modelValue", "updated-mobile-fee-part"], - emits: ["update:modelValue", "updated-zip-code", "updated-contains-military-base"], // The component emits an event + emits: ["update:modelValue", "updated-mobile-fee-part", "updated-contains-military-base"], // The component emits an event data() { return { internalModel: deepClone(this.modelValue), 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 1b665b5d5..174b74523 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 @@ -43,8 +43,7 @@ import { getPricedMobileFeePart } from "@/layouts/service-location/helpers/servi export default { name: "service-zip-modal-question", - emits: ["update:modelValue", "updated-mobile-fee-part"], - emits: ["updated-contains-military-base"], + emits: ["update:modelValue", "updated-mobile-fee-part", "updated-contains-military-base"], data() { return { internalModel: this.copyModel(this.modelValue), From 9fd6a08dd8ea1f71bfae6aa3f3821c20312e1629 Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Mon, 20 Mar 2023 11:00:31 -0400 Subject: [PATCH 34/78] remove comment that was removed previously --- .../mobile-location-modal-questions.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 8773b5daf..85726aebd 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 @@ -64,7 +64,7 @@ import { getPricedMobileFeePart } from "@/layouts/service-location/helpers/servi export default { name: "mobile-location-modal-questions", - emits: ["update:modelValue", "updated-mobile-fee-part", "updated-contains-military-base"], // The component emits an event + emits: ["update:modelValue", "updated-mobile-fee-part", "updated-contains-military-base"], data() { return { internalModel: deepClone(this.modelValue), From e0a57916750417890b95240d22e107b8fff7f156 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Mon, 20 Mar 2023 14:15:51 -0400 Subject: [PATCH 35/78] Another correction for previous commit --- .../mobile-location-modal-questions.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 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 2974254b3..5261d81e0 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 @@ -199,8 +199,8 @@ export default { this.internalModel = deepClone(newValue); this.resetComponent({ - streetAddress: updatedServiceZipCodeInfo.streetAddress, - city: updatedServiceZipCodeInfo.city, + streetAddress: newValue.addressQuestions.streetAddress, + city: newValue.addressQuestions.city, state: newValue.addressQuestions.state, zipCode: newValue.addressQuestions.zipCode, isVehicleProtected: newValue.isVehicleProtected, From c37487042e483f9d1e763ad01efe8fe5652d4810 Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Fri, 24 Mar 2023 12:50:38 -0400 Subject: [PATCH 36/78] Only process zipcode on change. --- .../service-zip-modal-question.vue | 38 +++++++++++-------- 1 file changed, 22 insertions(+), 16 deletions(-) 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 174b74523..5d9631442 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 @@ -140,28 +140,34 @@ export default { }, async setZipCode() { - this.resetAlerts(); + if (this.internalModel.zipCode !== this.modelValue.zipCode) + { + this.resetAlerts(); - const zipCodeData = await this.getZipCodeData(this.internalModel.zipCode); + const zipCodeData = await this.getZipCodeData(this.internalModel.zipCode); - if (!zipCodeData.isValid) { - this.displayInvalidZipAlert = true; - this.focusOnZipInput(); - this.resetModalButtonStyle(); - } else { - this.internalModel.state = zipCodeData.state; + if (!zipCodeData.isValid) { + this.displayInvalidZipAlert = true; + this.focusOnZipInput(); + this.resetModalButtonStyle(); + } else { + this.internalModel.state = zipCodeData.state; - // retrieve mobile fee part - const serviceZipCode = this.internalModel.zipCode; - const mobileFeePart = await getPricedMobileFeePart(serviceZipCode); + // retrieve mobile fee part + const serviceZipCode = this.internalModel.zipCode; + const mobileFeePart = await getPricedMobileFeePart(serviceZipCode); - // emit it to parent - this.$emit("updated-mobile-fee-part", mobileFeePart); + // emit it to parent + this.$emit("updated-mobile-fee-part", mobileFeePart); - // Update the page level model - this.$emit("update:modelValue", this.internalModel); - this.$emit("updated-contains-military-base", zipCodeData.containsMilitaryBase); + // Update the page level model + this.$emit("update:modelValue", this.internalModel); + this.$emit("updated-contains-military-base", zipCodeData.containsMilitaryBase); + this.closeModal(); + } + } + else { this.closeModal(); } }, From cfeed1ff28a2733009d5b250f5c109ba3861194a Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Fri, 24 Mar 2023 13:37:59 -0400 Subject: [PATCH 37/78] formatting --- .../service-zip-modal-question.vue | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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 5d9631442..3861ff01d 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 @@ -140,8 +140,7 @@ export default { }, async setZipCode() { - if (this.internalModel.zipCode !== this.modelValue.zipCode) - { + if (this.internalModel.zipCode !== this.modelValue.zipCode) { this.resetAlerts(); const zipCodeData = await this.getZipCodeData(this.internalModel.zipCode); @@ -166,8 +165,7 @@ export default { this.closeModal(); } - } - else { + } else { this.closeModal(); } }, From df2665a2ce0a9a1a8dbf34b902daa69e1d48bbc5 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Fri, 24 Mar 2023 13:44:31 -0400 Subject: [PATCH 38/78] Technical review changes --- src/constants/error-messages.js | 1 + src/digital-components/modal/modal.vue | 15 +++++---- .../textbox-question/textbox-question.vue | 28 +++++++++++++++-- .../mobile-location-modal-questions.vue | 13 +++++++- .../service-location/service-location.vue | 31 ++++++++++++++++--- .../service-zip-modal-question.vue | 2 +- 6 files changed, 74 insertions(+), 16 deletions(-) diff --git a/src/constants/error-messages.js b/src/constants/error-messages.js index 5631b44c7..3c3f776c1 100644 --- a/src/constants/error-messages.js +++ b/src/constants/error-messages.js @@ -25,6 +25,7 @@ const errorMessages = { "Invalid VIN. Please make sure that you entered the correct 17-digit, alpha-numeric number. VINs do not contain the letters I, O, or Q", OPTION_REQUIRED: "Please select an option", VEHICLE_REQUIRED: "Please select a vehicle", + MOBILE_LOCATION_REQUIRED: "Please enter your service address", }; export { errorMessages }; diff --git a/src/digital-components/modal/modal.vue b/src/digital-components/modal/modal.vue index a18881796..e10f437d3 100644 --- a/src/digital-components/modal/modal.vue +++ b/src/digital-components/modal/modal.vue @@ -60,14 +60,17 @@ export default { setup() { const modalId = `modal-${crypto.randomUUID()}`; - const form = useForm(); + const { meta, validate, resetForm } = useForm(); + const isFormTouched = useIsFormTouched(); const isFormDirty = useIsFormDirty(); const isFormValid = useIsFormValid(); return { modalId, - form, + meta, + validate, + resetForm, isFormTouched, isFormDirty, isFormValid, @@ -75,7 +78,7 @@ export default { }, methods: { async validateAndEmit() { - const validationResult = await this.form.validate(); + const validationResult = await this.validate(); if (validationResult.valid) { this.$emit("footer-button-event"); } else { @@ -103,10 +106,10 @@ export default { }, computed: { isFooterButtonDisabled() { - if (!this.isFormTouched) { - return !this.isFormValid; + if (!this.meta.touched) { + return !this.meta.valid; } - return !this.isFormDirty || !this.isFormValid; + return !this.meta.dirty || !this.meta.valid; }, }, components: { diff --git a/src/digital-components/textbox-question/textbox-question.vue b/src/digital-components/textbox-question/textbox-question.vue index 2766e2cd9..335c47a60 100644 --- a/src/digital-components/textbox-question/textbox-question.vue +++ b/src/digital-components/textbox-question/textbox-question.vue @@ -1,11 +1,19 @@ @@ -74,6 +88,8 @@ export default { questionAlignment: String, // Left or center. Left is default. cornerStyle: String, // Rounded or square. Square is default. includeSearchIcon: Boolean, + hideInput: Boolean, + centerErrorMessage: Boolean, }, setup(props) { const inputId = !props.customInputId ? `input-${crypto.randomUUID()}` : props.customInputId; @@ -142,6 +158,12 @@ export default { From 25d03a1c0ac2178bda18d6312f2b137b7d4551fe Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Mon, 27 Mar 2023 10:31:54 -0400 Subject: [PATCH 43/78] Removed unused watch statement --- src/layouts/service-location/service-location.vue | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 8b3042678..261e84521 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -216,15 +216,6 @@ export default { navigateToHeritageFunnel({ loadingModal: this.$refs.loadingModal }); }, }, - watch: { - zipCode(newValue, oldValue) { - if (newValue !== oldValue) { - baseMixin.methods.getZipCodeData(newValue).then((r) => { - this.zipContainsMilitaryBase = r.containsMilitaryBase; - }); - } - }, - }, components: { alert, serviceZipModalQuestion, From 6b25e8ea47601f60edb7981e30695fa89b90f09d Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Mon, 27 Mar 2023 13:22:32 -0400 Subject: [PATCH 44/78] Merge outstanding changes --- .../mobile-location-modal-questions.vue | 14 ++++++++++---- src/layouts/service-location/service-location.vue | 1 + 2 files changed, 11 insertions(+), 4 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 a319a85b9..d0128bcd3 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 @@ -61,7 +61,11 @@ import vehicleProtectedQuestion from "@/layouts/service-location/mobile-location // Helpers import { deepClone } from "@/layouts/service-location/helpers/object-cloning-helper/object-cloning-helper"; -import { getPricedMobileFeePart } from "@/layouts/service-location/helpers/service-location-helper/service-location-helper"; + +import { + getPricedMobileFeePart, + getServiceabilityDetails, +} from "@/layouts/service-location/helpers/service-location-helper/service-location-helper"; export default { name: "mobile-location-modal-questions", @@ -187,13 +191,15 @@ export default { } else { // retrieve mobile fee part const serviceZipCode = this.internalModel.addressQuestions.zipCode; - const mobileFeePart = await getPricedMobileFeePart(serviceZipCode); - + + // retrieve serviceability details + const serviceabilityDetails = await getServiceabilityDetails(serviceZipCode); + // update content related to service zip code this.$emit("updated-mobile-fee-part", mobileFeePart); this.$emit("updated-serviceability", serviceabilityDetails.data); - this.$emit("updated-contains-military-base", zipCodeData.containsMilitaryBase); + this.$emit("updated-contains-military-base", zipCodeData.containsMilitaryBase); // Update the page level model this.$emit("update:modelValue", this.internalModel); diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index b049bb0cb..4eaad2cbb 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -37,6 +37,7 @@ linkWidgetName="MobileLocationLinkWidget" modalWidgetName="MobileLocationModalWidget" /> Date: Mon, 27 Mar 2023 13:31:26 -0400 Subject: [PATCH 45/78] Patched in missing Military code --- src/layouts/service-location/service-location.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 4eaad2cbb..6b059079f 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -10,6 +10,7 @@ :mobileFeePart="mobileFeePart" @updated-mobile-fee-part="setMobileFeePart" @updated-serviceability="setServiceabilityDetails" + @updated-contains-military-base="setContainsMilitaryBase" linkWidgetName="ServiceZipLinkWidget" modalWidgetName="ServiceZipModalWidget" /> From 31355e1e735888a3b3283a099614b735592a14e1 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Mon, 27 Mar 2023 13:37:30 -0400 Subject: [PATCH 46/78] added comment --- .../service-zip-modal-question/service-zip-modal-question.vue | 2 ++ 1 file changed, 2 insertions(+) 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 ed4a3ea69..0698fc340 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 @@ -149,6 +149,8 @@ export default { // retrieve mobile fee part const serviceZipCode = this.internalModel.zipCode; const mobileFeePart = await getPricedMobileFeePart(serviceZipCode); + + // retrieve serviceability details const serviceabilityDetails = await getServiceabilityDetails(serviceZipCode); // update content related to service zip code From 902cd698582cb44c5fb93bd609faf81336b55df2 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Tue, 28 Mar 2023 08:28:55 -0400 Subject: [PATCH 47/78] WIP --- src/layouts/service-location/service-location.vue | 8 ++++---- .../service-type-question/service-type-question.vue | 11 +++++++++-- src/store/index.js | 1 + 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 6b059079f..e6613cda8 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -190,10 +190,10 @@ export default { }, }, showMilitaryZipAlert() { - return ( - this.zipContainsMilitaryBase && - (this.isZipServiceableMobile == null || this.isZipServiceableMobile === true) - ); + const isZipServiceableMobile = + this.isGlassServiceableMobile && this.isRecalibrationServiceableMobile; + + return this.zipContainsMilitaryBase && isZipServiceableMobile; }, }, methods: { diff --git a/src/layouts/service-location/service-type-question/service-type-question.vue b/src/layouts/service-location/service-type-question/service-type-question.vue index b74ad989f..d8ba9e864 100644 --- a/src/layouts/service-location/service-type-question/service-type-question.vue +++ b/src/layouts/service-location/service-type-question/service-type-question.vue @@ -55,8 +55,13 @@ export default { return filteredAnswers; }, serviceability() { - const mobileAvailable = - this.isGlassServiceableMobile && this.isRecalibrationServiceableMobile; + let mobileAvailable; + if (this.IsRecalibrationServiceableMobile == null) { + mobileAvailable = this.isGlassServiceableMobile; + } else { + mobileAvailable = this.isGlassServiceableMobile && this.isRecalibrationServiceableMobile; + } + const inshopAvailable = this.isGlassServiceableInshop && this.isRecalibrationServiceableInshop; @@ -87,6 +92,8 @@ export default { handler(newValue) { if (newValue == "MobileOnly") { this.selectedValues = "Mobile"; + } else { + this.selectedValues = null; } }, }, diff --git a/src/store/index.js b/src/store/index.js index 413d2f8b0..24d9e5b84 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -43,6 +43,7 @@ const getDefaultState = () => { state: null, zipCode: null, zipCodeCtu: null, + serviceType: null, }, customer: { emailAddress: null, From 04854a455cf3fbe1d1d589fe2a1a60f271ce7fc7 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Tue, 28 Mar 2023 08:39:54 -0400 Subject: [PATCH 48/78] WIP --- .../service-type-question/service-type-question.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/layouts/service-location/service-type-question/service-type-question.vue b/src/layouts/service-location/service-type-question/service-type-question.vue index d8ba9e864..4f1a36ac7 100644 --- a/src/layouts/service-location/service-type-question/service-type-question.vue +++ b/src/layouts/service-location/service-type-question/service-type-question.vue @@ -59,7 +59,8 @@ export default { if (this.IsRecalibrationServiceableMobile == null) { mobileAvailable = this.isGlassServiceableMobile; } else { - mobileAvailable = this.isGlassServiceableMobile && this.isRecalibrationServiceableMobile; + mobileAvailable = + this.isGlassServiceableMobile && this.isRecalibrationServiceableMobile; } const inshopAvailable = From 0bde42e0d2cda395b5be2aad279d20cf1763107c Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Tue, 28 Mar 2023 13:20:12 -0400 Subject: [PATCH 49/78] WIP --- src/digital-components/modal/modal.vue | 4 ++-- .../mobile-location-modal-questions.vue | 4 ++++ src/layouts/service-location/service-location.vue | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/digital-components/modal/modal.vue b/src/digital-components/modal/modal.vue index 32a00ad15..ba7e60eb6 100644 --- a/src/digital-components/modal/modal.vue +++ b/src/digital-components/modal/modal.vue @@ -29,7 +29,7 @@ Date: Tue, 28 Mar 2023 13:47:09 -0400 Subject: [PATCH 50/78] Updated existing unit tests --- src/digital-components/modal/modal.spec.js | 4 +- .../mobile-location-modal-questions.spec.js | 14 +++++++ .../service-location/service-location.spec.js | 14 +++++++ .../service-zip-modal-question.spec.js | 14 +++++++ .../modal-button-main.spec.js | 38 +++++++++---------- 5 files changed, 63 insertions(+), 21 deletions(-) diff --git a/src/digital-components/modal/modal.spec.js b/src/digital-components/modal/modal.spec.js index a948fe99a..e4d8692d4 100644 --- a/src/digital-components/modal/modal.spec.js +++ b/src/digital-components/modal/modal.spec.js @@ -92,7 +92,7 @@ describe("modal.vue", () => { wrapper.vm.resetButtonStyle = resetButtonStyle; // Act - const buttonMain = wrapper.findComponent({ ref: "buttonMain" }); + const buttonMain = wrapper.findComponent({ ref: "modalButtonMain" }); await buttonMain.trigger("click-event"); // Assert @@ -124,7 +124,7 @@ describe("modal.vue", () => { wrapper.vm.resetButtonStyle = resetButtonStyle; // Act - const buttonMain = wrapper.findComponent({ ref: "buttonMain" }); + const buttonMain = wrapper.findComponent({ ref: "modalButtonMain" }); await buttonMain.trigger("click-event"); // Assert diff --git a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.spec.js b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.spec.js index fbea693b9..66bd93799 100644 --- a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.spec.js +++ b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.spec.js @@ -110,12 +110,26 @@ const mockGetPricedMobileFeePart = (mockServiceZipCode) => { return Promise.resolve(mobileFeePart); }; +const mockGetServiceabilityDetails = (mockServiceZipCode) => { + const serviceabilityDetails = { + isGlassServiceableInshop: true, + isRecalibrationServiceableInshop: true, + isGlassServiceableMobile: true, + isRecalibrationServiceableMobile: true, + }; + + return Promise.resolve(serviceabilityDetails); +}; + jest.mock( "@/layouts/service-location/helpers/service-location-helper/service-location-helper", () => ({ getPricedMobileFeePart: jest.fn((mockServiceZipCode) => { return mockGetPricedMobileFeePart(mockServiceZipCode); }), + getServiceabilityDetails: jest.fn((mockServiceZipCode) => { + return mockGetServiceabilityDetails(mockServiceZipCode); + }), }) ); diff --git a/src/layouts/service-location/service-location.spec.js b/src/layouts/service-location/service-location.spec.js index b48fa2f06..2a056c4d1 100644 --- a/src/layouts/service-location/service-location.spec.js +++ b/src/layouts/service-location/service-location.spec.js @@ -32,12 +32,26 @@ const mockGetPricedMobileFeePart = (mockServiceZipCode) => { return Promise.resolve(mobileFeePart); }; +const mockGetServiceabilityDetails = (mockServiceZipCode) => { + const serviceabilityDetails = { + isGlassServiceableInshop: true, + isRecalibrationServiceableInshop: true, + isGlassServiceableMobile: true, + isRecalibrationServiceableMobile: true, + }; + + return Promise.resolve(serviceabilityDetails); +}; + jest.mock( "@/layouts/service-location/helpers/service-location-helper/service-location-helper", () => ({ getPricedMobileFeePart: jest.fn((mockServiceZipCode) => { return mockGetPricedMobileFeePart(mockServiceZipCode); }), + getServiceabilityDetails: jest.fn((mockServiceZipCode) => { + return mockGetServiceabilityDetails(mockServiceZipCode); + }), }) ); diff --git a/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.spec.js b/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.spec.js index 407e129cf..6c9cf42f5 100644 --- a/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.spec.js +++ b/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.spec.js @@ -33,12 +33,26 @@ const mockGetPricedMobileFeePart = (mockServiceZipCode) => { return Promise.resolve(mobileFeePart); }; +const mockGetServiceabilityDetails = (mockServiceZipCode) => { + const serviceabilityDetails = { + isGlassServiceableInshop: true, + isRecalibrationServiceableInshop: true, + isGlassServiceableMobile: true, + isRecalibrationServiceableMobile: true, + }; + + return Promise.resolve(serviceabilityDetails); +}; + jest.mock( "@/layouts/service-location/helpers/service-location-helper/service-location-helper", () => ({ getPricedMobileFeePart: jest.fn((mockServiceZipCode) => { return mockGetPricedMobileFeePart(mockServiceZipCode); }), + getServiceabilityDetails: jest.fn((mockServiceZipCode) => { + return mockGetServiceabilityDetails(mockServiceZipCode); + }), }) ); diff --git a/src/ux-components/modal-button-main/modal-button-main.spec.js b/src/ux-components/modal-button-main/modal-button-main.spec.js index 41e244a72..bd3587f22 100644 --- a/src/ux-components/modal-button-main/modal-button-main.spec.js +++ b/src/ux-components/modal-button-main/modal-button-main.spec.js @@ -1,21 +1,21 @@ import { shallowMount } from "@vue/test-utils"; -import buttonMain from "./button-main"; +import modalButtonMain from "./modal-button-main"; import { getMountOptions } from "@/helpers/unit-test-helper.js"; import { nextTick } from "vue"; -describe("buttonMain.vue", () => { +describe("modal-button-main.vue", () => { it("Should return btn-primary class", () => { // Arrange/Act const wrapper = shallowMount( - buttonMain, + modalButtonMain, setupMocks({ - props: { + propsData: { isPrimary: true, }, }) ); const button = wrapper.find("button"); - + // Assert expect(button.attributes("class")).toContain("btn-primary"); }); @@ -23,9 +23,9 @@ describe("buttonMain.vue", () => { it("Should return aria-disabled state", () => { // Arrange/Act const wrapper = shallowMount( - buttonMain, + modalButtonMain, setupMocks({ - props: { + propsData: { isDisabled: true, }, }) @@ -39,9 +39,9 @@ describe("buttonMain.vue", () => { it("Should return loader color", async () => { // Arrange const wrapper = shallowMount( - buttonMain, + modalButtonMain, setupMocks({ - props: { + propsData: { loaderColor: "blue", loaderEnabled: true, }, @@ -60,9 +60,9 @@ describe("buttonMain.vue", () => { it("Should return loader position", async () => { // Arrange const wrapper = shallowMount( - buttonMain, + modalButtonMain, setupMocks({ - props: { + propsData: { loaderPosition: "right", loaderEnabled: true, }, @@ -81,9 +81,9 @@ describe("buttonMain.vue", () => { it("Should set 'isLoaderDisplayed' to false when calling 'removeLoader'", async () => { // Arrange const wrapper = shallowMount( - buttonMain, + modalButtonMain, setupMocks({ - props: { + propsData: { loaderPosition: "right", loaderEnabled: true, }, @@ -106,9 +106,9 @@ describe("buttonMain.vue", () => { it("Should set 'isLoaderDisplayed' to false when calling 'resetButtonStyle'", async () => { // Arrange const wrapper = shallowMount( - buttonMain, + modalButtonMain, setupMocks({ - props: { + propsData: { loaderPosition: "right", loaderEnabled: true, }, @@ -130,9 +130,9 @@ describe("buttonMain.vue", () => { it("Should emit 'click-event' event when clicking if the button is enabled", async () => { // Arrange const wrapper = shallowMount( - buttonMain, + modalButtonMain, setupMocks({ - props: { + propsData: { loaderPosition: "right", loaderEnabled: true, isDisabled: false, @@ -154,9 +154,9 @@ describe("buttonMain.vue", () => { it("Should not emit 'click-event' event when clicking if the button is disabled", async () => { // Arrange const wrapper = shallowMount( - buttonMain, + modalButtonMain, setupMocks({ - props: { + propsData: { loaderPosition: "right", loaderEnabled: true, isDisabled: true, From 1639045d748524cf8ce9f0b7add773d8cae741a0 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Wed, 29 Mar 2023 07:46:42 -0400 Subject: [PATCH 51/78] Unit tests completed --- .../service-type-question.spec.js | 186 +++++++++++++++++- .../modal-button-main.spec.js | 2 +- 2 files changed, 186 insertions(+), 2 deletions(-) diff --git a/src/layouts/service-location/service-type-question/service-type-question.spec.js b/src/layouts/service-location/service-type-question/service-type-question.spec.js index 3d0843e10..13b727c54 100644 --- a/src/layouts/service-location/service-type-question/service-type-question.spec.js +++ b/src/layouts/service-location/service-type-question/service-type-question.spec.js @@ -1 +1,185 @@ -test.todo("some test to be written in the future"); +import { shallowMount } from "@vue/test-utils"; +import { getMountOptions } from "@/helpers/unit-test-helper.js"; +import serviceTypeQuestion from "./service-type-question"; + +const mockCmsContent = { + QuestionText: "Choose a service option:", + Answers: [ + { + AnswerImageUrl: "", + Name: "Mobile", + SubText: "", + SubWidgetName: "", + Text: "Mobile", + }, + { + AnswerImageUrl: "", + Name: "Inshop", + SubText: "", + SubWidgetName: "", + Text: "In-shop", + }, + { + AnswerImageUrl: "", + Name: "DropOff", + SubText: "", + SubWidgetName: "", + Text: "Drop-off", + }, + ], +}; + +const cmsWidgetName = "ServiceTypeQuestionWidget"; +const mockMixin = { + methods: { + getCmsContent: jest.fn((widgetName, cmsFieldName) => { + if (widgetName === cmsWidgetName) { + return mockCmsContent[cmsFieldName]; + } + + return null; + }), + }, +}; + +describe("service-type-question.vue", () => { + it("Should display all options if both in-shop and mobile are available", async () => { + // Arrange/Act + const { wrapper } = setupMocks({ + mixins: [mockMixin], + props: { + cmsWidgetName: cmsWidgetName, + isGlassServiceableInshop: true, + isRecalibrationServiceableInshop: true, + isGlassServiceableMobile: true, + isRecalibrationServiceableMobile: true, + }, + mountOptions: { + attachTo: document.body, + }, + }); + + // Assert + expect(wrapper.vm.answersToDisplay).toEqual([ + { + AnswerImageUrl: "", + Name: "Mobile", + SubText: "", + SubWidgetName: "", + Text: "Mobile", + }, + { + AnswerImageUrl: "", + Name: "Inshop", + SubText: "", + SubWidgetName: "", + Text: "In-shop", + }, + { + AnswerImageUrl: "", + Name: "DropOff", + SubText: "", + SubWidgetName: "", + Text: "Drop-off", + }, + ]); + }); + + it("Should display only the In-Shop and Drop-Off answers when only in-shop service is available", async () => { + // Arrange/Act + const { wrapper } = setupMocks({ + mixins: [mockMixin], + props: { + cmsWidgetName: cmsWidgetName, + isGlassServiceableInshop: true, + isRecalibrationServiceableInshop: true, + isGlassServiceableMobile: false, + isRecalibrationServiceableMobile: false, + }, + mountOptions: { + attachTo: document.body, + }, + }); + + // Assert + expect(wrapper.vm.answersToDisplay).toEqual([ + { + AnswerImageUrl: "", + Name: "Inshop", + SubText: "", + SubWidgetName: "", + Text: "In-shop", + }, + { + AnswerImageUrl: "", + Name: "DropOff", + SubText: "", + SubWidgetName: "", + Text: "Drop-off", + }, + ]); + }); + + it("Should display only the Mobile answer when only mobile service is available", async () => { + // Arrange/Act + const { wrapper } = setupMocks({ + mixins: [mockMixin], + props: { + cmsWidgetName: cmsWidgetName, + isGlassServiceableInshop: false, + isRecalibrationServiceableInshop: false, + isGlassServiceableMobile: true, + isRecalibrationServiceableMobile: true, + }, + mountOptions: { + attachTo: document.body, + }, + }); + + // Assert + expect(wrapper.vm.answersToDisplay).toEqual([ + { + AnswerImageUrl: "", + Name: "Mobile", + SubText: "", + SubWidgetName: "", + Text: "Mobile", + }, + ]); + }); + + it("Should display no answers if neither in-shop nor mobile service are available", async () => { + // Arrange/Act + const { wrapper } = setupMocks({ + mixins: [mockMixin], + props: { + cmsWidgetName: cmsWidgetName, + isGlassServiceableInshop: false, + isRecalibrationServiceableInshop: false, + isGlassServiceableMobile: false, + isRecalibrationServiceableMobile: false, + }, + mountOptions: { + attachTo: document.body, + }, + }); + + // Assert + expect(wrapper.vm.answersToDisplay).toEqual([]); + }); +}); + +function setupMocks({ mountOptions, mixins, props, isShallowMount = true }) { + const resultingMountOptions = getMountOptions({ + ...mountOptions, + mixins, + }); + + if (props) resultingMountOptions.propsData = props; + + const wrapper = isShallowMount + ? shallowMount(serviceTypeQuestion, resultingMountOptions) + : mount(serviceTypeQuestion, resultingMountOptions); + + return { wrapper }; +} diff --git a/src/ux-components/modal-button-main/modal-button-main.spec.js b/src/ux-components/modal-button-main/modal-button-main.spec.js index bd3587f22..f212d8ec3 100644 --- a/src/ux-components/modal-button-main/modal-button-main.spec.js +++ b/src/ux-components/modal-button-main/modal-button-main.spec.js @@ -15,7 +15,7 @@ describe("modal-button-main.vue", () => { }) ); const button = wrapper.find("button"); - + // Assert expect(button.attributes("class")).toContain("btn-primary"); }); From 67154e9192c1e5c4704eb23cdfa9afe622078351 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Wed, 29 Mar 2023 09:21:02 -0400 Subject: [PATCH 52/78] WIP --- .../service-location/service-location.vue | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index d8167ad57..d4f632374 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -16,7 +16,12 @@ + Date: Wed, 29 Mar 2023 13:05:38 -0400 Subject: [PATCH 53/78] Restored Mocky endpoints while we're waiting for CSR-1104 to be 100% completed --- src/store/index.js | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index 24d9e5b84..7b6b64283 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -928,13 +928,23 @@ export const actions = { }, getServiceabilityDetails(context, { serviceZipCode }) { - const lineItems = context.getters.order.lineItems; - const lineItemsToSend = [...lineItems.supportingItems]; - const encodedLineItems = encodeURIComponent(JSON.stringify(lineItemsToSend)); - return globalMethods.callHttpClient({ + return globalMethods.callMockHttpClient({ method: endpoints.GetServiceabilityDetails.method, - endpoint: `${endpoints.GetServiceabilityDetails.url}?zip=${serviceZipCode}&lineItems=${encodedLineItems}`, + //TODO: Remove Mocky Endpoints + //endpoint: "https://run.mocky.io/v3/59e1a644-cf16-4f08-8069-1ab2a1e38f79", // NoShopsAvailable + //endpoint: "https://run.mocky.io/v3/4fe1fb89-dd56-4e4a-9af2-96bd1ab77847", // ForcedInshop + //endpoint: "https://run.mocky.io/v3/e2eaa097-6ea5-4906-af53-901edaa94939", // ForcedMobile + endpoint: "https://run.mocky.io/v3/1811a1fe-12a7-48f3-939e-d10a9b77dd25", // All Options }); + + // TODO: Restore this when CSR-1104 is 100% complete + // const lineItems = context.getters.order.lineItems; + // const lineItemsToSend = [...lineItems.supportingItems]; + // const encodedLineItems = encodeURIComponent(JSON.stringify(lineItemsToSend)); + // return globalMethods.callHttpClient({ + // method: endpoints.GetServiceabilityDetails.method, + // endpoint: `${endpoints.GetServiceabilityDetails.url}?zip=${serviceZipCode}&lineItems=${encodedLineItems}`, + // }); }, getSupportingItems(context) { From 23d433931d792184a984a2b9029d6818ed364021 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Wed, 29 Mar 2023 15:34:52 -0400 Subject: [PATCH 54/78] Pull serviceability logic up to service-location page. --- .../service-location/service-location.vue | 28 +++++++---- .../service-type-question.vue | 46 +++++-------------- 2 files changed, 31 insertions(+), 43 deletions(-) diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index d8167ad57..2b166e830 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -20,10 +20,8 @@ alertClass="alert-warning" /> answer.Name == "Mobile"); - } else if (this.serviceability == "InshopOnly") { + } else if (this.isServiceableInshop) { filteredAnswers = this.answersFromCms.filter( (answer) => answer.Name == "Inshop" || answer.Name == "DropOff" ); - } else if (this.serviceability == "None") { + } else { filteredAnswers = []; } return filteredAnswers; }, - serviceability() { - let mobileAvailable; - if (this.IsRecalibrationServiceableMobile == null) { - mobileAvailable = this.isGlassServiceableMobile; - } else { - mobileAvailable = - this.isGlassServiceableMobile && this.isRecalibrationServiceableMobile; - } - - const inshopAvailable = - this.isGlassServiceableInshop && this.isRecalibrationServiceableInshop; - - let result; - if (inshopAvailable && mobileAvailable) { - result = "All"; - } else if (inshopAvailable && !mobileAvailable) { - result = "InshopOnly"; - } else if (!inshopAvailable && mobileAvailable) { - result = "MobileOnly"; - } else if (!inshopAvailable && !mobileAvailable) { - result = "None"; - } - - return result; - }, selectedValues: { get: function () { return this.modelValue; @@ -87,11 +60,14 @@ export default { this.$emit("update:modelValue", newValue); }, }, + isMobileOnly() { + return this.isServiceableMobile && !this.isServiceableInshop; + }, }, watch: { - serviceability: { + isMobileOnly: { handler(newValue) { - if (newValue == "MobileOnly") { + if (newValue) { this.selectedValues = "Mobile"; } else { this.selectedValues = null; From e244e264199f82431ea407f7dce591ad4b6e550b Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Wed, 29 Mar 2023 15:43:56 -0400 Subject: [PATCH 55/78] Added non-cms version of the alert --- src/layouts/service-location/service-location.vue | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 2b166e830..256ce6bc1 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -18,6 +18,12 @@ cmsWidgetName="AlertMilitaryBaseZipWidget" v-if="showMilitaryZipAlert" alertClass="alert-warning" /> + Date: Wed, 29 Mar 2023 15:53:16 -0400 Subject: [PATCH 56/78] Update to proper cms widget. --- src/layouts/service-location/service-location.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 256ce6bc1..774aafd87 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -20,8 +20,7 @@ alertClass="alert-warning" /> Date: Wed, 29 Mar 2023 16:50:46 -0400 Subject: [PATCH 57/78] Update tests based on changes to logic. --- .../service-type-question.spec.js | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/src/layouts/service-location/service-type-question/service-type-question.spec.js b/src/layouts/service-location/service-type-question/service-type-question.spec.js index 13b727c54..f4f48a77d 100644 --- a/src/layouts/service-location/service-type-question/service-type-question.spec.js +++ b/src/layouts/service-location/service-type-question/service-type-question.spec.js @@ -49,10 +49,8 @@ describe("service-type-question.vue", () => { mixins: [mockMixin], props: { cmsWidgetName: cmsWidgetName, - isGlassServiceableInshop: true, - isRecalibrationServiceableInshop: true, - isGlassServiceableMobile: true, - isRecalibrationServiceableMobile: true, + isServiceableInshop: true, + isServiceableMobile: true, }, mountOptions: { attachTo: document.body, @@ -91,10 +89,8 @@ describe("service-type-question.vue", () => { mixins: [mockMixin], props: { cmsWidgetName: cmsWidgetName, - isGlassServiceableInshop: true, - isRecalibrationServiceableInshop: true, - isGlassServiceableMobile: false, - isRecalibrationServiceableMobile: false, + isServiceableInshop: true, + isServiceableMobile: false, }, mountOptions: { attachTo: document.body, @@ -126,10 +122,8 @@ describe("service-type-question.vue", () => { mixins: [mockMixin], props: { cmsWidgetName: cmsWidgetName, - isGlassServiceableInshop: false, - isRecalibrationServiceableInshop: false, - isGlassServiceableMobile: true, - isRecalibrationServiceableMobile: true, + isServiceableInshop: false, + isServiceableMobile: true, }, mountOptions: { attachTo: document.body, @@ -154,10 +148,8 @@ describe("service-type-question.vue", () => { mixins: [mockMixin], props: { cmsWidgetName: cmsWidgetName, - isGlassServiceableInshop: false, - isRecalibrationServiceableInshop: false, - isGlassServiceableMobile: false, - isRecalibrationServiceableMobile: false, + isServiceableInshop: false, + isServiceableMobile: false, }, mountOptions: { attachTo: document.body, From 67e67a1ff945f713a392be4742ec33efdc37e6ee Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Thu, 30 Mar 2023 08:04:39 -0400 Subject: [PATCH 58/78] Tech review changes --- src/digital-components/modal/modal.vue | 2 +- .../modal-button-main.spec.js | 0 .../modal-button-main/modal-button-main.vue | 0 .../address-questions/address-questions.vue | 3 ++ .../appointment-type-question.spec.js} | 10 +++---- .../appointment-type-question.vue} | 4 +-- .../mobile-location-modal-questions.vue | 2 +- .../service-location/service-location.vue | 30 +++++++++++-------- src/store/index.js | 9 ------ 9 files changed, 30 insertions(+), 30 deletions(-) rename src/{ => digital-components/modal}/ux-components/modal-button-main/modal-button-main.spec.js (100%) rename src/{ => digital-components/modal}/ux-components/modal-button-main/modal-button-main.vue (100%) rename src/layouts/service-location/{service-type-question/service-type-question.spec.js => appointment-type-question/appointment-type-question.spec.js} (94%) rename src/layouts/service-location/{service-type-question/service-type-question.vue => appointment-type-question/appointment-type-question.vue} (97%) diff --git a/src/digital-components/modal/modal.vue b/src/digital-components/modal/modal.vue index ba7e60eb6..3bd0721f2 100644 --- a/src/digital-components/modal/modal.vue +++ b/src/digital-components/modal/modal.vue @@ -41,7 +41,7 @@ diff --git a/src/store/index.js b/src/store/index.js index 2dbc7b2cc..abcf231f0 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -931,8 +931,8 @@ export const actions = { return globalMethods.callMockHttpClient({ method: endpoints.GetServiceabilityDetails.method, //TODO: Remove Mocky Endpoints - endpoint: "https://run.mocky.io/v3/59e1a644-cf16-4f08-8069-1ab2a1e38f79", // NoShopsAvailable - //endpoint: "https://run.mocky.io/v3/4fe1fb89-dd56-4e4a-9af2-96bd1ab77847", // ForcedInshop + //endpoint: "https://run.mocky.io/v3/59e1a644-cf16-4f08-8069-1ab2a1e38f79", // NoShopsAvailable + endpoint: "https://run.mocky.io/v3/4fe1fb89-dd56-4e4a-9af2-96bd1ab77847", // ForcedInshop //endpoint: "https://run.mocky.io/v3/e2eaa097-6ea5-4906-af53-901edaa94939", // ForcedMobile //endpoint: "https://run.mocky.io/v3/1811a1fe-12a7-48f3-939e-d10a9b77dd25", // All Options }); From 40bc9b9a75321b32f81b805b6abad5e9f5bb551d Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Fri, 31 Mar 2023 10:31:25 -0400 Subject: [PATCH 69/78] Completed unit tests --- .../service-location/service-location.spec.js | 79 +++++++++++++++++++ .../service-location/service-location.vue | 11 ++- src/store/index.js | 4 +- 3 files changed, 89 insertions(+), 5 deletions(-) diff --git a/src/layouts/service-location/service-location.spec.js b/src/layouts/service-location/service-location.spec.js index b0a06b16f..1cea19cb9 100644 --- a/src/layouts/service-location/service-location.spec.js +++ b/src/layouts/service-location/service-location.spec.js @@ -323,6 +323,30 @@ describe("service-location.vue", () => { expect(wrapper.vm.mobileLocationQuestions).toStrictEqual(newMobileLocationQuestions); }); + test("resets appointment type selection when service zip code is updated by service zip modal", () => { + // Arrange + const { wrapper } = setupMocks({}); + wrapper.vm.$refs.mobileLocationModalQuestions.resetComponent = jest.fn(); + wrapper.vm.$refs.serviceZipCodeQuestion.resetMobileFeePart = jest.fn(); + + const newServiceZipCodeQuestion = { + zipCode: "61606", + state: "IL", + }; + + wrapper.vm.selectedAppointmentType = "Inshop"; + + const serviceZipCodeComponent = wrapper.findComponent({ + ref: "serviceZipCodeQuestion", + }); + + // Act + serviceZipCodeComponent.vm.$emit("update:modelValue", newServiceZipCodeQuestion); + + // Assert + expect(wrapper.vm.selectedAppointmentType).toStrictEqual(null); + }); + test("displays military zip message when zip is updated", () => { // Arrange const { wrapper } = setupMocks({}); @@ -437,6 +461,61 @@ describe("service-location.vue", () => { // Assert expect(wrapper.vm.serviceZipCodeQuestion).toStrictEqual(newServiceZipCodeInfo); }); + + test("resets appointment type selection when service zip code is updated by mobile location modal when Mobile is not selected", () => { + // Arrange + const { wrapper } = setupMocks({}); + wrapper.vm.$refs.mobileLocationModalQuestions.resetComponent = jest.fn(); + wrapper.vm.$refs.serviceZipCodeQuestion.resetMobileFeePart = jest.fn(); + + const newServiceZipCodeQuestion = { + zipCode: "61606", + state: "IL", + }; + + wrapper.vm.selectedAppointmentType = "Dropoff"; + + const serviceZipCodeComponent = wrapper.findComponent({ + ref: "serviceZipCodeQuestion", + }); + + // Act + serviceZipCodeComponent.vm.$emit("update:modelValue", newServiceZipCodeQuestion); + + // Assert + expect(wrapper.vm.selectedAppointmentType).toStrictEqual(null); + }); + + test("does not reset appointment type selection when service zip code is updated by mobile location modal when Mobile is selected", () => { + // Arrange + const { wrapper } = setupMocks({}); + const appointmentTypeMobile = "Mobile"; + wrapper.vm.$refs.mobileLocationModalQuestions.resetComponent = jest.fn(); + wrapper.vm.$refs.serviceZipCodeQuestion.resetMobileFeePart = jest.fn(); + + const mobileLocationQuestions = { + addressQuestions: { + streetAddress: "555 Some Street", + apartmentNumberOrBusinessName: "", + city: "Westerville", + state: "OH", + zipCode: "43081", + }, + isVehicleProtected: "YesAnswer", + }; + + wrapper.vm.selectedAppointmentType = "Mobile"; + + const mobileLocationComponent = wrapper.findComponent({ + ref: "mobileLocationModalQuestions", + }); + + // Act + mobileLocationComponent.vm.$emit("update:modelValue", mobileLocationQuestions); + + // Assert + expect(wrapper.vm.selectedAppointmentType).toStrictEqual(appointmentTypeMobile); + }); }); describe("serviceability logic", () => { diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 69b4f4926..49572dbda 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -169,6 +169,7 @@ export default { set: function (newValue) { if (newValue.zipCode !== this.zipCode) { this.resetMobileLocation(); + this.selectedAppointmentType = null; } this.state = newValue.state; @@ -198,11 +199,12 @@ export default { this.isVehicleProtected = newValue.isVehicleProtected; this.mobileLocationValidationField = "isValid"; + + if ((newValue.zipCode !== this.zipCode) && !this.selectedAppointmentType == "Mobile") { + this.selectedAppointmentType = null; + } }, }, - displayMilitaryZipAlert() { - return this.zipContainsMilitaryBase && this.isServiceableMobile; - }, isServiceableMobile() { if (this.isRecalibrationServiceableMobile !== null) { return this.isGlassServiceableMobile && this.isRecalibrationServiceableMobile; @@ -217,6 +219,9 @@ export default { return this.isGlassServiceableInshop; } }, + displayMilitaryZipAlert() { + return this.zipContainsMilitaryBase && this.isServiceableMobile; + }, displayServiceableMobileOnly() { return this.isServiceableMobile && !this.isServiceableInshop; }, diff --git a/src/store/index.js b/src/store/index.js index 2dbc7b2cc..6da7550a2 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -931,10 +931,10 @@ export const actions = { return globalMethods.callMockHttpClient({ method: endpoints.GetServiceabilityDetails.method, //TODO: Remove Mocky Endpoints - endpoint: "https://run.mocky.io/v3/59e1a644-cf16-4f08-8069-1ab2a1e38f79", // NoShopsAvailable + //endpoint: "https://run.mocky.io/v3/59e1a644-cf16-4f08-8069-1ab2a1e38f79", // NoShopsAvailable //endpoint: "https://run.mocky.io/v3/4fe1fb89-dd56-4e4a-9af2-96bd1ab77847", // ForcedInshop //endpoint: "https://run.mocky.io/v3/e2eaa097-6ea5-4906-af53-901edaa94939", // ForcedMobile - //endpoint: "https://run.mocky.io/v3/1811a1fe-12a7-48f3-939e-d10a9b77dd25", // All Options + endpoint: "https://run.mocky.io/v3/1811a1fe-12a7-48f3-939e-d10a9b77dd25", // All Options }); // TODO: Restore this when CSR-1104 is 100% complete From b06ee56d27661752574d5c4f6ba6405e2cfc19bf Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Fri, 31 Mar 2023 13:41:46 -0400 Subject: [PATCH 70/78] Prettified --- src/layouts/service-location/service-location.spec.js | 8 ++++---- src/layouts/service-location/service-location.vue | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/layouts/service-location/service-location.spec.js b/src/layouts/service-location/service-location.spec.js index 1cea19cb9..28a8ca473 100644 --- a/src/layouts/service-location/service-location.spec.js +++ b/src/layouts/service-location/service-location.spec.js @@ -345,7 +345,7 @@ describe("service-location.vue", () => { // Assert expect(wrapper.vm.selectedAppointmentType).toStrictEqual(null); - }); + }); test("displays military zip message when zip is updated", () => { // Arrange @@ -461,7 +461,7 @@ describe("service-location.vue", () => { // Assert expect(wrapper.vm.serviceZipCodeQuestion).toStrictEqual(newServiceZipCodeInfo); }); - + test("resets appointment type selection when service zip code is updated by mobile location modal when Mobile is not selected", () => { // Arrange const { wrapper } = setupMocks({}); @@ -485,7 +485,7 @@ describe("service-location.vue", () => { // Assert expect(wrapper.vm.selectedAppointmentType).toStrictEqual(null); }); - + test("does not reset appointment type selection when service zip code is updated by mobile location modal when Mobile is selected", () => { // Arrange const { wrapper } = setupMocks({}); @@ -515,7 +515,7 @@ describe("service-location.vue", () => { // Assert expect(wrapper.vm.selectedAppointmentType).toStrictEqual(appointmentTypeMobile); - }); + }); }); describe("serviceability logic", () => { diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 49572dbda..ac1334fcb 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -200,7 +200,10 @@ export default { this.mobileLocationValidationField = "isValid"; - if ((newValue.zipCode !== this.zipCode) && !this.selectedAppointmentType == "Mobile") { + if ( + newValue.zipCode !== this.zipCode && + !this.selectedAppointmentType == "Mobile" + ) { this.selectedAppointmentType = null; } }, From 8daa078c299967c324a0dac4fc2abfd1185b600a Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Tue, 4 Apr 2023 15:11:38 -0400 Subject: [PATCH 71/78] Add text link rendering to alert + hook into opening modal. --- .../service-location/service-location.vue | 6 ++++- src/ux-components/alert/alert.vue | 23 ++++++++++++++++--- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 6c8ef58d1..846a1731e 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -30,6 +30,7 @@ class="my-4" cmsWidgetName="AlertRecalNoMobileWidget" v-if="displayRecalibrationWarning" + @text-link-clicked="openModalAction" alertClass="alert-warning" />

@@ -40,11 +51,13 @@ From f87a64380bd85d3ca58ecbb849dcaa6e7d3b720c Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Tue, 4 Apr 2023 16:38:49 -0400 Subject: [PATCH 72/78] Add recalibration-checking logic. --- src/layouts/service-location/service-location.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 846a1731e..577120c85 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -232,9 +232,13 @@ export default { return this.isGlassServiceableInshop; } }, + isDualOrStaticRecalibration() { + const supportingItems = store.getters.lineItems.supportingItems; + + return supportingItems.some((item) => item.partNumber === "RECAL STATIC" || item.partNumber === "RECAL DUAL"); + }, displayRecalibrationWarning() { - //TODO: Check lineItems for static or dual recalibration. - return true; + return this.isDualOrStaticRecalibration; }, displayServiceableInshopOnly() { return ( From 572831254d60ee1e3a0bb7c245971f1fade06409 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Wed, 5 Apr 2023 08:57:01 -0400 Subject: [PATCH 73/78] Formatting --- src/layouts/service-location/service-location.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 577120c85..800f7ee52 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -234,8 +234,10 @@ export default { }, isDualOrStaticRecalibration() { const supportingItems = store.getters.lineItems.supportingItems; - - return supportingItems.some((item) => item.partNumber === "RECAL STATIC" || item.partNumber === "RECAL DUAL"); + + return supportingItems.some( + (item) => item.partNumber === "RECAL STATIC" || item.partNumber === "RECAL DUAL" + ); }, displayRecalibrationWarning() { return this.isDualOrStaticRecalibration; From fb0280fa1820e25a3c651a4f4e09dda54036073a Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Wed, 5 Apr 2023 10:56:34 -0400 Subject: [PATCH 74/78] CSR-1129: create schedule page, put date picker on it --- jest.config.js | 3 +- src/constants/error-messages.js | 1 + .../date-picker/date-picker.vue | 473 +++++++++--------- src/router/index.js | 1 - src/router/router-constants/fmgPage-values.js | 1 + .../router-constants/navigation-scenarios.js | 3 + src/router/router-constants/routing-table.js | 13 + 7 files changed, 260 insertions(+), 235 deletions(-) diff --git a/jest.config.js b/jest.config.js index ceeb6f781..3186939df 100644 --- a/jest.config.js +++ b/jest.config.js @@ -15,9 +15,10 @@ module.exports = { "!src/layouts/vehicle-damage/windshield-options/windshield-options.vue", "!src/layouts/reveal/**/*.vue", "!src/ux-components/text-link/**/*.vue", - "!src/common-components/date-picker/**/*.vue", // Temp until unit tests completed + "!src/common-components/date-picker/**/*.vue", // git statuTemp until unit tests completed "!src/layouts/vin-lookup/**/*.vue", //Temporary for Quote page testing "!src/common-components/funnel-header/menu-modal/**/*.vue", + "!src/layouts/schedule/*.vue", // Temp test exclusion while in development // END ], // ! means exclude from coverage. testMatch: ["**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)"], diff --git a/src/constants/error-messages.js b/src/constants/error-messages.js index 3c3f776c1..810929d20 100644 --- a/src/constants/error-messages.js +++ b/src/constants/error-messages.js @@ -26,6 +26,7 @@ const errorMessages = { OPTION_REQUIRED: "Please select an option", VEHICLE_REQUIRED: "Please select a vehicle", MOBILE_LOCATION_REQUIRED: "Please enter your service address", + DATE_REQUIRED: "Please select a date", }; export { errorMessages }; diff --git a/src/digital-components/date-picker/date-picker.vue b/src/digital-components/date-picker/date-picker.vue index e3b5ff5d1..813708b66 100644 --- a/src/digital-components/date-picker/date-picker.vue +++ b/src/digital-components/date-picker/date-picker.vue @@ -1,5 +1,5 @@