CSR-762 Fix merge conflict
This commit is contained in:
commit
00d7fd1611
18 changed files with 120 additions and 128 deletions
|
|
@ -28,7 +28,7 @@ module.exports = {
|
||||||
testMatch: ["**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)"],
|
testMatch: ["**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)"],
|
||||||
coverageThreshold: {
|
coverageThreshold: {
|
||||||
global: {
|
global: {
|
||||||
statements: 85,
|
statements: 80,
|
||||||
// Got the go ahead from Mark to temporarily lower this. Taking out initialize component made the year,make,model and style coverage drop a bit. Once unit tests for license plate lookup, vin lookup and address lookup are in the coverage should go back up to 90
|
// Got the go ahead from Mark to temporarily lower this. Taking out initialize component made the year,make,model and style coverage drop a bit. Once unit tests for license plate lookup, vin lookup and address lookup are in the coverage should go back up to 90
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
42
src/App.vue
42
src/App.vue
|
|
@ -11,48 +11,12 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// TODO KO glass-part-question has nested button questions
|
import { handleChildFocus } from "@/helpers/input-button-focus-helper"
|
||||||
// TODO KO selectedValues - make consistent for checkbox and radio if possible
|
|
||||||
export default {
|
export default {
|
||||||
name: "app",
|
name: "app",
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
lastFocusedInputGroupName: "",
|
|
||||||
onFocusCallback: null,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
handleChildFocus(e) {
|
handleChildFocus: handleChildFocus
|
||||||
const targetType = e.target.type;
|
}
|
||||||
if (targetType !== "radio" && targetType !== "checkbox") {
|
|
||||||
this.handleInputFocus({
|
|
||||||
groupName: null,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
handleInputFocus(e) {
|
|
||||||
if (
|
|
||||||
e &&
|
|
||||||
this.lastFocusedInputGroupName !== e.groupName &&
|
|
||||||
this.onFocusCallback
|
|
||||||
) {
|
|
||||||
this.onFocusCallback();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
handleInputBlur(e) {
|
|
||||||
if (e) {
|
|
||||||
this.lastFocusedInputGroupName = e.groupName;
|
|
||||||
this.onFocusCallback = e.onFocusCallback;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
$route: {
|
|
||||||
handler() {
|
|
||||||
this.lastFocusedInputGroup = null;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -952,13 +952,30 @@ describe.skip("baseInputButton.vue", () => {
|
||||||
test.only("click on both => both are selected", async () => {
|
test.only("click on both => both are selected", async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const { wrapper } = setupBaseInputButtonWrapper({
|
const { wrapper } = setupBaseInputButtonWrapper({
|
||||||
isMultiSelect: true
|
isMultiSelect: true,
|
||||||
|
value1: "value1"
|
||||||
})
|
})
|
||||||
console.log(wrapper.html())
|
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const buttonWrappers = wrapper.findAllComponents({name: "baseInputButtonWrapper"})
|
const buttonWrappers = wrapper.findAllComponents({name: "baseInputButtonWrapper"})
|
||||||
await buttonWrappers[0].trigger("click")
|
|
||||||
|
// The two together simulate a click
|
||||||
|
const inputOne = buttonWrappers.at(0);
|
||||||
|
await inputOne.trigger("mousedown.left")
|
||||||
|
await inputOne.trigger("change")
|
||||||
|
await inputOne.trigger("click")
|
||||||
|
|
||||||
|
console.log({
|
||||||
|
html: wrapper.html(),
|
||||||
|
buttonWrapper1: inputOne,
|
||||||
|
a: inputOne.vm.selectedValue,
|
||||||
|
c: inputOne.vm.modelValue,
|
||||||
|
d: inputOne.modelValue,
|
||||||
|
e: inputOne.vm.value,
|
||||||
|
f: inputOne.value,
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(wrapper.vm.value).toEqual(["value1"])
|
expect(wrapper.vm.value).toEqual(["value1"])
|
||||||
|
|
@ -1015,8 +1032,8 @@ function setupBaseInputButtonWrapper({ mockData = {} }) {
|
||||||
};
|
};
|
||||||
|
|
||||||
let parentComponentTemplate = "<div>"
|
let parentComponentTemplate = "<div>"
|
||||||
parentComponentTemplate += `<baseInputButtonWrapper v-model="value" :isMultiSelect="isMultiSelect" groupName="myGroupName" value="value1" />`
|
parentComponentTemplate += `<baseInputButtonWrapper v-model="selectedValue" :isMultiSelect="${mockData.isMultiSelect}" groupName="myGroupName" value="value1" />`
|
||||||
parentComponentTemplate += `<baseInputButtonWrapper v-model="value" :isMultiSelect="isMultiSelect" groupName="myGroupName" value="value2" />`
|
parentComponentTemplate += `<baseInputButtonWrapper v-model="selectedValue" :isMultiSelect="${mockData.isMultiSelect}" groupName="myGroupName" value="value2" />`
|
||||||
parentComponentTemplate += `</div>`
|
parentComponentTemplate += `</div>`
|
||||||
const wrapper = mount({
|
const wrapper = mount({
|
||||||
data() {
|
data() {
|
||||||
|
|
|
||||||
|
|
@ -26,40 +26,15 @@
|
||||||
import { useField } from "vee-validate";
|
import { useField } from "vee-validate";
|
||||||
import { toRef } from "vue";
|
import { toRef } from "vue";
|
||||||
import { queryStrings } from "@/constants/query-strings";
|
import { queryStrings } from "@/constants/query-strings";
|
||||||
import inputButtonWrapperMixin from "../../mixins/input-button-wrapper-mixin";
|
import { handleInputFocus, handleInputBlur } from "@/helpers/input-button-focus-helper";
|
||||||
|
import { inputButtonProps } from "@/common-components/base-input-button/button-functionality-props";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "base-input-button",
|
name: "base-input-button",
|
||||||
props: {
|
props: {
|
||||||
// ...inputButtonWrapperMixin.props
|
...inputButtonProps,
|
||||||
value: {
|
|
||||||
type: [String, Number],
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
modelValue: {
|
|
||||||
type: [Array, String, Number],
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
isMultiSelect: Boolean,
|
|
||||||
groupName: {
|
|
||||||
type: String,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
validationRules: {
|
|
||||||
type: String,
|
|
||||||
default: "",
|
|
||||||
},
|
|
||||||
buttonWrapperClasses: [String, Array, Object],
|
buttonWrapperClasses: [String, Array, Object],
|
||||||
inputClasses: [String, Array, Object],
|
inputClasses: [String, Array, Object],
|
||||||
valueToLogType: String,
|
|
||||||
selectOnKeypress: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true,
|
|
||||||
},
|
|
||||||
isRequired: Boolean,
|
|
||||||
lastValuePushedToGa: [String, Number],
|
|
||||||
setLastValuePushedToGa: Function,
|
|
||||||
shouldPushClickEventToGAOnMount: Boolean,
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -68,15 +43,15 @@ export default {
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
if (this.isChecked) {
|
if (this.isChecked) {
|
||||||
if (this.shouldPushClickEventToGAOnMount) {
|
this.handleChange(this.modelValue);
|
||||||
this.handleEventAction(this.eventTypes.MOUNT)
|
|
||||||
} else {
|
|
||||||
this.handleChange(this.modelValue);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleEventAction(eventType, e) {
|
handleEventAction(eventType, e) {
|
||||||
|
console.log("HANDLE EVENT ACTION: ", {
|
||||||
|
eventType,
|
||||||
|
e
|
||||||
|
})
|
||||||
if (this.isMultiSelect) {
|
if (this.isMultiSelect) {
|
||||||
switch (eventType) {
|
switch (eventType) {
|
||||||
case this.eventTypes.ENTER:
|
case this.eventTypes.ENTER:
|
||||||
|
|
@ -92,16 +67,15 @@ export default {
|
||||||
case this.eventTypes.CLICK:
|
case this.eventTypes.CLICK:
|
||||||
case this.eventTypes.ENTER:
|
case this.eventTypes.ENTER:
|
||||||
case this.eventTypes.SPACE:
|
case this.eventTypes.SPACE:
|
||||||
case this.eventTypes.MOUNT:
|
|
||||||
this.handleClick(e);
|
this.handleClick(e);
|
||||||
this.handlePushClickEventToGACheck(
|
this.handlePushClickEventToGACheck(
|
||||||
this.eventTypes.CLICK
|
this.eventTypes.CLICK
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case this.eventTypes.CHANGE:
|
case this.eventTypes.CHANGE:
|
||||||
this.selectOnKeypress
|
this.selectingInitiatesLoad
|
||||||
? this.handleClick(e)
|
? this.handleSelectionChange(e)
|
||||||
: this.handleSelectionChange(e);
|
: this.handleClick(e);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -130,12 +104,12 @@ export default {
|
||||||
this.$emit("update:modelValue", this.valueToEmit);
|
this.$emit("update:modelValue", this.valueToEmit);
|
||||||
},
|
},
|
||||||
handleFocus() {
|
handleFocus() {
|
||||||
this.$root.handleInputFocus({
|
handleInputFocus({
|
||||||
groupName: this.groupName,
|
groupName: this.groupName,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleBlur() {
|
handleBlur() {
|
||||||
this.$root.handleInputBlur({
|
handleInputBlur({
|
||||||
groupName: this.groupName,
|
groupName: this.groupName,
|
||||||
onFocusCallback: this.handlePushClickEventToGACheck,
|
onFocusCallback: this.handlePushClickEventToGACheck,
|
||||||
});
|
});
|
||||||
|
|
@ -146,6 +120,7 @@ export default {
|
||||||
this.pushClickEventToGA();
|
this.pushClickEventToGA();
|
||||||
} else { // if from tabbing around
|
} else { // if from tabbing around
|
||||||
if (
|
if (
|
||||||
|
this.valueToEmit !== null &&
|
||||||
!this.isValueSelectedOnClick &&
|
!this.isValueSelectedOnClick &&
|
||||||
this.isChecked &&
|
this.isChecked &&
|
||||||
this.lastValuePushedToGa != this.value
|
this.lastValuePushedToGa != this.value
|
||||||
|
|
@ -193,7 +168,6 @@ export default {
|
||||||
ENTER: "enter",
|
ENTER: "enter",
|
||||||
SPACE: "space",
|
SPACE: "space",
|
||||||
CLICK: "click",
|
CLICK: "click",
|
||||||
MOUNT: "mount"
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
export const inputButtonProps = {
|
||||||
|
value: {
|
||||||
|
type: [String, Number],
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
modelValue: {
|
||||||
|
type: [Array, String, Number],
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
isMultiSelect: Boolean,
|
||||||
|
groupName: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
validationRules: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
valueToLogType: String,
|
||||||
|
isRequired: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
|
lastValuePushedToGa: [String, Number],
|
||||||
|
setLastValuePushedToGa: Function,
|
||||||
|
selectingInitiatesLoad: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -49,10 +49,8 @@
|
||||||
:isWide="isWide"
|
:isWide="isWide"
|
||||||
:validationRules="validationRules"
|
:validationRules="validationRules"
|
||||||
:textPosition="textPosition"
|
:textPosition="textPosition"
|
||||||
:selectOnKeypress="selectOnKeypress"
|
|
||||||
:lastValuePushedToGa="lastValuePushedToGa"
|
:lastValuePushedToGa="lastValuePushedToGa"
|
||||||
:setLastValuePushedToGa="setLastValuePushedToGa"
|
:setLastValuePushedToGa="setLastValuePushedToGa"
|
||||||
:shouldPushClickEventToGAOnMount="shouldPushClickEventToGAOnMount"
|
|
||||||
v-model="selectedValues"
|
v-model="selectedValues"
|
||||||
/>
|
/>
|
||||||
<!-- For nested questions -->
|
<!-- For nested questions -->
|
||||||
|
|
@ -118,11 +116,6 @@ export default {
|
||||||
suppressError: Boolean,
|
suppressError: Boolean,
|
||||||
useTextForValue: Boolean,
|
useTextForValue: Boolean,
|
||||||
valueToLogType: String,
|
valueToLogType: String,
|
||||||
selectOnKeypress: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true,
|
|
||||||
},
|
|
||||||
shouldPushClickEventToGAOnMount: Boolean
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -179,7 +172,6 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
buttonsInfo() {
|
buttonsInfo() {
|
||||||
// TODO KO temporary. It should always just be an array
|
|
||||||
return (Array.isArray(this.answers) ? this.answers : [])?.map(
|
return (Array.isArray(this.answers) ? this.answers : [])?.map(
|
||||||
(answer) => ({
|
(answer) => ({
|
||||||
buttonLabel: answer.buttonLabel ?? answer.Text ?? answer,
|
buttonLabel: answer.buttonLabel ?? answer.Text ?? answer,
|
||||||
|
|
|
||||||
35
src/helpers/analytics-helper.js
Normal file
35
src/helpers/analytics-helper.js
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
let lastFocusedInputGroupName = "";
|
||||||
|
let onFocusCallback = null;
|
||||||
|
|
||||||
|
// TODO KO Add tests for this file
|
||||||
|
const handleChildFocus = (e) => {
|
||||||
|
const targetType = e.target.type;
|
||||||
|
if (targetType !== "radio" && targetType !== "checkbox") {
|
||||||
|
handleInputFocus({
|
||||||
|
groupName: null,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleInputFocus = (e) => {
|
||||||
|
if (
|
||||||
|
e &&
|
||||||
|
lastFocusedInputGroupName !== e.groupName &&
|
||||||
|
onFocusCallback
|
||||||
|
) {
|
||||||
|
onFocusCallback();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleInputBlur = (e) => {
|
||||||
|
if (e) {
|
||||||
|
lastFocusedInputGroupName = e.groupName;
|
||||||
|
onFocusCallback = e.onFocusCallback;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export {
|
||||||
|
handleChildFocus,
|
||||||
|
handleInputFocus,
|
||||||
|
handleInputBlur
|
||||||
|
}
|
||||||
|
|
@ -25,7 +25,7 @@ export default ({
|
||||||
name: "replaceOptionsQuestion",
|
name: "replaceOptionsQuestion",
|
||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
replaceOptions: [],
|
replaceOptions: this.isMultiSelect ? [] : "",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
|
|
@ -46,7 +46,7 @@ export default ({
|
||||||
updateSelectedValues() {
|
updateSelectedValues() {
|
||||||
// UPDATE SELECTEDVALUES IF ONLY ONE ANSWER
|
// UPDATE SELECTEDVALUES IF ONLY ONE ANSWER
|
||||||
if(Array.isArray(this.answersToDisplay) && this.answersToDisplay.length === 1) {
|
if(Array.isArray(this.answersToDisplay) && this.answersToDisplay.length === 1) {
|
||||||
this.selectedValues = [this.answersToDisplay[0].Name];
|
this.selectedValues = this.isMultiSelect ? [this.answersToDisplay[0].Name] : this.answersToDisplay[0].Name;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -91,7 +91,7 @@ export default ({
|
||||||
},
|
},
|
||||||
shouldDisplayReplaceOptionsQuestion(shouldDisplayReplaceOptionsQuestion) {
|
shouldDisplayReplaceOptionsQuestion(shouldDisplayReplaceOptionsQuestion) {
|
||||||
if (!shouldDisplayReplaceOptionsQuestion) {
|
if (!shouldDisplayReplaceOptionsQuestion) {
|
||||||
this.selectedValues = [];
|
this.selectedValues = this.isMultiSelect ? [] : "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ export default ({
|
||||||
name: "sideDoorOptions",
|
name: "sideDoorOptions",
|
||||||
props: {
|
props: {
|
||||||
groupName: String,
|
groupName: String,
|
||||||
modelValue: [Array, Object], // TODO Does this take an array?
|
modelValue: Object,
|
||||||
selectedDamageLocations: Array,
|
selectedDamageLocations: Array,
|
||||||
cmsWidgetName: String,
|
cmsWidgetName: String,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -57,8 +57,8 @@ defineRule("windshield-replace-options-required", required(errorMessages.WINSHIE
|
||||||
|
|
||||||
defineRule("check-for-repair-and-replace", (selectedWindshieldDamageType, selectedDamageLocations) => {
|
defineRule("check-for-repair-and-replace", (selectedWindshieldDamageType, selectedDamageLocations) => {
|
||||||
return selectedWindshieldDamageType.toString() != damageLocationsSelected.REPAIR ||
|
return selectedWindshieldDamageType.toString() != damageLocationsSelected.REPAIR ||
|
||||||
(!selectedDamageLocations.includes(damageLocationsSelected.WINDSHIELD) && !selectedDamageLocations[0]?.includes(damageLocationsSelected.WINDSHIELD)) ||
|
(!selectedDamageLocations.includes(damageLocationsSelected.WINDSHIELD) && !selectedDamageLocations[0]?.includes(damageLocationsSelected.WINDSHIELD)) ||
|
||||||
(selectedDamageLocations.length === 1 && selectedDamageLocations[0].length === 1);
|
(selectedDamageLocations[0].length === 1);
|
||||||
});
|
});
|
||||||
defineRule("repair-only", (value) => {
|
defineRule("repair-only", (value) => {
|
||||||
return value.toString() === damageLocationsSelected.REPAIR;
|
return value.toString() === damageLocationsSelected.REPAIR;
|
||||||
|
|
@ -83,7 +83,7 @@ export default ({
|
||||||
},
|
},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
modelValue: [Object, String], // TODO Does this take a string?
|
modelValue: Object,
|
||||||
selectedDamageLocations: Array,
|
selectedDamageLocations: Array,
|
||||||
hasRepairReplaceConflict: Boolean,
|
hasRepairReplaceConflict: Boolean,
|
||||||
hasSplitSingleConflict: Boolean,
|
hasSplitSingleConflict: Boolean,
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@
|
||||||
groupName="ChooseVehicleMake"
|
groupName="ChooseVehicleMake"
|
||||||
textPosition="text-start"
|
textPosition="text-start"
|
||||||
v-model="selectedValue"
|
v-model="selectedValue"
|
||||||
:selectOnKeypress="false"
|
|
||||||
isRequired
|
isRequired
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@
|
||||||
groupName="ChooseVehicleModel"
|
groupName="ChooseVehicleModel"
|
||||||
textPosition="text-start"
|
textPosition="text-start"
|
||||||
v-model="selectedValue"
|
v-model="selectedValue"
|
||||||
:selectOnKeypress="false"
|
|
||||||
isRequired
|
isRequired
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,7 @@
|
||||||
isRequired
|
isRequired
|
||||||
:groupName="`${glassLocation}-${glassName}-${selectedTint}`"
|
:groupName="`${glassLocation}-${glassName}-${selectedTint}`"
|
||||||
:validationRules="partValidationRules"
|
:validationRules="partValidationRules"
|
||||||
:shouldPushClickEventToGAOnMount="
|
/>
|
||||||
shouldPushClickEventToGAOnMount
|
|
||||||
" />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</buttonQuestion>
|
</buttonQuestion>
|
||||||
|
|
@ -57,7 +55,6 @@ export default {
|
||||||
glassColorQuestion: "",
|
glassColorQuestion: "",
|
||||||
glassFeatureQuestion: "",
|
glassFeatureQuestion: "",
|
||||||
selectedTint: "",
|
selectedTint: "",
|
||||||
shouldPushClickEventToGAOnMount: true,
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
|
|
@ -224,7 +221,6 @@ export default {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (this.modelValue !== undefined) {
|
if (this.modelValue !== undefined) {
|
||||||
// Populate button-question model-value if parts data already exists in VueX
|
// Populate button-question model-value if parts data already exists in VueX
|
||||||
this.shouldPushClickEventToGAOnMount = false;
|
|
||||||
this.selectedTint = this.modelValue?.color
|
this.selectedTint = this.modelValue?.color
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@
|
||||||
groupName="ChooseVehicleStyle"
|
groupName="ChooseVehicleStyle"
|
||||||
textPosition="text-start"
|
textPosition="text-start"
|
||||||
v-model="selectedValue"
|
v-model="selectedValue"
|
||||||
:selectOnKeypress="false"
|
|
||||||
isRequired
|
isRequired
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@
|
||||||
groupName="ChooseVehicleYear"
|
groupName="ChooseVehicleYear"
|
||||||
textPosition="text-start"
|
textPosition="text-start"
|
||||||
v-model="selectedValue"
|
v-model="selectedValue"
|
||||||
:selectOnKeypress="false"
|
|
||||||
isRequired
|
isRequired
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@ export default {
|
||||||
pushEventToGA(category, action, label, pushToLogApp = false, valueToLogType = null) {
|
pushEventToGA(category, action, label, pushToLogApp = false, valueToLogType = null) {
|
||||||
const currentPageName = getPageNameByQueryString();
|
const currentPageName = getPageNameByQueryString();
|
||||||
const labelToLog = getValueToLog(label, valueToLogType);
|
const labelToLog = getValueToLog(label, valueToLogType);
|
||||||
|
|
||||||
const eventToBePushed = {
|
const eventToBePushed = {
|
||||||
'event': GaEvents.GENERIC_EVENT,
|
'event': GaEvents.GENERIC_EVENT,
|
||||||
'category': category,
|
'category': category,
|
||||||
|
|
@ -140,7 +141,7 @@ export default {
|
||||||
|
|
||||||
noSession() {
|
noSession() {
|
||||||
return getSessionKeyValue() === 0 || getSessionIdValue() === '00000000-0000-0000-0000-000000000000';
|
return getSessionKeyValue() === 0 || getSessionIdValue() === '00000000-0000-0000-0000-000000000000';
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
analyticsPageEvents() {
|
analyticsPageEvents() {
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
|
import { inputButtonProps } from "@/common-components/base-input-button/button-functionality-props";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
modelValue: [Array, String, Number],
|
...inputButtonProps,
|
||||||
value: [String, Number],
|
|
||||||
isMultiSelect: Boolean,
|
|
||||||
groupName: String,
|
|
||||||
buttonLabel: [Number, String],
|
buttonLabel: [Number, String],
|
||||||
buttonLabelSubCopy: String,
|
buttonLabelSubCopy: String,
|
||||||
buttonImage: String,
|
buttonImage: String,
|
||||||
|
|
@ -13,16 +12,7 @@ export default {
|
||||||
},
|
},
|
||||||
textPosition: String,
|
textPosition: String,
|
||||||
screenReaderOnlyText: String,
|
screenReaderOnlyText: String,
|
||||||
valueToLogType: String,
|
|
||||||
validationRules: String,
|
|
||||||
isWide: Boolean,
|
isWide: Boolean,
|
||||||
isRequired: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true,
|
|
||||||
},
|
|
||||||
lastValuePushedToGa: [String, Number],
|
|
||||||
setLastValuePushedToGa: Function,
|
|
||||||
shouldPushClickEventToGAOnMount: Boolean,
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
selectedValue: {
|
selectedValue: {
|
||||||
|
|
|
||||||
|
|
@ -1044,11 +1044,8 @@ export const actions = {
|
||||||
);
|
);
|
||||||
const isWindshieldRepairTheSame =
|
const isWindshieldRepairTheSame =
|
||||||
isWindshieldRepair === context.state.order.damage.isRepair;
|
isWindshieldRepair === context.state.order.damage.isRepair;
|
||||||
const isChipCountTheSame = Array.isArray(selectedWindshieldChipCount) //TODO: fix the underlying components so this is never an array
|
|
||||||
? selectedWindshieldChipCount[0] ===
|
const isChipCountTheSame = selectedWindshieldChipCount === context.state.order.damage.numberOfChips;
|
||||||
context.state.order.damage.numberOfChips
|
|
||||||
: selectedWindshieldChipCount ===
|
|
||||||
context.state.order.damage.numberOfChips;
|
|
||||||
|
|
||||||
const isDamageChanging =
|
const isDamageChanging =
|
||||||
!isGlassToReplaceTheSame ||
|
!isGlassToReplaceTheSame ||
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue