From ae387b71daf26c43727ca92986959706f24a2dd9 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Tue, 1 Mar 2022 11:34:36 -0500 Subject: [PATCH 01/19] CSR-297 reponse.data empty object may be valid --- src/global-methods.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/global-methods.js b/src/global-methods.js index a0023ef4c..bb202de13 100644 --- a/src/global-methods.js +++ b/src/global-methods.js @@ -19,7 +19,7 @@ export default { }).then( (response) => { if (response.status == httpStatusCodes.OK) { - if(response.data == undefined || response.data == {}) { + if(response.data == undefined) { reject(response); }else{ resolve(response); From 9dc96ba9e857fe90b9b10dc7ac8bcd3e37aff202 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Thu, 3 Mar 2022 14:09:31 -0500 Subject: [PATCH 02/19] CSR-297 bug fixes --- src/layouts/vehicle-damage/vehicle-damage.vue | 16 +++++------- src/router/router-constants/routing-table.js | 26 +++---------------- src/store/index.js | 3 +++ 3 files changed, 14 insertions(+), 31 deletions(-) diff --git a/src/layouts/vehicle-damage/vehicle-damage.vue b/src/layouts/vehicle-damage/vehicle-damage.vue index 5a9eca92f..8f8ae1106 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.vue +++ b/src/layouts/vehicle-damage/vehicle-damage.vue @@ -132,7 +132,7 @@ export default { }, async forwardButtonAction() { - var windshieldChipCount = this.selectedWindshieldOptions.selectedWindshieldChipCount && this.isWindshieldDamageLocation ? + const windshieldChipCount = this.selectedWindshieldOptions.selectedWindshieldChipCount && this.isWindshieldDamageLocation ? this.selectedWindshieldOptions.selectedWindshieldChipCount[0] : null; store.commit(this.storeMutations.UPDATE_IS_REPAIR, this.isWindshieldRepair); @@ -143,7 +143,7 @@ export default { 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); @@ -158,14 +158,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. @@ -177,7 +175,7 @@ export default { }, selectedGlassToReplace() { - var selectedGlassToReplace = []; + const selectedGlassToReplace = []; if (this.isWindshieldDamageLocation && !this.isWindshieldRepair){ this.selectedWindshieldOptions.selectedWindshieldReplaceOptions.forEach(wsItem => { selectedGlassToReplace.push({ location: damageLocationsParts.WINDSHIELD, name: wsItem}); diff --git a/src/router/router-constants/routing-table.js b/src/router/router-constants/routing-table.js index 3540d3bf8..58bd128a9 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/store/index.js b/src/store/index.js index 41daf3955..d81d1c523 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -68,6 +68,9 @@ export const mutations = { }, updateIsRepair(state, isRepair){ state.order.damage.isRepair = isRepair; + if (!isRepair){ + this.commit(storeMutations.UPDATE_NUMBER_OF_CHIPS, null); + } }, updateNumberOfChips(state, numberOfChips){ state.order.damage.numberOfChips = numberOfChips; From b10d8c55cea6db94638fdb6191ffab28a73ecb1b Mon Sep 17 00:00:00 2001 From: FrankRua Date: Thu, 3 Mar 2022 16:38:04 -0500 Subject: [PATCH 03/19] POC tint aut oselection --- .../glass-part-question.vue | 71 ++++++++++++------- 1 file changed, 45 insertions(+), 26 deletions(-) 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..b33eca98f 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 @@ -6,7 +6,7 @@
- +{{ selectedTint }}
{ - const currentGlassSelection = partsData.partsOrQuestions[key]; + Object.keys(this.PartDataFromApi.partsOrQuestions).forEach((key) => { + const currentGlassSelection = this.PartDataFromApi.partsOrQuestions[key]; if (currentGlassSelection.glassName === this.glassName && currentGlassSelection.glassLocation === this.glassLocation) { if (currentGlassSelection.parts.length === 1) { - this.selectedPart = { [currentGlassSelection.glassLocation]: [currentGlassSelection.parts[0].partNumber]}; + this.selectedPart = { + [currentGlassSelection.glassLocation]: [currentGlassSelection.parts[0].partNumber] + }; } } }); + }, + + AutoSelectTintIfOnlyOneColor(tintColor) { + this.selectedTint[tintColor] = { + buttonId: `${this.glassLocation}-${this.glassName}-${tintColor}`, + checkValue: "", + value: "", + }; + }, + + LoadPreselectedValues() { + if (this.modelValue !== undefined) { + // Populate button-question model-value if parts data already exists in VueX + const alreadyPopulatedPartsData = + this.$store.getters.lineItems.glassParts; + + Object.keys(alreadyPopulatedPartsData).forEach((key) => { + const partNumber = alreadyPopulatedPartsData[key].partNumber; + const tintColor = alreadyPopulatedPartsData[key].color; + + Object.keys(this.modelValue).forEach((key) => { + if (this.modelValue[key][0] === partNumber) { + this.selectedTint[tintColor] = { + buttonId: `${this.glassLocation}-${this.glassName}-${tintColor}`, + checkValue: "", + value: "", + }; + } + }); + }); + } } }, }; From 46791251b23b9e1088744ddc823daadae22b35aa Mon Sep 17 00:00:00 2001 From: FrankRua Date: Fri, 4 Mar 2022 10:43:39 -0500 Subject: [PATCH 04/19] default model value --- .../glass-part-question/glass-part-question.vue | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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 b33eca98f..37f58e677 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 @@ -6,10 +6,9 @@
-{{ selectedTint }}
- { return glass.location === damageLocationsParts.WINDSHIELD }) || + store.getters.damage.isRepair) { + glassSelections.push(damageLocationsSelected.WINDSHIELD); + } + if (store.getters.damage.glassToReplace.some(glass => { return glass.location === damageLocationsParts.DRIVER })) { + glassSelections.push(damageLocationsSelected.SIDEDOOR); + } + + if (store.getters.damage.glassToReplace.some(glass => { return glass.location === damageLocationsParts.PASSENGER })) { + glassSelections.push(damageLocationsSelected.SIDEDOOR); + } + + if (store.getters.damage.glassToReplace.some(glass => { return glass.location === damageLocationsParts.REAR })) { + glassSelections.push(damageLocationsSelected.REARWINDOW); + } + + return glassSelections; + }, + + getWindshieldOptions() { + 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 === damageLocationsParts.WINDSHIELD && + glass.name === "Single" })) { + windShieldOptions.selectedWindshieldDamageType.push("Replace"); + windShieldOptions.selectedWindshieldReplaceOptions.push("Single"); + } + + if (store.getters.damage.glassToReplace.some(glass => { return glass.location === damageLocationsParts.WINDSHIELD && + glass.name === "Driver" })) { + windShieldOptions.selectedWindshieldDamageType.push("Replace"); + windShieldOptions.selectedWindshieldReplaceOptions.push("Driver"); + } + + if (store.getters.damage.glassToReplace.some(glass => { return glass.location === damageLocationsParts.WINDSHIELD && + glass.name === "Passenger" })) { + windShieldOptions.selectedWindshieldDamageType.push("Replace"); + windShieldOptions.selectedWindshieldReplaceOptions.push("Passenger"); + } + } + + if (store.getters.damage.isRepair) { + windShieldOptions.selectedWindshieldDamageType.push("Repair"); + windShieldOptions.selectedWindshieldChipCount.push(store.getters.damage.numberOfChips); + } + + return windShieldOptions; + }, + async forwardButtonAction() { const windshieldChipCount = this.selectedWindshieldOptions.selectedWindshieldChipCount && this.isWindshieldDamageLocation ? this.selectedWindshieldOptions.selectedWindshieldChipCount[0] : null; @@ -171,7 +226,7 @@ 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() { diff --git a/src/layouts/vehicle-damage/windshield-options/windshield-options.vue b/src/layouts/vehicle-damage/windshield-options/windshield-options.vue index ed214158e..f0020de43 100644 --- a/src/layouts/vehicle-damage/windshield-options/windshield-options.vue +++ b/src/layouts/vehicle-damage/windshield-options/windshield-options.vue @@ -70,7 +70,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); From 13532b1c5dba7d662f9956d69aa6ce060534948f Mon Sep 17 00:00:00 2001 From: FrankRua Date: Fri, 4 Mar 2022 14:08:14 -0500 Subject: [PATCH 06/19] update --- .../vehicle-parts/glass-part-question/glass-part-question.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 37f58e677..e7f4757ce 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 @@ -8,7 +8,7 @@
- +
-

{{ colorQuestionText }}

+

{{ colorQuestionText }}

-
+
-
+
-
- + -
+ " + :buttonLabel="name" + altText="" + :buttonID="`${glassLocation}-${glassName}-${name}`" + :groupName="`${glassLocation}-${glassName}`" + @isCheckedChanged="ResetTintAndPartSelections()" + /> +
-
-
- -
+ " + class="row my-2" + aria-live="polite" + > +
+
+
-
+
diff --git a/src/layouts/vehicle-parts/vehicle-parts.vue b/src/layouts/vehicle-parts/vehicle-parts.vue index 7c0efeda7..39c8bbbf3 100644 --- a/src/layouts/vehicle-parts/vehicle-parts.vue +++ b/src/layouts/vehicle-parts/vehicle-parts.vue @@ -136,7 +136,7 @@ export default { } }); }); - + console.log(this.glassParts) return { glassName: g.glassName, glassLocation: g.glassLocation, diff --git a/src/ux-components/list-card/list-card.vue b/src/ux-components/list-card/list-card.vue index c1fc6d089..832f33c6b 100644 --- a/src/ux-components/list-card/list-card.vue +++ b/src/ux-components/list-card/list-card.vue @@ -70,6 +70,7 @@ export default { colLength: String, validationRules: String, selectedValues: [Array, String], + modelValue: Object, hasError: Boolean, }, data(){ @@ -81,6 +82,14 @@ export default { if(Array.isArray(this.selectedValues)){ this.checkValue = this.isMultiSelect ? this.selectedValues.includes(this.value) : this.selectedValues[0]; } + this.$nextTick(() => { + if(Object.keys(this.modelValue).length > 0) { + this.checkValue = this.modelValue.value; + const emitEvent = { checkValue: this.checkValue, value: this.value.toString(), buttonId: this.buttonID.toString() }; + this.$emit('isCheckedChanged', emitEvent); + this.$emit('update:modelValue', emitEvent); + } + }) }, computed: { getLabelClasses() { From 533c79938532c0b71fa232fae3f9e4048b2f713e Mon Sep 17 00:00:00 2001 From: FrankRua Date: Fri, 4 Mar 2022 16:56:58 -0500 Subject: [PATCH 08/19] defects --- .../glass-part-question.vue | 54 +-- src/layouts/vehicle-parts/vehicle-parts.vue | 381 +++++++++--------- src/ux-components/list-card/list-card.vue | 101 +++-- 3 files changed, 285 insertions(+), 251 deletions(-) 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 e923af0c6..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 @@ -82,16 +82,10 @@ export default { glassName: String, glassLocation: String, colorAnswers: Array, - modelValue: { - type: Object, - default: () => ({}), - }, + modelValue: Object, }, mounted() { this.LoadPreselectedValues(); - if (Object.keys(this.featureListData).length === 1) { - this.AutoSelectTintIfOnlyOneColor(Object.keys(this.featureListData)[0]); - } }, components: { listCard, @@ -144,6 +138,7 @@ export default { }, }, methods: { + // Initialize the component data initializeComponent(cmsContent) { this.glassColorQuestion = cmsContent.ColorQuestionWidget.QuestionText; this.glassFeatureQuestion = cmsContent.FeatureQuestionWidget.QuestionText; @@ -191,35 +186,30 @@ export default { }); }, - AutoSelectTintIfOnlyOneColor(tintColor) { - this.selectedTint[tintColor] = { - buttonId: `${this.glassLocation}-${this.glassName}-${tintColor}`, - checkValue: "", - value: `${this.glassLocation}-${this.glassName}-${tintColor}`, - }; - }, - + // Loads the preselected values from the store. LoadPreselectedValues() { - if (Object.keys(this.modelValue).length !== 0) { - // Populate button-question model-value if parts data already exists in VueX - const alreadyPopulatedPartsData = - this.$store.getters.lineItems.glassParts; + this.$nextTick(() => { + if (this.modelValue !== undefined) { + // Populate button-question model-value if parts data already exists in VueX + const alreadyPopulatedPartsData = + this.$store.getters.lineItems.glassParts; - Object.keys(alreadyPopulatedPartsData).forEach((key) => { - const partNumber = alreadyPopulatedPartsData[key].partNumber; - const tintColor = alreadyPopulatedPartsData[key].color; + Object.keys(alreadyPopulatedPartsData).forEach((key) => { + const partNumber = alreadyPopulatedPartsData[key].partNumber; + const tintColor = alreadyPopulatedPartsData[key].color; - Object.keys(this.modelValue).forEach((key) => { - if (this.modelValue[key][0] === partNumber) { - this.selectedTint[tintColor] = { - buttonId: `${this.glassLocation}-${this.glassName}-${tintColor}`, - checkValue: "", - value: `${this.glassLocation}-${this.glassName}-${tintColor}`, - }; - } + Object.keys(this.modelValue).forEach((key) => { + if (this.modelValue[key][0] === partNumber) { + this.selectedTint[tintColor] = { + buttonId: `${this.glassLocation}-${this.glassName}-${tintColor}`, + checkValue: "", + value: `${this.glassLocation}-${this.glassName}-${tintColor}`, + }; + } + }); }); - }); - } + } + }); }, }, }; diff --git a/src/layouts/vehicle-parts/vehicle-parts.vue b/src/layouts/vehicle-parts/vehicle-parts.vue index 39c8bbbf3..41e17f601 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/ux-components/list-card/list-card.vue b/src/ux-components/list-card/list-card.vue index 832f33c6b..8c5ac9e23 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 }}

@@ -73,23 +81,26 @@ export default { modelValue: Object, hasError: Boolean, }, - data(){ + data() { return { checkValue: Boolean, + }; + }, + 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]; - } - this.$nextTick(() => { - if(Object.keys(this.modelValue).length > 0) { - this.checkValue = this.modelValue.value; - const emitEvent = { checkValue: this.checkValue, value: this.value.toString(), buttonId: this.buttonID.toString() }; - this.$emit('isCheckedChanged', emitEvent); - this.$emit('update:modelValue', emitEvent); + 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() { @@ -105,23 +116,26 @@ 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"; const { - value: inputValue, - handleChange, - errors, - } = useField(props.groupName, props.validationRules, - { + value: inputValue, + handleChange, + errors, + } = useField(props.groupName, props.validationRules, { type: inputType, checkedValue: props.value, }); @@ -136,10 +150,12 @@ export default { \ No newline at end of file + From eead9f0ccd26233c5a771a53912461441d0b2724 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Sun, 6 Mar 2022 15:29:28 -0500 Subject: [PATCH 09/19] CSR-297 persist vehicle damage selections and tests --- src/constants/damage-locations-parts.js | 8 - src/constants/damage-locations-selected.js | 14 ++ .../vehicle-damage/vehicle-damage.spec.js | 172 +++++++++++++++++- src/layouts/vehicle-damage/vehicle-damage.vue | 117 ++++++++---- src/layouts/vehicle-year/vehicle-year.vue | 4 + 5 files changed, 268 insertions(+), 47 deletions(-) delete mode 100644 src/constants/damage-locations-parts.js 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 index 827bbf57b..905d9c8c5 100644 --- a/src/constants/damage-locations-selected.js +++ b/src/constants/damage-locations-selected.js @@ -2,6 +2,20 @@ 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/layouts/vehicle-damage/vehicle-damage.spec.js b/src/layouts/vehicle-damage/vehicle-damage.spec.js index 39ee4beda..67d127d75 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.spec.js +++ b/src/layouts/vehicle-damage/vehicle-damage.spec.js @@ -19,6 +19,7 @@ import { nextTick } from "vue"; import { storeActions } from "@/constants/store-actions"; import { storeMutations } from "@/constants/store-mutations"; import store from "@/store"; +import { damageLocationsSelected } from "@/constants/damage-locations-selected.js"; // Mock our module for promises. jest.mock("@/helpers/layout-helper.js", () => ({ @@ -38,6 +39,9 @@ jest.mock("@/store", () => ({ vehicle: { carId: "C00000000", }, + damage: { + glassToReplace: [] + }, }, })); @@ -252,7 +256,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: [ { @@ -272,7 +276,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, },],}, }); @@ -296,7 +300,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); @@ -389,13 +393,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, },],}, }); @@ -416,7 +420,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); }); @@ -596,6 +600,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" }, 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" }, + 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" }, 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" }, 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" }, damage: { glassToReplace: [{location: damageLocation, name: damageName}] }, isRepair: true}; + + var glassSelections = wrapper.vm.getRearReplaceOptionsFromStore(); + + //Assert + expect(glassSelections).toEqual(expectedGlass); + + }); +}); + + function setupMocks({ pageHeaderWidgetHeaderText = {}, mountOptionsMockData = { diff --git a/src/layouts/vehicle-damage/vehicle-damage.vue b/src/layouts/vehicle-damage/vehicle-damage.vue index 1fa6fe6c6..f71fde437 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.vue +++ b/src/layouts/vehicle-damage/vehicle-damage.vue @@ -46,7 +46,6 @@ import { settleAllPromises } from "@/helpers/layout-helper"; import { storeActions } from "@/constants/store-actions"; import store from "@/store"; import baseMixin from "@/mixins/base-mixin"; -import { damageLocationsParts } from "@/constants/damage-locations-parts.js"; import { damageLocationsCms } from "@/constants/damage-locations-cms.js"; import { damageLocationsSelected } from "@/constants/damage-locations-selected.js"; @@ -107,14 +106,14 @@ export default { }, data(){ return { - selectedDamageLocations: this.getDamageLocations(), + selectedDamageLocations: this.getDamageLocationsFromStore(), sideDoorOptionsData: { - selectedDoorSides: [], - selectedDriverSideReplaceOptions: [], - selectedPassengerSideReplaceOptions: [] + selectedDoorSides: this.getDoorSidesFromStore(), + selectedDriverSideReplaceOptions: this.getDriverSideReplaceOptionsFromStore(), + selectedPassengerSideReplaceOptions: this.getPassengerSideReplaceOptionsFromStore() }, - selectedWindshieldOptions: this.getWindshieldOptions(), - selectedRearReplaceOptions: [], + selectedWindshieldOptions: this.getWindshieldOptionsFromStore(), + selectedRearReplaceOptions: this.getRearReplaceOptionsFromStore(), } }, methods: { @@ -125,6 +124,10 @@ export default { store.dispatch(storeActions.RESET_PARTS_STATE_AND_DEPENDENCIES); }, backButtonAction() { + store.commit(this.storeMutations.UPDATE_IS_REPAIR, null); + store.commit(this.storeMutations.UPDATE_NUMBER_OF_CHIPS, null); + store.commit(this.storeMutations.UPDATE_GLASS_TO_REPLACE, []); + // route to move backwards this.$router.navigate( this.navigationScenarios.CLICKED_BACK, @@ -132,60 +135,108 @@ export default { ); }, - getDamageLocations() { + getDamageLocationsFromStore() { var glassSelections = []; - if (store.getters.damage.glassToReplace.some(glass => { return glass.location === damageLocationsParts.WINDSHIELD }) || + + 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 === damageLocationsParts.DRIVER })) { + 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 === damageLocationsParts.PASSENGER })) { - glassSelections.push(damageLocationsSelected.SIDEDOOR); - } - - if (store.getters.damage.glassToReplace.some(glass => { return glass.location === damageLocationsParts.REAR })) { + if (store.getters.damage.glassToReplace.some(glass => { return glass.location === damageLocationsSelected.REAR })) { glassSelections.push(damageLocationsSelected.REARWINDOW); } return glassSelections; }, - getWindshieldOptions() { + 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 === damageLocationsParts.WINDSHIELD && - glass.name === "Single" })) { - windShieldOptions.selectedWindshieldDamageType.push("Replace"); - windShieldOptions.selectedWindshieldReplaceOptions.push("Single"); + 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 === damageLocationsParts.WINDSHIELD && - glass.name === "Driver" })) { - windShieldOptions.selectedWindshieldDamageType.push("Replace"); - windShieldOptions.selectedWindshieldReplaceOptions.push("Driver"); + 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 === damageLocationsParts.WINDSHIELD && - glass.name === "Passenger" })) { - windShieldOptions.selectedWindshieldDamageType.push("Replace"); - windShieldOptions.selectedWindshieldReplaceOptions.push("Passenger"); + 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("Repair"); + 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() { const windshieldChipCount = this.selectedWindshieldOptions.selectedWindshieldChipCount && this.isWindshieldDamageLocation ? this.selectedWindshieldOptions.selectedWindshieldChipCount[0] : null; @@ -233,25 +284,25 @@ export default { 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-year/vehicle-year.vue b/src/layouts/vehicle-year/vehicle-year.vue index 460c8ced4..869cd6acb 100644 --- a/src/layouts/vehicle-year/vehicle-year.vue +++ b/src/layouts/vehicle-year/vehicle-year.vue @@ -93,6 +93,10 @@ export default { store.commit(storeMutations.UPDATE_STYLE, null); store.commit(storeMutations.UPDATE_CAR_ID, null); store.commit(storeMutations.UPDATE_VEHICLE_CATEGORY, null); + store.commit(storeMutations.UPDATE_IS_REPAIR, null); + store.commit(storeMutations.UPDATE_NUMBER_OF_CHIPS, null); + store.commit(storeMutations.UPDATE_GLASS_TO_REPLACE, []); + // Invokes store.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES); From a40600bba553a934719a5faa6a0dffe538cd232c Mon Sep 17 00:00:00 2001 From: CarlNation Date: Sun, 6 Mar 2022 15:42:47 -0500 Subject: [PATCH 10/19] CSR-297 - reset vehicle damage selections --- src/layouts/vehicle-style/vehicle-style.vue | 4 ++++ src/layouts/vehicle-year/vehicle-year.vue | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) 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 869cd6acb..563ecb31d 100644 --- a/src/layouts/vehicle-year/vehicle-year.vue +++ b/src/layouts/vehicle-year/vehicle-year.vue @@ -93,9 +93,6 @@ export default { store.commit(storeMutations.UPDATE_STYLE, null); store.commit(storeMutations.UPDATE_CAR_ID, null); store.commit(storeMutations.UPDATE_VEHICLE_CATEGORY, null); - store.commit(storeMutations.UPDATE_IS_REPAIR, null); - store.commit(storeMutations.UPDATE_NUMBER_OF_CHIPS, null); - store.commit(storeMutations.UPDATE_GLASS_TO_REPLACE, []); // Invokes From 2f88ac6daa82b842fa31cf00f63189fc0c794332 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Sun, 6 Mar 2022 20:56:03 -0500 Subject: [PATCH 11/19] CSR-297 this moved to style page --- src/layouts/vehicle-damage/vehicle-damage.vue | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/layouts/vehicle-damage/vehicle-damage.vue b/src/layouts/vehicle-damage/vehicle-damage.vue index f71fde437..9a16b7a96 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.vue +++ b/src/layouts/vehicle-damage/vehicle-damage.vue @@ -124,10 +124,6 @@ export default { store.dispatch(storeActions.RESET_PARTS_STATE_AND_DEPENDENCIES); }, backButtonAction() { - store.commit(this.storeMutations.UPDATE_IS_REPAIR, null); - store.commit(this.storeMutations.UPDATE_NUMBER_OF_CHIPS, null); - store.commit(this.storeMutations.UPDATE_GLASS_TO_REPLACE, []); - // route to move backwards this.$router.navigate( this.navigationScenarios.CLICKED_BACK, From 6f6cbc9db497e07fa4a6d848c658f708c31ed4e6 Mon Sep 17 00:00:00 2001 From: bmauger Date: Mon, 7 Mar 2022 08:14:03 -0500 Subject: [PATCH 12/19] Fix spacing per qa. --- src/common-components/vin-information/vin-information.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 @@
-
+
From 3e91d1dbee4a305618d0788c88588df368627d87 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Mon, 7 Mar 2022 08:51:13 -0500 Subject: [PATCH 13/19] CSR-297 tint mapper --- src/constants/tint-mapper.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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" }, ] } From 7ca8c72079c8a2c966af35c2a8d1b3e565ecb032 Mon Sep 17 00:00:00 2001 From: Mark Harris Date: Mon, 7 Mar 2022 09:13:12 -0500 Subject: [PATCH 14/19] CSR-109 --- src/layouts/vehicle-parts/vehicle-parts.vue | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/layouts/vehicle-parts/vehicle-parts.vue b/src/layouts/vehicle-parts/vehicle-parts.vue index 41e17f601..abc8ee936 100644 --- a/src/layouts/vehicle-parts/vehicle-parts.vue +++ b/src/layouts/vehicle-parts/vehicle-parts.vue @@ -197,10 +197,9 @@ export default { this.$route ); }, - - // Nothing here to reset, the previous pages will setting parts correctly for here. + resetDependentState() { - + // Nothing additional to reset here: The page save is already fully resetting all the line-items on the order }, LoadInitialPartsData() { From c7e18f2dedad0c68c6fb44f4918131a61f91e657 Mon Sep 17 00:00:00 2001 From: bmauger Date: Mon, 7 Mar 2022 09:34:41 -0500 Subject: [PATCH 15/19] Remove focus outline on iPhone. --- .../list-button-horizontal/list-button-horizontal.vue | 1 + 1 file changed, 1 insertion(+) 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 c64a2adb4..873bf7cdf 100644 --- a/src/ux-components/list-button-horizontal/list-button-horizontal.vue +++ b/src/ux-components/list-button-horizontal/list-button-horizontal.vue @@ -142,6 +142,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 { From acc7adcb4a29194182665269ac5c4d5efdc1e9e6 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Mon, 7 Mar 2022 09:56:31 -0500 Subject: [PATCH 16/19] CSR-297 chip count reset in page and not store --- src/layouts/vehicle-damage/vehicle-damage.vue | 4 +++- src/store/index.js | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/layouts/vehicle-damage/vehicle-damage.vue b/src/layouts/vehicle-damage/vehicle-damage.vue index 9a16b7a96..fc684ef63 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.vue +++ b/src/layouts/vehicle-damage/vehicle-damage.vue @@ -239,8 +239,10 @@ export default { store.commit(this.storeMutations.UPDATE_IS_REPAIR, this.isWindshieldRepair); - if (windshieldChipCount){ + if (this.isWindshieldRepair && windshieldChipCount){ store.commit(this.storeMutations.UPDATE_NUMBER_OF_CHIPS, parseInt(windshieldChipCount)); + } else { + store.commit(this.storeMutations.UPDATE_NUMBER_OF_CHIPS, null); } store.commit(this.storeMutations.UPDATE_GLASS_TO_REPLACE, this.selectedGlassToReplace()); diff --git a/src/store/index.js b/src/store/index.js index a231dfabb..4b0e06eb4 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -68,9 +68,6 @@ export const mutations = { }, updateIsRepair(state, isRepair){ state.order.damage.isRepair = isRepair; - if (!isRepair){ - this.commit(storeMutations.UPDATE_NUMBER_OF_CHIPS, null); - } }, updateNumberOfChips(state, numberOfChips){ state.order.damage.numberOfChips = numberOfChips; From c952d3f85bd9410872282a60a4b2ff36f1c9da9e Mon Sep 17 00:00:00 2001 From: CarlNation Date: Mon, 7 Mar 2022 10:40:05 -0500 Subject: [PATCH 17/19] CSR-297 clean up chip count logic --- src/layouts/vehicle-damage/vehicle-damage.vue | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/layouts/vehicle-damage/vehicle-damage.vue b/src/layouts/vehicle-damage/vehicle-damage.vue index fc684ef63..ebb188d89 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.vue +++ b/src/layouts/vehicle-damage/vehicle-damage.vue @@ -234,13 +234,10 @@ export default { }, async forwardButtonAction() { - const windshieldChipCount = this.selectedWindshieldOptions.selectedWindshieldChipCount && this.isWindshieldDamageLocation ? - this.selectedWindshieldOptions.selectedWindshieldChipCount[0] : null; - store.commit(this.storeMutations.UPDATE_IS_REPAIR, this.isWindshieldRepair); - if (this.isWindshieldRepair && windshieldChipCount){ - store.commit(this.storeMutations.UPDATE_NUMBER_OF_CHIPS, parseInt(windshieldChipCount)); + if (this.isWindshieldRepair && this.selectedWindshieldOptions.selectedWindshieldChipCount){ + store.commit(this.storeMutations.UPDATE_NUMBER_OF_CHIPS, parseInt(this.selectedWindshieldOptions.selectedWindshieldChipCount)); } else { store.commit(this.storeMutations.UPDATE_NUMBER_OF_CHIPS, null); } From bdd80337699a79be4a75beeed4e31fb7a1348d92 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Mon, 7 Mar 2022 11:17:55 -0500 Subject: [PATCH 18/19] CSR-297 --- src/layouts/vehicle-damage/vehicle-damage.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layouts/vehicle-damage/vehicle-damage.vue b/src/layouts/vehicle-damage/vehicle-damage.vue index ebb188d89..fa0fc4a73 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.vue +++ b/src/layouts/vehicle-damage/vehicle-damage.vue @@ -236,7 +236,7 @@ export default { async forwardButtonAction() { store.commit(this.storeMutations.UPDATE_IS_REPAIR, this.isWindshieldRepair); - if (this.isWindshieldRepair && this.selectedWindshieldOptions.selectedWindshieldChipCount){ + 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); From d17dc6ba2af385b57e11a3f9b78702808d20c7a2 Mon Sep 17 00:00:00 2001 From: bmauger Date: Mon, 7 Mar 2022 13:47:28 -0500 Subject: [PATCH 19/19] Update arrow color on error. --- src/styles/common-error-styles.scss | 6 ++++++ 1 file changed, 6 insertions(+) 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; + } } }