This commit is contained in:
Leah Schumann 2023-09-21 08:49:01 -04:00
parent a0aa596094
commit 19e419cd80
6 changed files with 77 additions and 16 deletions

View file

@ -8,7 +8,7 @@
:answers="answersToDisplay" :answers="answersToDisplay"
:groupName="groupName" :groupName="groupName"
buttonTypeString="listCard" buttonTypeString="listCard"
v-model="selectedValues" v-model="selectedValue"
:suppressError="suppressError" :suppressError="suppressError"
:validationRules="validationRules" :validationRules="validationRules"
isRequired /> isRequired />
@ -55,7 +55,7 @@ export default {
}) })
: []; : [];
}, },
selectedValues: { selectedValue: {
get: function () { get: function () {
return this.modelValue; return this.modelValue;
}, },

View file

@ -71,3 +71,18 @@ export async function getAvailabilityRating(
return Promise.resolve(shopStatus); return Promise.resolve(shopStatus);
} }
// export function getMobileProvider(mobileProviderNumber) {
// const provider = {
// providerNumber: mobileProviderNumber,
// address: {
// streetAddress1: null,
// streetAddress2: null,
// city: null,
// state: null,
// zipCode: null,
// zipCodeCtu: null,
// },
// };
// return provider;
// }

View file

@ -306,9 +306,10 @@ export default {
margin-top: 0em; margin-top: 0em;
} }
#mobileLocationLinkPromptId { .update-mobile-location-text-link {
white-space: pre-line; white-space: pre-line;
} }
.text-black { .text-black {
color: $black; color: $black;
} }

View file

@ -31,7 +31,7 @@
class="my-5" class="my-5"
cmsWidgetName="AlertRecalNoMobileWidget" cmsWidgetName="AlertRecalNoMobileWidget"
v-if="displayRecalibrationWarning" v-if="displayRecalibrationWarning"
@text-link-clicked="openModalAction" @text-link-clicked="openRecalibrationInformationModal"
alertClass="alert-warning" /> alertClass="alert-warning" />
<alert <alert
ref="alertInshopOnly" ref="alertInshopOnly"
@ -74,8 +74,9 @@
v-model="selectedProvider" v-model="selectedProvider"
:selectedAppointmentType="selectedAppointmentType" :selectedAppointmentType="selectedAppointmentType"
:isDisplayed="isShopQuestionDisplayed" :isDisplayed="isShopQuestionDisplayed"
@updated-shop-list="setUpdatedShopList"
cmsWidgetName="ShopQuestionWidget" /> cmsWidgetName="ShopQuestionWidget" />
<contentGroupModal ref="RecalModal" cmsWidgetName="RecalModal" /> <contentGroupModal ref="recalibrationInformationModal" cmsWidgetName="RecalModal" />
<funnel-footer <funnel-footer
cmsWidgetName="FunnelFooterWidget" cmsWidgetName="FunnelFooterWidget"
ref="funnelFooter" ref="funnelFooter"
@ -149,6 +150,7 @@ export default {
mobileFeePart: null, mobileFeePart: null,
zipContainsMilitaryBase: false, zipContainsMilitaryBase: false,
zipCodeCtu: null, zipCodeCtu: null,
providerData: [],
}; };
}, },
async beforeRouteEnter(to, from, next) { async beforeRouteEnter(to, from, next) {
@ -302,6 +304,9 @@ export default {
displayNoShopsAlert() { displayNoShopsAlert() {
return !this.isServiceableInshop && !this.isServiceableMobile; return !this.isServiceableInshop && !this.isServiceableMobile;
}, },
recalibrationInformationModal() {
return this.$refs.recalibrationInformationModal;
},
}, },
methods: { methods: {
arePagePrerequisitesValid() { arePagePrerequisitesValid() {
@ -372,6 +377,15 @@ export default {
this.isRecalibrationServiceableMobile = this.isRecalibrationServiceableMobile =
serviceabilityDetails.isRecalibrationServiceableMobile; serviceabilityDetails.isRecalibrationServiceableMobile;
}, },
async reloadShopData(zipCode) {
await this.$refs.shopQuestion.reloadShopData(zipCode);
},
setUpdatedShopList(providerData) {
this.providerData = providerData;
},
openRecalibrationInformationModal() {
this.recalibrationInformationModal.openModal();
},
backButtonAction() { backButtonAction() {
this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route); this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route);
}, },
@ -403,11 +417,24 @@ export default {
this.$router.navigateWithSaving(this.navigationScenarios.CLICKED_FORWARD, this.$route); this.$router.navigateWithSaving(this.navigationScenarios.CLICKED_FORWARD, this.$route);
}, },
openModalAction(modalName) { },
this.$refs[modalName].openModal(); watch: {
}, selectedAppointmentType: {
async reloadShopData() { handler(newValue) {
await this.$refs.shopQuestion.reloadShopData(this.zipCode); if (newValue === "Mobile") {
this.selectedProvider = this.defaultProvider;
this.selectedProvider.providerNumber = this.providerData.mobileProviderNumber;
}
},
providerData: {
handler(newValue) {
if (newValue === "Mobile") {
this.selectedProvider = this.defaultProvider;
this.selectedProvider.providerNumber =
this.providerData.mobileProviderNumber;
}
},
},
}, },
}, },
components: { components: {

View file

@ -95,8 +95,10 @@ export default {
return this.selectedValue?.providerNumber; return this.selectedValue?.providerNumber;
}, },
set: function (newValue) { set: function (newValue) {
console.log(`set: ${newValue}`);
// Button Question only supports Number, or String data types so we must get the full object to emit // Button Question only supports Number, or String data types so we must get the full object to emit
this.selectedValue = this.getSelectedProviderObject(newValue); this.selectedValue =
this.getSelectedProviderObject(newValue) ?? this.defaultProvider;
}, },
}, },
displayDropoffInformation() { displayDropoffInformation() {
@ -132,6 +134,7 @@ export default {
}, },
initializeComponent(shopQuestionInitialData) { initializeComponent(shopQuestionInitialData) {
this.shopProviders = shopQuestionInitialData.shopProviders; this.shopProviders = shopQuestionInitialData.shopProviders;
this.$emit("updated-shop-list", shopQuestionInitialData);
}, },
async getNextShopsFromList(numberToGet = 3) { async getNextShopsFromList(numberToGet = 3) {
const shopIterator = (array, n) => { const shopIterator = (array, n) => {
@ -195,16 +198,28 @@ export default {
async reloadShopData(serviceZipCode) { async reloadShopData(serviceZipCode) {
const result = await this.loadData(serviceZipCode); const result = await this.loadData(serviceZipCode);
this.initializeComponent(result.data); this.initializeComponent(result.data);
console.log("reloadShopData");
this.resetAnswers(); this.resetAnswers();
await nextTick(); await nextTick();
await this.getNextShopsFromList(); await this.getNextShopsFromList();
}, },
getSelectedProviderObject(providerNumber) { getSelectedProviderObject(providerNumber) {
const provider = this.shopProviders?.find( const defaultProvider = {
(provider) => provider.providerNumber == providerNumber providerNumber: null,
); address: {
streetAddress1: null,
streetAddress2: null,
city: null,
state: null,
zipCode: null,
zipCodeCtu: null,
},
};
const provider =
this.shopProviders?.find((provider) => provider.providerNumber == providerNumber) ??
defaultProvider;
return provider; return provider;
}, },
@ -223,7 +238,9 @@ export default {
await nextTick(); await nextTick();
this.selectedProviderNumber = null; if (newValue !== "Mobile") {
this.selectedProviderNumber = -1;
}
await nextTick(); await nextTick();

View file

@ -1280,6 +1280,7 @@ export const actions = {
? convertGlassPieceToBackEndCompatibleFormat(order.damage.glassToReplace) ? convertGlassPieceToBackEndCompatibleFormat(order.damage.glassToReplace)
: []; : [];
var payload = { var payload = {
zipCode: order.serviceLocation.provider.zipCode,
providerNumber: providerNumber, providerNumber: providerNumber,
startDate: startDate, startDate: startDate,
endDate: endDate, endDate: endDate,