This commit is contained in:
Katie Kroell 2024-01-25 15:07:12 -05:00
parent 3bf6c3f831
commit 86dc82070a
2 changed files with 34 additions and 52 deletions

View file

@ -85,7 +85,6 @@ import settleAllPromises from '@/helpers/layout-helper';
import { Form } from 'vee-validate';
import BaseFormMixin from '@/mixins/base-form-mixin.js';
import { useMainStore } from '@/store';
import widgetFields from '@/constants/cms-widget-fields';
import { toTitleCase, toDisplayPhoneNumber, formatAmountInDollars } from '@/helpers/text-helper.js';
import bailoutMessage from '@/constants/bailoutMessage';
@ -122,23 +121,41 @@ export default {
const mainStore = useMainStore();
return { mainStore };
},
data() {
return {
widget: {
tpaConfirmation: 'TPAConfirmationContent',
orderDetails: 'OrderDetailsContent',
contactCarrier: 'ContactCarrierContent'
}
};
},
computed: {
tpaConfirmationHeaderText() {
return this.getCmsContent('TPAConfirmationContent', 'HeaderText');
},
tpaConfirmationImage() {
return this.getCmsContent('TPAConfirmationContent', 'Image');
},
tpaConfirmationSubheaderText() {
return this.getCmsContent('TPAConfirmationContent', 'SubheaderText')
?.replaceAll('{custom:glassShop}', this.preferredShopName);
},
tpaConfirmationBodyOne() {
return this.getCmsContent(this.widget.tpaConfirmation, widgetFields.CONTENT_GROUP_WIDGET.BODY_TEXT)
return this.getCmsContent('TPAConfirmationContent', 'BodyText')
?.replaceAll('{custom:phoneNumber}', this.preferredShopPhoneNumber)
?.replaceAll('{custom:glassShop}', this.preferredShopName);
},
tpaConfirmationBodyTwo() {
return this.getCmsContent(this.widget.tpaConfirmation, widgetFields.CONTENT_GROUP_WIDGET.BODY_TEXT_2);
return this.getCmsContent('TPAConfirmationContent', 'BodyText2');
},
contactCarrierText() {
return this.getCmsContent('ContactCarrierContent', 'Text')
?.replaceAll('{custom:carrierPhoneNumber}', this.carrierPhoneNumber);
},
orderDetailsTitle() {
return this.getCmsContent('OrderDetailsContent', 'HeaderText');
},
orderDetailsBody() {
const orderDetailsBodyText = this.getCmsContent('OrderDetailsContent', 'BodyText');
return this.processIfStatements(orderDetailsBodyText, 'custom', this.getCustomValueFromString);
},
deductibleBoxValue() {
return this.isVerified ? this.formatAmountInDollars(this.currentDeductible) : VERIFYING_COVERAGE;
},
currentDeductible() {
return useMainStore().order.currentDeductible;
},
preferredShopName() {
return toTitleCase(useMainStore().order.serviceLocation.provider.companyName);
@ -146,48 +163,19 @@ export default {
preferredShopPhoneNumber() {
return this.toDisplayPhoneNumber(useMainStore().order.serviceLocation.provider.phoneNumber);
},
orderDetailsTitle() {
return this.getCmsContent(this.widget.orderDetails, widgetFields.CONTENT_GROUP_WIDGET.HEADER_TEXT);
},
orderDetailsBody() {
const orderDetailsBodyText = this.getCmsContent(this.widget.orderDetails, widgetFields.CONTENT_GROUP_WIDGET.BODY_TEXT);
return this.processIfStatements(orderDetailsBodyText, 'custom', this.getCustomValueFromString);
},
isVerified() {
return useMainStore().order.payment.insuranceCoverage.isVerified;
},
currentDeductible() {
return useMainStore().order.currentDeductible;
},
deductibleBoxValue() {
const testVerified = this.isVerified;
const testString = VERIFYING_COVERAGE;
if (!testVerified) {
return testString;
}
// return this.isVerified ? this.formatAmountInDollars(this.currentDeductible) : VERIFYING_COVERAGE;
return this.formatAmountInDollars(this.currentDeductible);
},
tpaConfirmationHeaderText() {
return this.getCmsContent('TPAConfirmationContent', 'HeaderText');
},
tpaConfirmationSubheaderText() {
return this.getCmsContent('TPAConfirmationContent', 'SubheaderText')
?.replaceAll('{custom:glassShop}', this.preferredShopName);
},
tpaConfirmationImage() {
return this.getCmsContent('TPAConfirmationContent', 'Image');
},
contactCarrierText() {
return this.getCmsContent(this.widget.contactCarrier, widgetFields.TEXT_BLOCK_WIDGET.TEXT)
?.replaceAll('{custom:carrierPhoneNumber}', this.carrierPhoneNumber);
},
// TODO: Replace with actual carrier number when account service is ready
carrierPhoneNumber() {
return '800-000-0000';
},
carrierName() {
return this.mainStore.issConfig.clientName;
},
// TODO: Replace with actual carrier homepage URL
carrierUrl() {
return '//www.libertymutual.com';
}
},
mounted() {
@ -196,7 +184,7 @@ export default {
methods:
{
async forwardButtonAction() {
return this.navigateForward();
window.location.href = this.carrierUrl;
},
navigateForward() {
this.$router.navigate(
@ -204,9 +192,6 @@ export default {
this.$route
);
},
getBodyTextFromCms(cmsWidgetName) {
return this.getCmsContent(cmsWidgetName, 'BodyText');
},
getCustomValueFromString(str) {
switch (str) {
case 'deductibleAboveZero':

View file

@ -75,9 +75,6 @@ const navigationScenarios = Object.freeze({
EDIT_PREFERRED_SHOP: 'EDIT_PREFERRED_SHOP',
EDIT_CONTACT_DETAILS: 'EDIT_CONTACT_DETAILS',
// TPA Confirmation
REQUEST_CALLBACK: 'REQUEST_CALLBACK',
// Provider Preference
CLICKED_FORWARD_WITH_SAFELITE: 'CLICKED_FORWARD_WITH_SAFELITE',
CLICKED_FORWARD_WITH_TPA_ENABLED: 'CLICKED_FORWARD_WITH_TPA_ENABLED',