CSR-715 Cleanup

This commit is contained in:
Katie 2022-07-01 09:03:33 -04:00
parent d9f7be2c62
commit 173f1b495b
5 changed files with 11 additions and 47 deletions

View file

@ -152,8 +152,6 @@ export default {
return this.modelValue;
},
set: function(newValue) {
console.log("selectedValues")
console.log(newValue)
this.$emit("update:modelValue", newValue);
}
},
@ -180,10 +178,6 @@ export default {
}
}
console.log("handling")
console.log(val)
console.log(this.selectedValues)
this.$emit("isCheckedChanged", val);
},
},

View file

@ -284,7 +284,6 @@ export default {
},
async forwardButtonAction() {
// TODO CSR-715 look here
store.commit(this.storeMutations.UPDATE_IS_REPAIR, this.isWindshieldRepair);
if (this.isWindshieldRepair){
@ -312,7 +311,6 @@ export default {
},
selectedGlassToReplace() {
// TODO CSR-715
const selectedGlassToReplace = [];
if (this.isWindshieldDamageLocation && !this.isWindshieldRepair){
this.selectedWindshieldOptions.selectedWindshieldReplaceOptions.forEach(wsItem => {
@ -363,7 +361,7 @@ export default {
isWindshieldRepair() {
if (!this.isWindshieldDamageLocation) return false;
return this.selectedWindshieldOptions.selectedWindshieldDamageType.toUpperCase() === "REPAIR";
return this.selectedWindshieldOptions.selectedWindshieldDamageType.toUpperCase() === damageLocationsSelected.REPAIR;
},
isDriverSideReplace() {
if (!this.isSideDoorDamageLocation) return false;
@ -385,7 +383,7 @@ export default {
return this.isWindshieldDamageLocation && this.selectedDamageLocations.length > 1 && this.isWindshieldRepair;
},
hasSplitSingleConflict() {
if (!this.selectedDamageLocations?.includes("Windshield") || this.selectedWindshieldOptions.selectedWindshieldDamageType?.toUpperCase() === "REPAIR" || !this.selectedWindshieldOptions.selectedWindshieldReplaceOptions) return false;
if (!this.selectedDamageLocations?.includes("Windshield") || this.selectedWindshieldOptions.selectedWindshieldDamageType?.toUpperCase() === damageLocationsSelected.REPAIR || !this.selectedWindshieldOptions.selectedWindshieldReplaceOptions) return false;
return this.selectedWindshieldOptions.selectedWindshieldReplaceOptions.some(selectedSingleWindshield =>
{

View file

@ -41,8 +41,6 @@ export default ({
return this.modelValue;
},
set: function(newValue) {
console.log("setting")
console.log(newValue)
this.$emit("update:modelValue", newValue);
this.$nextTick();
}

View file

@ -4,7 +4,7 @@
:isAvailable=isWindshieldDamageLocation
:suppressError="hasRepairReplaceConflict || showNoReplacementAvailableError"
groupName="WindshieldDamageTypeQuestion"
v-model="selectedWindshieldDamageTypeValues"
v-model="selectedWindshieldDamageTypeValue"
:validationRules="windshieldDamageTypeQuestionValidationRules"
/>
<alert
@ -51,16 +51,12 @@ import { errorMessages } from "@/constants/error-messages";
import { damageLocationsSelected } from "@/constants/damage-locations-selected.js";
// DEFINE VALIDATION RULES
console.log("Defining the rules")
defineRule("windshield-damage-type-required", required(errorMessages.WINDSHIELD_DAMAGE_TYPE_REQUIRED));
defineRule("windshield-chip-count-required", required(errorMessages.WINDSHIELD_CHIP_COUNT_REQUIRED));
defineRule("windshield-replace-options-required", required(errorMessages.WINSHIELD_REPLACE_OPTIONS_REQUIRED));
defineRule("repair-only", (value) => {
if (value.toString().toUpperCase() === damageLocationsSelected.REPAIR.toUpperCase()) {
return true;
}
return false;
return value.toString().toUpperCase() === damageLocationsSelected.REPAIR.toUpperCase();
});
defineRule("prevent-split-and-single-together", (value) => {
if (value.toString().toUpperCase().includes(damageLocationsSelected.SINGLE.toUpperCase()) &&
@ -94,8 +90,6 @@ 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,
@ -107,27 +101,18 @@ 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: {
selectedWindshieldDamageTypeValue: {
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: {
@ -135,7 +120,7 @@ export default ({
return this.selectedValues.selectedWindshieldChipCount;
},
set: function(newValue) {
this.selectedValues = this.getWindshieldOptions(this.selectedWindshieldDamageTypeValues, newValue, null);
this.selectedValues = this.getWindshieldOptions(this.selectedWindshieldDamageTypeValue, newValue, null);
}
},
selectedWindshieldReplaceOptionsValues: {
@ -143,7 +128,7 @@ export default ({
return this.selectedValues.selectedWindshieldReplaceOptions;
},
set: function(newValue) {
this.selectedValues = this.getWindshieldOptions(this.selectedWindshieldDamageTypeValues, null, newValue);
this.selectedValues = this.getWindshieldOptions(this.selectedWindshieldDamageTypeValue, null, newValue);
}
},
isWindshieldDamageLocation() {
@ -153,14 +138,14 @@ export default ({
});
},
isRepairOptionSelected(){
if (!this.selectedWindshieldDamageTypeValues) return false;
if (!this.selectedWindshieldDamageTypeValue) return false;
return this.selectedWindshieldDamageTypeValues.toUpperCase() === "REPAIR" && this.isWindshieldDamageLocation;
return this.selectedWindshieldDamageTypeValue.toUpperCase() === "REPAIR" && this.isWindshieldDamageLocation;
},
isReplaceOptionSelected(){
if (!this.selectedWindshieldDamageTypeValues) return false;
if (!this.selectedWindshieldDamageTypeValue) return false;
return this.selectedWindshieldDamageTypeValues.toUpperCase() === "REPLACE" && this.isWindshieldDamageLocation;
return this.selectedWindshieldDamageTypeValue.toUpperCase() === "REPLACE" && this.isWindshieldDamageLocation;
},
isWindshieldReplaceAvailable() {
return !(Array.isArray(this.windshieldAvailableReplacementOptions) && this.windshieldAvailableReplacementOptions.length < 1);

View file

@ -134,8 +134,6 @@ export default {
},
methods: {
handleInputChange(x) {
console.log("handleInputChange")
console.log(x)
if(!this.selectingInitiatesLoad) {
this.handleCheckChange();
}
@ -151,8 +149,6 @@ export default {
this.handleChange(this.value);
},
triggerButton(x) {
console.log("triggerButton")
console.log(x)
if(this.selectingInitiatesLoad) {
this.displayLoader();
this.handleCheckChange();
@ -161,18 +157,11 @@ export default {
this.pushEventToGA(this.$route.query[queryStrings.FMG_PAGE], this.GaActions.CLICKED, this.value.toString(), true);
},
handleCheckChange() {
console.log("handleCheckChange")
console.log("multiselect: " + this.isMultiSelect)
const emitEvent = {
checkValue: this.checkValue, // only read on checkboxes, on handleCheckedChanged on button-question
value: this.value.toString(),
buttonId: this.buttonID && this.buttonID.toString(),
};
console.log(emitEvent)
this.$emit("isCheckedChanged", emitEvent);
this.$emit("update:modelValue", emitEvent);