clean up
This commit is contained in:
parent
3bf6c3f831
commit
86dc82070a
2 changed files with 34 additions and 52 deletions
|
|
@ -85,7 +85,6 @@ import settleAllPromises from '@/helpers/layout-helper';
|
||||||
import { Form } from 'vee-validate';
|
import { Form } from 'vee-validate';
|
||||||
import BaseFormMixin from '@/mixins/base-form-mixin.js';
|
import BaseFormMixin from '@/mixins/base-form-mixin.js';
|
||||||
import { useMainStore } from '@/store';
|
import { useMainStore } from '@/store';
|
||||||
import widgetFields from '@/constants/cms-widget-fields';
|
|
||||||
import { toTitleCase, toDisplayPhoneNumber, formatAmountInDollars } from '@/helpers/text-helper.js';
|
import { toTitleCase, toDisplayPhoneNumber, formatAmountInDollars } from '@/helpers/text-helper.js';
|
||||||
import bailoutMessage from '@/constants/bailoutMessage';
|
import bailoutMessage from '@/constants/bailoutMessage';
|
||||||
|
|
||||||
|
|
@ -122,23 +121,41 @@ export default {
|
||||||
const mainStore = useMainStore();
|
const mainStore = useMainStore();
|
||||||
return { mainStore };
|
return { mainStore };
|
||||||
},
|
},
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
widget: {
|
|
||||||
tpaConfirmation: 'TPAConfirmationContent',
|
|
||||||
orderDetails: 'OrderDetailsContent',
|
|
||||||
contactCarrier: 'ContactCarrierContent'
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
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() {
|
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:phoneNumber}', this.preferredShopPhoneNumber)
|
||||||
?.replaceAll('{custom:glassShop}', this.preferredShopName);
|
?.replaceAll('{custom:glassShop}', this.preferredShopName);
|
||||||
},
|
},
|
||||||
tpaConfirmationBodyTwo() {
|
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() {
|
preferredShopName() {
|
||||||
return toTitleCase(useMainStore().order.serviceLocation.provider.companyName);
|
return toTitleCase(useMainStore().order.serviceLocation.provider.companyName);
|
||||||
|
|
@ -146,48 +163,19 @@ export default {
|
||||||
preferredShopPhoneNumber() {
|
preferredShopPhoneNumber() {
|
||||||
return this.toDisplayPhoneNumber(useMainStore().order.serviceLocation.provider.phoneNumber);
|
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() {
|
isVerified() {
|
||||||
return useMainStore().order.payment.insuranceCoverage.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
|
// TODO: Replace with actual carrier number when account service is ready
|
||||||
carrierPhoneNumber() {
|
carrierPhoneNumber() {
|
||||||
return '800-000-0000';
|
return '800-000-0000';
|
||||||
},
|
},
|
||||||
carrierName() {
|
carrierName() {
|
||||||
return this.mainStore.issConfig.clientName;
|
return this.mainStore.issConfig.clientName;
|
||||||
|
},
|
||||||
|
// TODO: Replace with actual carrier homepage URL
|
||||||
|
carrierUrl() {
|
||||||
|
return '//www.libertymutual.com';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
@ -196,7 +184,7 @@ export default {
|
||||||
methods:
|
methods:
|
||||||
{
|
{
|
||||||
async forwardButtonAction() {
|
async forwardButtonAction() {
|
||||||
return this.navigateForward();
|
window.location.href = this.carrierUrl;
|
||||||
},
|
},
|
||||||
navigateForward() {
|
navigateForward() {
|
||||||
this.$router.navigate(
|
this.$router.navigate(
|
||||||
|
|
@ -204,9 +192,6 @@ export default {
|
||||||
this.$route
|
this.$route
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
getBodyTextFromCms(cmsWidgetName) {
|
|
||||||
return this.getCmsContent(cmsWidgetName, 'BodyText');
|
|
||||||
},
|
|
||||||
getCustomValueFromString(str) {
|
getCustomValueFromString(str) {
|
||||||
switch (str) {
|
switch (str) {
|
||||||
case 'deductibleAboveZero':
|
case 'deductibleAboveZero':
|
||||||
|
|
|
||||||
|
|
@ -75,9 +75,6 @@ const navigationScenarios = Object.freeze({
|
||||||
EDIT_PREFERRED_SHOP: 'EDIT_PREFERRED_SHOP',
|
EDIT_PREFERRED_SHOP: 'EDIT_PREFERRED_SHOP',
|
||||||
EDIT_CONTACT_DETAILS: 'EDIT_CONTACT_DETAILS',
|
EDIT_CONTACT_DETAILS: 'EDIT_CONTACT_DETAILS',
|
||||||
|
|
||||||
// TPA Confirmation
|
|
||||||
REQUEST_CALLBACK: 'REQUEST_CALLBACK',
|
|
||||||
|
|
||||||
// Provider Preference
|
// Provider Preference
|
||||||
CLICKED_FORWARD_WITH_SAFELITE: 'CLICKED_FORWARD_WITH_SAFELITE',
|
CLICKED_FORWARD_WITH_SAFELITE: 'CLICKED_FORWARD_WITH_SAFELITE',
|
||||||
CLICKED_FORWARD_WITH_TPA_ENABLED: 'CLICKED_FORWARD_WITH_TPA_ENABLED',
|
CLICKED_FORWARD_WITH_TPA_ENABLED: 'CLICKED_FORWARD_WITH_TPA_ENABLED',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue