Merge pull request #687 from Safelite/feature/richardson/misc-style-fixes

format only
This commit is contained in:
brich1212safe 2024-05-07 12:50:28 -04:00 committed by GitHub
commit f560b60b00
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -66,7 +66,7 @@ export default {
buttonQuestion, buttonQuestion,
siteFooter, siteFooter,
// eslint-disable-next-line vue/no-reserved-component-names // eslint-disable-next-line vue/no-reserved-component-names
Form, Form
}, },
mixins: [BaseFormMixin], mixins: [BaseFormMixin],
async beforeRouteEnter(to, from, next) { async beforeRouteEnter(to, from, next) {
@ -87,26 +87,20 @@ export default {
siteHeader: 'SiteHeaderWidget', siteHeader: 'SiteHeaderWidget',
siteSubHeader: 'SiteSubHeaderWidget', siteSubHeader: 'SiteSubHeaderWidget',
existingOrNewQuestion: 'ExistingOrNewQuestion', existingOrNewQuestion: 'ExistingOrNewQuestion',
siteFooter: 'SiteFooterWidget', siteFooter: 'SiteFooterWidget'
}, },
rules: { rules: {
selectionRequired: globalRules.OPTION_REQUIRED, selectionRequired: globalRules.OPTION_REQUIRED
}, }
}; };
}, },
computed: { computed: {
questionText() { questionText() {
return this.getCmsContent( return this.getCmsContent(this.widget.existingOrNewQuestion, 'QuestionText');
this.widget.existingOrNewQuestion,
'QuestionText'
);
}, },
answersFromCms() { answersFromCms() {
return ( return (
this.getCmsContent( this.getCmsContent(this.widget.existingOrNewQuestion, 'Answers') ?? []
this.widget.existingOrNewQuestion,
'Answers'
) ?? []
); );
}, },
getNewOrderSelectionName() { getNewOrderSelectionName() {
@ -117,32 +111,28 @@ export default {
const orders = useMainStore().applicationUser.duplicateOrders; const orders = useMainStore().applicationUser.duplicateOrders;
return ( return (
orders?.map((o) => { orders?.map((o) => {
const vehicle = const vehicle = !!o.vehicleYear && !!o.vehicleMake && !!o.vehicleModel
!!o.vehicleYear && !!o.vehicleMake && !!o.vehicleModel ? `${o.vehicleYear} ${o.vehicleMake} ${o.vehicleModel}`
? `${o.vehicleYear} ${o.vehicleMake} ${o.vehicleModel}` : null;
: null; const dateOfLoss = o.responseDate == null
? ''
const dateOfLoss = : new Date(o.responseDate).toLocaleDateString();
o.responseDate == null const subtext = vehicle && o.responseDate
? '' ? `${vehicle}, ${dateOfLoss}`
: new Date(o.responseDate).toLocaleDateString(); : (vehicle ?? '').concat(dateOfLoss);
const subtext =
vehicle && o.responseDate
? `${vehicle}, ${dateOfLoss}`
: (vehicle ?? '').concat(dateOfLoss);
return { return {
Text: duplicateOrderText, Text: duplicateOrderText,
Name: o.referralNumber, Name: o.referralNumber,
SubText: toTitleCase(subtext), SubText: toTitleCase(subtext),
value: o.correlationId, value: o.correlationId
}; };
}) ?? [] }) ?? []
); );
}, },
answers() { answers() {
return [...this.duplicateOrders, ...this.answersFromCms]; return [...this.duplicateOrders, ...this.answersFromCms];
}, }
}, },
methods: { methods: {
/** /**
@ -151,9 +141,7 @@ export default {
async forwardButtonAction() { async forwardButtonAction() {
if (this.selectedAnswer !== null) { if (this.selectedAnswer !== null) {
const selectedReferral = const selectedReferral =
this.mainStore.applicationUser.duplicateOrders.find( this.mainStore.applicationUser.duplicateOrders.find((o) => o.correlationId === this.selectedAnswer);
(o) => o.correlationId === this.selectedAnswer
);
if (selectedReferral) { if (selectedReferral) {
await this.mainStore await this.mainStore
.loadSession(selectedReferral) .loadSession(selectedReferral)
@ -179,14 +167,12 @@ export default {
if (!this.mainStore.order.loadedFromDupeCheck) { if (!this.mainStore.order.loadedFromDupeCheck) {
if (policyVehicles.length !== 0) { if (policyVehicles.length !== 0) {
this.$router.navigate( this.$router.navigate(
this.navigationScenarios this.navigationScenarios.CLICKED_FORWARD_POLICY_VERIFIED_WITH_VEHICLES,
.CLICKED_FORWARD_POLICY_VERIFIED_WITH_VEHICLES,
this.$route this.$route
); );
} else { } else {
this.$router.navigate( this.$router.navigate(
this.navigationScenarios this.navigationScenarios.CLICKED_FORWARD_POLICY_VERIFIED_NO_VEHICLES,
.CLICKED_FORWARD_POLICY_VERIFIED_NO_VEHICLES,
this.$route this.$route
); );
} }
@ -195,25 +181,22 @@ export default {
if (this.mainStore.order.vehicle.vin) { if (this.mainStore.order.vehicle.vin) {
this.$router.navigate( this.$router.navigate(
this.navigationScenarios this.navigationScenarios.CLICKED_FORWARD_LOADED_DUPLICATE_WITH_POLICY_VEHICLE,
.CLICKED_FORWARD_LOADED_DUPLICATE_WITH_POLICY_VEHICLE,
this.$route this.$route
); );
} else if (policyVehicles.length !== 0) { } else if (policyVehicles.length !== 0) {
this.$router.navigate( this.$router.navigate(
this.navigationScenarios this.navigationScenarios.CLICKED_FORWARD_LOADED_DUPLICATE_WITH_NON_POLICY_VEHICLE,
.CLICKED_FORWARD_LOADED_DUPLICATE_WITH_NON_POLICY_VEHICLE,
this.$route this.$route
); );
} else { } else {
this.$router.navigate( this.$router.navigate(
this.navigationScenarios this.navigationScenarios.CLICKED_FORWARD_LOADED_DUPLICATE_WITH_NO_POLICY_VEHICLES,
.CLICKED_FORWARD_LOADED_DUPLICATE_WITH_NO_POLICY_VEHICLES,
this.$route this.$route
); );
} }
}, }
}, }
}; };
</script> </script>