diff --git a/src/constants/dynamictext-mapper.js b/src/constants/dynamictext-mapper.js index b450d0561..d47ef9d02 100644 --- a/src/constants/dynamictext-mapper.js +++ b/src/constants/dynamictext-mapper.js @@ -10,7 +10,7 @@ const customMappings = { { key: 'Rear Stationary', transformedValue: 'rear window' }, { key: 'Rear Slider', transformedValue: 'rear window' }, { key: 'Driver Front', transformedValue: 'driver side front door' }, - { key: 'Driver Back ', transformedValue: 'driver side back door' }, + { key: 'Driver Back', transformedValue: 'driver side back door' }, { key: 'Driver Vent', transformedValue: 'driver side vent glass' }, { key: 'Driver Quarter', transformedValue: 'driver side quarter panel' }, { key: 'Driver SideDoor', transformedValue: 'driver side sliding door' }, diff --git a/src/constants/store-actions.js b/src/constants/store-actions.js index 0717a3498..e83b44096 100644 --- a/src/constants/store-actions.js +++ b/src/constants/store-actions.js @@ -14,10 +14,10 @@ const storeActions = { GET_PARTS_OR_QUESTIONS: "getPartsOrQuestions", // DEPENDENCY MUTATIONS - RESET_VEHICLE_STATE: "resetVehicleAndDependencies", - RESET_DAMAGE_STATE: "resetDamageAndDependencies", - RESET_REGISTRATION_STATE: "resetRegistrationAndDependencies", - RESET_PARTS_STATE: "resetPartsAndDependencies", + RESET_VEHICLE_STATE_AND_DEPENDENCIES: "resetVehicleAndDependencies", + RESET_DAMAGE_STATE_AND_DEPENDENCIES: "resetDamageAndDependencies", + RESET_REGISTRATION_STATE_AND_DEPENDENCIES: "resetRegistrationAndDependencies", + RESET_PARTS_STATE_AND_DEPENDENCIES: "resetPartsAndDependencies", }; export { storeActions }; diff --git a/src/layouts/form-test/form-test.vue b/src/layouts/form-test/form-test.vue index 774d863a8..7f2c736b2 100644 --- a/src/layouts/form-test/form-test.vue +++ b/src/layouts/form-test/form-test.vue @@ -144,7 +144,7 @@ export default { }, resetDependentState() { // Invokes - store.dispatch(storeActions.RESET_PARTS_STATE); + store.dispatch(storeActions.RESET_PARTS_STATE_AND_DEPENDENCIES); }, onSubmit(values) { window.alert('Success! Submitted values: ' + JSON.stringify(values, null ,2)) diff --git a/src/layouts/part-questions/part-questions.vue b/src/layouts/part-questions/part-questions.vue index 75cf54527..c1b9142bd 100644 --- a/src/layouts/part-questions/part-questions.vue +++ b/src/layouts/part-questions/part-questions.vue @@ -1,11 +1,11 @@ diff --git a/src/layouts/vehicle-parts/vehicle-parts.vue b/src/layouts/vehicle-parts/vehicle-parts.vue index c12aba5b4..0ccfd9c4e 100644 --- a/src/layouts/vehicle-parts/vehicle-parts.vue +++ b/src/layouts/vehicle-parts/vehicle-parts.vue @@ -17,7 +17,7 @@
- + @@ -75,7 +75,7 @@ export default { // Glass Part Question dynamic component Object.keys(vm.$refs) - .filter((r) => r.includes(vm.refPrefix) && vm.$refs[r][0] !== undefined) + .filter((r) => r.includes(vm.RefPrefix) && vm.$refs[r][0] !== undefined) .forEach((c) => vm.$refs[c][0].initializeComponent({ ColorQuestionWidget: resultMap.cmsContent.ColorQuestionWidget, @@ -95,7 +95,6 @@ export default { data() { return { glassParts: {}, - refPrefix: "partQuestion", alertWidgetData: Object, }; }, @@ -110,7 +109,7 @@ export default { computed: { PartsForQuestions() { const partsData = this.$store.getters.pageData(this.$route.query.fmgPage); - const alreadyPopulatedPartsData = this.$store.getters.lineItems.glassParts; + const alreadyPopulatedPartsData = this.$store.getters.lineItems.glassParts === null ? {} : this.$store.getters.lineItems.glassParts; // Map API result data, to vehicle-parts data structure const mappedData = partsData.partsOrQuestions.map(g => { @@ -148,6 +147,10 @@ export default { PartsFromApi() { return store.getters.pageData(fmgPageValues.VEHICLE_PARTS); + }, + + RefPrefix() { + return 'partQuestion'; } }, diff --git a/src/layouts/vehicle-style/vehicle-style.vue b/src/layouts/vehicle-style/vehicle-style.vue index 11653e25d..d7b37b4b0 100644 --- a/src/layouts/vehicle-style/vehicle-style.vue +++ b/src/layouts/vehicle-style/vehicle-style.vue @@ -99,8 +99,8 @@ export default { }, resetDependentState() { // Invokes - store.dispatch(storeActions.RESET_DAMAGE_STATE); - store.dispatch(storeActions.RESET_REGISTRATION_STATE); + store.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES); + store.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES); }, }, diff --git a/src/layouts/vehicle-year/vehicle-year.spec.js b/src/layouts/vehicle-year/vehicle-year.spec.js index c04d61b17..5e6d9bf33 100644 --- a/src/layouts/vehicle-year/vehicle-year.spec.js +++ b/src/layouts/vehicle-year/vehicle-year.spec.js @@ -163,8 +163,8 @@ describe("vehicle-year.vue", () => { expect(store.commit).toBeCalledWith(storeMutations.UPDATE_CAR_ID, null) expect(store.commit).toBeCalledWith(storeMutations.UPDATE_VEHICLE_CATEGORY, null) - expect(store.dispatch).toBeCalledWith(storeActions.RESET_DAMAGE_STATE) - expect(store.dispatch).toBeCalledWith(storeActions.RESET_REGISTRATION_STATE) + expect(store.dispatch).toBeCalledWith(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES) + expect(store.dispatch).toBeCalledWith(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES) }); }); diff --git a/src/layouts/vehicle-year/vehicle-year.vue b/src/layouts/vehicle-year/vehicle-year.vue index d73ac46f9..460c8ced4 100644 --- a/src/layouts/vehicle-year/vehicle-year.vue +++ b/src/layouts/vehicle-year/vehicle-year.vue @@ -95,8 +95,8 @@ export default { store.commit(storeMutations.UPDATE_VEHICLE_CATEGORY, null); // Invokes - store.dispatch(storeActions.RESET_DAMAGE_STATE); - store.dispatch(storeActions.RESET_REGISTRATION_STATE); + store.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES); + store.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES); } }, components: { diff --git a/src/store/index.js b/src/store/index.js index eaa4e4f67..4b0e06eb4 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -122,9 +122,8 @@ export const mutations = { }, resetPartsState(state) { - state.glassParts = null; - state.childParts = null; - state.otherParts = null; + state.order.lineItems.glassParts = null; + state.order.lineItems.otherParts = null; } } diff --git a/src/ux-components/radio/radio.vue b/src/ux-components/radio/radio.vue index cccc0d91d..84267fb01 100644 --- a/src/ux-components/radio/radio.vue +++ b/src/ux-components/radio/radio.vue @@ -42,12 +42,14 @@ export default { }, data() { return { - checkValue: false, + checkValue: Boolean, }; }, created() { if (this.selectedValues) { this.checkValue = this.selectedValues[0] === this.value; + }else{ + this.checkValue = false; } }, methods: {