diff --git a/src/constants/tint-mapper.js b/src/constants/tint-mapper.js index 7452b692..87b5e145 100644 --- a/src/constants/tint-mapper.js +++ b/src/constants/tint-mapper.js @@ -1,7 +1,7 @@ // TintMap with array keys by location, lowercase to avoid as much string mismatching as possible. // Src assumes you have a @/assets/img/tints/, making the final value @/assets/img/tints/{Src} in the markup. // See vehicle-parts for implementation example. -const tintMap = { +const tintMap = Object.freeze({ other: [ // Blue Shade { name: 'blue tint, blue shade', src: 'Glass-BlueShade-BlueTint.svg' }, @@ -71,23 +71,19 @@ const tintMap = { // No shade or tint { name: 'clear', src: 'Windshield-NoShade-NoTint.svg' } ] -}; +}); // Gets the tint image source string given the glass location, and the tint description (like 'Green Tint') // Use lowered strings here to try to avoid mismatch. Returns an empty string if array key doesn't exist. // Returns undefined if no items are found. -export function getTintImage(glassLocation, colorString) { +const getTintImage = (glassLocation, colorString) => { // Windshield glass has special images, all other glass uses the same though. - if (glassLocation.toLowerCase() !== 'windshield') { - glassLocation = 'other'; - } - - if (tintMap[glassLocation.toLowerCase()] === undefined) { + const glassLoc = (glassLocation.toLowerCase() !== 'windshield') ? 'other' : 'windshield'; + if (tintMap[glassLoc] === undefined) { return ''; } - const tintImageSource = tintMap[glassLocation.toLowerCase()] - .find((item) => item.name.toLowerCase() === colorString.toLowerCase()); + return tintMap[glassLoc].find((item) => item.name.toLowerCase() === colorString.toLowerCase()); +}; - return tintImageSource; -} +export default getTintImage; diff --git a/src/constants/vehicle-categories.js b/src/constants/vehicle-categories.js index 37f75eef..e2e342d0 100644 --- a/src/constants/vehicle-categories.js +++ b/src/constants/vehicle-categories.js @@ -1,4 +1,4 @@ -const vehicleCategories = { +const vehicleCategories = Object.freeze({ CAR: 'CAR', TRUCK: 'TRUCK', VAN: 'VAN', @@ -6,6 +6,6 @@ const vehicleCategories = { SUV: 'SUV', MOTORHOME: 'MOTOR HOME', SEMI: 'SEMI' -}; +}); -export { vehicleCategories }; \ No newline at end of file +export default vehicleCategories; diff --git a/src/constants/vehicle-selection-options.js b/src/constants/vehicle-selection-options.js index 57f1d764..7c87d5aa 100644 --- a/src/constants/vehicle-selection-options.js +++ b/src/constants/vehicle-selection-options.js @@ -2,4 +2,4 @@ const vehicleSelectionOptions = Object.freeze({ VEHICLE_NOT_LISTED: 'Vehicle not listed' }); -export { vehicleSelectionOptions }; +export default vehicleSelectionOptions; diff --git a/src/constants/vin-lookup-methods.js b/src/constants/vin-lookup-methods.js index f4651cf0..539bdb3d 100644 --- a/src/constants/vin-lookup-methods.js +++ b/src/constants/vin-lookup-methods.js @@ -4,4 +4,4 @@ const vinLookupMethodSelections = Object.freeze({ HOMEADDRESS: 'HomeAddress' }); -export { vinLookupMethodSelections }; +export default vinLookupMethodSelections; diff --git a/src/digital-components/base-input-button/base-input-button.vue b/src/digital-components/base-input-button/base-input-button.vue index a35ac631..20a9f50f 100644 --- a/src/digital-components/base-input-button/base-input-button.vue +++ b/src/digital-components/base-input-button/base-input-button.vue @@ -30,7 +30,7 @@ import { handleButtonComponentFocus, handleInputComponentBlur } from '@/helpers/button-question-focus-helper'; -import { inputButtonProps } from '@/digital-components/base-input-button/button-functionality-props'; +import inputButtonProps from '@/digital-components/base-input-button/button-functionality-props'; export default { name: 'base-input-button', diff --git a/src/digital-components/base-input-button/button-functionality-props.js b/src/digital-components/base-input-button/button-functionality-props.js index 34db5bd4..b62a67e8 100644 --- a/src/digital-components/base-input-button/button-functionality-props.js +++ b/src/digital-components/base-input-button/button-functionality-props.js @@ -1,4 +1,4 @@ -export const inputButtonProps = { +const inputButtonProps = { value: { type: [String, Number], required: true @@ -36,3 +36,5 @@ export const inputButtonProps = { }, suppressError: Boolean }; + +export default inputButtonProps; diff --git a/src/helpers/unit-test-helper.js b/src/helpers/unit-test-helper.js index 9ec182ee..23e7781c 100644 --- a/src/helpers/unit-test-helper.js +++ b/src/helpers/unit-test-helper.js @@ -1,6 +1,6 @@ import { navigationScenarios } from '@/router/router-constants/navigation-scenarios.js'; import { RouterLinkStub } from '@vue/test-utils'; -import { vehicleCategories } from '@/constants/vehicle-categories.js'; +import vehicleCategories from '@/constants/vehicle-categories.js'; import { issPageValues } from '@/router/router-constants/issPage-values'; import cookieNames from '@/constants/cookie-names'; import { Form } from 'vee-validate'; diff --git a/src/iss-components/vehicle-banner/vehicle-banner.spec.js b/src/iss-components/vehicle-banner/vehicle-banner.spec.js index 58b1ba87..cfd05257 100644 --- a/src/iss-components/vehicle-banner/vehicle-banner.spec.js +++ b/src/iss-components/vehicle-banner/vehicle-banner.spec.js @@ -1,5 +1,5 @@ import { shallowMount } from '@vue/test-utils'; -import { vehicleCategories } from '@/constants/vehicle-categories.js'; +import vehicleCategories from '@/constants/vehicle-categories.js'; import { useMainStore } from '@/store'; import { createApp } from 'vue'; import { createPinia, mapStores } from 'pinia'; diff --git a/src/layouts/policy-vehicles/policy-vehicles.spec.js b/src/layouts/policy-vehicles/policy-vehicles.spec.js index 03a18cdf..364f0e22 100644 --- a/src/layouts/policy-vehicles/policy-vehicles.spec.js +++ b/src/layouts/policy-vehicles/policy-vehicles.spec.js @@ -10,7 +10,7 @@ import { getRandomString, getRandomInt } from '@/helpers/data-generation'; import endorsementOptions from '@/constants/endorsement-options'; import { createTestingPinia } from '@pinia/testing'; import { issPageValues } from '@/router/router-constants/issPage-values'; -import { vehicleSelectionOptions } from '@/constants/vehicle-selection-options'; +import vehicleSelectionOptions from '@/constants/vehicle-selection-options'; // Mock fetchCmsContentForPage jest.mock('@/helpers/cms-content-helper', () => ({ diff --git a/src/layouts/policy-vehicles/policy-vehicles.vue b/src/layouts/policy-vehicles/policy-vehicles.vue index 8cfbd451..34ff8f9f 100644 --- a/src/layouts/policy-vehicles/policy-vehicles.vue +++ b/src/layouts/policy-vehicles/policy-vehicles.vue @@ -50,7 +50,7 @@ import { fetchCmsContentForPage } from '@/helpers/cms-content-helper.js'; import { Form } from 'vee-validate'; import BaseFormMixin from '@/mixins/base-form-mixin.js'; import { issPageValues } from '@/router/router-constants/issPage-values.js'; -import { vehicleSelectionOptions } from '@/constants/vehicle-selection-options.js'; +import vehicleSelectionOptions from '@/constants/vehicle-selection-options.js'; import endorsementOptions from '@/constants/endorsement-options.js'; import globalRules from '@/constants/global-rules.js'; import { useMainStore } from '@/store/index.js'; diff --git a/src/layouts/vehicle-damage/vehicle-damage.spec.js b/src/layouts/vehicle-damage/vehicle-damage.spec.js index 3d77a71c..f5fba05f 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.spec.js +++ b/src/layouts/vehicle-damage/vehicle-damage.spec.js @@ -3,7 +3,7 @@ import { mount, flushPromises } from '@vue/test-utils'; import { createTestingPinia } from '@pinia/testing'; import { navigationScenarios } from '@/router/router-constants/navigation-scenarios'; import { routerParams } from '@/router/router-params'; -import { vehicleCategories } from '@/constants/vehicle-categories'; +import vehicleCategories from '@/constants/vehicle-categories'; import VehicleDamageComponent from '@/layouts/vehicle-damage/vehicle-damage'; const mockRoute = { diff --git a/src/layouts/vehicle-lookup/vehicle-lookup.spec.js b/src/layouts/vehicle-lookup/vehicle-lookup.spec.js index ea96ee04..b932259d 100644 --- a/src/layouts/vehicle-lookup/vehicle-lookup.spec.js +++ b/src/layouts/vehicle-lookup/vehicle-lookup.spec.js @@ -3,7 +3,7 @@ import { mount } from '@vue/test-utils'; import { navigationScenarios } from '@/router/router-constants/navigation-scenarios'; import queryStrings from '@/constants/query-strings'; import { GaActions } from '@/constants/analytics'; -import { vinLookupMethodSelections } from '@/constants/vin-lookup-methods'; +import vinLookupMethodSelections from '@/constants/vin-lookup-methods'; import { useMainStore } from '@/store'; import { createTestingPinia } from '@pinia/testing'; import { mapStores } from 'pinia'; diff --git a/src/layouts/vehicle-lookup/vehicle-lookup.vue b/src/layouts/vehicle-lookup/vehicle-lookup.vue index b93c0c66..4b409868 100644 --- a/src/layouts/vehicle-lookup/vehicle-lookup.vue +++ b/src/layouts/vehicle-lookup/vehicle-lookup.vue @@ -43,7 +43,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 { vinLookupMethodSelections } from '@/constants/vin-lookup-methods'; +import vinLookupMethodSelections from '@/constants/vin-lookup-methods'; import { useMainStore } from '@/store'; // Import Component diff --git a/src/layouts/vehicle-lookup/vin-lookup-methods/vin-lookup-methods.vue b/src/layouts/vehicle-lookup/vin-lookup-methods/vin-lookup-methods.vue index e6d835e2..cfe6f108 100644 --- a/src/layouts/vehicle-lookup/vin-lookup-methods/vin-lookup-methods.vue +++ b/src/layouts/vehicle-lookup/vin-lookup-methods/vin-lookup-methods.vue @@ -13,7 +13,7 @@ // Import Other Supporting Files import { useMainStore } from '@/store'; -import { vinLookupMethodSelections } from '@/constants/vin-lookup-methods'; +import vinLookupMethodSelections from '@/constants/vin-lookup-methods'; import { settleAllPromises } from '@/helpers/layout-helper'; import globalRules from '@/constants/global-rules'; diff --git a/src/layouts/vehicle-parts/glass-part-question/glass-part-question.vue b/src/layouts/vehicle-parts/glass-part-question/glass-part-question.vue index 23840d1c..2c5e9d61 100644 --- a/src/layouts/vehicle-parts/glass-part-question/glass-part-question.vue +++ b/src/layouts/vehicle-parts/glass-part-question/glass-part-question.vue @@ -46,7 +46,7 @@ import buttonQuestion from '@/digital-components/button-question/button-question'; // Supporting files -import { getTintImage } from '@/constants/tint-mapper'; +import getTintImage from '@/constants/tint-mapper'; import getCustomTransformValue from '@/constants/dynamictext-mapper'; import { defineRule } from 'vee-validate'; import { required } from '@/helpers/validation-rules'; diff --git a/src/mixins/base-mixin.js b/src/mixins/base-mixin.js index 4c55009b..1679a739 100644 --- a/src/mixins/base-mixin.js +++ b/src/mixins/base-mixin.js @@ -1,7 +1,7 @@ import { mapStores } from 'pinia'; import { useMainStore } from '@/store'; import { navigationScenarios } from '@/router/router-constants/navigation-scenarios'; -import { vehicleCategories } from '@/constants/vehicle-categories.js'; +import vehicleCategories from '@/constants/vehicle-categories.js'; import queryStrings from '@/constants/query-strings'; import dynamicStrings from '@/constants/dynamic-strings'; import { routerParams } from '@/router/router-constants/router-params'; diff --git a/src/mixins/input-button-wrapper-mixin.js b/src/mixins/input-button-wrapper-mixin.js index 0a7401f9..b4a3172f 100644 --- a/src/mixins/input-button-wrapper-mixin.js +++ b/src/mixins/input-button-wrapper-mixin.js @@ -1,4 +1,4 @@ -import { inputButtonProps } from '@/digital-components/base-input-button/button-functionality-props'; +import inputButtonProps from '@/digital-components/base-input-button/button-functionality-props'; export default { model: {