CSR-2063
CSR-2063 allow users that select 'vehicle not listed' button to return to concept and change their vehicle
This commit is contained in:
parent
6c00cd88b1
commit
1a5ed36e97
2 changed files with 38 additions and 6 deletions
|
|
@ -528,8 +528,7 @@ export default {
|
||||||
},
|
},
|
||||||
shouldHideBackButton() {
|
shouldHideBackButton() {
|
||||||
return (
|
return (
|
||||||
this.$store.getters.payment.insuranceCoverage.isVerified ||
|
this.$store.getters.payment.insuranceCoverage.isVerified
|
||||||
getFunnelCookie()?.HasDelayedClaimRegistration
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
<vehicleQuestion
|
<vehicleQuestion
|
||||||
ref="vehicleYearQuestion"
|
ref="vehicleYearQuestion"
|
||||||
v-model="selectedYear"
|
v-model="selectedYear"
|
||||||
:isDisabled="!yearOptions.length"
|
:isDisabled="isYearDisabled"
|
||||||
:options="yearOptions"
|
:options="yearOptions"
|
||||||
cmsWidgetName="VehicleYearQuestion"
|
cmsWidgetName="VehicleYearQuestion"
|
||||||
validationRules="year-required"
|
validationRules="year-required"
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
<vehicleQuestion
|
<vehicleQuestion
|
||||||
ref="vehicleMakeQuestion"
|
ref="vehicleMakeQuestion"
|
||||||
v-model="selectedMake"
|
v-model="selectedMake"
|
||||||
:isDisabled="!makeOptions.length"
|
:isDisabled="isMakeDisabled"
|
||||||
:options="makeOptions"
|
:options="makeOptions"
|
||||||
cmsWidgetName="VehicleMakeQuestion"
|
cmsWidgetName="VehicleMakeQuestion"
|
||||||
validationRules="make-required"
|
validationRules="make-required"
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
ref="vehicleModelQuestion"
|
ref="vehicleModelQuestion"
|
||||||
v-model="selectedModel"
|
v-model="selectedModel"
|
||||||
cmsWidgetName="VehicleModelQuestion"
|
cmsWidgetName="VehicleModelQuestion"
|
||||||
:isDisabled="!modelOptions.length"
|
:isDisabled="isModelDisabled"
|
||||||
:options="modelOptions"
|
:options="modelOptions"
|
||||||
validationRules="model-required"
|
validationRules="model-required"
|
||||||
placeHolderText="Select model"
|
placeHolderText="Select model"
|
||||||
|
|
@ -43,7 +43,7 @@
|
||||||
ref="vehicleStyleQuestion"
|
ref="vehicleStyleQuestion"
|
||||||
v-model="selectedStyle"
|
v-model="selectedStyle"
|
||||||
cmsWidgetName="VehicleStyleQuestion"
|
cmsWidgetName="VehicleStyleQuestion"
|
||||||
:isDisabled="!styleOptions.length"
|
:isDisabled="isStyleDisabled"
|
||||||
:options="styleOptions"
|
:options="styleOptions"
|
||||||
validationRules="style-required"
|
validationRules="style-required"
|
||||||
placeHolderText="Select style"
|
placeHolderText="Select style"
|
||||||
|
|
@ -98,6 +98,11 @@ import store from "@/store";
|
||||||
import { storeActions } from "@/constants/store-actions.js";
|
import { storeActions } from "@/constants/store-actions.js";
|
||||||
import baseMixin from "@/mixins/base-mixin.js";
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
|
|
||||||
|
import { applicationConfig } from "@/constants/application-config.js";
|
||||||
|
import { getDeviceIdValue } from "@/helpers/heritage-integration/cookie-helper";
|
||||||
|
import { experimentTriggers } from "@/constants/experiments";
|
||||||
|
import { getFunnelCookie } from "@/helpers/heritage-integration/cookie-helper";
|
||||||
|
|
||||||
//define validation rules
|
//define validation rules
|
||||||
defineRule("year-required", required(errorMessages.YEAR_REQUIRED));
|
defineRule("year-required", required(errorMessages.YEAR_REQUIRED));
|
||||||
defineRule("make-required", required(errorMessages.MAKE_REQUIRED));
|
defineRule("make-required", required(errorMessages.MAKE_REQUIRED));
|
||||||
|
|
@ -127,6 +132,14 @@ export default {
|
||||||
|
|
||||||
async beforeRouteEnter(to, from, next) {
|
async beforeRouteEnter(to, from, next) {
|
||||||
// Call APIs
|
// Call APIs
|
||||||
|
if (applicationConfig.CURRENT_ENVIRONMENT === "Localhost") {
|
||||||
|
storeActions.RUN_EXPERIMENTS_FOR_TRIGGER,
|
||||||
|
{
|
||||||
|
userId: getDeviceIdValue(),
|
||||||
|
triggerEvent: experimentTriggers.PAGE_ENTRY,
|
||||||
|
triggerValue: "vehicle",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage);
|
const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage);
|
||||||
const experimentForLogging = store.getters.applicationUser.experiments.find(
|
const experimentForLogging = store.getters.applicationUser.experiments.find(
|
||||||
|
|
@ -311,6 +324,18 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
isYearDisabled() {
|
||||||
|
return this.isDisabled(this.yearOptions);
|
||||||
|
},
|
||||||
|
isMakeDisabled() {
|
||||||
|
return this.isDisabled(this.makeOptions);
|
||||||
|
},
|
||||||
|
isModelDisabled() {
|
||||||
|
return this.isDisabled(this.modelOptions);
|
||||||
|
},
|
||||||
|
isStyleDisabled() {
|
||||||
|
return this.isDisabled(this.styleOptions);
|
||||||
|
},
|
||||||
unmatchedVehicleIcon() {
|
unmatchedVehicleIcon() {
|
||||||
if (this.imageUrl == null && this.carId !== null) return true;
|
if (this.imageUrl == null && this.carId !== null) return true;
|
||||||
else return false;
|
else return false;
|
||||||
|
|
@ -332,6 +357,14 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
isDisabled(options) {
|
||||||
|
if (!options.length || store.getters.payment?.insuranceCoverage?.isVerified || getFunnelCookie()?.HasDelayedClaimRegistration) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},
|
||||||
getVehicle(year, make, model, style) {
|
getVehicle(year, make, model, style) {
|
||||||
return this.dispatchStoreActionWithLogging(
|
return this.dispatchStoreActionWithLogging(
|
||||||
this.storeActions.GET_VEHICLE,
|
this.storeActions.GET_VEHICLE,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue