Merge branch 'release/2022.09.15' into rlsmerge/2022.09.15-to-2022.09.29v2
This commit is contained in:
commit
724220bb4f
5 changed files with 20 additions and 8 deletions
|
|
@ -173,11 +173,16 @@ export default {
|
||||||
if(this.selectingInitiatesLoad) {
|
if(this.selectingInitiatesLoad) {
|
||||||
this.selectedValues = val.value;
|
this.selectedValues = val.value;
|
||||||
} else {
|
} else {
|
||||||
if(Array.isArray(this.selectedValues)) {
|
if(this.isMultiSelect) {
|
||||||
const newSelectedValues = this.selectedValues;
|
const newSelectedValues = this.selectedValues;
|
||||||
val.checkValue ? newSelectedValues.push(val.value) : newSelectedValues.splice(newSelectedValues.indexOf(val.value), 1);
|
val.checkValue ? newSelectedValues.push(val.value) : newSelectedValues.splice(newSelectedValues.indexOf(val.value), 1);
|
||||||
this.selectedValues = newSelectedValues;
|
this.selectedValues = newSelectedValues;
|
||||||
}
|
}
|
||||||
|
else if (Array.isArray(this.selectedValues)) {
|
||||||
|
this.selectedValues[0] = val.value;
|
||||||
|
const temp = this.selectedValues;
|
||||||
|
this.selectedValues = temp;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
this.selectedValues = val.value;
|
this.selectedValues = val.value;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,8 @@ export default ({
|
||||||
return this.modelValue;
|
return this.modelValue;
|
||||||
},
|
},
|
||||||
set: function(newValue) {
|
set: function(newValue) {
|
||||||
this.$emit("update:modelValue", newValue);
|
const numberValue = Number(newValue);
|
||||||
|
this.$emit("update:modelValue", numberValue);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -717,7 +717,7 @@ export const actions = {
|
||||||
endpoint: endpoints.GetPartsOrQuestions.url,
|
endpoint: endpoints.GetPartsOrQuestions.url,
|
||||||
payload: {
|
payload: {
|
||||||
carId: carId,
|
carId: carId,
|
||||||
glass: glassArray,
|
glass: glassArray ?? [],
|
||||||
zip: zipCode,
|
zip: zipCode,
|
||||||
vin: vin
|
vin: vin
|
||||||
},
|
},
|
||||||
|
|
@ -942,8 +942,14 @@ export const actions = {
|
||||||
.slice()
|
.slice()
|
||||||
.sort()
|
.sort()
|
||||||
.every((obj, index) => obj.glassLocation === selectedGlassPassedInSorted[index].glassLocation && obj.glassName === selectedGlassPassedInSorted[index].glassName);
|
.every((obj, index) => obj.glassLocation === selectedGlassPassedInSorted[index].glassLocation && obj.glassName === selectedGlassPassedInSorted[index].glassName);
|
||||||
|
const isWindshieldRepairTheSame = isWindshieldRepair === context.state.order.damage.isRepair;
|
||||||
|
const isChipCountTheSame = Array.isArray(selectedWindshieldChipCount) //TODO: fix the underlying components so this is never an array
|
||||||
|
? selectedWindshieldChipCount[0] === context.state.order.damage.numberOfChips
|
||||||
|
: selectedWindshieldChipCount === context.state.order.damage.numberOfChips;
|
||||||
|
|
||||||
if (!isGlassToReplaceTheSame) {
|
const isDamageChanging = !isGlassToReplaceTheSame || !isWindshieldRepairTheSame || (isWindshieldRepair && !isChipCountTheSame);
|
||||||
|
|
||||||
|
if (isDamageChanging) {
|
||||||
//Reset dependent state when changing
|
//Reset dependent state when changing
|
||||||
context.dispatch(storeActions.RESET_PARTS_STATE_AND_DEPENDENCIES);
|
context.dispatch(storeActions.RESET_PARTS_STATE_AND_DEPENDENCIES);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -211,11 +211,12 @@ describe("list-button-horizontal.vue", () => {
|
||||||
isWide: false,
|
isWide: false,
|
||||||
modelValue: ["List Card Checkbox"],
|
modelValue: ["List Card Checkbox"],
|
||||||
isMultiSelect: false,
|
isMultiSelect: false,
|
||||||
|
value: "Car-Front",
|
||||||
selectedValues: ["Car-Front"]
|
selectedValues: ["Car-Front"]
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
// Assert
|
// Assert
|
||||||
expect(wrapper.componentVM.checkValue).toEqual("Car-Front");
|
expect(wrapper.vm.checkValue).toEqual(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Should run handleCheckChange if selectingInitiatesLoad is false and handleInputChange is triggered", async () => {
|
it("Should run handleCheckChange if selectingInitiatesLoad is false and handleInputChange is triggered", async () => {
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@
|
||||||
:type="isMultiSelect ? 'checkbox' : 'radio'"
|
:type="isMultiSelect ? 'checkbox' : 'radio'"
|
||||||
:id="buttonID"
|
:id="buttonID"
|
||||||
:name="groupName"
|
:name="groupName"
|
||||||
:value="value"
|
|
||||||
:aria-required="isRequired"
|
:aria-required="isRequired"
|
||||||
v-model="checkValue"
|
v-model="checkValue"
|
||||||
:checked="checkValue"
|
:checked="checkValue"
|
||||||
|
|
@ -91,7 +90,7 @@ export default {
|
||||||
if (Array.isArray(this.selectedValues)) {
|
if (Array.isArray(this.selectedValues)) {
|
||||||
this.checkValue = this.isMultiSelect
|
this.checkValue = this.isMultiSelect
|
||||||
? this.selectedValues.includes(this.value)
|
? this.selectedValues.includes(this.value)
|
||||||
: this.selectedValues[0];
|
: this.selectedValues[0] == this.value;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -123,7 +122,7 @@ export default {
|
||||||
handleCheckChange() {
|
handleCheckChange() {
|
||||||
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,
|
||||||
buttonId: this.buttonID && this.buttonID.toString(),
|
buttonId: this.buttonID && this.buttonID.toString(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue