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() {
|
||||
if (this.isClientPassed)
|
||||
{
|
||||
//if disabled state is broken maliciously and policy number is changed, do not update new policy number
|
||||
if (this.welcomePageModel.policyNumber != this.mainStore.order.policy.policyNumber)
|
||||
{
|
||||
this.welcomePageModel.policyNumber = this.mainStore.order.policy.policyNumber
|
||||
}
|
||||
this.mainStore.order.policy.isPolicyNumberDisabled = true;
|
||||
this.welcomePageModel.isPolicyNumberDisabled = "true";
|
||||
}
|
||||
|
||||
this.mainStore.updatePolicyData(this.welcomePageModel);
|
||||
|
|
@ -265,6 +260,7 @@ export default {
|
|||
isDamageGlassOnly : this.mainStore.order.policy.isDamageGlassOnly,
|
||||
phoneNumber : this.mainStore.order.customer.phoneNumber,
|
||||
email : this.mainStore.order.customer.emailAddress,
|
||||
isPolicyNumberDisabled: this.mainStore.order.policy.isPolicyNumberDisabled,
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
@ -366,24 +362,14 @@ export default {
|
|||
},
|
||||
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 (!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;
|
||||
}
|
||||
if ((!visitedPolicyHolderPage && this.mainStore.order.policy.policyNumber) || this.mainStore.order.policy.isPolicyNumberDisabled )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ const getDefaultState = () => {
|
|||
damageState: null,
|
||||
damageCity: null,
|
||||
isDamageGlassOnly: null,
|
||||
isPolicyNumberDisabled: false
|
||||
isPolicyNumberDisabled: null
|
||||
},
|
||||
customer: {
|
||||
address: {
|
||||
|
|
|
|||
Loading…
Reference in a new issue