From 3991bc52af2f87c1df651366c38be183d07c2ac0 Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Mon, 2 Oct 2023 15:40:47 -0400 Subject: [PATCH] Location Alerts on schedule page Mocked result Linting on shop question. --- src/constants/endpoints.js | 4 ++ .../schedule-page/helpers/schedule-helper.js | 30 ++++++++++ .../location-alerts/location-alerts.vue | 57 +++++++++++++++++++ src/layouts/schedule-page/schedule-page.vue | 18 +++++- .../shop-question/shop-question.vue | 6 +- src/store/index.js | 10 ++++ src/styles/ux-variables-svg-strings.scss | 1 + 7 files changed, 123 insertions(+), 3 deletions(-) create mode 100644 src/layouts/schedule-page/helpers/schedule-helper.js create mode 100644 src/layouts/schedule-page/location-alerts/location-alerts.vue create mode 100644 src/styles/ux-variables-svg-strings.scss diff --git a/src/constants/endpoints.js b/src/constants/endpoints.js index a34d8990..162d90bf 100644 --- a/src/constants/endpoints.js +++ b/src/constants/endpoints.js @@ -11,6 +11,10 @@ const endpoints = Object.freeze({ url: (applicationAbbreviation, pageName) => `/content/api/v1/content/${applicationAbbreviation}/${pageName}`, method: 'GET' }, + GetAlertReasons: { + url: '/location/api/v1/location/alert-reasons', + method: 'GET' + }, GetVehicleYears: { url: '/vehicle/api/v1/vehicle/years', method: 'GET' diff --git a/src/layouts/schedule-page/helpers/schedule-helper.js b/src/layouts/schedule-page/helpers/schedule-helper.js new file mode 100644 index 00000000..7347bfca --- /dev/null +++ b/src/layouts/schedule-page/helpers/schedule-helper.js @@ -0,0 +1,30 @@ +import { useMainStore } from '@/store'; + +const getAlertReasons = async (ctu) => { + const store = useMainStore(); + const alertReasons = await store.getAlertReasonsByCtu(ctu); + + return Promise.resolve(alertReasons); +}; + +// This function will go away after testing. +// The Service already went through testing and had these removed from it. +export async function mockGetAlertReasons(ctu) { + let retList = []; + if (ctu === '01853') { // Ocala, FL 34470 + retList = [ + 'Hurricane', 'ExtremeTemperature' + ]; + } else if (ctu === '01814') { // Phoenix, AZ 85026 + retList = [ + 'ExtremeTemperature' + ]; + } else if (ctu === '01845') { // Raleigh, NC 27601 + retList = [ + 'Hurricane' + ]; + } + return Promise.resolve(retList); +} + +export default getAlertReasons; diff --git a/src/layouts/schedule-page/location-alerts/location-alerts.vue b/src/layouts/schedule-page/location-alerts/location-alerts.vue new file mode 100644 index 00000000..46a84e5c --- /dev/null +++ b/src/layouts/schedule-page/location-alerts/location-alerts.vue @@ -0,0 +1,57 @@ + + diff --git a/src/layouts/schedule-page/schedule-page.vue b/src/layouts/schedule-page/schedule-page.vue index 9d6116ec..8ba01a3e 100644 --- a/src/layouts/schedule-page/schedule-page.vue +++ b/src/layouts/schedule-page/schedule-page.vue @@ -18,6 +18,9 @@ marginTopSizeOverride="1" />
+ { vm.setCmsContent(resultMap.cmsContent); + vm.$refs.locationAlerts.initializeComponent(resultMap.alertReasons); }); }, setup() { diff --git a/src/layouts/service-location/shop-question/shop-question.vue b/src/layouts/service-location/shop-question/shop-question.vue index 53786682..220f4ad4 100644 --- a/src/layouts/service-location/shop-question/shop-question.vue +++ b/src/layouts/service-location/shop-question/shop-question.vue @@ -36,7 +36,7 @@ :text="showMoreShopsLinkText" href="#!" :aria-label="showMoreShopsLinkText" - @click-event="getNextShopsFromList" /> + @clickEvent="getNextShopsFromList" />
@@ -254,6 +254,8 @@ export default {