Merge branch 'develop' into feature/CSR-1100

This commit is contained in:
Chloe Herd 2023-03-30 09:07:15 -04:00
commit cef1eeec1f
9 changed files with 30 additions and 30 deletions

View file

@ -41,7 +41,7 @@
</template> </template>
<script> <script>
import modalButtonMain from "@/ux-components/modal-button-main/modal-button-main"; import modalButtonMain from "@/digital-components/modal/ux-components/modal-button-main/modal-button-main";
import { Modal } from "bootstrap"; import { Modal } from "bootstrap";
import { useForm } from "vee-validate"; import { useForm } from "vee-validate";

View file

@ -369,6 +369,9 @@ export default {
console.log("Unable to load Google Places API script"); console.log("Unable to load Google Places API script");
}); });
}, },
resetAlerts() {
this.displayVerificationWarning = false;
},
}, },
mounted() { mounted() {
this.setupAddressLookup(); this.setupAddressLookup();

View file

@ -1,6 +1,6 @@
import { shallowMount } from "@vue/test-utils"; import { shallowMount } from "@vue/test-utils";
import { getMountOptions } from "@/helpers/unit-test-helper.js"; import { getMountOptions } from "@/helpers/unit-test-helper.js";
import serviceTypeQuestion from "./service-type-question"; import appointmentTypeQuestion from "./appointment-type-question";
const mockCmsContent = { const mockCmsContent = {
QuestionText: "Choose a service option:", QuestionText: "Choose a service option:",
@ -29,7 +29,7 @@ const mockCmsContent = {
], ],
}; };
const cmsWidgetName = "ServiceTypeQuestionWidget"; const cmsWidgetName = "AppointmentTypeQuestionWidget";
const mockMixin = { const mockMixin = {
methods: { methods: {
getCmsContent: jest.fn((widgetName, cmsFieldName) => { getCmsContent: jest.fn((widgetName, cmsFieldName) => {
@ -42,7 +42,7 @@ const mockMixin = {
}, },
}; };
describe("service-type-question.vue", () => { describe("appointment-type-question.vue", () => {
it("Should display all options if both in-shop and mobile are available", async () => { it("Should display all options if both in-shop and mobile are available", async () => {
// Arrange/Act // Arrange/Act
const { wrapper } = setupMocks({ const { wrapper } = setupMocks({
@ -170,8 +170,8 @@ function setupMocks({ mountOptions, mixins, props, isShallowMount = true }) {
if (props) resultingMountOptions.propsData = props; if (props) resultingMountOptions.propsData = props;
const wrapper = isShallowMount const wrapper = isShallowMount
? shallowMount(serviceTypeQuestion, resultingMountOptions) ? shallowMount(appointmentTypeQuestion, resultingMountOptions)
: mount(serviceTypeQuestion, resultingMountOptions); : mount(appointmentTypeQuestion, resultingMountOptions);
return { wrapper }; return { wrapper };
} }

View file

@ -1,6 +1,6 @@
<template> <template>
<transition name="fade" mode="out-in"> <transition name="fade" mode="out-in">
<div class="service-type-question" aria-live="polite"> <div class="appointment-type-question" aria-live="polite">
<buttonQuestion <buttonQuestion
:questionText="questionText" :questionText="questionText"
:answers="answersToDisplay" :answers="answersToDisplay"
@ -18,7 +18,7 @@
import buttonQuestion from "@/digital-components/button-question/button-question"; import buttonQuestion from "@/digital-components/button-question/button-question";
export default { export default {
name: "service-type-question", name: "appointment-type-question",
props: { props: {
modelValue: String, modelValue: String,
groupName: String, groupName: String,

View file

@ -181,7 +181,7 @@ export default {
this.$refs[this.modalName].resetButtonStyle(); this.$refs[this.modalName].resetButtonStyle();
}, },
resetAlerts() { resetAlerts() {
this.$refs.addressQuestions.displayVerificationWarning = false; this.$refs.addressQuestions.resetAlerts();
}, },
async setMobileLocation() { async setMobileLocation() {
// Validate the Zip Code // Validate the Zip Code

View file

@ -16,7 +16,7 @@
<alert <alert
class="my-4" class="my-4"
cmsWidgetName="AlertMilitaryBaseZipWidget" cmsWidgetName="AlertMilitaryBaseZipWidget"
v-if="showMilitaryZipAlert" v-if="displayMilitaryZipAlert"
alertClass="alert-warning" /> alertClass="alert-warning" />
<alert <alert
class="my-4" class="my-4"
@ -24,16 +24,21 @@
v-if="isServiceableMobileOnly" v-if="isServiceableMobileOnly"
alertClass="alert-warning" alertClass="alert-warning"
data-test="mobileOnlyAlert" /> data-test="mobileOnlyAlert" />
<serviceTypeQuestion <alert
v-model="selectedServiceType" class="my-4"
cmsWidgetName="AlertNoServiceWarningWidget"
v-if="displayNoServiceWarningAlert"
alertClass="alert-warning" />
<appointmentTypeQuestion
v-model="selectedAppointmentType"
:isServiceableMobile="isServiceableMobile" :isServiceableMobile="isServiceableMobile"
:isServiceableInshop="isServiceableInshop" :isServiceableInshop="isServiceableInshop"
ref="serviceTypeQuestion" ref="appointmentTypeQuestion"
groupName="serviceTypeQuestion" groupName="appointmentTypeQuestion"
cmsWidgetName="ServiceTypeQuestionWidget" cmsWidgetName="AppointmentTypeQuestionWidget"
validationRules="option-required" /> validationRules="option-required" />
<mobileLocationModalQuestions <mobileLocationModalQuestions
v-show="selectedServiceType === 'Mobile'" v-show="selectedAppointmentType === 'Mobile'"
v-model="mobileLocationQuestions" v-model="mobileLocationQuestions"
:mobileFeePart="mobileFeePart" :mobileFeePart="mobileFeePart"
@updated-mobile-fee-part="setMobileFeePart" @updated-mobile-fee-part="setMobileFeePart"
@ -43,7 +48,7 @@
linkWidgetName="MobileLocationLinkWidget" linkWidgetName="MobileLocationLinkWidget"
modalWidgetName="MobileLocationModalWidget" /> modalWidgetName="MobileLocationModalWidget" />
<textboxQuestion <textboxQuestion
v-show="selectedServiceType === 'Mobile'" v-show="selectedAppointmentType === 'Mobile'"
ref="mobileLocationQuestionsError" ref="mobileLocationQuestionsError"
v-model="mobileLocationValidationField" v-model="mobileLocationValidationField"
validationRules="mobile-location-required" validationRules="mobile-location-required"
@ -64,7 +69,7 @@
import alert from "@/ux-components/alert/alert"; import alert from "@/ux-components/alert/alert";
import serviceZipModalQuestion from "@/layouts/service-location/service-zip-modal-question/service-zip-modal-question"; 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 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 appointmentTypeQuestion from "@/layouts/service-location/appointment-type-question/appointment-type-question";
import funnelHeader from "@/fmg-components/funnel-header/funnel-header"; import funnelHeader from "@/fmg-components/funnel-header/funnel-header";
import funnelFooter from "@/fmg-components/funnel-footer/funnel-footer"; import funnelFooter from "@/fmg-components/funnel-footer/funnel-footer";
import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header"; import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header";
@ -104,7 +109,7 @@ export default {
isRecalibrationServiceableMobile: null, isRecalibrationServiceableMobile: null,
mobileFeePart: null, mobileFeePart: null,
zipContainsMilitaryBase: false, zipContainsMilitaryBase: false,
selectedServiceType: null, selectedAppointmentType: null,
mobileLocationValidationField: null, mobileLocationValidationField: null,
}; };
}, },
@ -144,6 +149,7 @@ export default {
// Call the "next" function to complete the transition to this page. // Call the "next" function to complete the transition to this page.
next((vm) => { next((vm) => {
vm.setCmsContent(resultMap.cmsContent); vm.setCmsContent(resultMap.cmsContent);
console.log(resultMap.serviceabilityDetails);
vm.setData( vm.setData(
resultMap.zipCodeData, resultMap.zipCodeData,
resultMap.serviceabilityDetails, resultMap.serviceabilityDetails,
@ -193,7 +199,7 @@ export default {
this.mobileLocationValidationField = "isValid"; this.mobileLocationValidationField = "isValid";
}, },
}, },
showMilitaryZipAlert() { displayMilitaryZipAlert() {
return this.zipContainsMilitaryBase && this.isServiceableMobile; return this.zipContainsMilitaryBase && this.isServiceableMobile;
}, },
isServiceableMobile() { isServiceableMobile() {
@ -280,7 +286,7 @@ export default {
components: { components: {
alert, alert,
serviceZipModalQuestion, serviceZipModalQuestion,
serviceTypeQuestion, appointmentTypeQuestion,
mobileLocationModalQuestions, mobileLocationModalQuestions,
funnelHeader, funnelHeader,
funnelFooter, funnelFooter,

View file

@ -1674,12 +1674,3 @@ function getLineItemQueryStringForPricing(lineItems) {
}) })
.join(""); .join("");
} }
function getLineItemQueryStringForServiceability(lineItems) {
return lineItems
.map((lineItem) => {
let queryStringSnippet = `&lineItems=${lineItem.partNumber}`;
return queryStringSnippet;
})
.join("");
}