Merge branch 'release/2022.09.29' into rlsmerge/2022.09.29-to-developv2
This commit is contained in:
commit
891e9cb8b2
10 changed files with 75 additions and 52 deletions
|
|
@ -175,11 +175,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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -181,13 +181,13 @@ export default {
|
||||||
state: zipCodeData.state,
|
state: zipCodeData.state,
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
if (!zipCodeData.isZipValid) {
|
if (!zipCodeData.isValid) {
|
||||||
this.displayInvalidZipAlert = true;
|
this.displayInvalidZipAlert = true;
|
||||||
return this.$refs.funnelFooter.removeLoader();
|
return this.$refs.funnelFooter.removeLoader();
|
||||||
}
|
}
|
||||||
this.displayInvalidZipAlert = false;
|
this.displayInvalidZipAlert = false;
|
||||||
|
|
||||||
if (!zipCodeData.isZipServiceable) {
|
if (!zipCodeData.isServiceable) {
|
||||||
this.displayNonServiceableZipAlert = true;
|
this.displayNonServiceableZipAlert = true;
|
||||||
return this.$refs.funnelFooter.removeLoader();
|
return this.$refs.funnelFooter.removeLoader();
|
||||||
}
|
}
|
||||||
|
|
@ -220,7 +220,6 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
AlertNonServiceableZipHeader(){
|
AlertNonServiceableZipHeader(){
|
||||||
console.log(this.getCmsContent("AlertNonServiceableZipWidget", "HeadlineText"));
|
|
||||||
return this.getCmsContent("AlertNonServiceableZipWidget", "HeadlineText").replaceAll("{custom:serviceZip}", this.serviceZipCode);
|
return this.getCmsContent("AlertNonServiceableZipWidget", "HeadlineText").replaceAll("{custom:serviceZip}", this.serviceZipCode);
|
||||||
},
|
},
|
||||||
AlertNonServiceableZipBody(){
|
AlertNonServiceableZipBody(){
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -239,11 +239,12 @@ function setupMocks({ customMountOptions }) {
|
||||||
|
|
||||||
function mockOutPromises({carId, isZipValid = true, isZipServiceable = true}) {
|
function mockOutPromises({carId, isZipValid = true, isZipServiceable = true}) {
|
||||||
const apiResponses = {
|
const apiResponses = {
|
||||||
serviceZipValidationResponse: {
|
vehicleLookupResponse: {
|
||||||
isValid: isZipValid,
|
carId: carId
|
||||||
isServiceable: isZipServiceable
|
|
||||||
},
|
},
|
||||||
vehicleLookupResponse: carId ? { carId: carId } : null
|
zipCodeData: {
|
||||||
|
isValid: true, isServiceable: true, state: "OH"
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
settleAllPromises.mockImplementation(() => apiResponses);
|
settleAllPromises.mockImplementation(() => apiResponses);
|
||||||
|
|
|
||||||
|
|
@ -238,14 +238,16 @@ export default {
|
||||||
resultKey: "vehicleLookupResponse",
|
resultKey: "vehicleLookupResponse",
|
||||||
promise: vehicleLookupResponse,
|
promise: vehicleLookupResponse,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
resultKey: "zipCodeData",
|
||||||
|
promise: this.getZipCodeData(this.serviceZipCode)
|
||||||
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
const resultMap = await settleAllPromises(promiseResultMap);
|
const resultMap = await settleAllPromises(promiseResultMap);
|
||||||
const zipCodeData = await this.getZipCodeData(this.serviceZipCode);
|
|
||||||
|
|
||||||
// If a Service Zip is entered and it is an invalid zip code (ex. 11111) then show an alert
|
// If a Service Zip is entered and it is an invalid zip code (ex. 11111) then show an alert
|
||||||
const isZipValid = zipCodeData.isValid;
|
const isZipValid = resultMap.zipCodeData.isValid;
|
||||||
|
|
||||||
if (this.serviceZipCode && !isZipValid) {
|
if (this.serviceZipCode && !isZipValid) {
|
||||||
this.displayInvalidZipAlert = true;
|
this.displayInvalidZipAlert = true;
|
||||||
return this.$refs.funnelFooter.removeLoader();
|
return this.$refs.funnelFooter.removeLoader();
|
||||||
|
|
@ -253,14 +255,14 @@ export default {
|
||||||
this.displayInvalidZipAlert = false;
|
this.displayInvalidZipAlert = false;
|
||||||
|
|
||||||
// If either lookup fails, remove the loader and stop processing the page.
|
// If either lookup fails, remove the loader and stop processing the page.
|
||||||
if (!resultMap.vehicleLookupResponse || !zipCodeData.isServiceable) {
|
if (!resultMap.vehicleLookupResponse || !resultMap.zipCodeData.isServiceable) {
|
||||||
// If the vehicle result is undefined, the vin entered was invalid.
|
// If the vehicle result is undefined, the vin entered was invalid.
|
||||||
if(!resultMap.vehicleLookupResponse) {
|
if(!resultMap.vehicleLookupResponse) {
|
||||||
this.displayVinNotFoundAlert = true;
|
this.displayVinNotFoundAlert = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if Service Zip entered is serviceable, if not display an alert
|
// Check if Service Zip entered is serviceable, if not display an alert
|
||||||
if (!zipCodeData.isServiceable) {
|
if (!resultMap.zipCodeData.isServiceable) {
|
||||||
this.displayNonServiceableZipAlert = true;
|
this.displayNonServiceableZipAlert = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -294,7 +296,7 @@ export default {
|
||||||
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.emailAddress, false);
|
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.emailAddress, false);
|
||||||
await this.dispatchStoreAction(storeActions.SAVE_SERVICE_LOCATION, {
|
await this.dispatchStoreAction(storeActions.SAVE_SERVICE_LOCATION, {
|
||||||
zipCode: this.serviceZipCode,
|
zipCode: this.serviceZipCode,
|
||||||
state: zipCodeData.state,
|
state: resultMap.zipCodeData.state,
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
return await this.navigateForward();
|
return await this.navigateForward();
|
||||||
|
|
|
||||||
|
|
@ -49,21 +49,12 @@ export default {
|
||||||
return footerInfoBox ? footerInfoBox.offsetHeight : 0;
|
return footerInfoBox ? footerInfoBox.offsetHeight : 0;
|
||||||
},
|
},
|
||||||
async getZipCodeData(zipCode) {
|
async getZipCodeData(zipCode) {
|
||||||
const serviceZipValidationResponse = this.dispatchStoreAction(storeActions.VALIDATE_ZIP, { zip: zipCode });
|
const serviceZipValidationResponse = await this.dispatchStoreAction(storeActions.VALIDATE_ZIP, { zip: zipCode });
|
||||||
|
|
||||||
const promiseResultMap = [
|
|
||||||
{
|
|
||||||
resultKey: "serviceZipValidationResponse",
|
|
||||||
promise: serviceZipValidationResponse,
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
const resultMap = await settleAllPromises(promiseResultMap);
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isZipValid: resultMap.serviceZipValidationResponse.isValid,
|
isValid: serviceZipValidationResponse.data.isValid,
|
||||||
isZipServiceable: resultMap.serviceZipValidationResponse.isServiceable,
|
isServiceable: serviceZipValidationResponse.data.isServiceable,
|
||||||
state: resultMap.serviceZipValidationResponse.state
|
state: serviceZipValidationResponse.data.state
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ describe("baseMixin.js", () => {
|
||||||
test("getZipCodeData calls dispatch", () => {
|
test("getZipCodeData calls dispatch", () => {
|
||||||
const mixIn = getMixInInstance({});
|
const mixIn = getMixInInstance({});
|
||||||
mixIn.methods.dispatchStoreAction = jest.fn();
|
mixIn.methods.dispatchStoreAction = jest.fn();
|
||||||
mixIn.methods.dispatchStoreAction.mockReturnValue({ isValid:true, isServiceable:true, state:"OH" });
|
mixIn.methods.dispatchStoreAction.mockReturnValue({data: { isValid:true, isServiceable:true, state:"OH" }});
|
||||||
const type = "";
|
const type = "";
|
||||||
const payload = { zip: 43015 };
|
const payload = { zip: 43015 };
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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 () => {
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,34 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="list-group list-button-horizontal d-flex flex-column w-100"
|
<div
|
||||||
:class="[(errors.length > 0 || hasError) ? 'has-error' : '', isCashOrInsurance ? 'radio-fancy' : '']"
|
class="list-group list-button-horizontal d-flex flex-column w-100"
|
||||||
@keyup.space="triggerButton()" @keyup.up="handleKeyupArrow()" @keyup.down="handleKeyupArrow()"
|
:class="[(errors.length > 0 || hasError) ? 'has-error' : '']"
|
||||||
@keyup.left="handleKeyupArrow()" @keyup.right="handleKeyupArrow()">
|
@keyup.space="triggerButton()"
|
||||||
<input :type="isMultiSelect ? 'checkbox' : 'radio'" :id="buttonID" :name="groupName" :value="value"
|
@keyup.up="handleKeyupArrow()"
|
||||||
:aria-required="isRequired" v-model="checkValue" @change="handleInputChange()" />
|
@keyup.down="handleKeyupArrow()"
|
||||||
<label tabindex="-1" :for="buttonID" :aria-labelledby="buttonID"
|
@keyup.left="handleKeyupArrow()"
|
||||||
class="d-flex flex-column justify-content-center p-3" @mouseup="triggerButton()">
|
@keyup.right="handleKeyupArrow()"
|
||||||
<span class="m-0" :class="textPosition">
|
>
|
||||||
{{ buttonLabel }}
|
<input
|
||||||
|
:type="isMultiSelect ? 'checkbox' : 'radio'"
|
||||||
|
:id="buttonID"
|
||||||
|
:name="groupName"
|
||||||
|
:aria-required="isRequired"
|
||||||
|
v-model="checkValue"
|
||||||
|
:checked="checkValue"
|
||||||
|
@change="handleInputChange()"
|
||||||
|
/>
|
||||||
|
<label
|
||||||
|
tabindex="-1"
|
||||||
|
:for="buttonID"
|
||||||
|
:aria-label="buttonLabel"
|
||||||
|
class="d-flex flex-column justify-content-center py-3 px-4"
|
||||||
|
@mouseup="triggerButton()"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
class="m-0"
|
||||||
|
:class="textPosition"
|
||||||
|
>
|
||||||
|
{{buttonLabel}}
|
||||||
</span>
|
</span>
|
||||||
<span v-if="buttonLabelSubCopy" class="m-0 small" :class="textPosition">
|
<span v-if="buttonLabelSubCopy" class="m-0 small" :class="textPosition">
|
||||||
{{ buttonLabelSubCopy }}
|
{{ buttonLabelSubCopy }}
|
||||||
|
|
@ -58,14 +78,11 @@ export default {
|
||||||
checkValue: Boolean,
|
checkValue: Boolean,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
created() {
|
||||||
if (Array.isArray(this.validateValue)) {
|
if (Array.isArray(this.selectedValues)) {
|
||||||
this.checkValue = this.isValueSelectedByArray(this.selectedValues);
|
this.checkValue = this.isMultiSelect
|
||||||
const isSelectedByValidator = this.isValueSelectedByArray(this.validateValue);
|
? this.selectedValues.includes(this.value)
|
||||||
|
: this.selectedValues[0] == this.value;
|
||||||
if (this.checkValue != isSelectedByValidator) {
|
|
||||||
this.handleChange(this.value);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.checkValue = this.selectedValues;
|
this.checkValue = this.selectedValues;
|
||||||
|
|
@ -105,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