CSR-762 Edit how most button-question wrappers emit
This commit is contained in:
parent
dce7a575b6
commit
d4100f4d26
20 changed files with 190 additions and 127 deletions
|
|
@ -122,7 +122,7 @@ export default {
|
||||||
},
|
},
|
||||||
handleClick(e) {
|
handleClick(e) {
|
||||||
this.handleSelectionChange(e);
|
this.handleSelectionChange(e);
|
||||||
this.$emit("change", this.valueToEmit);
|
this.$emit("buttonClicked", this.valueToEmit);
|
||||||
},
|
},
|
||||||
pushClickEventToGA() {
|
pushClickEventToGA() {
|
||||||
this.pushEventToGA(
|
this.pushEventToGA(
|
||||||
|
|
@ -136,7 +136,7 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
isChecked() {
|
isChecked() {
|
||||||
if (this.isMultiSelect || this.modelValue instanceof Array) {
|
if (this.isMultiSelect && this.modelValue instanceof Array) {
|
||||||
return this.modelValue.includes(this.value);
|
return this.modelValue.includes(this.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -151,9 +151,6 @@ export default {
|
||||||
"-"
|
"-"
|
||||||
)}`;
|
)}`;
|
||||||
},
|
},
|
||||||
// baseInputButtonProps() {
|
|
||||||
|
|
||||||
// }
|
|
||||||
},
|
},
|
||||||
setup(props) {
|
setup(props) {
|
||||||
const inputType = props.isMultiSelect ? "checkbox" : "radio";
|
const inputType = props.isMultiSelect ? "checkbox" : "radio";
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@
|
||||||
:validationRules="validationRules"
|
:validationRules="validationRules"
|
||||||
:textPosition="textPosition"
|
:textPosition="textPosition"
|
||||||
:selectOnKeypress="selectOnKeypress"
|
:selectOnKeypress="selectOnKeypress"
|
||||||
@change="handleAnswerChange" />
|
@buttonClicked="handleAnswerChange" />
|
||||||
<!-- For nested questions -->
|
<!-- For nested questions -->
|
||||||
<transition name="fade" mode="out-in">
|
<transition name="fade" mode="out-in">
|
||||||
<div
|
<div
|
||||||
|
|
@ -222,7 +222,7 @@ export default {
|
||||||
},
|
},
|
||||||
handleAnswerChange(primaryAnswerValue) {
|
handleAnswerChange(primaryAnswerValue) {
|
||||||
this.primaryValue = primaryAnswerValue;
|
this.primaryValue = primaryAnswerValue;
|
||||||
this.$emit("change", primaryAnswerValue);
|
this.$emit("buttonQuestionChange", primaryAnswerValue);
|
||||||
this.$emit("update:modelValue", primaryAnswerValue);
|
this.$emit("update:modelValue", primaryAnswerValue);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ export async function loadOrderIfPresent() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO KO isOrderDifferent and isOrderSubmitted
|
||||||
// Reset state if cookie says to.
|
// Reset state if cookie says to.
|
||||||
if (funnelCookie.ShouldResetState) {
|
if (funnelCookie.ShouldResetState) {
|
||||||
baseMixin.methods.dispatchStoreAction(storeActions.RESET_STATE);
|
baseMixin.methods.dispatchStoreAction(storeActions.RESET_STATE);
|
||||||
|
|
@ -25,7 +26,6 @@ export async function loadOrderIfPresent() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Load referral if there is a cookie, and it doesn't indicate it needs a state reset.
|
// Load referral if there is a cookie, and it doesn't indicate it needs a state reset.
|
||||||
return (await loadOrder(funnelCookie.ReferralNumber, funnelCookie.ReferralDate, funnelCookie.ReferralCorrelationId, funnelCookie.ReferralParentAccountNumber)).data;
|
return (await loadOrder(funnelCookie.ReferralNumber, funnelCookie.ReferralDate, funnelCookie.ReferralCorrelationId, funnelCookie.ReferralParentAccountNumber)).data;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,40 +6,39 @@
|
||||||
buttonType="listButtonHorizontal"
|
buttonType="listButtonHorizontal"
|
||||||
v-model="selectedValues"
|
v-model="selectedValues"
|
||||||
isCashOrInsurance
|
isCashOrInsurance
|
||||||
isRequired />
|
isRequired
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import buttonQuestion from "@/common-components/button-question/button-question";
|
import buttonQuestion from "@/common-components/button-question/button-question";
|
||||||
|
|
||||||
export default {
|
export default ({
|
||||||
name: "cashOrInsuranceQuestion",
|
name: "cashOrInsuranceQuestion",
|
||||||
props: {
|
props: {
|
||||||
modelValue: String,
|
modelValue: String,
|
||||||
groupName: String,
|
groupName: String,
|
||||||
cmsWidgetName: String,
|
cmsWidgetName: String,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
answersFromCms() {
|
answersFromCms(){
|
||||||
return this.getCmsContent(this.cmsWidgetName, "Answers");
|
return this.getCmsContent(this.cmsWidgetName, 'Answers');
|
||||||
},
|
},
|
||||||
selectedValues: {
|
selectedValues: {
|
||||||
get: function () {
|
get: function() {
|
||||||
// Convert to CMS answer name from bool
|
// Convert to CMS answer name from bool
|
||||||
var cmsAnswerValue = this.modelValue
|
var cmsAnswerValue = this.modelValue ? "InsuranceAnswer" : "CashAnswer";
|
||||||
? "InsuranceAnswer"
|
|
||||||
: "CashAnswer";
|
|
||||||
return cmsAnswerValue;
|
return cmsAnswerValue;
|
||||||
},
|
},
|
||||||
set: function (newValue) {
|
set: function(newValue) {
|
||||||
// Convert back to bool for parent component
|
// Convert back to bool for parent component
|
||||||
this.$emit("update:modelValue", newValue === "InsuranceAnswer");
|
this.$emit("update:modelValue", newValue === "InsuranceAnswer");
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
buttonQuestion,
|
buttonQuestion,
|
||||||
},
|
},
|
||||||
};
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -6,8 +6,7 @@
|
||||||
:answers="answersToDisplay"
|
:answers="answersToDisplay"
|
||||||
:groupName="groupName"
|
:groupName="groupName"
|
||||||
buttonType="listCard"
|
buttonType="listCard"
|
||||||
isRequired
|
v-model="selectedDamageLocations"
|
||||||
v-model="selectedValue"
|
|
||||||
validationRules="damage-location-required"
|
validationRules="damage-location-required"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -19,22 +18,20 @@ import store from "@/store";
|
||||||
import { defineRule } from "vee-validate";
|
import { defineRule } from "vee-validate";
|
||||||
import { required } from "@/helpers/validation-rules";
|
import { required } from "@/helpers/validation-rules";
|
||||||
import { errorMessages } from "@/constants/error-messages";
|
import { errorMessages } from "@/constants/error-messages";
|
||||||
import buttonQuestionWrapperMixin from "@/mixins/button-question-wrapper-mixin"
|
|
||||||
|
|
||||||
// DEFINE VALIDATION RULES
|
// DEFINE VALIDATION RULES
|
||||||
defineRule("damage-location-required", required(errorMessages.DAMAGE_LOCATION_REQUIRED));
|
defineRule("damage-location-required", required(errorMessages.DAMAGE_LOCATION_REQUIRED));
|
||||||
|
|
||||||
export default ({
|
export default ({
|
||||||
name: "damageLocationQuestion",
|
name: "damageLocationQuestion",
|
||||||
mixins: [buttonQuestionWrapperMixin],
|
|
||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
damageOptions: {},
|
damageOptions: {},
|
||||||
// selectedValue: []
|
selectedDamageLocations: this.modelValue
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
modelValue: Array,
|
modelValue: [Array, String, Number],
|
||||||
groupName: String,
|
groupName: String,
|
||||||
cmsWidgetName: String,
|
cmsWidgetName: String,
|
||||||
},
|
},
|
||||||
|
|
@ -72,13 +69,13 @@ export default ({
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
selectedDamageLocations(selectedDamageLocations) {
|
||||||
|
this.$emit("update:modelValue", selectedDamageLocations);
|
||||||
|
}
|
||||||
|
},
|
||||||
components: {
|
components: {
|
||||||
buttonQuestion,
|
buttonQuestion,
|
||||||
},
|
},
|
||||||
watch: {
|
|
||||||
selectedValue(selectedValue) {
|
|
||||||
this.$emit("update:modelValue", selectedValue)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
:answers="answersToDisplay"
|
:answers="answersToDisplay"
|
||||||
:groupName="groupName"
|
:groupName="groupName"
|
||||||
buttonType="listCard"
|
buttonType="listCard"
|
||||||
v-model="selectedValue"
|
v-model="selectedReplaceOptions"
|
||||||
:validationRules="validationRules"
|
:validationRules="validationRules"
|
||||||
:suppressError="suppressError"
|
:suppressError="suppressError"
|
||||||
:isRequired="isRequired"
|
:isRequired="isRequired"
|
||||||
|
|
@ -20,21 +20,22 @@
|
||||||
<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 buttonQuestionWrapperMixin from "@/mixins/button-question-wrapper-mixin";
|
// import buttonQuestionWrapperMixin from "@/mixins/button-question-wrapper-mixin";
|
||||||
|
|
||||||
export default ({
|
export default ({
|
||||||
name: "replaceOptionsQuestion",
|
name: "replaceOptionsQuestion",
|
||||||
mixins: [buttonQuestionWrapperMixin],
|
// mixins: [buttonQuestionWrapperMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
replaceOptions: [],
|
replaceOptions: [],
|
||||||
|
selectedReplaceOptions: this.modelValue
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
|
modelValue: [Array, String, Number],
|
||||||
isAvailable: Boolean,
|
isAvailable: Boolean,
|
||||||
filterByVehicleCategory: Boolean,
|
filterByVehicleCategory: Boolean,
|
||||||
groupName: String,
|
groupName: String,
|
||||||
// modelValue: Array,
|
|
||||||
isMultiSelect: Boolean,
|
isMultiSelect: Boolean,
|
||||||
validationRules: String,
|
validationRules: String,
|
||||||
suppressError: Boolean,
|
suppressError: Boolean,
|
||||||
|
|
@ -50,7 +51,7 @@ export default ({
|
||||||
// ex: BackGlass stationary
|
// ex: BackGlass stationary
|
||||||
if (Array.isArray(this.answersToDisplay) && this.answersToDisplay.length === 1) {
|
if (Array.isArray(this.answersToDisplay) && this.answersToDisplay.length === 1) {
|
||||||
const selectedAnswer = this.answersToDisplay[0].Name;
|
const selectedAnswer = this.answersToDisplay[0].Name;
|
||||||
this.selectedValue = this.isMultiSelect ? [selectedAnswer] : selectedAnswer;
|
this.selectedReplaceOptions = this.isMultiSelect ? [selectedAnswer] : selectedAnswer;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -87,8 +88,11 @@ export default ({
|
||||||
},
|
},
|
||||||
shouldDisplayReplaceOptionsQuestion(shouldDisplayReplaceOptionsQuestion) {
|
shouldDisplayReplaceOptionsQuestion(shouldDisplayReplaceOptionsQuestion) {
|
||||||
if (!shouldDisplayReplaceOptionsQuestion) {
|
if (!shouldDisplayReplaceOptionsQuestion) {
|
||||||
this.selectedValue = [];
|
this.selectedReplaceOptions = [];
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
selectedReplaceOptions(selectedReplaceOptions) {
|
||||||
|
this.$emit("update:modelValue", selectedReplaceOptions);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
:groupName="groupName"
|
:groupName="groupName"
|
||||||
buttonType="listButtonHorizontal"
|
buttonType="listButtonHorizontal"
|
||||||
useTextForValue
|
useTextForValue
|
||||||
v-model="selectedValue"
|
v-model="numberOfChips"
|
||||||
:validationRules="validationRules"
|
:validationRules="validationRules"
|
||||||
isRequired
|
isRequired
|
||||||
/>
|
/>
|
||||||
|
|
@ -17,12 +17,18 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import buttonQuestion from "@/common-components/button-question/button-question";
|
import buttonQuestion from "@/common-components/button-question/button-question";
|
||||||
import buttonQuestionWrapperMixin from "@/mixins/button-question-wrapper-mixin";
|
// import buttonQuestionWrapperMixin from "@/mixins/button-question-wrapper-mixin";
|
||||||
|
|
||||||
export default ({
|
export default ({
|
||||||
name: "windshieldOptions",
|
name: "windshieldChipCountQuestion",
|
||||||
mixins: [buttonQuestionWrapperMixin],
|
// mixins: [buttonQuestionWrapperMixin],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
numberOfChips: this.modelValue
|
||||||
|
}
|
||||||
|
},
|
||||||
props: {
|
props: {
|
||||||
|
modelValue: [String, Number],
|
||||||
groupName: String,
|
groupName: String,
|
||||||
isAvailable: Boolean,
|
isAvailable: Boolean,
|
||||||
validationRules: String,
|
validationRules: String,
|
||||||
|
|
@ -38,6 +44,11 @@ export default ({
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
buttonQuestion,
|
buttonQuestion,
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
numberOfChips(numberOfChips) {
|
||||||
|
this.$emit("update:modelValue", numberOfChips);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -1,28 +1,36 @@
|
||||||
<template>
|
<template>
|
||||||
<transition name="fade" mode="out-in">
|
<transition name="fade" mode="out-in">
|
||||||
<div class="windshield-damage-type-question" v-if="isAvailable" aria-live="polite">
|
<div
|
||||||
|
class="windshield-damage-type-question"
|
||||||
|
v-if="isAvailable"
|
||||||
|
aria-live="polite">
|
||||||
<buttonQuestion
|
<buttonQuestion
|
||||||
:questionText="questionText"
|
:questionText="questionText"
|
||||||
:answers="answersFromCms"
|
:answers="answersFromCms"
|
||||||
:groupName="groupName"
|
:groupName="groupName"
|
||||||
buttonType="listCard"
|
buttonType="listCard"
|
||||||
v-model="selectedValue"
|
v-model="selectedWindshieldDamageType"
|
||||||
:suppressError="suppressError"
|
:suppressError="suppressError"
|
||||||
:validationRules="validationRules"
|
:validationRules="validationRules"
|
||||||
isRequired
|
isRequired />
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import buttonQuestion from "@/common-components/button-question/button-question";
|
import buttonQuestion from "@/common-components/button-question/button-question";
|
||||||
import buttonQuestionWrapperMixin from "@/mixins/button-question-wrapper-mixin";
|
// import buttonQuestionWrapperMixin from "@/mixins/button-question-wrapper-mixin";
|
||||||
|
|
||||||
export default ({
|
export default {
|
||||||
name: "windshieldDamageTypeQuestion",
|
name: "windshieldDamageTypeQuestion",
|
||||||
mixins: [buttonQuestionWrapperMixin],
|
// mixins: [buttonQuestionWrapperMixin],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
selectedWindshieldDamageType: this.modelValue,
|
||||||
|
};
|
||||||
|
},
|
||||||
props: {
|
props: {
|
||||||
|
modelValue: String,
|
||||||
groupName: String,
|
groupName: String,
|
||||||
isAvailable: Boolean,
|
isAvailable: Boolean,
|
||||||
suppressError: Boolean,
|
suppressError: Boolean,
|
||||||
|
|
@ -30,15 +38,20 @@ export default ({
|
||||||
cmsWidgetName: String,
|
cmsWidgetName: String,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
questionText(){
|
questionText() {
|
||||||
return this.getCmsContent(this.cmsWidgetName, 'QuestionText');
|
return this.getCmsContent(this.cmsWidgetName, "QuestionText");
|
||||||
},
|
},
|
||||||
answersFromCms(){
|
answersFromCms() {
|
||||||
return this.getCmsContent(this.cmsWidgetName, 'Answers');
|
return this.getCmsContent(this.cmsWidgetName, "Answers");
|
||||||
|
},
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
selectedWindshieldDamageType(selectedWindshieldDamageType) {
|
||||||
|
this.$emit("update:modelValue", selectedWindshieldDamageType);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
buttonQuestion,
|
buttonQuestion,
|
||||||
},
|
},
|
||||||
})
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,15 @@
|
||||||
<template>
|
<template>
|
||||||
<buttonQuestion
|
<buttonQuestion
|
||||||
class="radioQuestion"
|
class="radioQuestion"
|
||||||
isOverflowScrollable
|
isOverflowScrollable
|
||||||
selectingInitiatesLoad
|
selectingInitiatesLoad
|
||||||
:questionText="questionText"
|
:questionText="questionText"
|
||||||
:answers="makes"
|
:answers="makes"
|
||||||
groupName="ChooseVehicleMake"
|
groupName="ChooseVehicleMake"
|
||||||
textPosition="text-start"
|
textPosition="text-start"
|
||||||
v-model="selectedValue"
|
v-model="selectedMake"
|
||||||
:selectOnKeypress="false"
|
:selectOnKeypress="false"
|
||||||
isRequired
|
isRequired />
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
@ -19,37 +18,44 @@ import buttonQuestion from "@/common-components/button-question/button-question"
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
import { storeActions } from "@/constants/store-actions.js";
|
import { storeActions } from "@/constants/store-actions.js";
|
||||||
import baseMixin from "@/mixins/base-mixin.js";
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
import buttonQuestionWrapperMixin from "../../../mixins/button-question-wrapper-mixin";
|
// import buttonQuestionWrapperMixin from "../../../mixins/button-question-wrapper-mixin";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "make-question",
|
name: "make-question",
|
||||||
mixins: [buttonQuestionWrapperMixin],
|
// mixins: [buttonQuestionWrapperMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
makes: [],
|
makes: [],
|
||||||
};
|
selectedMake: ""
|
||||||
},
|
};
|
||||||
props: {
|
|
||||||
cmsWidgetName: String,
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
questionText(){
|
|
||||||
return this.getCmsContent(this.cmsWidgetName, 'QuestionText');
|
|
||||||
},
|
},
|
||||||
},
|
props: {
|
||||||
components: {
|
modelValue: String,
|
||||||
buttonQuestion,
|
cmsWidgetName: String,
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
loadInitialData() {
|
|
||||||
return baseMixin.methods.dispatchStoreAction(
|
|
||||||
storeActions.GET_VEHICLE_MAKES,
|
|
||||||
{ year: store.getters.vehicle.year }
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
initializeComponent(initialData) {
|
computed: {
|
||||||
this.makes = initialData;
|
questionText() {
|
||||||
|
return this.getCmsContent(this.cmsWidgetName, "QuestionText");
|
||||||
|
},
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
buttonQuestion,
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
loadInitialData() {
|
||||||
|
return baseMixin.methods.dispatchStoreAction(
|
||||||
|
storeActions.GET_VEHICLE_MAKES,
|
||||||
|
{ year: store.getters.vehicle.year }
|
||||||
|
);
|
||||||
|
},
|
||||||
|
initializeComponent(initialData) {
|
||||||
|
this.makes = initialData;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
selectedMake(selectedMake) {
|
||||||
|
this.$emit("update:modelValue", selectedMake);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
:answers="models"
|
:answers="models"
|
||||||
groupName="ChooseVehicleModel"
|
groupName="ChooseVehicleModel"
|
||||||
textPosition="text-start"
|
textPosition="text-start"
|
||||||
v-model="selectedValue"
|
v-model="selectedModel"
|
||||||
:selectOnKeypress="false"
|
:selectOnKeypress="false"
|
||||||
isRequired
|
isRequired
|
||||||
/>
|
/>
|
||||||
|
|
@ -27,9 +27,11 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
models: [],
|
models: [],
|
||||||
|
selectedModel: ""
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
|
modelValue: String,
|
||||||
cmsWidgetName: String,
|
cmsWidgetName: String,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -51,5 +53,10 @@ export default {
|
||||||
this.models = initialData;
|
this.models = initialData;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
selectedModel(selectedModel) {
|
||||||
|
this.$emit("update:modelValue", selectedModel);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -64,10 +64,7 @@ import { settleAllPromises } from "@/helpers/layout-helper";
|
||||||
import { fmgPageValues } from "@/router/router-constants/fmgPage-values";
|
import { fmgPageValues } from "@/router/router-constants/fmgPage-values";
|
||||||
import { Form } from "vee-validate";
|
import { Form } from "vee-validate";
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
import { storeMutations } from "@/constants/store-mutations.js";
|
|
||||||
import vehicleQuestionsMixin from "@/mixins/vehicle-questions-mixin";
|
import vehicleQuestionsMixin from "@/mixins/vehicle-questions-mixin";
|
||||||
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
|
|
||||||
import { assertParenthesizedExpression } from "@babel/types";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "vehicle-parts",
|
name: "vehicle-parts",
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
:answers="styles"
|
:answers="styles"
|
||||||
groupName="ChooseVehicleStyle"
|
groupName="ChooseVehicleStyle"
|
||||||
textPosition="text-start"
|
textPosition="text-start"
|
||||||
v-model="selectedValue"
|
v-model="selectedStyle"
|
||||||
:selectOnKeypress="false"
|
:selectOnKeypress="false"
|
||||||
isRequired
|
isRequired
|
||||||
/>
|
/>
|
||||||
|
|
@ -19,14 +19,15 @@ import buttonQuestion from "@/common-components/button-question/button-question"
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
import { storeActions } from "@/constants/store-actions.js";
|
import { storeActions } from "@/constants/store-actions.js";
|
||||||
import baseMixin from "@/mixins/base-mixin.js";
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
import buttonQuestionWrapperMixin from "@/mixins/button-question-wrapper-mixin";
|
// import buttonQuestionWrapperMixin from "@/mixins/button-question-wrapper-mixin";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "style-question",
|
name: "style-question",
|
||||||
mixins: [buttonQuestionWrapperMixin],
|
// mixins: [buttonQuestionWrapperMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
styles: [],
|
styles: [],
|
||||||
|
selectedStyle: ""
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
|
|
@ -55,5 +56,10 @@ export default {
|
||||||
this.styles = initialData;
|
this.styles = initialData;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
selectedStyle(selectedStyle) {
|
||||||
|
this.$emit("update:modelValue", selectedStyle);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
:answers="years"
|
:answers="years"
|
||||||
groupName="ChooseVehicleYear"
|
groupName="ChooseVehicleYear"
|
||||||
textPosition="text-start"
|
textPosition="text-start"
|
||||||
v-model="selectedValue"
|
v-model="selectedYear"
|
||||||
:selectOnKeypress="false"
|
:selectOnKeypress="false"
|
||||||
isRequired
|
isRequired
|
||||||
/>
|
/>
|
||||||
|
|
@ -20,14 +20,15 @@ import buttonQuestion from "@/common-components/button-question/button-question"
|
||||||
// Supporting files
|
// Supporting files
|
||||||
import { storeActions } from "@/constants/store-actions.js";
|
import { storeActions } from "@/constants/store-actions.js";
|
||||||
import baseMixin from "@/mixins/base-mixin.js";
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
import buttonQuestionWrapperMixin from "@/mixins/button-question-wrapper-mixin";
|
// import buttonQuestionWrapperMixin from "@/mixins/button-question-wrapper-mixin";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "year-question",
|
name: "year-question",
|
||||||
mixins: [buttonQuestionWrapperMixin],
|
// mixins: [buttonQuestionWrapperMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
years: [],
|
years: [],
|
||||||
|
selectedYear: ""
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
|
|
@ -52,5 +53,10 @@ export default {
|
||||||
this.years = initialData;
|
this.years = initialData;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
selectedYear(selectedYear) {
|
||||||
|
this.$emit("update:modelValue", selectedYear);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,35 @@
|
||||||
|
import { ref, isRef } from "vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
modelValue: [String, Number]
|
modelValue: [Array, String, Number],
|
||||||
},
|
// modelValueName: {
|
||||||
data() {
|
// type: String,
|
||||||
return {
|
// required: true,
|
||||||
selectedValue: null,
|
// },
|
||||||
};
|
},
|
||||||
},
|
data() {
|
||||||
mounted() {
|
return {
|
||||||
console.log("MOUNTED: ", this.modelValue)
|
selectedValue: null,
|
||||||
this.selectedValue = this.modelValue;
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
created() {
|
||||||
selectedValue(selectedValue) {
|
this.selectedValue = this.modelValue;
|
||||||
console.log("selectedValue: ", selectedValue)
|
|
||||||
this.$emit("update:modelValue", selectedValue);
|
console.log("Created: ", {
|
||||||
|
selectedValue: this.selectedValue,
|
||||||
|
// modelValue: this.modelValue,
|
||||||
|
// modelValueName: this.modelValueName
|
||||||
|
})
|
||||||
|
if (this.modelValueName) {
|
||||||
|
this[this.modelValueName] = this.selectedValue;
|
||||||
|
// this.$on("update:modelValue", (dynamicModelValue) => {
|
||||||
|
// console.log("ON HIT", {
|
||||||
|
// dynamicModelValue: dynamicModelValue
|
||||||
|
// })
|
||||||
|
// this.selectedValue = dynamicModelValue;
|
||||||
|
// this.$emit("update:modelValue", dynamicModelValue)
|
||||||
|
// })
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,9 @@ export default {
|
||||||
const hasChildPartQuestions = this.hasChildPartQuestions(partsOrQuestions);
|
const hasChildPartQuestions = this.hasChildPartQuestions(partsOrQuestions);
|
||||||
const hasCapabilityQuestions = this.hasCapabilityQuestions(partsOrQuestions);
|
const hasCapabilityQuestions = this.hasCapabilityQuestions(partsOrQuestions);
|
||||||
|
|
||||||
|
console.log({
|
||||||
|
hasGlassLocationWithMultipleParts: hasGlassLocationWithMultipleParts
|
||||||
|
})
|
||||||
if (hasPartQuestions && this.currentPageComesBeforePage(currentPage, fmgPageValues.PART_QUESTIONS)) {
|
if (hasPartQuestions && this.currentPageComesBeforePage(currentPage, fmgPageValues.PART_QUESTIONS)) {
|
||||||
self.$router.navigateWithSaving(self.navigationScenarios.HAS_PART_QUESTIONS, self.$route, {}, {}, { partsOrQuestions: partsOrQuestions });
|
self.$router.navigateWithSaving(self.navigationScenarios.HAS_PART_QUESTIONS, self.$route, {}, {}, { partsOrQuestions: partsOrQuestions });
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
'list-group list-button-horizontal d-flex flex-column w-100',
|
'list-group list-button-horizontal d-flex flex-column w-100',
|
||||||
{ 'radio-fancy': isCashOrInsurance },
|
{ 'radio-fancy': isCashOrInsurance },
|
||||||
]"
|
]"
|
||||||
@change="handleAnswerChange">
|
@buttonClicked="handleAnswerChange">
|
||||||
<div
|
<div
|
||||||
class="list-button-horizontal-content d-flex flex-column justify-content-center p-3">
|
class="list-button-horizontal-content d-flex flex-column justify-content-center p-3">
|
||||||
<span class="m-0" :class="textPosition">
|
<span class="m-0" :class="textPosition">
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<baseInputButton
|
<baseInputButton
|
||||||
v-bind="$props"
|
v-bind="$props"
|
||||||
buttonWrapperClasses="list-group list-button rounded-3 d-flex flex-column w-100 mb-2"
|
buttonWrapperClasses="list-group list-button rounded-3 d-flex flex-column w-100 mb-2"
|
||||||
@change="handleAnswerChange">
|
@buttonClicked="handleAnswerChange">
|
||||||
<div
|
<div
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
:aria-label="buttonLabel"
|
:aria-label="buttonLabel"
|
||||||
|
|
@ -66,6 +66,9 @@ export default {
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.list-group {
|
.list-group {
|
||||||
|
.loader {
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
&.list-button {
|
&.list-button {
|
||||||
outline: none;
|
outline: none;
|
||||||
input[type="radio"],
|
input[type="radio"],
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
'list-card w-100 rounded-3 d-flex align-items-center h-100',
|
'list-card w-100 rounded-3 d-flex align-items-center h-100',
|
||||||
{ horizontal: isWide },
|
{ horizontal: isWide },
|
||||||
]"
|
]"
|
||||||
@change="handleAnswerChange">
|
@buttonClicked="handleAnswerChange">
|
||||||
<div
|
<div
|
||||||
class="d-flex w-100 align-items-center px-2 h-100 list-card-content"
|
class="d-flex w-100 align-items-center px-2 h-100 list-card-content"
|
||||||
:class="getLabelClasses">
|
:class="getLabelClasses">
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,6 @@ export default {
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.loader {
|
.loader {
|
||||||
display: flex;
|
display: flex;
|
||||||
position: absolute;
|
|
||||||
|
|
||||||
//Open an overlay to prevent page interaction
|
//Open an overlay to prevent page interaction
|
||||||
&:before {
|
&:before {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
v-bind="$props"
|
v-bind="$props"
|
||||||
buttonWrapperClasses="ui-radio form-check"
|
buttonWrapperClasses="ui-radio form-check"
|
||||||
inputClasses="form-check-input"
|
inputClasses="form-check-input"
|
||||||
@change="handleAnswerChange">
|
@buttonClicked="handleAnswerChange">
|
||||||
<div class="d-flex align-items-start form-check-label" :for="buttonID">
|
<div class="d-flex align-items-start form-check-label" :for="buttonID">
|
||||||
<p v-if="buttonLabel" class="m-0">{{ buttonLabel }}</p>
|
<p v-if="buttonLabel" class="m-0">{{ buttonLabel }}</p>
|
||||||
<span v-if="screenReaderOnlyText" class="sr-only">{{
|
<span v-if="screenReaderOnlyText" class="sr-only">{{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue