From 3d2179d884eccf0543f9ea71d7e40163fbf32788 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Tue, 11 Apr 2023 16:27:39 -0400 Subject: [PATCH] WIP --- src/constants/endpoints.js | 4 + src/constants/store-actions.js | 1 + .../service-location/service-location.vue | 31 +++-- .../shop-list-button/shop-list-button.spec.js | 1 + .../shop-list-button/shop-list-button.vue | 118 ++++++++++++++++++ .../shop-question/shop-question.spec.js | 2 +- .../shop-question/shop-question.vue | 39 +++--- src/store/index.js | 8 ++ 8 files changed, 180 insertions(+), 24 deletions(-) create mode 100644 src/layouts/service-location/shop-question/shop-list-button/shop-list-button.spec.js create mode 100644 src/layouts/service-location/shop-question/shop-list-button/shop-list-button.vue diff --git a/src/constants/endpoints.js b/src/constants/endpoints.js index aaf221bd2..f6aa10c0f 100644 --- a/src/constants/endpoints.js +++ b/src/constants/endpoints.js @@ -86,6 +86,10 @@ const endpoints = { url: "/parts/api/v1/parts/supporting-items", method: "POST", }, + GetProviderLocations: { + url: "/location/api/v1/location/providers", + method: "GET", + }, GetCapabilityQuestions: { url: "/parts/api/v1/parts/capability-questions", method: "GET", diff --git a/src/constants/store-actions.js b/src/constants/store-actions.js index 3fc664413..65ce02493 100644 --- a/src/constants/store-actions.js +++ b/src/constants/store-actions.js @@ -30,6 +30,7 @@ const storeActions = { GET_MOLDING_QUESTIONS: "getMoldingQuestions", GET_MOBILE_FEE_PART: "getMobileFeePart", GET_SERVICEABILITY_DETAILS: "getServiceabilityDetails", + GET_PROVIDER_LOCATIONS: "getProviderLocations", SAVE_SESSION: "saveSession", LOAD_SESSION: "loadSession", UPDATE_STORE_WITH_SAVE_SESSION_RESPONSE: "updateStoreWithSaveSessionResponse", diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 85ee084f3..5497ad545 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -64,6 +64,11 @@ ref="mobileLocationQuestions" linkWidgetName="MobileLocationLinkWidget" modalWidgetName="MobileLocationModalWidget" /> + item.partNumber === "RECAL STATIC" || item.partNumber === "RECAL DUAL" ); }, displayRecalibrationWarning() { - return this.requiresInshopRecalibration; + return this.isDualOrStaticRecalibration; }, displayServiceableInshopOnly() { return ( @@ -271,6 +284,9 @@ export default { displayNoShopsAlert() { return !this.isServiceableInshop && !this.isServiceableMobile; }, + isDropoff() { + return this.selectedAppointmentType === "Dropoff"; + }, }, methods: { arePagePrerequisitesValid() { @@ -352,6 +368,7 @@ export default { Form, loadingModal, contentGroupModal, + shopQuestion, }, }; diff --git a/src/layouts/service-location/shop-question/shop-list-button/shop-list-button.spec.js b/src/layouts/service-location/shop-question/shop-list-button/shop-list-button.spec.js new file mode 100644 index 000000000..3d0843e10 --- /dev/null +++ b/src/layouts/service-location/shop-question/shop-list-button/shop-list-button.spec.js @@ -0,0 +1 @@ +test.todo("some test to be written in the future"); diff --git a/src/layouts/service-location/shop-question/shop-list-button/shop-list-button.vue b/src/layouts/service-location/shop-question/shop-list-button/shop-list-button.vue new file mode 100644 index 000000000..898f167d9 --- /dev/null +++ b/src/layouts/service-location/shop-question/shop-list-button/shop-list-button.vue @@ -0,0 +1,118 @@ + + + + + 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 66012402c..3d0843e10 100644 --- a/src/layouts/service-location/shop-question/shop-question.spec.js +++ b/src/layouts/service-location/shop-question/shop-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/shop-question/shop-question.vue b/src/layouts/service-location/shop-question/shop-question.vue index f5cbdba98..2a538c759 100644 --- a/src/layouts/service-location/shop-question/shop-question.vue +++ b/src/layouts/service-location/shop-question/shop-question.vue @@ -9,6 +9,8 @@ alertClass="alert-info" v-bind:isDismissible="false" /> import alert from "@/ux-components/alert/alert"; import buttonQuestion from "@/digital-components/button-question/button-question"; +import shopListButton from "./shop-list-button/shop-list-button"; import { storeActions } from "@/constants/store-actions.js"; import store from "@/store"; @@ -42,6 +45,7 @@ export default { data() { return { shops: [], + shopListButton: shopListButton, }; }, props: { @@ -68,12 +72,14 @@ export default { }, }, answers() { - // Map API result data, to address-vehicles data structure - const mappedData = this.shops.map((s) => { + // Map API result data + const mappedData = this.shops.map((shop) => { return { - Name: s.providerNumber, - Text: `${s.city}${s.distance} mi`, - SubText: `${s.streetAddress}, ${s.city}, ${s.state} ${s.zipCode}`, + Name: shop.providerNumber, + buttonLabel: shop.city, + buttonLabelSubCopy: `${shop.distance} mi`, + buttonBodyCopy: `${shop.streetAddress}, ${shop.city}, ${shop.state} ${shop.zipCode}`, + buttonAuxillaryCopy: `foo` }; }); @@ -123,21 +129,24 @@ export default { font-weight: 500; line-height: 1.5rem; align-items: center; - margin-bottom: 0.25rem !important; - - .distance { + margin-bottom: 0.25rem !important; + + .button-label-sub-copy { + margin-bottom: 0rem !important; color: #727676; - margin-left: 0.25rem; + padding-left: 0.25rem; font-weight: 400; line-height: 1.25rem; - font-size: 0.75rem; + font-size: 0.75rem; + } + + .button-auxillary-copy { + display: flex; + align-items: right; } } - .button-label-sub-copy { - font-weight: 400; - margin-bottom: 0rem !important; - } + } } @@ -152,6 +161,4 @@ export default { padding-left: 1.5rem !important; padding-right: 0.5rem !important; } - - diff --git a/src/store/index.js b/src/store/index.js index 127d3558f..ca9aa4741 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -937,6 +937,14 @@ export const actions = { }); }, + getProviderLocations(context, { serviceZipCode }) { + return globalMethods.callMockHttpClient({ + method: endpoints.GetProviderLocations.method, + //TODO: Remove Mocky Endpoints + endpoint: "https://run.mocky.io/v3/2a82baf7-c6e8-40ac-8e2e-9d91800c7f9b", + }); + }, + getSupportingItems(context) { const glassPartsArray = context.getters.lineItems.glassParts ?? []; const carId = context.getters.vehicle.carId;