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() {
|
||||
return (
|
||||
this.$store.getters.payment.insuranceCoverage.isVerified ||
|
||||
getFunnelCookie()?.HasDelayedClaimRegistration
|
||||
this.$store.getters.payment.insuranceCoverage.isVerified
|
||||
);
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
<vehicleQuestion
|
||||
ref="vehicleYearQuestion"
|
||||
v-model="selectedYear"
|
||||
:isDisabled="!yearOptions.length"
|
||||
:isDisabled="isYearDisabled"
|
||||
:options="yearOptions"
|
||||
cmsWidgetName="VehicleYearQuestion"
|
||||
validationRules="year-required"
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
<vehicleQuestion
|
||||
ref="vehicleMakeQuestion"
|
||||
v-model="selectedMake"
|
||||
:isDisabled="!makeOptions.length"
|
||||
:isDisabled="isMakeDisabled"
|
||||
:options="makeOptions"
|
||||
cmsWidgetName="VehicleMakeQuestion"
|
||||
validationRules="make-required"
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
ref="vehicleModelQuestion"
|
||||
v-model="selectedModel"
|
||||
cmsWidgetName="VehicleModelQuestion"
|
||||
:isDisabled="!modelOptions.length"
|
||||
:isDisabled="isModelDisabled"
|
||||
:options="modelOptions"
|
||||
validationRules="model-required"
|
||||
placeHolderText="Select model"
|
||||
|
|
@ -43,7 +43,7 @@
|
|||
ref="vehicleStyleQuestion"
|
||||
v-model="selectedStyle"
|
||||
cmsWidgetName="VehicleStyleQuestion"
|
||||
:isDisabled="!styleOptions.length"
|
||||
:isDisabled="isStyleDisabled"
|
||||
:options="styleOptions"
|
||||
validationRules="style-required"
|
||||
placeHolderText="Select style"
|
||||
|
|
@ -98,6 +98,11 @@ import store from "@/store";
|
|||
import { storeActions } from "@/constants/store-actions.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
|
||||
defineRule("year-required", required(errorMessages.YEAR_REQUIRED));
|
||||
defineRule("make-required", required(errorMessages.MAKE_REQUIRED));
|
||||
|
|
@ -127,6 +132,14 @@ export default {
|
|||
|
||||
async beforeRouteEnter(to, from, next) {
|
||||
// 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 experimentForLogging = store.getters.applicationUser.experiments.find(
|
||||
|
|
@ -311,6 +324,18 @@ export default {
|
|||
},
|
||||
},
|
||||
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() {
|
||||
if (this.imageUrl == null && this.carId !== null) return true;
|
||||
else return false;
|
||||
|
|
@ -332,6 +357,14 @@ export default {
|
|||
},
|
||||
},
|
||||
methods: {
|
||||
isDisabled(options) {
|
||||
if (!options.length || store.getters.payment?.insuranceCoverage?.isVerified || getFunnelCookie()?.HasDelayedClaimRegistration) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
getVehicle(year, make, model, style) {
|
||||
return this.dispatchStoreActionWithLogging(
|
||||
this.storeActions.GET_VEHICLE,
|
||||
|
|
|
|||
Loading…
Reference in a new issue