Fixed issue where navigation back for unverified use case from policy holder details page.
This commit is contained in:
parent
8012d8db07
commit
3f7a7fb1c1
3 changed files with 26 additions and 10 deletions
|
|
@ -78,7 +78,7 @@
|
|||
cmsWidgetName="SiteFooterWidget"
|
||||
:isForwardActionDisabled="!meta.valid"
|
||||
@ForwardClicked="forwardButtonAction"
|
||||
@backClicked="navigateBack" />
|
||||
@backClicked="backButtonAction" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -138,7 +138,6 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
customerQuestions: this.getPolicyHolderDetailsFromStore(),
|
||||
vehiclesFound: [],
|
||||
rules: {
|
||||
firstName: globalRules.POLICYHOLDER_FIRST_NAME_REQUIRED,
|
||||
lastName: globalRules.POLICYHOLDER_LAST_NAME_REQUIRED,
|
||||
|
|
@ -152,8 +151,8 @@ export default {
|
|||
isCoverageEnabled() {
|
||||
return this.mainStore.issConfig.isCoverageEnabled;
|
||||
},
|
||||
vehiclesCount() {
|
||||
return this.vehiclesFound.length;
|
||||
isPolicyVehicleSelected() {
|
||||
return this.mainStore.order.vehicle.policyVehicleId >= 0;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -163,13 +162,10 @@ export default {
|
|||
},
|
||||
|
||||
navigateForward() {
|
||||
if (this.vehiclesCount > 0) {
|
||||
if (this.isPolicyVehicleSelected) {
|
||||
this.$router.navigate(
|
||||
this.navigationScenarios.CLICKED_FORWARD_POLICY_VERIFIED,
|
||||
this.$route,
|
||||
{},
|
||||
{},
|
||||
this.vehiclesFound
|
||||
this.$route
|
||||
);
|
||||
} else {
|
||||
this.$router.navigate(
|
||||
|
|
@ -179,6 +175,20 @@ export default {
|
|||
}
|
||||
},
|
||||
|
||||
backButtonAction() {
|
||||
if (this.isPolicyVehicleSelected) {
|
||||
this.$router.navigate(
|
||||
this.navigationScenarios.CLICKED_BACK_POLICY_VERIFIED,
|
||||
this.$route
|
||||
);
|
||||
} else {
|
||||
this.$router.navigate(
|
||||
this.navigationScenarios.CLICKED_BACK_POLICY_UNVERIFIED,
|
||||
this.$route
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
getPolicyHolderDetailsFromStore() {
|
||||
return {
|
||||
addressQuestions: {
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ const navigationScenarios = Object.freeze({
|
|||
|
||||
// Policy Holder Details
|
||||
CLICKED_FORWARD_POLICY_VERIFIED: 'CLICKED_FORWARD_POLICY_VERIFIED',
|
||||
CLICKED_BACK_POLICY_UNVERIFIED: 'CLICKED_BACK_POLICY_UNVERIFIED',
|
||||
CLICKED_BACK_POLICY_VERIFIED: 'CLICKED_BACK_POLICY_VERIFIED',
|
||||
|
||||
// Policy Vehicle
|
||||
CLICKED_FORWARD_LISTED_VEHICLE: 'CLICKED_FORWARD_LISTED_VEHICLE',
|
||||
|
|
|
|||
|
|
@ -451,7 +451,11 @@ const routingTable = () => [
|
|||
issPageValue: issPageValues.POLICY_HOLDER_DETAILS,
|
||||
maps: [
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_BACK,
|
||||
scenario: navigationScenarios.CLICKED_BACK_POLICY_UNVERIFIED,
|
||||
destinationIssPageValue: issPageValues.VEHICLE_SELECTION
|
||||
},
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_BACK_POLICY_VERIFIED,
|
||||
destinationIssPageValue: issPageValues.WELCOME_PAGE
|
||||
},
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue