some updates

This commit is contained in:
Bill Richardson 2026-01-28 12:24:32 -05:00
parent a8d6e4fb58
commit 0f40583be3
4 changed files with 48 additions and 38 deletions

View file

@ -172,10 +172,6 @@ export default {
modelValue: { modelValue: {
type: Object type: Object
}, },
mobileZipCode: {
type: String,
default: null
},
todayOverrideDateString: { todayOverrideDateString: {
// keep for use in unit tests to override today's date // keep for use in unit tests to override today's date
type: String, type: String,

View file

@ -4,11 +4,14 @@
:key="alert.cmsWidgetName" :key="alert.cmsWidgetName"
:ref="alert.cmsWidgetName" :ref="alert.cmsWidgetName"
class="mt-2 mb-3" class="mt-2 mb-3"
:manualHeadline="alert.manualHeadline"
:cmsWidgetName="alert.cmsWidgetName" :cmsWidgetName="alert.cmsWidgetName"
alertClass="alert-warning" /> alertClass="alert-warning" />
</template> </template>
<script> <script>
import alert from '@/ux-components/alert/alert.vue'; import alert from '@/ux-components/alert/alert.vue';
import widgetFields from '@/constants/cms-widget-fields';
import { toTitleCase } from '@/helpers/text-helper.js';
import getAlertReasons from '@/layouts/schedule-page/helpers/schedule-helper'; import getAlertReasons from '@/layouts/schedule-page/helpers/schedule-helper';
export default { export default {
@ -20,6 +23,10 @@ export default {
cmsWidgetPrefix: { cmsWidgetPrefix: {
type: String, type: String,
default: '' default: ''
},
city: {
type: String,
default: ''
} }
}, },
data() { data() {
@ -29,9 +36,15 @@ export default {
}, },
computed: { computed: {
prefixedAlertReasons() { prefixedAlertReasons() {
if (!this.alertReasons || this.alertReasons.length === 0) {
return [];
}
console.log('Prefixed Alert Reasons:', this.alertReasons);
return this.alertReasons.reduce((newObj, alertReason) => { return this.alertReasons.reduce((newObj, alertReason) => {
newObj.push({ newObj.push({
cmsWidgetName: `${this.cmsWidgetPrefix}${alertReason}`, cmsWidgetName: `${this.cmsWidgetPrefix}${alertReason}`,
manualHeadline: this.getCmsCopyForAlertReason(alertReason),
alertReason alertReason
}); });
return newObj; return newObj;
@ -51,6 +64,12 @@ export default {
}, },
cmsHeadlineTextFound(widgetName) { cmsHeadlineTextFound(widgetName) {
return this.getCmsContent(widgetName, 'HeadlineText') !== ''; return this.getCmsContent(widgetName, 'HeadlineText') !== '';
},
getCmsCopyForAlertReason(alertReason) {
const widgetName = `${this.cmsWidgetPrefix}${alertReason}`;
let content = this.getCmsContent(widgetName, widgetFields.ALERT_WIDGET.HEADLINE_TEXT);
content = content.replace('{custom:city}', toTitleCase(this.city));
return content;
} }
} }
}; };

View file

@ -19,9 +19,9 @@
<serviceLocation <serviceLocation
ref="serviceLocation" ref="serviceLocation"
@appointmentTypeChanged="appointmentTypeChangedFromServiceLocation" @appointmentTypeChanged="appointmentTypeChangedFromServiceLocation"
@cityUpdated="cityUpdatedFromServiceLocation"
@mobileZipUpdated="mobileZipUpdatedFromServiceLocation" @mobileZipUpdated="mobileZipUpdatedFromServiceLocation"
@providerChanged="providerChangedFromServiceLocation" @providerChanged="providerChangedFromServiceLocation" />
@serviceLocationUpdated="serviceLocationUpdatedFromServiceLocation" />
</div> </div>
</div> </div>
<div <div
@ -30,7 +30,8 @@
<div class="date-picker-content-container"> <div class="date-picker-content-container">
<locationAlerts <locationAlerts
ref="locationAlerts" ref="locationAlerts"
cmsWidgetPrefix="LocationAlert-" /> cmsWidgetPrefix="LocationAlert-"
:city="selectedServiceLocationCity" />
<datePicker <datePicker
ref="datePicker" ref="datePicker"
v-model="selectedTimeSlotInfo" v-model="selectedTimeSlotInfo"
@ -244,10 +245,6 @@ export default {
resultKey: 'cmsContent', resultKey: 'cmsContent',
promise: cmsContentPromise promise: cmsContentPromise
}, },
// {
// resultKey: 'datePickerInitialData',
// promise: datePickerInitialDataPromise
// },
{ {
resultKey: 'mobileFeePart', resultKey: 'mobileFeePart',
promise: mobileFeePartPromise promise: mobileFeePartPromise
@ -292,8 +289,6 @@ export default {
}; };
vm.setCmsContent(resultMap.cmsContent); vm.setCmsContent(resultMap.cmsContent);
// vm.$refs.datePicker.initializeComponent(resultMap.datePickerInitialData);
// vm.$refs.locationAlerts.initializeComponent(resultMap.alertReasons);
vm.$refs.serviceLocation.initializeComponent(serviceLocationData); vm.$refs.serviceLocation.initializeComponent(serviceLocationData);
await vm.setData(resultMap.premiumFeeWithPrice, initialServiceLocationObj); await vm.setData(resultMap.premiumFeeWithPrice, initialServiceLocationObj);
showIssLoadingModal(false); showIssLoadingModal(false);
@ -316,6 +311,7 @@ export default {
selectedDate: this.getSelectedDate(), selectedDate: this.getSelectedDate(),
selectedProvider: this.getSelectedProvider(), selectedProvider: this.getSelectedProvider(),
selectedServiceLocation: this.getServiceLocation(), selectedServiceLocation: this.getServiceLocation(),
selectedServiceLocationCity: this.getServiceLocationCity(),
selectedTimeSlotInfo: this.getSelectedTimeSlotInfo(), selectedTimeSlotInfo: this.getSelectedTimeSlotInfo(),
showDatePickerError: false showDatePickerError: false
}; };
@ -374,10 +370,19 @@ export default {
return useMainStore().order.serviceLocation.zipCode !== null; return useMainStore().order.serviceLocation.zipCode !== null;
}, },
async setData(premiumFeeWithPriceResponse, initialServiceLocationObj) { async setData(premiumFeeWithPriceResponse, initialServiceLocationObj) {
this.selectedServiceLocation = initialServiceLocationObj;
this.mobilePremiumAppointmentFee = premiumFeeWithPriceResponse this.mobilePremiumAppointmentFee = premiumFeeWithPriceResponse
? premiumFeeWithPriceResponse[0] ? premiumFeeWithPriceResponse[0]
: null; : null;
this.selectedServiceLocation = initialServiceLocationObj;
if (initialServiceLocationObj?.zipCodeCtu) {
this.$refs.locationAlerts.loadInitialData(
initialServiceLocationObj.zipCodeCtu,
initialServiceLocationObj.provider?.ctu
).then((alertReasons) => {
this.$refs.locationAlerts.initializeComponent(alertReasons.data);
});
}
if (this.selectedAppointmentType !== AppointmentTypeStrings.MOBILE if (this.selectedAppointmentType !== AppointmentTypeStrings.MOBILE
&& this.selectedAppointmentType !== AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP) { && this.selectedAppointmentType !== AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP) {
@ -393,16 +398,15 @@ export default {
if (this.inShopDatesData?.initialShopTimeSlotsResponse?.days?.length > 0) { if (this.inShopDatesData?.initialShopTimeSlotsResponse?.days?.length > 0) {
this.selectableDatesData = this.inShopDatesData.initialShopTimeSlotsResponse; this.selectableDatesData = this.inShopDatesData.initialShopTimeSlotsResponse;
this.$refs.datePicker.initializeComponent(this.inShopDatesData); this.$refs.datePicker.initializeComponent(this.inShopDatesData);
} else {
console.log('Appointment Type is In-Shop, but no existing data. Need to fetch here?...');
} }
} else if (this.mobileDatesData?.initialShopTimeSlotsResponse?.days?.length > 0) { } else if (this.mobileDatesData?.initialShopTimeSlotsResponse?.days?.length > 0) {
this.selectableDatesData = this.mobileDatesData.initialShopTimeSlotsResponse; this.selectableDatesData = this.mobileDatesData.initialShopTimeSlotsResponse;
this.$refs.datePicker.initializeComponent(this.mobileDatesData); this.$refs.datePicker.initializeComponent(this.mobileDatesData);
} else {
console.log('Appointment Type is Mobile, but no existing data. Need to fetch here?...');
} }
}, },
cityUpdatedFromServiceLocation(newCity) {
this.selectedServiceLocationCity = newCity;
},
dateSelectedFromPicker(date) { dateSelectedFromPicker(date) {
this.selectedDate = date; this.selectedDate = date;
this.showDatePickerError = false; this.showDatePickerError = false;
@ -567,6 +571,9 @@ export default {
getServiceLocation() { getServiceLocation() {
return this.mainStore.order.serviceLocation; return this.mainStore.order.serviceLocation;
}, },
getServiceLocationCity() {
return this.mainStore.order.serviceLocation?.city;
},
handleMqlChange(e) { handleMqlChange(e) {
this.isMobileView = !e.matches; this.isMobileView = !e.matches;
}, },
@ -581,7 +588,6 @@ export default {
} }
}, },
providerChangedFromServiceLocation(newProvider) { providerChangedFromServiceLocation(newProvider) {
console.log('Parent - Provider Changed from Service Location:', newProvider);
this.selectedProvider = newProvider?.provider; this.selectedProvider = newProvider?.provider;
if (newProvider?.refreshDatePicker) { if (newProvider?.refreshDatePicker) {
@ -589,10 +595,6 @@ export default {
this.refreshDatePicker(); this.refreshDatePicker();
} }
}, },
serviceLocationUpdatedFromServiceLocation(newServiceLocation) {
console.log('Parent - Service Location Updated from Service Location:', newServiceLocation);
this.selectedServiceLocation = newServiceLocation;
},
async refreshDatePicker() { async refreshDatePicker() {
await this.getDatePickerInitialData().then((data) => { await this.getDatePickerInitialData().then((data) => {
this.selectableDatesData = data.initialShopTimeSlotsResponse; this.selectableDatesData = data.initialShopTimeSlotsResponse;

View file

@ -5,18 +5,12 @@
ref="alertRecalNoMobile" ref="alertRecalNoMobile"
cmsWidgetName="AlertRecalNoMobileWidget" cmsWidgetName="AlertRecalNoMobileWidget"
alertClass="alert-warning" alertClass="alert-warning"
@text-link-clicked="openModalAction" /> @textLinkClicked="openModalAction" />
<alert <alert
v-if="displayBigTruckNoShops" v-if="displayBigTruckNoShops"
ref="alertBigTruckNoShops" ref="alertBigTruckNoShops"
cmsWidgetName="AlertBigTruckNoShopsWidget" cmsWidgetName="AlertBigTruckNoShopsWidget"
alertClass="alert-warning" /> alertClass="alert-warning" />
<div style="display: none;">
isServiceableMobile: {{ isServiceableMobile }}<br />
isServiceableInshop: {{ isServiceableInshop }}<br />
requiresInshopRecalibration: {{ requiresInshopRecalibration }}<br />
selectedAppointmentType: {{ selectedAppointmentType }}<br />
</div>
<div class="appointment-type"> <div class="appointment-type">
<div class="appointment-type-question-text d-flex"> <div class="appointment-type-question-text d-flex">
<span <span
@ -62,7 +56,7 @@
:selectedAppointmentType="selectedAppointmentType" :selectedAppointmentType="selectedAppointmentType"
modalWidgetName="ChangeLocationModalWidget" modalWidgetName="ChangeLocationModalWidget"
cmsWidgetName="ShopAddressWidget" cmsWidgetName="ShopAddressWidget"
@zip-updated="handleInShopZipUpdated" /> @zipUpdated="handleInShopZipUpdated" />
<!-- INTEGRATION TODO: Put this right under the calendar --> <!-- INTEGRATION TODO: Put this right under the calendar -->
<alert <alert
v-if="selectedProvider === null" v-if="selectedProvider === null"
@ -123,7 +117,6 @@ import { useMainStore } from '@/store';
import showIssLoadingModal from '@/helpers/loading-modal-helper.js'; import showIssLoadingModal from '@/helpers/loading-modal-helper.js';
import { import {
getAvailabilityRating, getAvailabilityRating,
getPricedMobileFeePart,
getServiceabilityDetails, getServiceabilityDetails,
getZipCodeData, getZipCodeData,
getMobileZipCodeData getMobileZipCodeData
@ -154,7 +147,7 @@ export default {
serviceZipQuestion serviceZipQuestion
}, },
mixins: [baseFormMixin], mixins: [baseFormMixin],
emits: ['service-location-updated', 'appointment-type-changed', 'mobile-zip-updated', 'provider-changed'], emits: ['appointment-type-changed', 'city-updated', 'mobile-zip-updated', 'provider-changed'],
setup() { setup() {
const mainStore = useMainStore(); const mainStore = useMainStore();
return { mainStore }; return { mainStore };
@ -294,6 +287,11 @@ export default {
} }
}, },
watch: { watch: {
city(newCity, oldCity) {
if (newCity !== oldCity) {
this.$emit('city-updated', newCity);
}
},
async mobileZipCode(newZip) { async mobileZipCode(newZip) {
if (newZip !== '') { if (newZip !== '') {
showIssLoadingModal(true); showIssLoadingModal(true);
@ -562,11 +560,6 @@ $page-side-padding: 1.5rem;
.form-test-error { .form-test-error {
font-weight: $font-weight-bold; font-weight: $font-weight-bold;
} }
:deep(.alert-header) {
button {
align-self: flex-start;
}
}
.appointment-type-question-text { .appointment-type-question-text {
color: $black; color: $black;
font-weight: 600; font-weight: 600;