From af647c0acc4e9a84f80bf0d0fa880b1a51321900 Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Tue, 7 May 2024 12:40:49 -0400 Subject: [PATCH] format only --- .../duplicate-check/duplicate-check.vue | 67 +++++++------------ 1 file changed, 25 insertions(+), 42 deletions(-) diff --git a/src/layouts/duplicate-check/duplicate-check.vue b/src/layouts/duplicate-check/duplicate-check.vue index d341a69e..1eb465bd 100644 --- a/src/layouts/duplicate-check/duplicate-check.vue +++ b/src/layouts/duplicate-check/duplicate-check.vue @@ -66,7 +66,7 @@ export default { buttonQuestion, siteFooter, // eslint-disable-next-line vue/no-reserved-component-names - Form, + Form }, mixins: [BaseFormMixin], async beforeRouteEnter(to, from, next) { @@ -87,26 +87,20 @@ export default { siteHeader: 'SiteHeaderWidget', siteSubHeader: 'SiteSubHeaderWidget', existingOrNewQuestion: 'ExistingOrNewQuestion', - siteFooter: 'SiteFooterWidget', + siteFooter: 'SiteFooterWidget' }, rules: { - selectionRequired: globalRules.OPTION_REQUIRED, - }, + selectionRequired: globalRules.OPTION_REQUIRED + } }; }, computed: { questionText() { - return this.getCmsContent( - this.widget.existingOrNewQuestion, - 'QuestionText' - ); + return this.getCmsContent(this.widget.existingOrNewQuestion, 'QuestionText'); }, answersFromCms() { return ( - this.getCmsContent( - this.widget.existingOrNewQuestion, - 'Answers' - ) ?? [] + this.getCmsContent(this.widget.existingOrNewQuestion, 'Answers') ?? [] ); }, getNewOrderSelectionName() { @@ -117,32 +111,28 @@ export default { const orders = useMainStore().applicationUser.duplicateOrders; return ( orders?.map((o) => { - const vehicle = - !!o.vehicleYear && !!o.vehicleMake && !!o.vehicleModel - ? `${o.vehicleYear} ${o.vehicleMake} ${o.vehicleModel}` - : null; - - const dateOfLoss = - o.responseDate == null - ? '' - : new Date(o.responseDate).toLocaleDateString(); - const subtext = - vehicle && o.responseDate - ? `${vehicle}, ${dateOfLoss}` - : (vehicle ?? '').concat(dateOfLoss); + const vehicle = !!o.vehicleYear && !!o.vehicleMake && !!o.vehicleModel + ? `${o.vehicleYear} ${o.vehicleMake} ${o.vehicleModel}` + : null; + const dateOfLoss = o.responseDate == null + ? '' + : new Date(o.responseDate).toLocaleDateString(); + const subtext = vehicle && o.responseDate + ? `${vehicle}, ${dateOfLoss}` + : (vehicle ?? '').concat(dateOfLoss); return { Text: duplicateOrderText, Name: o.referralNumber, SubText: toTitleCase(subtext), - value: o.correlationId, + value: o.correlationId }; }) ?? [] ); }, answers() { return [...this.duplicateOrders, ...this.answersFromCms]; - }, + } }, methods: { /** @@ -151,9 +141,7 @@ export default { async forwardButtonAction() { if (this.selectedAnswer !== null) { const selectedReferral = - this.mainStore.applicationUser.duplicateOrders.find( - (o) => o.correlationId === this.selectedAnswer - ); + this.mainStore.applicationUser.duplicateOrders.find((o) => o.correlationId === this.selectedAnswer); if (selectedReferral) { await this.mainStore .loadSession(selectedReferral) @@ -179,14 +167,12 @@ export default { if (!this.mainStore.order.loadedFromDupeCheck) { if (policyVehicles.length !== 0) { this.$router.navigate( - this.navigationScenarios - .CLICKED_FORWARD_POLICY_VERIFIED_WITH_VEHICLES, + this.navigationScenarios.CLICKED_FORWARD_POLICY_VERIFIED_WITH_VEHICLES, this.$route ); } else { this.$router.navigate( - this.navigationScenarios - .CLICKED_FORWARD_POLICY_VERIFIED_NO_VEHICLES, + this.navigationScenarios.CLICKED_FORWARD_POLICY_VERIFIED_NO_VEHICLES, this.$route ); } @@ -195,25 +181,22 @@ export default { if (this.mainStore.order.vehicle.vin) { this.$router.navigate( - this.navigationScenarios - .CLICKED_FORWARD_LOADED_DUPLICATE_WITH_POLICY_VEHICLE, + this.navigationScenarios.CLICKED_FORWARD_LOADED_DUPLICATE_WITH_POLICY_VEHICLE, this.$route ); } else if (policyVehicles.length !== 0) { this.$router.navigate( - this.navigationScenarios - .CLICKED_FORWARD_LOADED_DUPLICATE_WITH_NON_POLICY_VEHICLE, + this.navigationScenarios.CLICKED_FORWARD_LOADED_DUPLICATE_WITH_NON_POLICY_VEHICLE, this.$route ); } else { this.$router.navigate( - this.navigationScenarios - .CLICKED_FORWARD_LOADED_DUPLICATE_WITH_NO_POLICY_VEHICLES, + this.navigationScenarios.CLICKED_FORWARD_LOADED_DUPLICATE_WITH_NO_POLICY_VEHICLES, this.$route ); } - }, - }, + } + } };