CSR-319: remove console logging and outdated code blocks
This commit is contained in:
parent
312ba851bf
commit
98b4329693
8 changed files with 1 additions and 67 deletions
|
|
@ -123,9 +123,7 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleCheckedChanged(val) {
|
handleCheckedChanged(val) {
|
||||||
console.log('BQ (', this.groupName, ') handleCheckedChanged, val: ', val)
|
|
||||||
if(this.isMultiSelect && this.selectedValues) {
|
if(this.isMultiSelect && this.selectedValues) {
|
||||||
console.log('BQ (', this.groupName, ') handleCheckedChanged, this.selectedValues is 1st: ', this.selectedValues)
|
|
||||||
// Add or remove item to array of data to emit
|
// Add or remove item to array of data to emit
|
||||||
const newSelectedValues = this.selectedValues;
|
const newSelectedValues = this.selectedValues;
|
||||||
if(Array.isArray(this.selectedValues)) {
|
if(Array.isArray(this.selectedValues)) {
|
||||||
|
|
@ -135,7 +133,6 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
this.selectedValues = [val.value];
|
this.selectedValues = [val.value];
|
||||||
}
|
}
|
||||||
console.log('BQ (', this.groupName, ') handleCheckedChanged, this.selectedValues is now: ', this.selectedValues)
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<transition name="fade" mode="out-in">
|
<transition name="fade" mode="out-in">
|
||||||
<div v-if="isAvailable && this.answersToDisplay.length > 0" class="replace-options-question" :class="this.answersToDisplay.length < 2 ? 'd-noneXXXXconsole.logXXXXXXXXXXXXX' : ''" aria-live="polite">
|
<div v-if="isAvailable && this.answersToDisplay.length > 0" class="replace-options-question" :class="this.answersToDisplay.length < 2 ? 'd-none' : ''" aria-live="polite">
|
||||||
<buttonQuestion
|
<buttonQuestion
|
||||||
isWide
|
isWide
|
||||||
:questionText="questionText"
|
:questionText="questionText"
|
||||||
|
|
@ -44,25 +44,11 @@ export default ({
|
||||||
},
|
},
|
||||||
updateSelectedValues() {
|
updateSelectedValues() {
|
||||||
// UPDATE SELECTEDVALUES IF ONLY ONE ANSWER
|
// UPDATE SELECTEDVALUES IF ONLY ONE ANSWER
|
||||||
console.log(' ROQ updateSelectedValues, this.answersToDisplay: ', this.answersToDisplay);
|
|
||||||
console.log(' ROQ updateSelectedValues, this.selectedValues: ', this.selectedValues);
|
|
||||||
|
|
||||||
if(Array.isArray(this.answersToDisplay) && this.answersToDisplay.length === 1) {
|
if(Array.isArray(this.answersToDisplay) && this.answersToDisplay.length === 1) {
|
||||||
console.log(' ROQ ONLY ONE ANSWER!')
|
|
||||||
this.selectedValues = [this.answersToDisplay[0].Name];
|
this.selectedValues = [this.answersToDisplay[0].Name];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// mounted() {
|
|
||||||
// console.log('**** MOUJNTED *****. this.groupName: ', this.groupName)
|
|
||||||
// console.log(' ROQ **** MOUJNTED *****, this.answersToDisplay: ', this.answersToDisplay);
|
|
||||||
// console.log(' ROQ **** MOUJNTED *****, this.selectedValues: ', this.selectedValues);
|
|
||||||
|
|
||||||
// if(Array.isArray(this.answersToDisplay) && this.answersToDisplay.length === 1) {
|
|
||||||
// console.log(' ROQ ONLY ONE ANSWER! this.groupName: ', this.groupName)
|
|
||||||
// this.selectedValues = [this.answersToDisplay[0].Name];
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
computed: {
|
computed: {
|
||||||
selectedValues: {
|
selectedValues: {
|
||||||
get: function() {
|
get: function() {
|
||||||
|
|
@ -90,7 +76,6 @@ export default ({
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
isAvailable(val) {
|
isAvailable(val) {
|
||||||
console.log('ROQ ^^^ isAvailable changed.')
|
|
||||||
// CHECK TO UPDATE SELECTED VALUES WHEN ISAVAILABLE IS TRUE
|
// CHECK TO UPDATE SELECTED VALUES WHEN ISAVAILABLE IS TRUE
|
||||||
val && this.updateSelectedValues();
|
val && this.updateSelectedValues();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,11 +37,7 @@ export default ({
|
||||||
},
|
},
|
||||||
updateSelectedValues() {
|
updateSelectedValues() {
|
||||||
// UPDATE SELECTEDVALUES IF ONLY ONE ANSWER
|
// UPDATE SELECTEDVALUES IF ONLY ONE ANSWER
|
||||||
console.log(' updateSelectedValues, this.answersToDisplay: ', this.answersToDisplay);
|
|
||||||
console.log(' updateSelectedValues, this.selectedValues: ', this.selectedValues);
|
|
||||||
|
|
||||||
if(Array.isArray(this.answersToDisplay) && this.answersToDisplay.length === 1 && this.selectedValues) {
|
if(Array.isArray(this.answersToDisplay) && this.answersToDisplay.length === 1 && this.selectedValues) {
|
||||||
console.log(' ONLY ONE ANSWER!')
|
|
||||||
this.selectedValues = [this.answersToDisplay[0].Name];
|
this.selectedValues = [this.answersToDisplay[0].Name];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -58,7 +54,6 @@ export default ({
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
isAvailable(val) {
|
isAvailable(val) {
|
||||||
console.log('*** isAvailable changed.')
|
|
||||||
// CHECK TO UPDATE SELECTED VALUES WHEN ISAVAILABLE IS TRUE
|
// CHECK TO UPDATE SELECTED VALUES WHEN ISAVAILABLE IS TRUE
|
||||||
val && this.updateSelectedValues();
|
val && this.updateSelectedValues();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,31 +17,6 @@
|
||||||
<script>
|
<script>
|
||||||
import buttonQuestion from "@/common-components/button-question/button-question";
|
import buttonQuestion from "@/common-components/button-question/button-question";
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
// import { defineRule } from "vee-validate";
|
|
||||||
//
|
|
||||||
// //DEFINE VALIDATION RULES
|
|
||||||
// // add these to the button component above:
|
|
||||||
// // validationRules="windshield-damage-required|checkForRepairAndReplace:@DamageLocationQuestion"
|
|
||||||
// // :suppressError="suppressError"
|
|
||||||
// defineRule("windshield-damage-required", (value) => {
|
|
||||||
// // console.log('validation rule - windshield-damage-required, value: ', value);
|
|
||||||
// if (!value || value.length < 1) {
|
|
||||||
// // console.log('validation rule - windshield-damage-required, RETURN ERROR');
|
|
||||||
// return "Please select windshield damage";
|
|
||||||
// }
|
|
||||||
// // console.log('validation rule - windshield-damage-required, return true');
|
|
||||||
// return true;
|
|
||||||
// });
|
|
||||||
// defineRule("checkForRepairAndReplace", (value, [other]) => {
|
|
||||||
// // console.log('validation rule - checkForRepairAndReplace, value: ', value);
|
|
||||||
// // console.log('validation rule - checkForRepairAndReplace, other: ', other);
|
|
||||||
// if (value.toUpperCase() === "REPAIR" && other.toString().includes("Windshield") && other.length > 1) {
|
|
||||||
// console.log('validation rule - checkForRepairAndReplace, RETURN ERROR');
|
|
||||||
// return "checkForRepairAndReplace error"
|
|
||||||
// }
|
|
||||||
// // console.log('validation rule - checkForRepairAndReplace, return true');
|
|
||||||
// return true;
|
|
||||||
// });
|
|
||||||
|
|
||||||
export default ({
|
export default ({
|
||||||
name: "windshieldDamageTypeQuestion",
|
name: "windshieldDamageTypeQuestion",
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,6 @@ defineRule("windshield-chip-count-required", required(errorMessages.WINDSHIELD_C
|
||||||
defineRule("windshield-replace-options-required", required(errorMessages.WINSHIELD_REPLACE_OPTIONS_REQUIRED));
|
defineRule("windshield-replace-options-required", required(errorMessages.WINSHIELD_REPLACE_OPTIONS_REQUIRED));
|
||||||
|
|
||||||
defineRule("checkForRepairAndReplace", (value, [other]) => {
|
defineRule("checkForRepairAndReplace", (value, [other]) => {
|
||||||
console.log('checkForRepairAndReplace, value: ', value, ' / other: ', other);
|
|
||||||
if (value.toString().toUpperCase().includes("REPAIR") && other.toString().toUpperCase().includes("WINDSHIELD") && other.length > 1) {
|
if (value.toString().toUpperCase().includes("REPAIR") && other.toString().toUpperCase().includes("WINDSHIELD") && other.length > 1) {
|
||||||
return "checkForRepairAndReplace error"
|
return "checkForRepairAndReplace error"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,6 @@ export default {
|
||||||
};
|
};
|
||||||
|
|
||||||
if (Array.isArray(props.selectedValues) && props.selectedValues.length == 1) {
|
if (Array.isArray(props.selectedValues) && props.selectedValues.length == 1) {
|
||||||
console.log('p r o p s . s el ectedV al ues, props.selectedValues: ', props.selectedValues)
|
|
||||||
fieldOptions['initialValue'] = fieldOptions.checkedValue;
|
fieldOptions['initialValue'] = fieldOptions.checkedValue;
|
||||||
}
|
}
|
||||||
const {
|
const {
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,6 @@ export default {
|
||||||
};
|
};
|
||||||
|
|
||||||
if (Array.isArray(props.selectedValues) && props.selectedValues.length == 1) {
|
if (Array.isArray(props.selectedValues) && props.selectedValues.length == 1) {
|
||||||
console.log('p r o p s . s el ectedV al ues, props.selectedValues: ', props.selectedValues)
|
|
||||||
fieldOptions['initialValue'] = fieldOptions.checkedValue;
|
fieldOptions['initialValue'] = fieldOptions.checkedValue;
|
||||||
}
|
}
|
||||||
const {
|
const {
|
||||||
|
|
|
||||||
|
|
@ -107,23 +107,14 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setup(props) {
|
setup(props) {
|
||||||
// console.log('RUNNING setup... ... ... props.validationRules: ', props.validationRules)
|
|
||||||
// console.log('RUNNING setup... ... ... props.value: ', props.value)
|
|
||||||
console.log('RUNNING setup... ... ... props.selectedValues: ', props.selectedValues)
|
|
||||||
|
|
||||||
const inputType = props.isMultiSelect ? "checkbox" : "radio";
|
const inputType = props.isMultiSelect ? "checkbox" : "radio";
|
||||||
|
|
||||||
// const { selectedValues, value } = toRefs(props);
|
|
||||||
// console.log('XXXXXXX selectedValues: ', selectedValues)
|
|
||||||
// console.log('XXXXXXX value: ', value)
|
|
||||||
|
|
||||||
const fieldOptions = {
|
const fieldOptions = {
|
||||||
type: inputType,
|
type: inputType,
|
||||||
checkedValue: props.value,
|
checkedValue: props.value,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (Array.isArray(props.selectedValues) && props.selectedValues.length == 1) {
|
if (Array.isArray(props.selectedValues) && props.selectedValues.length == 1) {
|
||||||
console.log('p r o p s . s el ectedV al ues, props.selectedValues: ', props.selectedValues)
|
|
||||||
fieldOptions['initialValue'] = fieldOptions.checkedValue;
|
fieldOptions['initialValue'] = fieldOptions.checkedValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -137,12 +128,6 @@ export default {
|
||||||
errors,
|
errors,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
// watch: {
|
|
||||||
// checkValue(val) {
|
|
||||||
// console.log('LC > CHANGE in checkValue, val: ', val)
|
|
||||||
// // this.handleChange()
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue