From 65c9ce64c24100322e861a1bcdecc2ddf5a1ee9d Mon Sep 17 00:00:00 2001 From: DavidAtSafelite Date: Thu, 10 Aug 2023 07:33:38 -0400 Subject: [PATCH 1/2] A bit more prefer-default and I added the new store constants. They are *not* being used yet, but I like the idea of getting them in and giving folks an opportunity to get used to the idea. --- src/constants/cookie-names.js | 2 +- src/constants/coverage-statuses.js | 6 +- src/constants/damage-locations-cms.js | 6 +- src/constants/damage-locations-selected.js | 6 +- src/helpers/cookie-helper.js | 2 +- src/helpers/damage-helper.js | 2 +- src/helpers/unit-test-helper.js | 2 +- .../service-package-question.vue | 3 +- .../side-door-options/side-door-options.vue | 2 +- src/layouts/vehicle-damage/vehicle-damage.vue | 4 +- .../windshield-options/windshield-options.vue | 2 +- src/mixins/analytics-mixin.js | 2 +- src/store/constants/apis.js | 191 +++++++++++++ src/store/constants/default-payloads.js | 254 ++++++++++++++++++ src/store/index.js | 4 +- src/store/store.spec.js | 2 +- 16 files changed, 468 insertions(+), 22 deletions(-) create mode 100644 src/store/constants/apis.js create mode 100644 src/store/constants/default-payloads.js diff --git a/src/constants/cookie-names.js b/src/constants/cookie-names.js index 3a7606e3..ded5da72 100644 --- a/src/constants/cookie-names.js +++ b/src/constants/cookie-names.js @@ -9,4 +9,4 @@ const cookieNames = { SESSION_KEY: 'skey' }; -export { cookieNames }; +export default Object.freeze(cookieNames); diff --git a/src/constants/coverage-statuses.js b/src/constants/coverage-statuses.js index 7b50aa51..5f794cc9 100644 --- a/src/constants/coverage-statuses.js +++ b/src/constants/coverage-statuses.js @@ -1,7 +1,7 @@ -const coverageStatuses = { +const coverageStatuses = Object.freeze({ PENDING: 'Pending', NO_COMP: 'No Comp', VERIFIED: 'Verified' -}; +}); -export { coverageStatuses }; \ No newline at end of file +export default coverageStatuses; diff --git a/src/constants/damage-locations-cms.js b/src/constants/damage-locations-cms.js index 8fd10043..9b99dc68 100644 --- a/src/constants/damage-locations-cms.js +++ b/src/constants/damage-locations-cms.js @@ -1,9 +1,9 @@ -const damageLocationsCms = { +const damageLocationsCms = Object.freeze({ WINDSHIELD: 'WINDSHIELD', SIDEDOOR: 'SIDEDOOR', REARWINDOW: 'REARWINDOW', DRIVERSIDE: 'DRIVERSIDE', PASSENGERSIDE: 'PASSENGERSIDE' -}; +}); -export { damageLocationsCms }; +export default damageLocationsCms; diff --git a/src/constants/damage-locations-selected.js b/src/constants/damage-locations-selected.js index a57dbd88..2783283c 100644 --- a/src/constants/damage-locations-selected.js +++ b/src/constants/damage-locations-selected.js @@ -1,4 +1,4 @@ -const damageLocationsSelected = { +const damageLocationsSelected = Object.freeze({ WINDSHIELD: 'Windshield', SIDEDOOR: 'SideDoor', REARWINDOW: 'RearWindow', @@ -16,6 +16,6 @@ const damageLocationsSelected = { PASSENGERSIDE: 'PassengerSide', STATIONARY: 'Stationary', SLIDER: 'Slider' -}; +}); -export { damageLocationsSelected }; +export default damageLocationsSelected; diff --git a/src/helpers/cookie-helper.js b/src/helpers/cookie-helper.js index 123c9ec3..b52051e9 100644 --- a/src/helpers/cookie-helper.js +++ b/src/helpers/cookie-helper.js @@ -1,4 +1,4 @@ -import { cookieNames } from '@/constants/cookie-names'; +import cookieNames from '@/constants/cookie-names'; import applicationConfig from '@/constants/application-config'; import { useMainStore } from '@/store'; diff --git a/src/helpers/damage-helper.js b/src/helpers/damage-helper.js index 9bb91f5a..3c6bfce2 100644 --- a/src/helpers/damage-helper.js +++ b/src/helpers/damage-helper.js @@ -1,5 +1,5 @@ import damageCustomLabels from '@/constants/damage-custom-labels'; -import { damageLocationsSelected } from '@/constants/damage-locations-selected'; +import damageLocationsSelected from '@/constants/damage-locations-selected'; import { useMainStore } from '@/store'; export function getDamageString() { diff --git a/src/helpers/unit-test-helper.js b/src/helpers/unit-test-helper.js index cbeb6cda..01a6a286 100644 --- a/src/helpers/unit-test-helper.js +++ b/src/helpers/unit-test-helper.js @@ -2,7 +2,7 @@ import { navigationScenarios } from '@/router/router-constants/navigation-scenar import { RouterLinkStub } from '@vue/test-utils'; import { vehicleCategories } from '@/constants/vehicle-categories.js'; import { issPageValues } from '@/router/router-constants/issPage-values'; -import { cookieNames } from '@/constants/cookie-names'; +import cookieNames from '@/constants/cookie-names'; import { Form } from 'vee-validate'; import baseMixin from '@/mixins/base-mixin'; import { diff --git a/src/layouts/service-packages/service-package-question/service-package-question.vue b/src/layouts/service-packages/service-package-question/service-package-question.vue index dfd4d83e..0fc826ee 100644 --- a/src/layouts/service-packages/service-package-question/service-package-question.vue +++ b/src/layouts/service-packages/service-package-question/service-package-question.vue @@ -13,11 +13,12 @@