CSR-715 Cleanup
This commit is contained in:
parent
d9f7be2c62
commit
173f1b495b
5 changed files with 11 additions and 47 deletions
|
|
@ -152,8 +152,6 @@ export default {
|
||||||
return this.modelValue;
|
return this.modelValue;
|
||||||
},
|
},
|
||||||
set: function(newValue) {
|
set: function(newValue) {
|
||||||
console.log("selectedValues")
|
|
||||||
console.log(newValue)
|
|
||||||
this.$emit("update:modelValue", 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);
|
this.$emit("isCheckedChanged", val);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -284,7 +284,6 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
async forwardButtonAction() {
|
async forwardButtonAction() {
|
||||||
// TODO CSR-715 look here
|
|
||||||
store.commit(this.storeMutations.UPDATE_IS_REPAIR, this.isWindshieldRepair);
|
store.commit(this.storeMutations.UPDATE_IS_REPAIR, this.isWindshieldRepair);
|
||||||
|
|
||||||
if (this.isWindshieldRepair){
|
if (this.isWindshieldRepair){
|
||||||
|
|
@ -312,7 +311,6 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
selectedGlassToReplace() {
|
selectedGlassToReplace() {
|
||||||
// TODO CSR-715
|
|
||||||
const selectedGlassToReplace = [];
|
const selectedGlassToReplace = [];
|
||||||
if (this.isWindshieldDamageLocation && !this.isWindshieldRepair){
|
if (this.isWindshieldDamageLocation && !this.isWindshieldRepair){
|
||||||
this.selectedWindshieldOptions.selectedWindshieldReplaceOptions.forEach(wsItem => {
|
this.selectedWindshieldOptions.selectedWindshieldReplaceOptions.forEach(wsItem => {
|
||||||
|
|
@ -363,7 +361,7 @@ export default {
|
||||||
isWindshieldRepair() {
|
isWindshieldRepair() {
|
||||||
if (!this.isWindshieldDamageLocation) return false;
|
if (!this.isWindshieldDamageLocation) return false;
|
||||||
|
|
||||||
return this.selectedWindshieldOptions.selectedWindshieldDamageType.toUpperCase() === "REPAIR";
|
return this.selectedWindshieldOptions.selectedWindshieldDamageType.toUpperCase() === damageLocationsSelected.REPAIR;
|
||||||
},
|
},
|
||||||
isDriverSideReplace() {
|
isDriverSideReplace() {
|
||||||
if (!this.isSideDoorDamageLocation) return false;
|
if (!this.isSideDoorDamageLocation) return false;
|
||||||
|
|
@ -385,7 +383,7 @@ export default {
|
||||||
return this.isWindshieldDamageLocation && this.selectedDamageLocations.length > 1 && this.isWindshieldRepair;
|
return this.isWindshieldDamageLocation && this.selectedDamageLocations.length > 1 && this.isWindshieldRepair;
|
||||||
},
|
},
|
||||||
hasSplitSingleConflict() {
|
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 =>
|
return this.selectedWindshieldOptions.selectedWindshieldReplaceOptions.some(selectedSingleWindshield =>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -41,8 +41,6 @@ export default ({
|
||||||
return this.modelValue;
|
return this.modelValue;
|
||||||
},
|
},
|
||||||
set: function(newValue) {
|
set: function(newValue) {
|
||||||
console.log("setting")
|
|
||||||
console.log(newValue)
|
|
||||||
this.$emit("update:modelValue", newValue);
|
this.$emit("update:modelValue", newValue);
|
||||||
this.$nextTick();
|
this.$nextTick();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
:isAvailable=isWindshieldDamageLocation
|
:isAvailable=isWindshieldDamageLocation
|
||||||
:suppressError="hasRepairReplaceConflict || showNoReplacementAvailableError"
|
:suppressError="hasRepairReplaceConflict || showNoReplacementAvailableError"
|
||||||
groupName="WindshieldDamageTypeQuestion"
|
groupName="WindshieldDamageTypeQuestion"
|
||||||
v-model="selectedWindshieldDamageTypeValues"
|
v-model="selectedWindshieldDamageTypeValue"
|
||||||
:validationRules="windshieldDamageTypeQuestionValidationRules"
|
:validationRules="windshieldDamageTypeQuestionValidationRules"
|
||||||
/>
|
/>
|
||||||
<alert
|
<alert
|
||||||
|
|
@ -51,16 +51,12 @@ import { errorMessages } from "@/constants/error-messages";
|
||||||
import { damageLocationsSelected } from "@/constants/damage-locations-selected.js";
|
import { damageLocationsSelected } from "@/constants/damage-locations-selected.js";
|
||||||
|
|
||||||
// DEFINE VALIDATION RULES
|
// DEFINE VALIDATION RULES
|
||||||
console.log("Defining the rules")
|
|
||||||
defineRule("windshield-damage-type-required", required(errorMessages.WINDSHIELD_DAMAGE_TYPE_REQUIRED));
|
defineRule("windshield-damage-type-required", required(errorMessages.WINDSHIELD_DAMAGE_TYPE_REQUIRED));
|
||||||
defineRule("windshield-chip-count-required", required(errorMessages.WINDSHIELD_CHIP_COUNT_REQUIRED));
|
defineRule("windshield-chip-count-required", required(errorMessages.WINDSHIELD_CHIP_COUNT_REQUIRED));
|
||||||
defineRule("windshield-replace-options-required", required(errorMessages.WINSHIELD_REPLACE_OPTIONS_REQUIRED));
|
defineRule("windshield-replace-options-required", required(errorMessages.WINSHIELD_REPLACE_OPTIONS_REQUIRED));
|
||||||
|
|
||||||
defineRule("repair-only", (value) => {
|
defineRule("repair-only", (value) => {
|
||||||
if (value.toString().toUpperCase() === damageLocationsSelected.REPAIR.toUpperCase()) {
|
return value.toString().toUpperCase() === damageLocationsSelected.REPAIR.toUpperCase();
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
});
|
});
|
||||||
defineRule("prevent-split-and-single-together", (value) => {
|
defineRule("prevent-split-and-single-together", (value) => {
|
||||||
if (value.toString().toUpperCase().includes(damageLocationsSelected.SINGLE.toUpperCase()) &&
|
if (value.toString().toUpperCase().includes(damageLocationsSelected.SINGLE.toUpperCase()) &&
|
||||||
|
|
@ -94,8 +90,6 @@ export default ({
|
||||||
this.$refs.replaceOptionsQuestion.initializeComponent(windshieldAvailableReplacementOptions);
|
this.$refs.replaceOptionsQuestion.initializeComponent(windshieldAvailableReplacementOptions);
|
||||||
},
|
},
|
||||||
getWindshieldOptions(selectedWindshieldDamageType, selectedWindshieldChipCount, selectedWindshieldReplaceOptions){
|
getWindshieldOptions(selectedWindshieldDamageType, selectedWindshieldChipCount, selectedWindshieldReplaceOptions){
|
||||||
console.log("getWindshieldOptions")
|
|
||||||
console.log(selectedWindshieldDamageType)
|
|
||||||
// ONLY UPDATE THE NEW VALUE IF IT IS TRUTHY (NOT NULL)
|
// ONLY UPDATE THE NEW VALUE IF IT IS TRUTHY (NOT NULL)
|
||||||
return {
|
return {
|
||||||
selectedWindshieldDamageType: selectedWindshieldDamageType ? selectedWindshieldDamageType : this.selectedValues.selectedWindshieldDamageType,
|
selectedWindshieldDamageType: selectedWindshieldDamageType ? selectedWindshieldDamageType : this.selectedValues.selectedWindshieldDamageType,
|
||||||
|
|
@ -107,27 +101,18 @@ export default ({
|
||||||
computed: {
|
computed: {
|
||||||
selectedValues: {
|
selectedValues: {
|
||||||
get: function() {
|
get: function() {
|
||||||
console.log("selectedValues in WO")
|
|
||||||
console.log(this.modelValue)
|
|
||||||
return this.modelValue;
|
return this.modelValue;
|
||||||
},
|
},
|
||||||
set: function(newValue) {
|
set: function(newValue) {
|
||||||
console.log("setting selectedValues in WO")
|
|
||||||
console.log(newValue)
|
|
||||||
this.$emit("update:modelValue", newValue);
|
this.$emit("update:modelValue", newValue);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
selectedWindshieldDamageTypeValues: {
|
selectedWindshieldDamageTypeValue: {
|
||||||
get: function() {
|
get: function() {
|
||||||
return this.selectedValues.selectedWindshieldDamageType;
|
return this.selectedValues.selectedWindshieldDamageType;
|
||||||
},
|
},
|
||||||
set: function(newValue) {
|
set: function(newValue) {
|
||||||
console.log("selectedWindshieldDamageTypeValues")
|
|
||||||
console.log("I'm changing!")
|
|
||||||
console.log(newValue)
|
|
||||||
this.selectedValues = this.getWindshieldOptions(newValue, null, null);
|
this.selectedValues = this.getWindshieldOptions(newValue, null, null);
|
||||||
// console.log(this.selectedValues)
|
|
||||||
console.log(this.getWindshieldOptions(newValue, null, null))
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
selectedWindshieldChipCountValues: {
|
selectedWindshieldChipCountValues: {
|
||||||
|
|
@ -135,7 +120,7 @@ export default ({
|
||||||
return this.selectedValues.selectedWindshieldChipCount;
|
return this.selectedValues.selectedWindshieldChipCount;
|
||||||
},
|
},
|
||||||
set: function(newValue) {
|
set: function(newValue) {
|
||||||
this.selectedValues = this.getWindshieldOptions(this.selectedWindshieldDamageTypeValues, newValue, null);
|
this.selectedValues = this.getWindshieldOptions(this.selectedWindshieldDamageTypeValue, newValue, null);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
selectedWindshieldReplaceOptionsValues: {
|
selectedWindshieldReplaceOptionsValues: {
|
||||||
|
|
@ -143,7 +128,7 @@ export default ({
|
||||||
return this.selectedValues.selectedWindshieldReplaceOptions;
|
return this.selectedValues.selectedWindshieldReplaceOptions;
|
||||||
},
|
},
|
||||||
set: function(newValue) {
|
set: function(newValue) {
|
||||||
this.selectedValues = this.getWindshieldOptions(this.selectedWindshieldDamageTypeValues, null, newValue);
|
this.selectedValues = this.getWindshieldOptions(this.selectedWindshieldDamageTypeValue, null, newValue);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isWindshieldDamageLocation() {
|
isWindshieldDamageLocation() {
|
||||||
|
|
@ -153,14 +138,14 @@ export default ({
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
isRepairOptionSelected(){
|
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(){
|
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() {
|
isWindshieldReplaceAvailable() {
|
||||||
return !(Array.isArray(this.windshieldAvailableReplacementOptions) && this.windshieldAvailableReplacementOptions.length < 1);
|
return !(Array.isArray(this.windshieldAvailableReplacementOptions) && this.windshieldAvailableReplacementOptions.length < 1);
|
||||||
|
|
|
||||||
|
|
@ -134,8 +134,6 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleInputChange(x) {
|
handleInputChange(x) {
|
||||||
console.log("handleInputChange")
|
|
||||||
console.log(x)
|
|
||||||
if(!this.selectingInitiatesLoad) {
|
if(!this.selectingInitiatesLoad) {
|
||||||
this.handleCheckChange();
|
this.handleCheckChange();
|
||||||
}
|
}
|
||||||
|
|
@ -151,8 +149,6 @@ export default {
|
||||||
this.handleChange(this.value);
|
this.handleChange(this.value);
|
||||||
},
|
},
|
||||||
triggerButton(x) {
|
triggerButton(x) {
|
||||||
console.log("triggerButton")
|
|
||||||
console.log(x)
|
|
||||||
if(this.selectingInitiatesLoad) {
|
if(this.selectingInitiatesLoad) {
|
||||||
this.displayLoader();
|
this.displayLoader();
|
||||||
this.handleCheckChange();
|
this.handleCheckChange();
|
||||||
|
|
@ -161,18 +157,11 @@ export default {
|
||||||
this.pushEventToGA(this.$route.query[queryStrings.FMG_PAGE], this.GaActions.CLICKED, this.value.toString(), true);
|
this.pushEventToGA(this.$route.query[queryStrings.FMG_PAGE], this.GaActions.CLICKED, this.value.toString(), true);
|
||||||
},
|
},
|
||||||
handleCheckChange() {
|
handleCheckChange() {
|
||||||
console.log("handleCheckChange")
|
|
||||||
console.log("multiselect: " + this.isMultiSelect)
|
|
||||||
|
|
||||||
|
|
||||||
const emitEvent = {
|
const emitEvent = {
|
||||||
checkValue: this.checkValue, // only read on checkboxes, on handleCheckedChanged on button-question
|
checkValue: this.checkValue, // only read on checkboxes, on handleCheckedChanged on button-question
|
||||||
value: this.value.toString(),
|
value: this.value.toString(),
|
||||||
buttonId: this.buttonID && this.buttonID.toString(),
|
buttonId: this.buttonID && this.buttonID.toString(),
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log(emitEvent)
|
|
||||||
|
|
||||||
|
|
||||||
this.$emit("isCheckedChanged", emitEvent);
|
this.$emit("isCheckedChanged", emitEvent);
|
||||||
this.$emit("update:modelValue", emitEvent);
|
this.$emit("update:modelValue", emitEvent);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue