Fix code formatting for payment-method page (#640)
This commit is contained in:
parent
ab5fa3b48b
commit
61f0790057
1 changed files with 55 additions and 60 deletions
|
|
@ -79,7 +79,6 @@ import alert from '@/ux-components/alert/alert.vue';
|
|||
// Supporting Items
|
||||
import settleAllPromises from '@/helpers/layout-helper';
|
||||
import { useMainStore } from '@/store';
|
||||
import { experimentSettings } from '@/constants/experiments';
|
||||
import { fetchCmsContentForPage } from '@/helpers/cms-content-helper';
|
||||
import { paymentMethods } from '@/constants/payment-method-constants';
|
||||
import queryStrings from '@/constants/query-strings';
|
||||
|
|
@ -102,7 +101,7 @@ export default {
|
|||
cartDropdown,
|
||||
paymentMethodQuestion,
|
||||
alert,
|
||||
VehicleBanner,
|
||||
VehicleBanner
|
||||
},
|
||||
mixins: [baseFormMixin],
|
||||
async beforeRouteEnter(to, from, next) {
|
||||
|
|
@ -115,20 +114,20 @@ export default {
|
|||
const promiseResultMap = [
|
||||
{
|
||||
resultKey: 'cmsContent',
|
||||
promise: cmsContentPromise,
|
||||
promise: cmsContentPromise
|
||||
},
|
||||
{
|
||||
resultKey: 'reviewDropdownData',
|
||||
promise: reviewDropdownPromise,
|
||||
promise: reviewDropdownPromise
|
||||
},
|
||||
{
|
||||
resultKey: 'wipers',
|
||||
promise: wipersPromise,
|
||||
promise: wipersPromise
|
||||
},
|
||||
{
|
||||
resultKey: 'rainDefense',
|
||||
promise: rainDefensePromise,
|
||||
},
|
||||
promise: rainDefensePromise
|
||||
}
|
||||
];
|
||||
|
||||
const resultMap = await settleAllPromises(promiseResultMap);
|
||||
|
|
@ -141,12 +140,10 @@ export default {
|
|||
const pricedVaps = await useMainStore()
|
||||
.getPriceOrderItems(unpricedVaps)
|
||||
.catch((err) => {
|
||||
useMainStore().setBailout(
|
||||
bailoutMessage.pricingResponseError(
|
||||
unpricedVaps.map((li) => li.partNumber),
|
||||
{ code: err.code, message: err.message, data: err.data }
|
||||
)
|
||||
);
|
||||
useMainStore().setBailout(bailoutMessage.pricingResponseError(
|
||||
unpricedVaps.map((li) => li.partNumber),
|
||||
{ code: err.code, message: err.message, data: err.data }
|
||||
));
|
||||
hasBailedOut = true;
|
||||
next(`/?issPage=${issPageValues.BAILOUT_PAGE}`);
|
||||
});
|
||||
|
|
@ -155,9 +152,7 @@ export default {
|
|||
next((vm) => {
|
||||
vm.setCmsContent(resultMap.cmsContent);
|
||||
vm.updateFooterButtonText(vm.customCallToActionButtonCopy);
|
||||
vm.$refs.reviewDropdown.initializeComponent(
|
||||
resultMap.reviewDropdownData
|
||||
);
|
||||
vm.$refs.reviewDropdown.initializeComponent(resultMap.reviewDropdownData);
|
||||
vm.storeAvailableVaps(pricedVaps ?? []);
|
||||
});
|
||||
}
|
||||
|
|
@ -166,8 +161,8 @@ export default {
|
|||
return {
|
||||
paymentMethodInternalModel: this.getPaymentMethodFromStore(),
|
||||
rules: {
|
||||
optionRequired: globalRules.OPTION_REQUIRED,
|
||||
},
|
||||
optionRequired: globalRules.OPTION_REQUIRED
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
|
@ -191,61 +186,61 @@ export default {
|
|||
},
|
||||
paymentMethod() {
|
||||
return this.paymentMethodInternalModel;
|
||||
},
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
customCallToActionButtonCopy(newValue) {
|
||||
this.updateFooterButtonText(newValue);
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
arePagePrerequisitesValid() {
|
||||
// Vehicle
|
||||
const { vehicle } = useMainStore().order;
|
||||
const vehicleReqs = !!(
|
||||
vehicle.year &&
|
||||
vehicle.make &&
|
||||
vehicle.model &&
|
||||
vehicle.style
|
||||
vehicle.year
|
||||
&& vehicle.make
|
||||
&& vehicle.model
|
||||
&& vehicle.style
|
||||
);
|
||||
|
||||
// Damage
|
||||
const { isRepair, numberOfChips, glassToReplace } =
|
||||
useMainStore().order.damage;
|
||||
const damageReqs = !!(
|
||||
(isRepair && numberOfChips) ||
|
||||
(!isRepair && glassToReplace?.length)
|
||||
(isRepair && numberOfChips)
|
||||
|| (!isRepair && glassToReplace?.length)
|
||||
);
|
||||
|
||||
// Service Package
|
||||
const { lineItems } = useMainStore().order;
|
||||
const packageReqs = !!(
|
||||
(isRepair || lineItems.glassParts) &&
|
||||
lineItems.supportingItems
|
||||
(isRepair || lineItems.glassParts)
|
||||
&& lineItems.supportingItems
|
||||
);
|
||||
|
||||
// Service Location
|
||||
const { serviceLocation } = useMainStore().order;
|
||||
const mobileReqs = !!(
|
||||
serviceLocation.address &&
|
||||
serviceLocation.city &&
|
||||
serviceLocation.state &&
|
||||
serviceLocation.zipCode
|
||||
serviceLocation.address
|
||||
&& serviceLocation.city
|
||||
&& serviceLocation.state
|
||||
&& serviceLocation.zipCode
|
||||
);
|
||||
|
||||
const providerLocation = serviceLocation.provider.address;
|
||||
const dropOffInshopReqs = !!(
|
||||
providerLocation.streetAddress &&
|
||||
providerLocation.city &&
|
||||
providerLocation.state &&
|
||||
providerLocation.zipCode
|
||||
providerLocation.streetAddress
|
||||
&& providerLocation.city
|
||||
&& providerLocation.state
|
||||
&& providerLocation.zipCode
|
||||
);
|
||||
|
||||
const isMobile =
|
||||
serviceLocation.appointmentType ===
|
||||
AppointmentTypeStrings.MOBILE ||
|
||||
serviceLocation.appointmentType ===
|
||||
AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP;
|
||||
serviceLocation.appointmentType
|
||||
=== AppointmentTypeStrings.MOBILE
|
||||
|| serviceLocation.appointmentType
|
||||
=== AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP;
|
||||
const serviceLocationReqs =
|
||||
(isMobile && mobileReqs) || (!isMobile && dropOffInshopReqs);
|
||||
|
||||
|
|
@ -253,11 +248,11 @@ export default {
|
|||
const { date, startTime, endTime, jobMaxMinutes, jobMinMinutes } =
|
||||
useMainStore().order.schedule;
|
||||
const scheduleReqs = !!(
|
||||
date &&
|
||||
startTime &&
|
||||
endTime &&
|
||||
jobMaxMinutes &&
|
||||
jobMinMinutes
|
||||
date
|
||||
&& startTime
|
||||
&& endTime
|
||||
&& jobMaxMinutes
|
||||
&& jobMinMinutes
|
||||
);
|
||||
|
||||
// Customer
|
||||
|
|
@ -268,27 +263,27 @@ export default {
|
|||
// Contact Info
|
||||
const { contactInfo } = useMainStore().order;
|
||||
const contactInfoReqs = !!(
|
||||
contactInfo.firstName &&
|
||||
contactInfo.lastName &&
|
||||
contactInfo.servicePhone &&
|
||||
contactInfo.emailAddress
|
||||
contactInfo.firstName
|
||||
&& contactInfo.lastName
|
||||
&& contactInfo.servicePhone
|
||||
&& contactInfo.emailAddress
|
||||
);
|
||||
|
||||
return (
|
||||
vehicleReqs &&
|
||||
damageReqs &&
|
||||
packageReqs &&
|
||||
serviceLocationReqs &&
|
||||
scheduleReqs &&
|
||||
customerReqs &&
|
||||
contactInfoReqs
|
||||
vehicleReqs
|
||||
&& damageReqs
|
||||
&& packageReqs
|
||||
&& serviceLocationReqs
|
||||
&& scheduleReqs
|
||||
&& customerReqs
|
||||
&& contactInfoReqs
|
||||
);
|
||||
},
|
||||
getPaymentMethodFromStore() {
|
||||
const { payInAdvanceType } = useMainStore().order.payment;
|
||||
const isPayInAdvance =
|
||||
useMainStore().order.payment.isPayInAdvance &&
|
||||
!!payInAdvanceType;
|
||||
useMainStore().order.payment.isPayInAdvance
|
||||
&& !!payInAdvanceType;
|
||||
|
||||
return isPayInAdvance
|
||||
? payInAdvanceType
|
||||
|
|
@ -314,8 +309,8 @@ export default {
|
|||
},
|
||||
storeAvailableVaps(vaps) {
|
||||
useMainStore().order.availableVaps = vaps;
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue