+
+
+
+
80) {
+ wrapper2.classList.add("justify-content-start");
+ wrapper2.classList.remove("justify-content-end");
+ } else {
+ wrapper2.classList.add("justify-content-end");
+ wrapper2.classList.remove("justify-content-start");
+ }
}
}
};
+
+
diff --git a/src/layouts/component-test/component-test.vue b/src/layouts/component-test/component-test.vue
index 2fd05b516..0e28d345a 100644
--- a/src/layouts/component-test/component-test.vue
+++ b/src/layouts/component-test/component-test.vue
@@ -76,7 +76,7 @@
Functioning as Checkbox
Checkbox no Description
Functioning as Radio Button
Radio Button no Description
Horizontal Radio Button
Radio Button no Description
{
damageLocationQuestion.methods.initializeComponent.call(wrapper.vm, cmsContent, damageOptions, "car-group");
//Assert
- expect(wrapper.vm.answersToDisplay).toStrictEqual([ { Name: 'car-Windshield' }, { Name: 'car-SideDoor' } ])
+ expect(wrapper.vm.answersToDisplay).toStrictEqual([ { Name: 'car-Windshield' }, { Name: 'car-SideDoor' }, {Name: "car-RearWindow"} ])
});
});
diff --git a/src/layouts/vehicle-damage/damage-location-question/damage-location-question.vue b/src/layouts/vehicle-damage/damage-location-question/damage-location-question.vue
index 97c08c3b8..c48912ff2 100644
--- a/src/layouts/vehicle-damage/damage-location-question/damage-location-question.vue
+++ b/src/layouts/vehicle-damage/damage-location-question/damage-location-question.vue
@@ -3,11 +3,11 @@
@@ -23,27 +23,33 @@ export default ({
questionText: String,
answersFromCms: Array,
damageOptions: Object,
- groupName: String,
}
},
props: {
- isMultiSelect: Boolean,
modelValue: Array,
+ groupName: String,
},
methods: {
- initializeComponent(cmsContent, damageOptions, groupName){
- this.groupName = groupName;
+ initializeComponent(cmsContent, damageOptions){
this.questionText = cmsContent.QuestionText;
this.answersFromCms = cmsContent.Answers;
this.damageOptions = damageOptions;
}
},
computed: {
+ selectedValues: {
+ get: function() {
+ return this.modelValue;
+ },
+ set: function(newValue) {
+ this.$emit("update:modelValue", newValue);
+ }
+ },
damageOptionsMap(){
return {
Windshield: true,
SideDoor: this.damageOptions.driverSideOptions.availableReplacementOptions || this.damageOptions.passengerSideOptions.availableReplacementOption ? true : false,
- RearWindow: this.damageOptions.backGlassOptions.availableReplacementOption ? true : false,
+ RearWindow: this.damageOptions.backGlassOptions.availableReplacementOptions ? true : false,
}
},
answersToDisplay(){
@@ -56,11 +62,6 @@ export default ({
: [];
},
},
- watch: {
- modelValue(val) {
- this.$emit("update:modelValue", val);
- }
- },
components: {
buttonQuestion,
}
diff --git a/src/layouts/vehicle-damage/replace-options-question/replace-options-question.vue b/src/layouts/vehicle-damage/replace-options-question/replace-options-question.vue
index f01f0cd90..41ecac799 100644
--- a/src/layouts/vehicle-damage/replace-options-question/replace-options-question.vue
+++ b/src/layouts/vehicle-damage/replace-options-question/replace-options-question.vue
@@ -4,11 +4,11 @@
@@ -25,24 +25,30 @@ export default ({
questionText: String,
answersFromCms: Array,
replaceOptions: Array,
- groupName: String,
}
},
props: {
- isMultiSelect: Boolean,
isAvailable: Boolean,
filterByVehicleCategory: Boolean,
+ groupName: String,
modelValue: Array,
},
methods: {
- initializeComponent(cmsContent, replaceOptions, groupName){
- this.groupName = groupName;
+ initializeComponent(cmsContent, replaceOptions){
this.questionText = cmsContent.QuestionText;
this.answersFromCms = cmsContent.Answers;
this.replaceOptions = replaceOptions;
}
},
computed: {
+ selectedValues: {
+ get: function() {
+ return this.modelValue;
+ },
+ set: function(newValue) {
+ this.$emit("update:modelValue", newValue);
+ }
+ },
answersToDisplay(){
return Array.isArray(this.answersFromCms)
? this.answersFromCms.filter(ans =>
@@ -53,11 +59,6 @@ export default ({
: [];
},
},
- watch: {
- modelValue(val) {
- this.$emit("update:modelValue", val);
- }
- },
components: {
buttonQuestion,
}
diff --git a/src/layouts/vehicle-damage/vehicle-damage.vue b/src/layouts/vehicle-damage/vehicle-damage.vue
index 9d57e4345..daa11a248 100644
--- a/src/layouts/vehicle-damage/vehicle-damage.vue
+++ b/src/layouts/vehicle-damage/vehicle-damage.vue
@@ -3,8 +3,8 @@
-
-
+
+
@@ -60,19 +60,16 @@ export default {
resultMap.cmsContent.FunnelSubHeaderWidget
);
vm.$refs.driverSideOptions.initializeComponent(
- resultMap.cmsContent.DriverSideReplaceOptionsQuestion, resultMap.damageOptions.driverSideOptions.availableReplacementOptions, 'DriverSideReplaceOptionsQuestion'
+ resultMap.cmsContent.DriverSideReplaceOptionsQuestion, resultMap.damageOptions.driverSideOptions.availableReplacementOptions
);
vm.$refs.damageLocation.initializeComponent(
- resultMap.cmsContent.DamageLocationQuestion, resultMap.damageOptions, 'DamageLocationQuestion'
+ resultMap.cmsContent.DamageLocationQuestion, resultMap.damageOptions
);
-
- // for damageOptions and cms content data
- //console.log(resultMap)
});
},
data(){
return {
- damageLocationQuestionData: [],
+ selectedDamageLocations: [],
driverSideOptionsData: [],
}
},
diff --git a/src/layouts/vehicle-make/make-question/make-question.vue b/src/layouts/vehicle-make/make-question/make-question.vue
index 3bda78285..9fb2d6ea1 100644
--- a/src/layouts/vehicle-make/make-question/make-question.vue
+++ b/src/layouts/vehicle-make/make-question/make-question.vue
@@ -7,7 +7,7 @@
groupName="Choose Vehicle Make"
textPosition="text-start"
:loaderEnabled="true"
- v-model="modelValue"
+ v-model="selectedValueAsArray"
isRequired=true
/>
@@ -28,7 +28,19 @@ export default {
};
},
props: {
- modelValue: Array,
+ modelValue: String,
+ },
+ computed: {
+ selectedValueAsArray: {
+ get: function() {
+ const modelValueAsArray = this.modelValue ? [this.modelValue] : [];
+ return modelValueAsArray;
+ },
+ set: function(newValue) {
+ const newValueAsScalar = newValue && newValue.length > 0 ? newValue[0] : null;
+ this.$emit("update:modelValue", newValueAsScalar);
+ }
+ }
},
components: {
buttonQuestion,
@@ -45,10 +57,5 @@ export default {
this.makes = initialData;
},
},
- watch: {
- modelValue(val) {
- this.$emit("update:modelValue", val);
- },
- },
};
diff --git a/src/layouts/vehicle-make/vehicle-make.vue b/src/layouts/vehicle-make/vehicle-make.vue
index a4d76fa85..023d24023 100644
--- a/src/layouts/vehicle-make/vehicle-make.vue
+++ b/src/layouts/vehicle-make/vehicle-make.vue
@@ -33,7 +33,7 @@ export default {
name: "vehicle-make",
data() {
return {
- selectedMake: [],
+ selectedMake: null,
};
},
computed: {},
diff --git a/src/layouts/vehicle-model/model-question/model-question.vue b/src/layouts/vehicle-model/model-question/model-question.vue
index be2c64be5..e79b8bafc 100644
--- a/src/layouts/vehicle-model/model-question/model-question.vue
+++ b/src/layouts/vehicle-model/model-question/model-question.vue
@@ -7,7 +7,7 @@
groupName="Choose Vehicle Model"
textPosition="text-start"
:loaderEnabled="true"
- v-model="modelValue"
+ v-model="selectedValueAsArray"
isRequired=true
/>
@@ -28,7 +28,19 @@ export default {
};
},
props: {
- modelValue: Array,
+ modelValue: String,
+ },
+ computed: {
+ selectedValueAsArray: {
+ get: function() {
+ const modelValueAsArray = this.modelValue ? [this.modelValue] : [];
+ return modelValueAsArray;
+ },
+ set: function(newValue) {
+ const newValueAsScalar = newValue && newValue.length > 0 ? newValue[0] : null;
+ this.$emit("update:modelValue", newValueAsScalar);
+ }
+ }
},
components: {
buttonQuestion,
@@ -45,10 +57,5 @@ export default {
this.models = initialData;
},
},
- watch: {
- modelValue(val) {
- this.$emit("update:modelValue", val);
- },
- },
};
diff --git a/src/layouts/vehicle-model/vehicle-model.vue b/src/layouts/vehicle-model/vehicle-model.vue
index 3d52404bc..02de04c3b 100644
--- a/src/layouts/vehicle-model/vehicle-model.vue
+++ b/src/layouts/vehicle-model/vehicle-model.vue
@@ -33,7 +33,7 @@ export default {
name: "vehicle-model",
data() {
return {
- selectedModel: [],
+ selectedModel: null,
};
},
computed: {},
diff --git a/src/layouts/vehicle-style/style-question/style-question.vue b/src/layouts/vehicle-style/style-question/style-question.vue
index e44514904..bfec78571 100644
--- a/src/layouts/vehicle-style/style-question/style-question.vue
+++ b/src/layouts/vehicle-style/style-question/style-question.vue
@@ -7,7 +7,7 @@
groupName="Choose Vehicle Style"
textPosition="text-start"
:loaderEnabled="true"
- v-model="modelValue"
+ v-model="selectedValueAsArray"
isRequired=true
/>
@@ -28,7 +28,19 @@ export default {
};
},
props: {
- modelValue: Array,
+ modelValue: String,
+ },
+ computed: {
+ selectedValueAsArray: {
+ get: function() {
+ const modelValueAsArray = this.modelValue ? [this.modelValue] : [];
+ return modelValueAsArray;
+ },
+ set: function(newValue) {
+ const newValueAsScalar = newValue && newValue.length > 0 ? newValue[0] : null;
+ this.$emit("update:modelValue", newValueAsScalar);
+ }
+ }
},
components: {
buttonQuestion,
@@ -49,10 +61,5 @@ export default {
this.styles = initialData;
},
},
- watch: {
- modelValue(val) {
- this.$emit("update:modelValue", val);
- },
- },
};
diff --git a/src/layouts/vehicle-style/vehicle-style.vue b/src/layouts/vehicle-style/vehicle-style.vue
index 912264ffc..3009a696a 100644
--- a/src/layouts/vehicle-style/vehicle-style.vue
+++ b/src/layouts/vehicle-style/vehicle-style.vue
@@ -32,7 +32,7 @@ export default {
name: "vehicle-style",
data() {
return {
- selectedStyle: [],
+ selectedStyle: null,
};
},
computed: {},
diff --git a/src/layouts/vehicle-year/vehicle-year.vue b/src/layouts/vehicle-year/vehicle-year.vue
index 7bc28c30d..1b10fba92 100644
--- a/src/layouts/vehicle-year/vehicle-year.vue
+++ b/src/layouts/vehicle-year/vehicle-year.vue
@@ -28,7 +28,7 @@ export default {
name: "vehicle-year",
data() {
return {
- selectedYear: [],
+ selectedYear: null,
};
},
computed: {},
@@ -73,7 +73,7 @@ export default {
watch: {
selectedYear(year) {
-
+
this.$store.commit(this.storeMutations.UPDATE_YEAR, year);
this.$router.navigateAfterSave(
this.navigationScenarios.SELECTED_YEAR,
diff --git a/src/layouts/vehicle-year/year-question/year-question.spec.js b/src/layouts/vehicle-year/year-question/year-question.spec.js
index fe0852533..3555e6126 100644
--- a/src/layouts/vehicle-year/year-question/year-question.spec.js
+++ b/src/layouts/vehicle-year/year-question/year-question.spec.js
@@ -72,6 +72,7 @@ describe("year-question.vue", () => {
});
});
+
function setupMocks({
modelValueProp = "1900",
cmsQuestionText = "CMS text goes here",
@@ -89,6 +90,7 @@ function setupMocks({
mountOptions.propsData = {
modelValue: modelValueProp,
};
+
const wrapper = shallowMount(yearQuestion, mountOptions);
//Mock CMS content
diff --git a/src/layouts/vehicle-year/year-question/year-question.vue b/src/layouts/vehicle-year/year-question/year-question.vue
index 36af97bca..96d047244 100644
--- a/src/layouts/vehicle-year/year-question/year-question.vue
+++ b/src/layouts/vehicle-year/year-question/year-question.vue
@@ -7,7 +7,7 @@
groupName="Choose Vehicle Year"
textPosition="text-start"
:loaderEnabled="true"
- v-model="modelValue"
+ v-model="selectedValueAsArray"
isRequired=true
/>
@@ -26,12 +26,24 @@ export default {
};
},
props: {
- modelValue: Array,
+ modelValue: String,
},
emits: ['update:modelValue'],
components: {
buttonQuestion,
},
+ computed: {
+ selectedValueAsArray: {
+ get: function() {
+ const modelValueAsArray = this.modelValue ? [this.modelValue] : [];
+ return modelValueAsArray;
+ },
+ set: function(newValue) {
+ const newValueAsScalar = newValue && newValue.length > 0 ? newValue[0] : null;
+ this.$emit("update:modelValue", newValueAsScalar);
+ }
+ }
+ },
methods: {
loadInitialData() {
return baseMixin.methods.dispatchNonBlockingStoreAction(
@@ -44,10 +56,5 @@ export default {
this.years = initialData;
},
},
- watch: {
- modelValue(val) {
- this.$emit("update:modelValue", val);
- },
- },
};
diff --git a/src/router/index.js b/src/router/index.js
index 02859e660..133a4106e 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -142,7 +142,7 @@ function navigate(scenario, currentRoute, invalidateOnSave, optionalQuery = {},
} else if (matchingScenarioMap.destinationUrl !== undefined) {
navigateToUrl(matchingScenarioMap.destinationUrl);
}
-};
+}
// Get navigation map depending on the scenario and the current 'page' you're on.
function getNavigationMap(scenario, currentRoute) {
@@ -156,7 +156,7 @@ function getNavigationMap(scenario, currentRoute) {
.map((m) => m.maps.filter((map) => map.scenario === scenario));
return matchedQueryValue[0][0];
-};
+}
//---------------------------------------------------------- Private Functions ----------------------------------------------------------
diff --git a/src/ux-components/button-main/button-main.vue b/src/ux-components/button-main/button-main.vue
index c8888c310..e44550c30 100644
--- a/src/ux-components/button-main/button-main.vue
+++ b/src/ux-components/button-main/button-main.vue
@@ -50,7 +50,7 @@ export default {
border-radius: $border-radius-lg;
color: $white;
transition: all 150ms linear;
- white-space: nowrap;
+ justify-content: center;
&:hover {
background: linear-gradient(
270deg,
diff --git a/src/ux-components/list-button-horizontal/list-button-horizontal.spec.js b/src/ux-components/list-button-horizontal/list-button-horizontal.spec.js
index c25b169fa..5cbe02e75 100644
--- a/src/ux-components/list-button-horizontal/list-button-horizontal.spec.js
+++ b/src/ux-components/list-button-horizontal/list-button-horizontal.spec.js
@@ -173,4 +173,45 @@ describe("list-button-horizontal.vue", () => {
expect(loader.attributes("style")).toContain("1rem");
});
+
+ it("Should emit button value on click", async () => {
+ // Act
+ const wrapper = shallowMount(listButtonHorizontal, {
+ propsData: {
+ isRadioHorizontal: true,
+ buttonLabel: "Windshield",
+ buttonID: "List Card Checkbox",
+ groupID: "radio-demo-1",
+ groupName: "radio 1",
+ buttonImage: "windshield-damage.svg",
+ isRequired: true,
+ isWide: false,
+ modelValue: ["List Card Checkbox"],
+ },
+ });
+ wrapper.vm.handleCheckChange();
+ // Assert
+ expect(wrapper.emitted()["isCheckedChanged"][0]).toEqual([{buttonId: "List Card Checkbox", isChecked: Boolean}]);
+ });
+
+ it("Should set checkValue data if selectedButtonIDs has value(s)", async () => {
+ // Act
+ const wrapper = shallowMount(listButtonHorizontal, {
+ propsData: {
+ isRadioHorizontal: true,
+ buttonLabel: "Windshield",
+ buttonID: "List Card Checkbox",
+ groupID: "radio-demo-1",
+ groupName: "radio 1",
+ buttonImage: "windshield-damage.svg",
+ isRequired: true,
+ isWide: false,
+ modelValue: ["List Card Checkbox"],
+ isMultiSelect: false,
+ selectedButtonIDs: ["Car-Front"]
+ },
+ });
+ // Assert
+ expect(wrapper.componentVM.checkValue).toEqual("Car-Front");
+ });
});
diff --git a/src/ux-components/list-button-horizontal/list-button-horizontal.vue b/src/ux-components/list-button-horizontal/list-button-horizontal.vue
index 967523893..e3e7c3891 100644
--- a/src/ux-components/list-button-horizontal/list-button-horizontal.vue
+++ b/src/ux-components/list-button-horizontal/list-button-horizontal.vue
@@ -12,6 +12,7 @@
:aria-required="isRequired"
:data-focus-target="groupName"
v-model="checkValue"
+ @change="handleCheckChange"
/>