updated vinlookupmethod constant

updated vin lookup method constant file
This commit is contained in:
hiteshkumar87 2023-03-02 20:58:48 +05:30
parent 1ed1561598
commit ed405fd19b
4 changed files with 13 additions and 13 deletions

View file

@ -1,7 +1,7 @@
const VIN_LOOKUP_METHODS = Object.freeze({
manualVin: 'ManualVin',
licensePlate: 'LicensePlate',
homeAddress: 'HomeAddress',
const vinLookupMethodSelections = Object.freeze({
MANUALVIN: 'ManualVin',
LICENSEPLATE: 'LicensePlate',
HOMEADDRESS: 'HomeAddress',
});
export default VIN_LOOKUP_METHODS;
export {vinLookupMethodSelections};

View file

@ -5,7 +5,7 @@ import { issPageValues } from '@/router/router-constants/issPage-values';
import { queryStrings } from '@/constants/query-strings';
import { GaActions } from "@/constants/analytics";
import VehicleLookup from './vehicle-lookup.vue';
import vinLookupMethods from '@/constants/vin-lookup-methods';
import {vinLookupMethodSelections} from '@/constants/vin-lookup-methods';
const vinLookupMethodsMockData = {
QuestionText: 'To find the right part, lets get your VIN. Or we can look it up for you!',
@ -121,7 +121,7 @@ describe('vehicle-lookup.vue', () => {
// Not using initializeComponent() because it doesn't trigger reactivity in test.
const Answers = JSON.parse(JSON.stringify(vinLookupMethodsMockData.Answers));
if(!mockIsVinbyAddressPermissibleToBeFalse.IsVinbyAddressPermissible){
Answers.splice(Answers.indexOf(vinLookupMethods.homeAddress),1);
Answers.splice(Answers.indexOf(vinLookupMethodSelections.HOMEADDRESS),1);
}
vinLookupMethodsWrapper.setData({
questionTextFromCms: vinLookupMethodsMockData.QuestionText,

View file

@ -38,7 +38,7 @@ import { fetchCmsContentForPage } from '@/helpers/cms-content-helper';
import { settleAllPromises } from '@/helpers/layout-helper';
import { Form } from 'vee-validate';
import BaseFormMixin from '@/mixins/base-form-mixin';
import constVinLookupMethods from '@/constants/vin-lookup-methods';
import {vinLookupMethodSelections} from '@/constants/vin-lookup-methods';
// Import Component
import SiteFooter from '@/iss-components/site-footer/site-footer.vue';
@ -98,13 +98,13 @@ export default {
},
forwardButtonAction() {
switch (this.selectedVinLookupMethod) {
case constVinLookupMethods.manualVin:
case vinLookupMethodSelections.MANUALVIN:
this.$router.navigate(this.navigationScenarios.SELECTED_MANUAL_VIN, this.$route);
break;
case constVinLookupMethods.licensePlate:
case vinLookupMethodSelections.LICENSEPLATE:
this.$router.navigate(this.navigationScenarios.SELECTED_LICENSE_PLATE, this.$route);
break;
case constVinLookupMethods.homeAddress:
case vinLookupMethodSelections.HOMEADDRESS:
this.$router.navigate(this.navigationScenarios.SELECTED_HOME_ADDRESS, this.$route);
break;
default:

View file

@ -17,7 +17,7 @@ import { defineRule } from 'vee-validate';
import { required } from '@/helpers/validation-rules';
import { errorMessages } from '@/constants/error-messages';
import { useMainStore } from "@/store";
import vinLookupMethods from '@/constants/vin-lookup-methods';
import {vinLookupMethodSelections} from '@/constants/vin-lookup-methods';
import { settleAllPromises } from "@/helpers/layout-helper";
// Import Component
@ -64,7 +64,7 @@ export default {
const answers = this.getCmsContent(this.cmsWidgetName, 'Answers');
if (Array.isArray(answers)) {
if(!isVinbyAddressPermissible){
answers.splice(answers.indexOf(vinLookupMethods.homeAddress),1);
answers.splice(answers.indexOf(vinLookupMethodSelections.HOMEADDRESS),1);
}
this.answersFromCms = answers;
}