SSR 383
refactored logic with update requirements
This commit is contained in:
parent
91729e94c1
commit
8a487f2db0
2 changed files with 9 additions and 23 deletions
|
|
@ -237,12 +237,7 @@ export default {
|
||||||
async forwardButtonAction() {
|
async forwardButtonAction() {
|
||||||
if (this.isClientPassed)
|
if (this.isClientPassed)
|
||||||
{
|
{
|
||||||
//if disabled state is broken maliciously and policy number is changed, do not update new policy number
|
this.welcomePageModel.isPolicyNumberDisabled = "true";
|
||||||
if (this.welcomePageModel.policyNumber != this.mainStore.order.policy.policyNumber)
|
|
||||||
{
|
|
||||||
this.welcomePageModel.policyNumber = this.mainStore.order.policy.policyNumber
|
|
||||||
}
|
|
||||||
this.mainStore.order.policy.isPolicyNumberDisabled = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.mainStore.updatePolicyData(this.welcomePageModel);
|
this.mainStore.updatePolicyData(this.welcomePageModel);
|
||||||
|
|
@ -265,6 +260,7 @@ export default {
|
||||||
isDamageGlassOnly : this.mainStore.order.policy.isDamageGlassOnly,
|
isDamageGlassOnly : this.mainStore.order.policy.isDamageGlassOnly,
|
||||||
phoneNumber : this.mainStore.order.customer.phoneNumber,
|
phoneNumber : this.mainStore.order.customer.phoneNumber,
|
||||||
email : this.mainStore.order.customer.emailAddress,
|
email : this.mainStore.order.customer.emailAddress,
|
||||||
|
isPolicyNumberDisabled: this.mainStore.order.policy.isPolicyNumberDisabled,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -366,24 +362,14 @@ export default {
|
||||||
},
|
},
|
||||||
isClientPassed()
|
isClientPassed()
|
||||||
{
|
{
|
||||||
|
|
||||||
const visitedPolicyHolderPage = this.mainStore.pageData(issPageValues.POLICY_HOLDER_DETAILS) ? true : false;
|
const visitedPolicyHolderPage = this.mainStore.pageData(issPageValues.POLICY_HOLDER_DETAILS) ? true : false;
|
||||||
|
|
||||||
if(this.mainStore.issConfig.isAuthenticated)
|
if(this.mainStore.issConfig.isAuthenticated)
|
||||||
{
|
if ((!visitedPolicyHolderPage && this.mainStore.order.policy.policyNumber) || this.mainStore.order.policy.isPolicyNumberDisabled )
|
||||||
if (!visitedPolicyHolderPage){ //checking if the page is loaded for the first time
|
|
||||||
if(this.mainStore.order.policy.policyNumber )
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}else
|
|
||||||
{
|
{
|
||||||
if (this.mainStore.order.policy.isPolicyNumberDisabled)
|
return true;
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ const getDefaultState = () => {
|
||||||
damageState: null,
|
damageState: null,
|
||||||
damageCity: null,
|
damageCity: null,
|
||||||
isDamageGlassOnly: null,
|
isDamageGlassOnly: null,
|
||||||
isPolicyNumberDisabled: false
|
isPolicyNumberDisabled: null
|
||||||
},
|
},
|
||||||
customer: {
|
customer: {
|
||||||
address: {
|
address: {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue