@@ -201,32 +202,32 @@ export default {
},
getWindshieldOptionsFromStore() {
- var windShieldOptions = { selectedWindshieldDamageType: [], selectedWindshieldChipCount: [], selectedWindshieldReplaceOptions: []};
+ 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.selectedWindshieldDamageType = 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.selectedWindshieldDamageType = 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.selectedWindshieldDamageType = damageLocationsSelected.REPLACE;
windShieldOptions.selectedWindshieldReplaceOptions.push(damageLocationsSelected.PASSENGER);
}
}
if (store.getters.damage.isRepair) {
- windShieldOptions.selectedWindshieldDamageType.push(damageLocationsSelected.REPAIR);
+ windShieldOptions.selectedWindshieldDamageType = damageLocationsSelected.REPAIR;
windShieldOptions.selectedWindshieldChipCount.push(store.getters.damage.numberOfChips);
}
@@ -284,6 +285,7 @@ export default {
},
async forwardButtonAction() {
+ // TODO CSR-715 look here
store.commit(this.storeMutations.UPDATE_IS_REPAIR, this.isWindshieldRepair);
if (this.isWindshieldRepair){
@@ -311,6 +313,7 @@ export default {
},
selectedGlassToReplace() {
+ // TODO CSR-715
const selectedGlassToReplace = [];
if (this.isWindshieldDamageLocation && !this.isWindshieldRepair){
this.selectedWindshieldOptions.selectedWindshieldReplaceOptions.forEach(wsItem => {
@@ -361,10 +364,7 @@ export default {
isWindshieldRepair() {
if (!this.isWindshieldDamageLocation) return false;
- return this.selectedWindshieldOptions.selectedWindshieldDamageType && this.selectedWindshieldOptions.selectedWindshieldDamageType.some(selectedDamageType =>
- {
- return selectedDamageType.toUpperCase() === "REPAIR";
- });
+ return this.selectedWindshieldOptions.selectedWindshieldDamageType.toUpperCase() === "REPAIR";
},
isDriverSideReplace() {
if (!this.isSideDoorDamageLocation) return false;
@@ -386,7 +386,7 @@ export default {
return this.isWindshieldDamageLocation && this.selectedDamageLocations.length > 1 && this.isWindshieldRepair;
},
hasSplitSingleConflict() {
- if (!this.selectedDamageLocations || !this.selectedDamageLocations.includes("Windshield") || !this.selectedWindshieldOptions.selectedWindshieldDamageType || !this.selectedWindshieldOptions.selectedWindshieldDamageType.includes("Replace") || !this.selectedWindshieldOptions.selectedWindshieldReplaceOptions) return false;
+ if (!this.selectedDamageLocations?.includes("Windshield") || this.selectedWindshieldOptions.selectedWindshieldDamageType?.toUpperCase() === "REPAIR" || !this.selectedWindshieldOptions.selectedWindshieldReplaceOptions) return false;
return this.selectedWindshieldOptions.selectedWindshieldReplaceOptions.some(selectedSingleWindshield =>
{
diff --git a/src/layouts/vehicle-damage/windshield-options/windshield-damage-type-question/windshield-damage-type-question.vue b/src/layouts/vehicle-damage/windshield-options/windshield-damage-type-question/windshield-damage-type-question.vue
index 455c27361..4d390e1f2 100644
--- a/src/layouts/vehicle-damage/windshield-options/windshield-damage-type-question/windshield-damage-type-question.vue
+++ b/src/layouts/vehicle-damage/windshield-options/windshield-damage-type-question/windshield-damage-type-question.vue
@@ -1,6 +1,7 @@
+ WDTQ: {{ modelValue }}
+ {{ windshieldDamageTypeQuestionValidationRules }}
+ WO:
+
+ {{ selectedWindshieldDamageTypeValues }}
{
+ console.log(value)
+ console.log(otherFieldValue)
+ console.log(value.toString().toUpperCase().includes(damageLocationsSelected.REPAIR.toUpperCase()))
+ console.log(otherFieldValue.toString().toUpperCase().includes(damageLocationsSelected.WINDSHIELD.toUpperCase()))
+ console.log(Array.isArray(otherFieldValue))
+ console.log(otherFieldValue.length > 1)
+ // this.$nextTick();
if (value.toString().toUpperCase().includes(damageLocationsSelected.REPAIR.toUpperCase()) &&
otherFieldValue.toString().toUpperCase().includes(damageLocationsSelected.WINDSHIELD.toUpperCase()) &&
Array.isArray(otherFieldValue) &&
otherFieldValue.length > 1)
{
+ console.log("A")
return false;
}
+ console.log("B")
return true;
});
defineRule("repair-only", (value) => {
@@ -91,7 +106,7 @@ export default ({
},
props: {
- modelValue: Array,
+ modelValue: String,
selectedDamageLocations: Array,
hasRepairReplaceConflict: Boolean,
hasSplitSingleConflict: Boolean,
@@ -103,6 +118,8 @@ export default ({
this.$refs.replaceOptionsQuestion.initializeComponent(windshieldAvailableReplacementOptions);
},
getWindshieldOptions(selectedWindshieldDamageType, selectedWindshieldChipCount, selectedWindshieldReplaceOptions){
+ console.log("getWindshieldOptions")
+ console.log(selectedWindshieldDamageType)
// ONLY UPDATE THE NEW VALUE IF IT IS TRUTHY (NOT NULL)
return {
selectedWindshieldDamageType: selectedWindshieldDamageType ? selectedWindshieldDamageType : this.selectedValues.selectedWindshieldDamageType,
@@ -114,18 +131,27 @@ export default ({
computed: {
selectedValues: {
get: function() {
+ console.log("selectedValues in WO")
+ console.log(this.modelValue)
return this.modelValue;
},
set: function(newValue) {
+ console.log("setting selectedValues in WO")
+ console.log(newValue)
this.$emit("update:modelValue", newValue);
}
},
- selectedWindshieldDamageTypeValues:{
+ selectedWindshieldDamageTypeValues: {
get: function() {
return this.selectedValues.selectedWindshieldDamageType;
},
set: function(newValue) {
+ console.log("selectedWindshieldDamageTypeValues")
+ console.log("I'm changing!")
+ console.log(newValue)
this.selectedValues = this.getWindshieldOptions(newValue, null, null);
+ // console.log(this.selectedValues)
+ console.log(this.getWindshieldOptions(newValue, null, null))
}
},
selectedWindshieldChipCountValues: {
@@ -153,12 +179,12 @@ export default ({
isRepairOptionSelected(){
if (!this.selectedWindshieldDamageTypeValues) return false;
- return this.selectedWindshieldDamageTypeValues.some(val => val.toUpperCase() === "REPAIR") && this.isWindshieldDamageLocation;
+ return this.selectedWindshieldDamageTypeValues.toUpperCase() === "REPAIR" && this.isWindshieldDamageLocation;
},
isReplaceOptionSelected(){
if (!this.selectedWindshieldDamageTypeValues) return false;
- return this.selectedWindshieldDamageTypeValues.some(val => val.toUpperCase() === "REPLACE") && this.isWindshieldDamageLocation;
+ return this.selectedWindshieldDamageTypeValues.toUpperCase() === "REPLACE" && this.isWindshieldDamageLocation;
},
isWindshieldReplaceAvailable() {
return !(Array.isArray(this.windshieldAvailableReplacementOptions) && this.windshieldAvailableReplacementOptions.length < 1);
diff --git a/src/ux-components/list-card/list-card.vue b/src/ux-components/list-card/list-card.vue
index 84762fc91..01ca30a8b 100644
--- a/src/ux-components/list-card/list-card.vue
+++ b/src/ux-components/list-card/list-card.vue
@@ -1,5 +1,7 @@
+ {{ errors }}
+
{{ hasError }}