diff --git a/src/common-components/vin-information/vin-information.vue b/src/common-components/vin-information/vin-information.vue index a90dfd467..3e5b67a91 100644 --- a/src/common-components/vin-information/vin-information.vue +++ b/src/common-components/vin-information/vin-information.vue @@ -4,7 +4,7 @@
-
+
diff --git a/src/constants/damage-locations-parts.js b/src/constants/damage-locations-parts.js deleted file mode 100644 index 465d58420..000000000 --- a/src/constants/damage-locations-parts.js +++ /dev/null @@ -1,8 +0,0 @@ -const damageLocationsParts = { - WINDSHIELD: "Windshield", - DRIVER: "Driver", - PASSENGER: "Passenger", - REAR: "Rear", - }; - - export { damageLocationsParts }; \ No newline at end of file diff --git a/src/constants/damage-locations-selected.js b/src/constants/damage-locations-selected.js new file mode 100644 index 000000000..905d9c8c5 --- /dev/null +++ b/src/constants/damage-locations-selected.js @@ -0,0 +1,21 @@ +const damageLocationsSelected = { + WINDSHIELD: "Windshield", + SIDEDOOR: "SideDoor", + REARWINDOW: "RearWindow", + REPAIR: "Repair", + REPLACE: "Replace", + DRIVER: "Driver", + PASSENGER: "Passenger", + FRONT: "Front", + REAR: "Rear", + BACK: "Back", + QUARTER: "Quarter", + VENT: "Vent", + SINGLE: "Single", + DRIVERSIDE: "DriverSide", + PASSENGERSIDE: "PassengerSide", + STATIONARY: "Stationary", + SLIDER: "Slider" + }; + + export { damageLocationsSelected }; \ No newline at end of file diff --git a/src/constants/tint-mapper.js b/src/constants/tint-mapper.js index 949ab19a7..516fc2a1e 100644 --- a/src/constants/tint-mapper.js +++ b/src/constants/tint-mapper.js @@ -35,7 +35,7 @@ const tintMap = { { name: "gray tint privacy", src: "Glass-NoShade-Privacy.svg" }, // No shade or tint - { name: "no shade, no tint", src: "Glass-NoShade-NoTint.svg" }, // ??? + { name: "clear", src: "Glass-NoShade-NoTint.svg" } ], windshield: [ @@ -70,7 +70,7 @@ const tintMap = { { name: "gray tint privacy", src: "Windshield-NoShade-Privacy.svg" }, // No shade or tint - { name: "no shade, no tint", src: "Windshield-NoShade-NoTint.svg" }, // ??? + { name: "clear", src: "Windshield-NoShade-NoTint.svg" }, ] } diff --git a/src/layouts/form-test/form-test.vue b/src/layouts/form-test/form-test.vue index cb2a7f653..8e9aefe22 100644 --- a/src/layouts/form-test/form-test.vue +++ b/src/layouts/form-test/form-test.vue @@ -84,7 +84,6 @@ import baseMixin from "@/mixins/base-mixin"; import { Form, defineRule } from "vee-validate"; import { required } from "@/helpers/validation-rules"; import { errorMessages } from "@/constants/error-messages"; -import { damageLocationsParts } from "@/constants/damage-locations-parts.js"; import { damageLocationsCms } from "@/constants/damage-locations-cms.js"; // DEFINE VALIDATION RULES diff --git a/src/layouts/reveal/reveal.vue b/src/layouts/reveal/reveal.vue index 18f0e499d..fdd371e68 100644 --- a/src/layouts/reveal/reveal.vue +++ b/src/layouts/reveal/reveal.vue @@ -51,7 +51,7 @@ export default { ); }, arePagePrerequisitesValid() { - return store.getters.lineItems.glassParts !== null; + return true; }, resetDependentState() { // Set diff --git a/src/layouts/vehicle-damage/vehicle-damage.spec.js b/src/layouts/vehicle-damage/vehicle-damage.spec.js index d1db67459..348da20ad 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.spec.js +++ b/src/layouts/vehicle-damage/vehicle-damage.spec.js @@ -20,6 +20,7 @@ import { storeActions } from "@/constants/store-actions"; import { storeMutations } from "@/constants/store-mutations"; import store from "@/store"; import { validate } from "vee-validate"; +import { damageLocationsSelected } from "@/constants/damage-locations-selected.js"; // Mock our module for promises. jest.mock("@/helpers/layout-helper.js", () => ({ @@ -41,6 +42,9 @@ jest.mock("@/store", () => ({ image: "test.jpg", }, eventBusItem: jest.fn(), + damage: { + glassToReplace: [] + }, }, })); @@ -260,7 +264,7 @@ describe("vehicle-damage.vue", () => { }); describe("vehicle-damage.vue", () => { - test("Windshield replace with single part on ForwardButtonAction triggers a router.navigateAfterSave and saves selections to store", async () => { + test("Windshield replace with single part on ForwardButtonAction triggers a router.navigate and saves selections to store", async () => { //Arrange const partsData = { partsOrQuestions: [ { @@ -280,7 +284,7 @@ describe("vehicle-damage.vue", () => { const { wrapper } = setupMocks({ pageHeaderWidgetHeaderText: "", mountOptionsMockData: { - router: { navigateAfterSave: jest.fn(), }, + router: { navigate: jest.fn(), }, actionList: [{ actionName: storeActions.GET_PARTS_OR_QUESTIONS, data: partsData, },], store: { getters: { @@ -310,7 +314,7 @@ describe("vehicle-damage.vue", () => { await wrapper.vm.forwardButtonAction(); //Assert - expect(wrapper.vm.$router.navigateAfterSave).toHaveBeenCalled(); + expect(wrapper.vm.$router.navigate).toHaveBeenCalled(); expect(wrapper.vm.selectedGlassToReplace()).toEqual(expectedGlassToReplace); expect(store.commit).toBeCalledWith(storeMutations.UPDATE_IS_REPAIR, false); expect(store.commit).toBeCalledWith(storeMutations.UPDATE_GLASS_TO_REPLACE, expectedGlassToReplace); @@ -409,13 +413,13 @@ describe("vehicle-damage.vue", () => { describe("vehicle-damage.vue", () => { - test("Windshield repair on ForwardButtonAction triggers a router.navigateAfterSave and saves selection to store", async () => { + test("Windshield repair on ForwardButtonAction triggers a router.navigate and saves selection to store", async () => { //Arrange const partsData = { partsOrQuestions: []}; const { wrapper } = setupMocks({ pageHeaderWidgetHeaderText: "", mountOptionsMockData: { - router: { navigateAfterSave: jest.fn(), }, + router: { navigate: jest.fn(), }, actionList: [{ actionName: storeActions.GET_PARTS_OR_QUESTIONS, data: partsData, },], store: { getters: { @@ -442,7 +446,7 @@ describe("vehicle-damage.vue", () => { await wrapper.vm.forwardButtonAction(); //Assert - expect(wrapper.vm.$router.navigateAfterSave).toHaveBeenCalled(); + expect(wrapper.vm.$router.navigate).toHaveBeenCalled(); expect(store.commit).toBeCalledWith(storeMutations.UPDATE_IS_REPAIR, true); expect(store.commit).toBeCalledWith(storeMutations.UPDATE_NUMBER_OF_CHIPS, 2); }); @@ -622,6 +626,162 @@ describe("vehicle-damage.vue", () => { }); }); +const damageLocations = [["Windshield", [damageLocationsSelected.WINDSHIELD]], + ["Driver", [damageLocationsSelected.SIDEDOOR]], + ["Passenger", [damageLocationsSelected.SIDEDOOR]], + ["Rear", [damageLocationsSelected.REARWINDOW]]]; +describe("vehicle-damage.vue", () => { + test.each(damageLocations)("getDamageLocationsFromStore for %s returns expected %s", async (damageLocation, expectedGlass) => { + + //Arrange + const { wrapper } = setupMocks({}); + + //Act + vehicleDamage.beforeRouteEnter.call( + wrapper.vm, + { query: { fmgPage: "vehicle-damage" } }, + undefined, + (c) => c(wrapper.vm) + ); + + store.getters = { vehicle: { carId: "C0000000" }, eventBusItem: jest.fn(), damage: { glassToReplace: [{location: damageLocation}] }, isRepair: true}; + + var glassSelections = wrapper.vm.getDamageLocationsFromStore(); + + //Assert + expect(glassSelections).toEqual(expectedGlass); + + }); +}); + +const storeWindshieldOptions = [[1, false, "Windshield", "Single", { selectedWindshieldDamageType: [damageLocationsSelected.REPLACE], + selectedWindshieldChipCount: [], selectedWindshieldReplaceOptions: [damageLocationsSelected.SINGLE]}], + [2, false, "Windshield", "Driver", { selectedWindshieldDamageType: [damageLocationsSelected.REPLACE], + selectedWindshieldChipCount: [], selectedWindshieldReplaceOptions: [damageLocationsSelected.DRIVER]}], + [3, false, "Windshield", "Passenger", { selectedWindshieldDamageType: [damageLocationsSelected.REPLACE], + selectedWindshieldChipCount: [], selectedWindshieldReplaceOptions: [damageLocationsSelected.PASSENGER]}], + [4, true, "", "", { selectedWindshieldDamageType: [damageLocationsSelected.REPAIR], + selectedWindshieldChipCount: [2], selectedWindshieldReplaceOptions: []}] + ]; +describe("vehicle-damage.vue", () => { + test.each(storeWindshieldOptions)("getWindshieldOptionsFromStore test #%s", async (testNum, isRepair, damageLocation, damageName, expectedWindshieldOptions) => { + + //Arrange + const { wrapper } = setupMocks({}); + + //Act + vehicleDamage.beforeRouteEnter.call( + wrapper.vm, + { query: { fmgPage: "vehicle-damage" } }, + undefined, + (c) => c(wrapper.vm) + ); + + store.getters = { + vehicle: + { carId: "C0000000" }, + eventBusItem: jest.fn(), + damage: + { + glassToReplace: [{location: damageLocation, name: damageName}], + isRepair: isRepair, + numberOfChips: 2 + }, + }; + + var windshieldSelections = wrapper.vm.getWindshieldOptionsFromStore(); + + //Assert + expect(windshieldSelections).toEqual(expectedWindshieldOptions); + + }); +}); + +const driverDoorSides = [["Driver", "Front", [damageLocationsSelected.FRONT]], + ["Driver", "Back", [damageLocationsSelected.BACK]], + ["Driver", "Vent", [damageLocationsSelected.VENT]], + ["Driver", "Quarter", [damageLocationsSelected.QUARTER]] + ]; +describe("vehicle-damage.vue", () => { + test.each(driverDoorSides)("getDriverSideReplaceOptionsFromStore for %s-%s returns expected %s", async (damageLocation, damageName, expectedGlass) => { + + //Arrange + const { wrapper } = setupMocks({}); + + //Act + vehicleDamage.beforeRouteEnter.call( + wrapper.vm, + { query: { fmgPage: "vehicle-damage" } }, + undefined, + (c) => c(wrapper.vm) + ); + + store.getters = { vehicle: { carId: "C0000000" }, eventBusItem: jest.fn(), damage: { glassToReplace: [{location: damageLocation, name: damageName}] }, isRepair: true}; + + var glassSelections = wrapper.vm.getDriverSideReplaceOptionsFromStore(); + + //Assert + expect(glassSelections).toEqual(expectedGlass); + + }); +}); + +const passengerDoorSides = [["Passenger", "Front", [damageLocationsSelected.FRONT]], + ["Passenger", "Back", [damageLocationsSelected.BACK]], + ["Passenger", "Vent", [damageLocationsSelected.VENT]], + ["Passenger", "Quarter", [damageLocationsSelected.QUARTER]] + ]; +describe("vehicle-damage.vue", () => { + test.each(passengerDoorSides)("getPassengerSideReplaceOptionsFromStore for %s-%s returns expected %s", async (damageLocation, damageName, expectedGlass) => { + + //Arrange + const { wrapper } = setupMocks({}); + + //Act + vehicleDamage.beforeRouteEnter.call( + wrapper.vm, + { query: { fmgPage: "vehicle-damage" } }, + undefined, + (c) => c(wrapper.vm) + ); + + store.getters = { vehicle: { carId: "C0000000" }, eventBusItem: jest.fn(), damage: { glassToReplace: [{location: damageLocation, name: damageName}] }, isRepair: true}; + + var glassSelections = wrapper.vm.getPassengerSideReplaceOptionsFromStore(); + + //Assert + expect(glassSelections).toEqual(expectedGlass); + + }); +}); + +const rearReplaceOptions = [["Rear", "Stationary", [damageLocationsSelected.STATIONARY]], + ["Rear", "Slider", [damageLocationsSelected.SLIDER]] + ]; +describe("vehicle-damage.vue", () => { + test.each(rearReplaceOptions)("getRearReplaceOptionsFromStore for %s-%s returns expected %s", async (damageLocation, damageName, expectedGlass) => { + + //Arrange + const { wrapper } = setupMocks({}); + + //Act + vehicleDamage.beforeRouteEnter.call( + wrapper.vm, + { query: { fmgPage: "vehicle-damage" } }, + undefined, + (c) => c(wrapper.vm) + ); + + store.getters = { vehicle: { carId: "C0000000" }, eventBusItem: jest.fn(), damage: { glassToReplace: [{location: damageLocation, name: damageName}] }, isRepair: true}; + + var glassSelections = wrapper.vm.getRearReplaceOptionsFromStore(); + + //Assert + expect(glassSelections).toEqual(expectedGlass); + + }); +}); + describe("vehicle-damage.vue", () => { test("when onInvalidSubmit is triggered with errors focus will be put on the first element with an error", async () => { @@ -640,7 +800,7 @@ describe("vehicle-damage.vue", () => { newObj.setAttribute("data-focus-target", "driverSideOptions"); document.body.appendChild(newObj); const testInputElement = document.getElementById("testInput"); - + //Act vehicleDamage.beforeRouteEnter.call( wrapper.vm, diff --git a/src/layouts/vehicle-damage/vehicle-damage.vue b/src/layouts/vehicle-damage/vehicle-damage.vue index 71dc44211..2fcdd2998 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.vue +++ b/src/layouts/vehicle-damage/vehicle-damage.vue @@ -73,8 +73,8 @@ import baseMixin from "@/mixins/base-mixin"; import { Form, defineRule } from "vee-validate"; import { required } from "@/helpers/validation-rules"; import { errorMessages } from "@/constants/error-messages"; -import { damageLocationsParts } from "@/constants/damage-locations-parts.js"; import { damageLocationsCms } from "@/constants/damage-locations-cms.js"; +import { damageLocationsSelected } from "@/constants/damage-locations-selected.js"; // DEFINE VALIDATION RULES defineRule("replace-options-required", required(errorMessages.REPLACE_OPTIONS_REQUIRED)); @@ -135,14 +135,14 @@ export default { }, data(){ return { - selectedDamageLocations: [], + selectedDamageLocations: this.getDamageLocationsFromStore(), sideDoorOptionsData: { - selectedDoorSides: [], - selectedDriverSideReplaceOptions: [], - selectedPassengerSideReplaceOptions: [] + selectedDoorSides: this.getDoorSidesFromStore(), + selectedDriverSideReplaceOptions: this.getDriverSideReplaceOptionsFromStore(), + selectedPassengerSideReplaceOptions: this.getPassengerSideReplaceOptionsFromStore() }, - selectedWindshieldOptions: [], - selectedRearReplaceOptions: [], + selectedWindshieldOptions: this.getWindshieldOptionsFromStore(), + selectedRearReplaceOptions: this.getRearReplaceOptionsFromStore(), } }, methods: { @@ -170,19 +170,121 @@ export default { el && el.focus(); } }, - async forwardButtonAction() { - var windshieldChipCount = this.selectedWindshieldOptions.selectedWindshieldChipCount && this.isWindshieldDamageLocation ? - this.selectedWindshieldOptions.selectedWindshieldChipCount[0] : null; + + getDamageLocationsFromStore() { + var glassSelections = []; + + if (store.getters.damage.glassToReplace.some(glass => { return glass.location === damageLocationsSelected.WINDSHIELD }) || + store.getters.damage.isRepair) { + glassSelections.push(damageLocationsSelected.WINDSHIELD); + } + if (store.getters.damage.glassToReplace.some(glass => { return glass.location === damageLocationsSelected.DRIVER || + glass.location === damageLocationsSelected.PASSENGER })) { + glassSelections.push(damageLocationsSelected.SIDEDOOR); + } + if (store.getters.damage.glassToReplace.some(glass => { return glass.location === damageLocationsSelected.REAR })) { + glassSelections.push(damageLocationsSelected.REARWINDOW); + } + + return glassSelections; + }, + + getWindshieldOptionsFromStore() { + var windShieldOptions = { selectedWindshieldDamageType: [], selectedWindshieldChipCount: [], selectedWindshieldReplaceOptions: []}; + + if (store.getters.damage.isRepair === undefined) return windshieldOptions; + + if (!store.getters.damage.isRepair) { + if (store.getters.damage.glassToReplace.some(glass => { return glass.location === damageLocationsSelected.WINDSHIELD && + glass.name === damageLocationsSelected.SINGLE })) { + windShieldOptions.selectedWindshieldDamageType.push(damageLocationsSelected.REPLACE); + windShieldOptions.selectedWindshieldReplaceOptions.push(damageLocationsSelected.SINGLE); + } + + if (store.getters.damage.glassToReplace.some(glass => { return glass.location === damageLocationsSelected.WINDSHIELD && + glass.name === damageLocationsSelected.DRIVER })) { + windShieldOptions.selectedWindshieldDamageType.push(damageLocationsSelected.REPLACE); + windShieldOptions.selectedWindshieldReplaceOptions.push(damageLocationsSelected.DRIVER); + } + + if (store.getters.damage.glassToReplace.some(glass => { return glass.location === damageLocationsSelected.WINDSHIELD && + glass.name === damageLocationsSelected.PASSENGER })) { + windShieldOptions.selectedWindshieldDamageType.push(damageLocationsSelected.REPLACE); + windShieldOptions.selectedWindshieldReplaceOptions.push(damageLocationsSelected.PASSENGER); + } + } + + if (store.getters.damage.isRepair) { + windShieldOptions.selectedWindshieldDamageType.push(damageLocationsSelected.REPAIR); + windShieldOptions.selectedWindshieldChipCount.push(store.getters.damage.numberOfChips); + } + + return windShieldOptions; + + }, + + getDoorSidesFromStore() { + var doorSides = []; + if (store.getters.damage.glassToReplace.some(glass => { return glass.location === damageLocationsSelected.DRIVER })){ + doorSides.push(damageLocationsSelected.DRIVERSIDE); + } + + if (store.getters.damage.glassToReplace.some(glass => { return glass.location === damageLocationsSelected.PASSENGER })){ + doorSides.push(damageLocationsSelected.PASSENGERSIDE); + } + + return doorSides; + }, + + getDriverSideReplaceOptionsFromStore() { + var driverSideReplaceOptions = []; + + store.getters.damage.glassToReplace.forEach(glass => { + if (glass.location === damageLocationsSelected.DRIVER){ + driverSideReplaceOptions.push(glass.name); + } + }); + + return driverSideReplaceOptions; + }, + + getPassengerSideReplaceOptionsFromStore() { + var passengerSideReplaceOptions = []; + + store.getters.damage.glassToReplace.forEach(glass => { + if (glass.location === damageLocationsSelected.PASSENGER){ + passengerSideReplaceOptions.push(glass.name); + } + }); + + return passengerSideReplaceOptions; + }, + + getRearReplaceOptionsFromStore(){ + var rearReplaceOptions = []; + + store.getters.damage.glassToReplace.forEach(glass => { + if (glass.location === damageLocationsSelected.REAR){ + rearReplaceOptions.push(glass.name); + } + }); + + return rearReplaceOptions; + }, + + async forwardButtonAction() { store.commit(this.storeMutations.UPDATE_IS_REPAIR, this.isWindshieldRepair); - if (windshieldChipCount){ - store.commit(this.storeMutations.UPDATE_NUMBER_OF_CHIPS, parseInt(windshieldChipCount)); + if (this.isWindshieldRepair){ + store.commit(this.storeMutations.UPDATE_NUMBER_OF_CHIPS, parseInt(this.selectedWindshieldOptions.selectedWindshieldChipCount)); + } else { + store.commit(this.storeMutations.UPDATE_NUMBER_OF_CHIPS, null); } store.commit(this.storeMutations.UPDATE_GLASS_TO_REPLACE, this.selectedGlassToReplace()); - var partsData = await baseMixin.methods.dispatchNonBlockingStoreAction(this.storeActions.GET_PARTS_OR_QUESTIONS, + const partsData = await baseMixin.methods.dispatchNonBlockingStoreAction(this.storeActions.GET_PARTS_OR_QUESTIONS, { carId: store.getters.vehicle.carId, glassArray: this.selectedGlassToReplace()}, false); this.navigateForward(partsData); @@ -197,14 +299,12 @@ export default { //found multiple parts for a single glass location (Windshield, Driver, Passenger, Rear) if (partsData.data.partsOrQuestions){ - var multiParts = false; - partsData.data.partsOrQuestions.forEach(pq => { - if (pq.parts != null && pq.parts.length > 1){ + for (var i = 0; i < partsData.data.partsOrQuestions.length; i++){ + if (partsData.data.partsOrQuestions[i].parts != null && partsData.data.partsOrQuestions[i].parts.length > 1){ this.$router.navigateAfterSave(this.navigationScenarios.SELECTED_DAMAGE_WITH_MULTIPLE_PARTS, this.$route, {}, {}, partsData.data); - multiParts = true; + return; } - }); - if (multiParts) return; + } } //if not a repair then there should only be 1 part and no problem questions at this point so save the part to the store. @@ -212,32 +312,32 @@ export default { store.commit(this.storeMutations.UPDATE_PARTS, partsData.data.partsOrQuestions[0].parts); } - this.$router.navigateAfterSave(this.navigationScenarios.SELECTED_DAMAGE_WITH_SINGLE_PART, this.$route); + this.$router.navigate(this.navigationScenarios.SELECTED_DAMAGE_WITH_SINGLE_PART, this.$route); }, selectedGlassToReplace() { - var selectedGlassToReplace = []; + const selectedGlassToReplace = []; if (this.isWindshieldDamageLocation && !this.isWindshieldRepair){ this.selectedWindshieldOptions.selectedWindshieldReplaceOptions.forEach(wsItem => { - selectedGlassToReplace.push({ location: damageLocationsParts.WINDSHIELD, name: wsItem}); + selectedGlassToReplace.push({ location: damageLocationsSelected.WINDSHIELD, name: wsItem}); }) } if (this.isDriverSideReplace){ this.sideDoorOptionsData.selectedDriverSideReplaceOptions.forEach(driverItem => { - selectedGlassToReplace.push({ location: damageLocationsParts.DRIVER, name: driverItem}); + selectedGlassToReplace.push({ location: damageLocationsSelected.DRIVER, name: driverItem}); }) } if (this.isPassengerSideReplace){ this.sideDoorOptionsData.selectedPassengerSideReplaceOptions.forEach(passengerItem => { - selectedGlassToReplace.push({ location: damageLocationsParts.PASSENGER, name: passengerItem}); + selectedGlassToReplace.push({ location: damageLocationsSelected.PASSENGER, name: passengerItem}); }) } if (this.isRearWindowDamageLocation) { this.selectedRearReplaceOptions.forEach(rearItem => { - selectedGlassToReplace.push({ location: damageLocationsParts.REAR, name: rearItem}); + selectedGlassToReplace.push({ location: damageLocationsSelected.REAR, name: rearItem}); }) } diff --git a/src/layouts/vehicle-damage/windshield-options/windshield-options.vue b/src/layouts/vehicle-damage/windshield-options/windshield-options.vue index 216ba623e..1d483f269 100644 --- a/src/layouts/vehicle-damage/windshield-options/windshield-options.vue +++ b/src/layouts/vehicle-damage/windshield-options/windshield-options.vue @@ -87,7 +87,7 @@ export default ({ }, selectedWindshieldChipCountValues: { get: function() { - return this.selectedValues.selectedChipCount; + return this.selectedValues.selectedWindshieldChipCount; }, set: function(newValue) { this.selectedValues = this.getWindshieldOptions(this.selectedWindshieldDamageTypeValues, newValue, null); 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 7e8639ee0..9be24b91b 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 @@ -1,34 +1,62 @@ diff --git a/src/layouts/vehicle-parts/vehicle-parts.vue b/src/layouts/vehicle-parts/vehicle-parts.vue index 7c0efeda7..abc8ee936 100644 --- a/src/layouts/vehicle-parts/vehicle-parts.vue +++ b/src/layouts/vehicle-parts/vehicle-parts.vue @@ -1,42 +1,26 @@ diff --git a/src/layouts/vehicle-style/vehicle-style.vue b/src/layouts/vehicle-style/vehicle-style.vue index d7b37b4b0..c5aec920c 100644 --- a/src/layouts/vehicle-style/vehicle-style.vue +++ b/src/layouts/vehicle-style/vehicle-style.vue @@ -27,6 +27,7 @@ import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; import { settleAllPromises } from "@/helpers/layout-helper"; import { storeActions } from "@/constants/store-actions"; import store from "@/store"; +import { storeMutations } from "@/constants/store-mutations"; export default { name: "vehicle-style", @@ -101,6 +102,9 @@ export default { // Invokes store.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES); store.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES); + store.commit(storeMutations.UPDATE_IS_REPAIR, null); + store.commit(storeMutations.UPDATE_NUMBER_OF_CHIPS, null); + store.commit(storeMutations.UPDATE_GLASS_TO_REPLACE, []); }, }, diff --git a/src/layouts/vehicle-year/vehicle-year.vue b/src/layouts/vehicle-year/vehicle-year.vue index 460c8ced4..563ecb31d 100644 --- a/src/layouts/vehicle-year/vehicle-year.vue +++ b/src/layouts/vehicle-year/vehicle-year.vue @@ -93,6 +93,7 @@ export default { store.commit(storeMutations.UPDATE_STYLE, null); store.commit(storeMutations.UPDATE_CAR_ID, null); store.commit(storeMutations.UPDATE_VEHICLE_CATEGORY, null); + // Invokes store.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES); diff --git a/src/router/router-constants/routing-table.js b/src/router/router-constants/routing-table.js index 87818ebe7..c9dc7ba4d 100644 --- a/src/router/router-constants/routing-table.js +++ b/src/router/router-constants/routing-table.js @@ -61,19 +61,14 @@ const routingTable = [ scenario: navigationScenarios.SELECTED_DAMAGE_WITH_SINGLE_PART, destinationFmgPageValue: fmgPageValues.REVEAL, }, - ], - }, - { - fmgPageValue: fmgPageValues.VEHICLE_DAMAGE, - maps: [ - { - scenario: navigationScenarios.CLICKED_BACK, - destinationFmgPageValue: fmgPageValues.VEHICLE_STYLE, - }, { scenario: navigationScenarios.SELECTED_DAMAGE_WITH_MULTIPLE_PARTS, destinationFmgPageValue: fmgPageValues.VEHICLE_PARTS, }, + { + scenario: navigationScenarios.SELECTED_DAMAGE_WITH_PART_QUESTIONS, + destinationFmgPageValue: fmgPageValues.PART_QUESTIONS, + }, ], }, { @@ -89,19 +84,6 @@ const routingTable = [ }, ], }, - { - fmgPageValue: fmgPageValues.VEHICLE_DAMAGE, - maps: [ - { - scenario: navigationScenarios.CLICKED_BACK, - destinationFmgPageValue: fmgPageValues.VEHICLE_STYLE, - }, - { - scenario: navigationScenarios.SELECTED_DAMAGE_WITH_PART_QUESTIONS, - destinationFmgPageValue: fmgPageValues.PART_QUESTIONS, - }, - ], - }, ]; export { routingTable }; diff --git a/src/styles/common-error-styles.scss b/src/styles/common-error-styles.scss index 2c26e69d7..42c8e499c 100644 --- a/src/styles/common-error-styles.scss +++ b/src/styles/common-error-styles.scss @@ -44,6 +44,12 @@ border: 1px solid transparent; } } + select { + background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 8.89' xml:space='preserve'%3e%3cpath d='M8 8.89c-.24 0-.46-.09-.63-.26L.26 1.53a.901.901 0 0 1 0-1.27C.43.1.66 0 .9 0s.47.1.64.26L8 6.74 14.47.27c.17-.17.4-.27.64-.27s.47.1.63.27c.17.17.26.4.26.64s-.1.47-.27.63l-7.1 7.09a.86.86 0 0 1-.63.26z' fill='%23d4281c'/%3e%3c/svg%3e"); + background-repeat: no-repeat; + background-position: right 0.75rem center; + background-size: 16px 12px; + } } } diff --git a/src/ux-components/list-button-horizontal/list-button-horizontal.vue b/src/ux-components/list-button-horizontal/list-button-horizontal.vue index 6d1cde2d4..c9f0f287c 100644 --- a/src/ux-components/list-button-horizontal/list-button-horizontal.vue +++ b/src/ux-components/list-button-horizontal/list-button-horizontal.vue @@ -146,6 +146,7 @@ export default { &:checked + label { background: $blue-100; box-shadow: 0 0 0 1px $blue; + outline: none; z-index: 2; } &:checked + label p:first-child { diff --git a/src/ux-components/list-card/list-card.vue b/src/ux-components/list-card/list-card.vue index 29b6fc2ee..e57fb861f 100644 --- a/src/ux-components/list-card/list-card.vue +++ b/src/ux-components/list-card/list-card.vue @@ -2,7 +2,11 @@
- {{buttonLabel}} + {{ buttonLabel }}

-

- {{buttonLabelSubCopy}} +

+ {{ buttonLabelSubCopy }}

{{ buttonLabel }}

@@ -70,18 +78,30 @@ export default { colLength: String, validationRules: String, selectedValues: [Array, String], + modelValue: Object, hasError: Boolean, }, - data(){ + data() { return { checkValue: [Boolean, String], } }, - created(){ - if(Array.isArray(this.selectedValues)){ - this.checkValue = this.isMultiSelect ? this.selectedValues.includes(this.value) : this.selectedValues[0]; + created() { + if (Array.isArray(this.selectedValues)) { + this.checkValue = this.isMultiSelect + ? this.selectedValues.includes(this.value) + : this.selectedValues[0]; } }, + watch: { + // Changing this will impact pre-selection data loads on vehicle-parts. + // If changed, please regression test that vehicle-parts data still loads correctly with previous selections. + modelValue(newVal) { + if (newVal !== undefined) { + this.checkValue = newVal.value; + } + }, + }, computed: { getLabelClasses() { if (this.isWide) { @@ -96,14 +116,18 @@ export default { }, }, methods: { - handleCheckChange(newValue, oldValue){ - const isInitialization = typeof(oldValue) === 'function'; + handleCheckChange(newValue, oldValue) { + const isInitialization = typeof oldValue === "function"; if (!isInitialization) { - const emitEvent = { checkValue: this.checkValue, value: this.value.toString(), buttonId: this.buttonID.toString() }; - this.$emit('isCheckedChanged', emitEvent); - this.$emit('update:modelValue', emitEvent); + const emitEvent = { + checkValue: this.checkValue, + value: this.value.toString(), + buttonId: this.buttonID.toString(), + }; + this.$emit("isCheckedChanged", emitEvent); + this.$emit("update:modelValue", emitEvent); } - } + }, }, setup(props) { const inputType = props.isMultiSelect ? "checkbox" : "radio"; @@ -133,10 +157,12 @@ export default { \ No newline at end of file +