few more updates for the second line of headline text
start alert collapsed
This commit is contained in:
parent
035a91ea71
commit
d1972e6ea9
3 changed files with 75 additions and 12 deletions
|
|
@ -47,8 +47,21 @@
|
||||||
v-if="displayLowAvailabilityInshop"
|
v-if="displayLowAvailabilityInshop"
|
||||||
ref="alertLowAvailabilityInshop"
|
ref="alertLowAvailabilityInshop"
|
||||||
cmsWidgetName="AlertLowAvailabilityInshopWidget"
|
cmsWidgetName="AlertLowAvailabilityInshopWidget"
|
||||||
|
:manualHeadlineLineTwo="getLowAvailabilityHeadlineLineTwoText"
|
||||||
:isCollapsible="true"
|
:isCollapsible="true"
|
||||||
alertClass="alert-warning" />
|
:startCollapsed="true"
|
||||||
|
alertClass="alert-warning">
|
||||||
|
<template #headline-line-two>
|
||||||
|
<button
|
||||||
|
class="m-0 alert-header-text d-block looka-likea-link"
|
||||||
|
type="button"
|
||||||
|
@click="triggerShopAddressModal">
|
||||||
|
<span class="m-0">
|
||||||
|
{{ getLowAvailabilityHeadlineLineTwoText }}
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
</template>
|
||||||
|
</alert>
|
||||||
<shopAddress
|
<shopAddress
|
||||||
ref="shopAddress"
|
ref="shopAddress"
|
||||||
v-model="selectedProvider"
|
v-model="selectedProvider"
|
||||||
|
|
@ -201,6 +214,9 @@ export default {
|
||||||
displayServiceableMobileOnly() {
|
displayServiceableMobileOnly() {
|
||||||
return this.isServiceableMobile && this.recalibrationRequired && !this.isServiceableInshop;
|
return this.isServiceableMobile && this.recalibrationRequired && !this.isServiceableInshop;
|
||||||
},
|
},
|
||||||
|
getLowAvailabilityHeadlineLineTwoText() {
|
||||||
|
return 'Try a different location';
|
||||||
|
},
|
||||||
inShopOnlyCopy() {
|
inShopOnlyCopy() {
|
||||||
let content = this.getCmsContent('AlertInshopOnlyWidget', widgetFields.ALERT_WIDGET.BODY_TEXT);
|
let content = this.getCmsContent('AlertInshopOnlyWidget', widgetFields.ALERT_WIDGET.BODY_TEXT);
|
||||||
content = content.replace('{custom:city}', toTitleCase(this.city));
|
content = content.replace('{custom:city}', toTitleCase(this.city));
|
||||||
|
|
@ -494,6 +510,9 @@ export default {
|
||||||
this.selectedAppointmentType = AppointmentTypeStrings.IN_SHOP;
|
this.selectedAppointmentType = AppointmentTypeStrings.IN_SHOP;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
triggerShopAddressModal() {
|
||||||
|
this.$refs.shopAddress.openModal();
|
||||||
|
},
|
||||||
async updateMobileZip() {
|
async updateMobileZip() {
|
||||||
this.mobileZipError = '';
|
this.mobileZipError = '';
|
||||||
const zipCodeData = await getMobileZipCodeData(this.mobileZipCode);
|
const zipCodeData = await getMobileZipCodeData(this.mobileZipCode);
|
||||||
|
|
@ -584,7 +603,23 @@ $page-side-padding: 1.5rem;
|
||||||
|
|
||||||
:deep(.alert-header) {
|
:deep(.alert-header) {
|
||||||
button.btn-collapse {
|
button.btn-collapse {
|
||||||
align-self: center;
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
button.looka-likea-link {
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 1rem;
|
||||||
|
padding: 0;
|
||||||
|
color: $heritage-blue-primary;
|
||||||
|
text-decoration: none;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: #125b7e;
|
||||||
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@
|
||||||
class="shop-address"
|
class="shop-address"
|
||||||
aria-live="polite">
|
aria-live="polite">
|
||||||
<div class="address-header">
|
<div class="address-header">
|
||||||
{{ questionText }}
|
{{ questionText }}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="modelValue"
|
v-if="modelValue"
|
||||||
class="current-address">
|
class="current-address">
|
||||||
|
|
@ -16,8 +16,8 @@
|
||||||
<span class="shop-distance">{{ modelValue.distanceInMiles?.toFixed(2) }} mi</span>
|
<span class="shop-distance">{{ modelValue.distanceInMiles?.toFixed(2) }} mi</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="address-line">
|
<div class="address-line">
|
||||||
{{ getProviderAddress(modelValue) }}
|
{{ getProviderAddress(modelValue) }}
|
||||||
</div>
|
</div>
|
||||||
<div class="address-line">
|
<div class="address-line">
|
||||||
{{ getProviderCityZipState(modelValue) }}
|
{{ getProviderCityZipState(modelValue) }}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,14 @@
|
||||||
0 0 0-.127-.37.489.489 0 0 0-.388-.205z" />
|
0 0 0-.127-.37.489.489 0 0 0-.388-.205z" />
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
<span class="m-0 alert-header-text">
|
<template v-if="alertHeadline">
|
||||||
{{ alertHeadline }}
|
<div class="alert-headline-text-container">
|
||||||
</span>
|
<span class="m-0 alert-header-text d-block">
|
||||||
|
{{ alertHeadline }}
|
||||||
|
</span>
|
||||||
|
<slot name="headline-line-two"></slot>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
<button
|
<button
|
||||||
v-if="isCollapsible"
|
v-if="isCollapsible"
|
||||||
class="btn-collapse"
|
class="btn-collapse"
|
||||||
|
|
@ -65,7 +70,7 @@
|
||||||
<div
|
<div
|
||||||
v-show="alertCopy"
|
v-show="alertCopy"
|
||||||
:id="collapseId"
|
:id="collapseId"
|
||||||
class="alert-body">
|
class="alert-body show">
|
||||||
<template
|
<template
|
||||||
v-for="paragraph in splitAlertCopyForParagraphTag"
|
v-for="paragraph in splitAlertCopyForParagraphTag"
|
||||||
:key="paragraph">
|
:key="paragraph">
|
||||||
|
|
@ -146,12 +151,19 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
manualHeadline: String,
|
manualHeadline: String,
|
||||||
|
manualHeadlineLineTwo: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
manualCopy: String,
|
manualCopy: String,
|
||||||
shouldScrollToOnMount: {
|
shouldScrollToOnMount: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true
|
||||||
},
|
},
|
||||||
startCollapsed: Boolean
|
startCollapsed: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
},
|
},
|
||||||
emits: ['textLinkClicked'],
|
emits: ['textLinkClicked'],
|
||||||
data() {
|
data() {
|
||||||
|
|
@ -169,11 +181,19 @@ export default {
|
||||||
? this.manualHeadline
|
? this.manualHeadline
|
||||||
: this.getCmsContent(this.cmsWidgetName, 'HeadlineText');
|
: this.getCmsContent(this.cmsWidgetName, 'HeadlineText');
|
||||||
},
|
},
|
||||||
|
alertHeadlineLineTwo() {
|
||||||
|
return this.manualHeadlineLineTwo
|
||||||
|
? this.manualHeadlineLineTwo
|
||||||
|
: '';
|
||||||
|
},
|
||||||
alertCopy() {
|
alertCopy() {
|
||||||
return this.manualCopy
|
return this.manualCopy
|
||||||
? this.manualCopy
|
? this.manualCopy
|
||||||
: this.getCmsContent(this.cmsWidgetName, 'BodyText');
|
: this.getCmsContent(this.cmsWidgetName, 'BodyText');
|
||||||
},
|
},
|
||||||
|
hasManualHeadlineLineTwo() {
|
||||||
|
return this.manualHeadlineLineTwo !== '';
|
||||||
|
},
|
||||||
splitAlertCopyForParagraphTag() {
|
splitAlertCopyForParagraphTag() {
|
||||||
return splitCMSCopyOnParagraphTag(this.alertCopy);
|
return splitCMSCopyOnParagraphTag(this.alertCopy);
|
||||||
},
|
},
|
||||||
|
|
@ -186,7 +206,7 @@ export default {
|
||||||
mounted() {
|
mounted() {
|
||||||
this.ensureAlertIsInViewPort();
|
this.ensureAlertIsInViewPort();
|
||||||
if (this.isCollapsible) {
|
if (this.isCollapsible) {
|
||||||
this.collapseElement = Collapse.getOrCreateInstance(document.getElementById(this.collapseId));
|
this.collapseElement = Collapse.getOrCreateInstance(document.getElementById(this.collapseId), { toggle: this.startCollapsed });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -230,6 +250,14 @@ export default {
|
||||||
border: 1px solid;
|
border: 1px solid;
|
||||||
padding: 0rem;
|
padding: 0rem;
|
||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
|
.alert-headline-text-container {
|
||||||
|
flex-grow: 1;
|
||||||
|
padding: 0rem 0.625rem;
|
||||||
|
|
||||||
|
.alert-header-text {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
.alert-header {
|
.alert-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue