Incorporating isClaimRegistrationRequired logic into verifiedDeductible
This commit is contained in:
parent
76d909908e
commit
36a8b706f0
6 changed files with 41 additions and 63 deletions
|
|
@ -165,7 +165,7 @@ function mapStringToModal(str) {
|
|||
const params = linkToReplace.substring((dynamicStrings.MODAL_LINK).length + 2, linkToReplace.length - 1);
|
||||
const splitParams = params.split(',');
|
||||
|
||||
const bodyText = '<a modalTarget="' + splitParams[0] + '" class="modal-text" aria-label="Modal window">' + splitParams[1] + '</a>';
|
||||
const bodyText = '<button modalTarget="' + splitParams[0] + '" class="modal-text" aria-label="Modal window">' + splitParams[1] + '</button>';
|
||||
|
||||
let returnVal = str.replace(linkToReplace, bodyText);
|
||||
|
||||
|
|
|
|||
|
|
@ -20,37 +20,6 @@
|
|||
<span class="dot-2">.</span>
|
||||
<span class="dot-3">.</span>
|
||||
</p>
|
||||
|
||||
<!-- <p>
|
||||
Finding shops near you
|
||||
<span class="dot-1">.</span>
|
||||
<span class="dot-2">.</span>
|
||||
<span class="dot-3">.</span>
|
||||
</p>
|
||||
<p>
|
||||
Looking for dates
|
||||
<span class="dot-1">.</span>
|
||||
<span class="dot-2">.</span>
|
||||
<span class="dot-3">.</span>
|
||||
</p>
|
||||
<p>
|
||||
Searching for times
|
||||
<span class="dot-1">.</span>
|
||||
<span class="dot-2">.</span>
|
||||
<span class="dot-3">.</span>
|
||||
</p>
|
||||
<p>
|
||||
Nearly there
|
||||
<span class="dot-1">.</span>
|
||||
<span class="dot-2">.</span>
|
||||
<span class="dot-3">.</span>
|
||||
</p>
|
||||
<p>
|
||||
Finishing up
|
||||
<span class="dot-1">.</span>
|
||||
<span class="dot-2">.</span>
|
||||
<span class="dot-3">.</span>
|
||||
</p> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -169,11 +169,10 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
isVerified: store.order.payment.insuranceCoverage.isVerified,
|
||||
availableLineItems: [],
|
||||
selectedProvider: '',
|
||||
deductibleText: 'Your deductible is:',
|
||||
isLoading: true,
|
||||
// TODO update when design team gives appropriate text
|
||||
loadingText: [
|
||||
'Connecting to your insurance company',
|
||||
'Nearly there',
|
||||
|
|
@ -230,7 +229,7 @@ export default {
|
|||
return damageString === 'match' ? '' : damageString;
|
||||
},
|
||||
vehicleDeductible() {
|
||||
if (this.coverageVerified) {
|
||||
if (this.policyLookupSuccessful) {
|
||||
if (store.order.damage.isRepair) {
|
||||
const repairDeductible = store.order.policy.deductible.repair;
|
||||
return repairDeductible;
|
||||
|
|
@ -250,38 +249,40 @@ export default {
|
|||
deductibleOverZero() {
|
||||
return this.verifiedDeductible && !this.isDeductibleZero;
|
||||
},
|
||||
coverageVerified() {
|
||||
policyLookupSuccessful() {
|
||||
return useMainStore().order.policy.policyLookupSuccessful;
|
||||
},
|
||||
coverageUnverified() {
|
||||
return !this.coverageVerified;
|
||||
registerClaimSuccessful() {
|
||||
return useMainStore().payment.insuranceCoverage.isVerified;
|
||||
},
|
||||
policyLookupUnsuccessful() {
|
||||
return !this.policyLookupSuccessful;
|
||||
},
|
||||
verifiedNoComp() {
|
||||
return this.coverageVerified ? store.order.policy.noCoverage : false;
|
||||
return this.policyLookupSuccessful ? store.order.policy.noCoverage : false;
|
||||
},
|
||||
verifiedITAC() {
|
||||
return this.coverageVerified
|
||||
return this.policyLookupSuccessful
|
||||
&& !this.verifiedNoComp
|
||||
&& this.vehicleDeductible > this.totalServicePrice;
|
||||
},
|
||||
coveredAndServicePriceAboveOrEqualDeductible() {
|
||||
return !this.verifiedNoComp && this.totalServicePrice >= this.vehicleDeductible;
|
||||
},
|
||||
verifiedDeductible() {
|
||||
return this.coverageVerified
|
||||
&& !this.verifiedNoComp
|
||||
&& this.totalServicePrice > this.vehicleDeductible;
|
||||
return this.isClaimRegistrationRequired
|
||||
? this.registerClaimSuccessful && this.coveredAndServicePriceAboveOrEqualDeductible
|
||||
: this.policyLookupSuccessful && this.coveredAndServicePriceAboveOrEqualDeductible;
|
||||
},
|
||||
isADAS() {
|
||||
const parts = store.order.lineItems.glassParts;
|
||||
return parts != null && parts.find((part) => part.requiresRecalibration);
|
||||
},
|
||||
ADASReplace() {
|
||||
if (!store.order.damage.isRepair) {
|
||||
const parts = store.order.lineItems.glassParts;
|
||||
|
||||
if (parts != null && parts.filter((part) =>
|
||||
part.requiresRecalibration).length > 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return !store.order.damage.isRepair && this.isADAS;
|
||||
},
|
||||
nonADASReplace() {
|
||||
return !this.ADASReplace;
|
||||
return !store.order.damage.isRepair && !this.isADAS;
|
||||
},
|
||||
nonADASRepair() {
|
||||
return store.order.damage.isRepair;
|
||||
|
|
@ -324,12 +325,15 @@ export default {
|
|||
this.$refs.loadingModal.showModal();
|
||||
setupModalLinks(this);
|
||||
const vm = this;
|
||||
if (useMainStore().policy.coverageVerified
|
||||
if (this.policyLookupSuccessful
|
||||
&& useMainStore().isClaimRegistrationRequired
|
||||
&& !useMainStore().policy.noCoverage) {
|
||||
&& this.coveredAndServicePriceAboveOrEqualDeductible) {
|
||||
useMainStore().registerClaim().then((r) => {
|
||||
vm.$refs.loadingModal.hideModal();
|
||||
return r;
|
||||
}, (r) => {
|
||||
vm.$refs.loadingModal.hideModal();
|
||||
return r;
|
||||
});
|
||||
} else {
|
||||
vm.$refs.loadingModal.hideModal();
|
||||
|
|
@ -346,7 +350,7 @@ export default {
|
|||
return this.navigateForward();
|
||||
},
|
||||
async navigateForward() {
|
||||
if (!this.coverageVerified || this.verifiedDeductible) {
|
||||
if (!this.policyLookupSuccessful || this.verifiedDeductible) {
|
||||
this.$router.navigate(this.navigationScenarios.CLICKED_FORWARD,
|
||||
this.$route);
|
||||
} else if (this.verifiedITAC || this.verifiedNoComp) {
|
||||
|
|
@ -389,7 +393,7 @@ export default {
|
|||
getCustomValueFromString(str) {
|
||||
switch (str) {
|
||||
case 'coverageUnverified':
|
||||
return this.coverageUnverified;
|
||||
return this.policyLookupUnsuccessful;
|
||||
case 'verifiedDeductible':
|
||||
return this.verifiedDeductible;
|
||||
case 'verifiedITAC':
|
||||
|
|
|
|||
|
|
@ -205,12 +205,6 @@ export default {
|
|||
color: $black;
|
||||
}
|
||||
|
||||
.modal-link a{
|
||||
color: $blue-700;
|
||||
font-size: 14px;
|
||||
line-height: 24px;
|
||||
font-weight: 500;
|
||||
}
|
||||
.question-text {
|
||||
margin-top: 0;
|
||||
margin-bottom: .5rem;
|
||||
|
|
|
|||
|
|
@ -22,6 +22,10 @@ $limu-button-color: #A9E3E9;
|
|||
color: $limu-link !important;
|
||||
}
|
||||
|
||||
.modal-text {
|
||||
color: $limu-link !important;
|
||||
}
|
||||
|
||||
.btn {
|
||||
&.btn-override[aria-disabled="false"]{
|
||||
&.btn-primary {
|
||||
|
|
|
|||
|
|
@ -69,5 +69,12 @@ body {
|
|||
color: $blue;
|
||||
cursor: pointer;
|
||||
text-decoration: underline;
|
||||
border: none;
|
||||
background-color: transparent;
|
||||
padding: 0;
|
||||
text-underline-offset: 5px;
|
||||
font-size: 14px;
|
||||
line-height: 24px;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue