Merge branch 'develop' into feature/CSR-104

This commit is contained in:
Leah Schumann 2022-05-13 15:14:35 -04:00
commit 19602c8357
5 changed files with 59 additions and 21 deletions

View file

@ -5,8 +5,8 @@
<span class="fs-5 fw-bold w-100">{{ questionText }}</span> <span class="fs-5 fw-bold w-100">{{ questionText }}</span>
</div> </div>
<div class="w-100 d-flex justify-content-center"> <div class="w-100 d-flex justify-content-center">
<fieldset class="w-100" :aria-required=isRequired :class="getFieldSetClasses" :role="isMultiSelect ? 'group' : 'radiogroup'" :aria-labelledby="groupName ? groupName + '-radio-group' : ''"> <fieldset class="w-100" :aria-required=isRequired :class="getFieldSetClasses" :role="isMultiSelect ? 'group' : 'radiogroup'" :aria-labelledby="groupName">
<legend class="sr-only" :data-focus-target="groupName" tabindex="-1"> <legend class="sr-only" :data-focus-target="groupName" :id="groupName" tabindex="-1">
{{(isMultiSelect && answers && answers.length > 1) ? 'Select one or more options below.' : 'Select an option below.' }} {{(isMultiSelect && answers && answers.length > 1) ? 'Select one or more options below.' : 'Select an option below.' }}
</legend> </legend>
<div :class="getComponentWrapperClasses"> <div :class="getComponentWrapperClasses">

View file

@ -18,8 +18,8 @@ const errorMessages = {
LAST_NAME_REQUIRED: "Please enter your last name", LAST_NAME_REQUIRED: "Please enter your last name",
EMAIL_ADDRESS_REQUIRED: "Please enter your email address", EMAIL_ADDRESS_REQUIRED: "Please enter your email address",
EMAIL_ADDRESS_FORMAT: "Please enter a valid email address", EMAIL_ADDRESS_FORMAT: "Please enter a valid email address",
SERVICE_ZIP_REQUIRED: "Please enter your Service ZIP", SERVICE_ZIP_REQUIRED: "Please enter your service ZIP",
SERVICE_ZIP_FORMAT: "Please enter a valid Service ZIP", SERVICE_ZIP_FORMAT: "Please enter a valid service ZIP",
VIN_REQUIRED: "Please enter your VIN", VIN_REQUIRED: "Please enter your VIN",
VIN_FORMAT: "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", VIN_FORMAT: "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", OPTION_REQUIRED: "Please select an option",

View file

@ -41,6 +41,9 @@ export default {
font-size: .875rem; font-size: .875rem;
color: $gray-600; color: $gray-600;
} }
li {
line-height: 26px;
}
a { a {
font-size: .875rem; font-size: .875rem;
} }
@ -70,6 +73,7 @@ export default {
overflow: hidden; overflow: hidden;
opacity: 0; opacity: 0;
img { img {
max-width: 420px;
width: 117%; width: 117%;
height: auto; height: auto;
} }

View file

@ -27,7 +27,7 @@
/> />
</div> </div>
</div> </div>
<div class="row my-2"> <div class="row mb-2">
<div class="col"> <div class="col">
<vinInformation /> <vinInformation />
</div> </div>
@ -92,7 +92,7 @@
class="my-3" class="my-3"
v-model="customAlertData" v-model="customAlertData"
v-if="vinNotFound" v-if="vinNotFound"
alertClass="alert-warning" alertClass="alert-danger"
cmsWidgetName="VinNotFound" cmsWidgetName="VinNotFound"
/> />
<alert <alert
@ -192,12 +192,17 @@ export default {
vinPopulatedOnPageLoad: this.getVinFromStore()?.length > 0, vinPopulatedOnPageLoad: this.getVinFromStore()?.length > 0,
}; };
}, },
watch: {
vin() {
this.$refs.funnelFooter.updateButtonText(
this.getCmsContent("FunnelFooterWidget", "ForwardButtonText")
);
}
},
computed: { computed: {
perfectMatchNewVinAlert() { perfectMatchNewVinAlert() {
const isVinPerfectMatch = this.vinPopulatedOnPageLoad && this.vin === this.getVinFromStore(); const isVinPerfectMatch = this.vinPopulatedOnPageLoad && this.vin === this.getVinFromStore();
if (isVinPerfectMatch) { this.updateIsCarIdDifferent(isVinPerfectMatch);
this.isCarIdDifferent = false;
}
return isVinPerfectMatch; return isVinPerfectMatch;
}, },
MatchedDifferentVehicleAlertHeader(){ MatchedDifferentVehicleAlertHeader(){
@ -269,6 +274,11 @@ export default {
); );
}); });
}, },
updateIsCarIdDifferent(isVinPerfectMatch){
if (isVinPerfectMatch) {
this.isCarIdDifferent = false;
}
},
backButtonAction() { backButtonAction() {
if (store.getters.vehicle.vin) { if (store.getters.vehicle.vin) {
this.$router.navigate(this.navigationScenarios.CLICKED_BACK_WITH_VIN, this.$route); this.$router.navigate(this.navigationScenarios.CLICKED_BACK_WITH_VIN, this.$route);

View file

@ -5,15 +5,17 @@
:class="[isDismissible ? 'alert-dismissible' : '', this.alertClass]" :class="[isDismissible ? 'alert-dismissible' : '', this.alertClass]"
> >
<p class="m-0 fw-bold alert-heading">{{ alertHeadline }}</p> <p class="m-0 fw-bold alert-heading">{{ alertHeadline }}</p>
<p v-if="splitAlertCopyForLink.length"> <template v-for="paragraph in splitAlertCopyForParagraphTag" :key="paragraph">
<template v-for="copy in splitAlertCopyForLink" :key="copy"> <p class="m-0 text-body small" v-if="!doesCopyContainRouterLink(paragraph)" v-html="paragraph"></p>
<span v-if="copy.includes('routerLink:')" class="m-0 text-body"> <p class="m-0 text-body small" v-else>
<router-link :to="{query: {fmgPage: `${copy.split(':')[1].split(',')[0]}`}, name: 'root'}">{{ copy.split(':')[1].split(',')[1] }}</router-link> <template v-for="copy in splitCopyForRouterLink(paragraph)" :key="copy">
</span> <span v-if="!doesCopyContainRouterLink(copy)" v-html="copy"></span>
<span v-else class="m-0 text-body" v-html="copy"></span> <span v-else>
</template> <router-link :to="{query: {fmgPage: `${getRouterLinkRouteFromCopy(copy)}`}, name: 'root'}">{{ getRouterLinkDisplayTextFromCopy(copy) }}</router-link>
</p> </span>
<p v-else class="m-0 text-body" v-html="alertCopy"></p> </template>
</p>
</template>
<button <button
type="button" type="button"
class="btn-close p-2" class="btn-close p-2"
@ -58,9 +60,31 @@ export default {
alertCopy(){ alertCopy(){
return this.cmsWidgetName ? this.getCmsContent(this.cmsWidgetName, 'BodyText') : this.manualCopy; return this.cmsWidgetName ? this.getCmsContent(this.cmsWidgetName, 'BodyText') : this.manualCopy;
}, },
splitAlertCopyForLink(){ splitAlertCopyForParagraphTag(){
// Splits content when brackets are found in text so that text can be looped through and router-link can be injected when needed // splits the alertCopy on <p ... > (with or without attributes) and </p>
return this.alertCopy.split(/{(.*?)}/g); // filter removes empty strings that are a result of string.split with regex
return this.alertCopy.split(/(?:<p(?:.*?)>)|(?:<\/p>)/g).filter(paragraph => paragraph !== "");
},
},
methods: {
doesCopyContainRouterLink(copy) {
return copy.includes('routerLink:');
},
splitCopyForRouterLink(copy){
// splits copy on { ... } such as {routerlink: ...}
return copy.split(/{(.*?)}/g);
},
getRouterLinkRouteFromCopy(copy){
// sample input: {routerLink:estimate,provide your VIN}
// first split would return 'estimate,provide your VIN'
// second split would return 'estimate'
return copy.split(':')[1].split(',')[0];
},
getRouterLinkDisplayTextFromCopy(copy){
// sample input: {routerLink:estimate,provide your VIN}
// first split would return 'estimate,provide your VIN'
// second split would return 'provide your VIN'
return copy.split(':')[1].split(',')[1];
} }
}, },
}; };