From 0d06ce769f35a544a87f68aafcee44a6d9988695 Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Mon, 22 May 2023 14:57:11 -0400 Subject: [PATCH 01/10] tech review updates --- .../location-alerts/location-alerts.vue | 53 +++++++++++++++++ src/layouts/schedule/schedule.vue | 58 +++---------------- 2 files changed, 62 insertions(+), 49 deletions(-) create mode 100644 src/layouts/schedule/location-alerts/location-alerts.vue diff --git a/src/layouts/schedule/location-alerts/location-alerts.vue b/src/layouts/schedule/location-alerts/location-alerts.vue new file mode 100644 index 000000000..0f8c7b46d --- /dev/null +++ b/src/layouts/schedule/location-alerts/location-alerts.vue @@ -0,0 +1,53 @@ + + diff --git a/src/layouts/schedule/schedule.vue b/src/layouts/schedule/schedule.vue index 60fb90b75..ea782999d 100644 --- a/src/layouts/schedule/schedule.vue +++ b/src/layouts/schedule/schedule.vue @@ -18,17 +18,9 @@ - - + // Components -import alert from "@/ux-components/alert/alert"; 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 datePicker from "@/digital-components/date-picker/date-picker"; +import locationAlerts from "@/layouts/schedule/location-alerts/location-alerts"; import timeSlotModalQuestion from "./time-slot-modal-question/time-slot-modal-question"; // Supporting files @@ -77,7 +69,6 @@ import baseMixin from "@/mixins/base-mixin.js"; import { storeActions } from "@/constants/store-actions"; import { settleAllPromises } from "@/helpers/layout-helper"; import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper"; -import { getAlertReasons } from "@/layouts/schedule/helpers/schedule-helper"; import { doesCopyContainRouterLink, splitCopyOnCMSPlaceHolder, @@ -125,7 +116,6 @@ export default { selectedDate: null, selectedTimeSlotId: null, selectableDatesData: [], - weatherAlerts: [], mobileEarlyBirdFee: null, }; }, @@ -167,7 +157,9 @@ export default { const earlyBirdPromise = baseMixin.methods.dispatchStoreAction( storeActions.GET_MOBILE_EARLY_BIRD_FEE ); - const alertReasonsPromise = getAlertReasons(store.getters.order.serviceLocation.zipCodeCtu); + const alertReasonsPromise = locationAlerts.methods.loadInitialData( + store.getters.order.serviceLocation.zipCodeCtu + ); // Settle promises and get results const promiseResultMap = [ @@ -198,8 +190,8 @@ export default { // Call the "next" function to complete the transition to this page. next((vm) => { vm.setCmsContent(resultMap.cmsContent); - vm.setData(resultMap.alertReasons); vm.$refs.datePicker.initializeComponent(resultMap.datePickerInitialData); + vm.$refs.locationAlerts.initializeComponent(resultMap.alertReasons); vm.selectableDatesData = resultMap.datePickerInitialData.initialShopTimeSlotsResponse; if (resultMap.earlyBird) { vm.mobileEarlyBirdFee = resultMap.pricingResults[0]; @@ -214,9 +206,6 @@ export default { // Splits content when brackets are found in text so that text can be looped through and router-link can be injected when needed return this.splitCopyOnCMSPlaceHolder(this.ChangeShopLinkText); }, - displayWeatherAlert() { - return this.weatherAlerts.length > 0; - }, appointmentType() { return this.$store.getters.order.serviceLocation.appointmentType; }, @@ -268,34 +257,6 @@ export default { ); return newShopTimeSlots; }, - setData(alertReasonsData) { - if (alertReasonsData) { - this.convertReasonsToCmsAlerts(alertReasonsData); - } - }, - cmsHeadlineTextFound(widgetName) { - return this.getCmsContent(widgetName, "HeadlineText") !== ""; - }, - convertReasonsToCmsAlerts(data) { - this.weatherAlerts = data.reduce((newObj, alert) => { - newObj.push({ - cmsWidgetName: `LocationAlert-${alert}`, - alertReason: alert, - }); - return newObj; - }, []); - }, - async getWeatherAlertReasons(ctu) { - await getAlertReasons(ctu) - .then((response) => { - if (response.data) { - this.convertReasonsToCmsAlerts(response.data); - } - }) - .catch(() => { - console.log("error fetching alert reasons.."); - }); - }, getServiceZipCtuCodeFromStore() { return store.getters.order.serviceLocation.zipCodeCtu; }, @@ -342,15 +303,14 @@ export default { }, }, components: { - alert, funnelHeader, funnelFooter, funnelSubHeader, Form, loadingModal, datePicker, + locationAlerts, timeSlotModalQuestion, }, - mounted() {}, }; From eac83dcfb07be17dde9b1d8b78de6fa66de1bf0b Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Mon, 22 May 2023 15:01:24 -0400 Subject: [PATCH 02/10] prettier --- src/layouts/schedule/schedule.vue | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/layouts/schedule/schedule.vue b/src/layouts/schedule/schedule.vue index ea782999d..d5e3b4c28 100644 --- a/src/layouts/schedule/schedule.vue +++ b/src/layouts/schedule/schedule.vue @@ -18,9 +18,7 @@ - + Date: Tue, 23 May 2023 09:01:04 -0400 Subject: [PATCH 03/10] Bryan pointed out I was diplaying the streetAddress where the city should be --- src/layouts/service-location/shop-question/shop-question.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layouts/service-location/shop-question/shop-question.vue b/src/layouts/service-location/shop-question/shop-question.vue index fffb36c49..3183cbc9e 100644 --- a/src/layouts/service-location/shop-question/shop-question.vue +++ b/src/layouts/service-location/shop-question/shop-question.vue @@ -143,7 +143,7 @@ export default { const distanceInMiles = Math.round(shopProvider.distanceInMiles * 2) / 2; return { - buttonLabel: streetAddress, + buttonLabel: city, buttonLabelSubCopy: `${distanceInMiles} mi`, buttonBodyCopy: `${streetAddress}, ${city}, ${state} ${zipCode}`, value: shopProvider.providerNumber, From b3813eedb150e1e71536efbc8bdec37ceec92af7 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Tue, 23 May 2023 09:09:54 -0400 Subject: [PATCH 04/10] Revert CSR-1367 --- .../text-block/text-block.vue | 9 +- src/layouts/review/review.spec.js | 3 - src/layouts/review/review.vue | 102 ------------------ src/router/index.js | 6 -- 4 files changed, 2 insertions(+), 118 deletions(-) delete mode 100644 src/layouts/review/review.spec.js delete mode 100644 src/layouts/review/review.vue diff --git a/src/digital-components/text-block/text-block.vue b/src/digital-components/text-block/text-block.vue index 3a608f3a0..4f9c41599 100644 --- a/src/digital-components/text-block/text-block.vue +++ b/src/digital-components/text-block/text-block.vue @@ -1,7 +1,7 @@ @@ -11,11 +11,6 @@ export default { props: { customText: String, // used to allow the insert of token values into textblock justifyText: String, // left, right, center - margin: { - // bootstrap margin to apply to the block. - type: String, - default: "mt-2", - }, typeStyle: String, // h1-h6, body, small, label, caption (see Figma or Confluence documentation) fontWeight: String, // bold=500, default is 400 cmsWidgetName: String, diff --git a/src/layouts/review/review.spec.js b/src/layouts/review/review.spec.js deleted file mode 100644 index 674dc71f7..000000000 --- a/src/layouts/review/review.spec.js +++ /dev/null @@ -1,3 +0,0 @@ -describe("Review Page", () => { - test.todo("Add more tests as specific functionality is added."); -}); diff --git a/src/layouts/review/review.vue b/src/layouts/review/review.vue deleted file mode 100644 index 9bccb2014..000000000 --- a/src/layouts/review/review.vue +++ /dev/null @@ -1,102 +0,0 @@ - - - - - diff --git a/src/router/index.js b/src/router/index.js index 86c402187..3abfa058d 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -31,7 +31,6 @@ import { applicationConfig } from "../constants/application-config"; // Components import datePicker from "@/digital-components/date-picker/date-picker.vue"; import demoDatePicker from "@/layouts/demo-date-picker/demo-date-picker.vue"; -import review from "@/layouts/review/review"; const routes = [ { @@ -44,11 +43,6 @@ const routes = [ name: "date-picker", component: datePicker, }, - { - path: "/review", // This is a temporary route for testing. - name: "review", - component: review, - }, { path: "/", name: "root", From 0e167607ad0882c06d492f735d6fc5240c3a4750 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Tue, 23 May 2023 09:13:31 -0400 Subject: [PATCH 05/10] Fixed unit tests --- .../shop-question/shop-question.spec.js | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/layouts/service-location/shop-question/shop-question.spec.js b/src/layouts/service-location/shop-question/shop-question.spec.js index c61fe2720..c4efdea91 100644 --- a/src/layouts/service-location/shop-question/shop-question.spec.js +++ b/src/layouts/service-location/shop-question/shop-question.spec.js @@ -179,19 +179,19 @@ describe("shop-question.vue", () => { expect(wrapper.vm.answers).toEqual([ { buttonBodyCopy: "4403 Executive Pkwy, Westerville, OH 43081", - buttonLabel: "4403 Executive Pkwy", + buttonLabel: "Westerville", buttonLabelSubCopy: "5 mi", value: "003335", }, { buttonBodyCopy: "760 Dearborn Park Ln, Worthington, OH 43085", - buttonLabel: "760 Dearborn Park Ln", + buttonLabel: "Worthington", buttonLabelSubCopy: "10.5 mi", value: "001820", }, { buttonBodyCopy: "5015 N High St, Columbus, OH 43214", - buttonLabel: "5015 N High St", + buttonLabel: "Columbus", buttonLabelSubCopy: "11.5 mi", value: "003343", }, @@ -320,19 +320,19 @@ describe("shop-question.vue", () => { const displayedAnswers = [ { buttonBodyCopy: "4403 Executive Pkwy, Westerville, OH 43081", - buttonLabel: "4403 Executive Pkwy", + buttonLabel: "Westerville", buttonLabelSubCopy: "5 mi", value: "003335", }, { buttonBodyCopy: "760 Dearborn Park Ln, Worthington, OH 43085", - buttonLabel: "760 Dearborn Park Ln", + buttonLabel: "Worthington", buttonLabelSubCopy: "10.5 mi", value: "001820", }, { buttonBodyCopy: "5015 N High St, Columbus, OH 43214", - buttonLabel: "5015 N High St", + buttonLabel: "Columbus", buttonLabelSubCopy: "11.5 mi", value: "003343", }, @@ -388,37 +388,37 @@ describe("shop-question.vue", () => { expect(wrapper.vm.answers).toEqual([ { buttonBodyCopy: "4403 Executive Pkwy, Westerville, OH 43081", - buttonLabel: "4403 Executive Pkwy", + buttonLabel: "Westerville", buttonLabelSubCopy: "5 mi", value: "003335", }, { buttonBodyCopy: "760 Dearborn Park Ln, Worthington, OH 43085", - buttonLabel: "760 Dearborn Park Ln", + buttonLabel: "Worthington", buttonLabelSubCopy: "10.5 mi", value: "001820", }, { buttonBodyCopy: "5015 N High St, Columbus, OH 43214", - buttonLabel: "5015 N High St", + buttonLabel: "Columbus", buttonLabelSubCopy: "11.5 mi", value: "003343", }, { buttonBodyCopy: "1670 Harmon Ave, Columbus, OH 43223", - buttonLabel: "1670 Harmon Ave", + buttonLabel: "Columbus", buttonLabelSubCopy: "16 mi", value: "006747", }, { buttonBodyCopy: "3938 Powell Rd, Powell, OH 43065", - buttonLabel: "3938 Powell Rd", + buttonLabel: "Powell", buttonLabelSubCopy: "16.5 mi", value: "003341", }, { buttonBodyCopy: "4580 W Broad St, Columbus, OH 43228", - buttonLabel: "4580 W Broad St", + buttonLabel: "Columbus", buttonLabelSubCopy: "19.5 mi", value: "003342", }, From 5b6e68b8c52ded15dbb392f0a2b8bae09e54d4fe Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 23 May 2023 11:10:31 -0400 Subject: [PATCH 06/10] CSR-886: remove demo pages / code --- .../demo-date-picker/demo-date-picker.spec.js | 19 ---- .../demo-date-picker/demo-date-picker.vue | 90 ------------------- src/router/index.js | 14 --- 3 files changed, 123 deletions(-) delete mode 100644 src/layouts/demo-date-picker/demo-date-picker.spec.js delete mode 100644 src/layouts/demo-date-picker/demo-date-picker.vue diff --git a/src/layouts/demo-date-picker/demo-date-picker.spec.js b/src/layouts/demo-date-picker/demo-date-picker.spec.js deleted file mode 100644 index 9f7fa378b..000000000 --- a/src/layouts/demo-date-picker/demo-date-picker.spec.js +++ /dev/null @@ -1,19 +0,0 @@ -import demoDatePicker from "./demo-date-picker"; - -// Supporting Files -import { shallowMount } from "@vue/test-utils"; -import { getMountOptions } from "@/helpers/unit-test-helper.js"; - -describe("demo-date-picker.vue", () => { - test.only("test TK...", () => {}); -}); - -function setupMocks({ mountOptionsMockData = {} }) { - const mountOptions = getMountOptions({ - ...mountOptionsMockData, - }); - - const wrapper = shallowMount(demoDatePicker, mountOptions); - - return { wrapper }; -} diff --git a/src/layouts/demo-date-picker/demo-date-picker.vue b/src/layouts/demo-date-picker/demo-date-picker.vue deleted file mode 100644 index 20416b1d4..000000000 --- a/src/layouts/demo-date-picker/demo-date-picker.vue +++ /dev/null @@ -1,90 +0,0 @@ - - - - - diff --git a/src/router/index.js b/src/router/index.js index 3abfa058d..15ba52647 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -28,21 +28,7 @@ import analyticsMixin from "@/mixins/analytics-mixin"; import { experimentTriggers } from "../constants/experiments"; import { applicationConfig } from "../constants/application-config"; -// Components -import datePicker from "@/digital-components/date-picker/date-picker.vue"; -import demoDatePicker from "@/layouts/demo-date-picker/demo-date-picker.vue"; - const routes = [ - { - path: "/demo-date-picker", // This is a temporary route for testing. - name: "demo-date-picker", - component: demoDatePicker, - }, - { - path: "/date-picker", // This is a temporary route for testing. - name: "date-picker", - component: datePicker, - }, { path: "/", name: "root", From 389b11ac2d59ac0cc0089d4f961bba91491498c6 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Wed, 24 May 2023 11:00:00 -0400 Subject: [PATCH 07/10] CSR-1420 fix misalignment of disclaimer copy Update code for text-block to not use flex. Use text-align accordingly. --- src/digital-components/text-block/text-block.vue | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/digital-components/text-block/text-block.vue b/src/digital-components/text-block/text-block.vue index 4f9c41599..2deb126e5 100644 --- a/src/digital-components/text-block/text-block.vue +++ b/src/digital-components/text-block/text-block.vue @@ -10,7 +10,7 @@ export default { name: "textBlock", props: { customText: String, // used to allow the insert of token values into textblock - justifyText: String, // left, right, center + justifyText: String, // right, center (left is default) typeStyle: String, // h1-h6, body, small, label, caption (see Figma or Confluence documentation) fontWeight: String, // bold=500, default is 400 cmsWidgetName: String, @@ -28,15 +28,11 @@ export default {