Fixed modal button validation issue
This commit is contained in:
parent
c4aa209413
commit
33c2401392
1 changed files with 7 additions and 3 deletions
|
|
@ -16,9 +16,7 @@
|
||||||
:onModalClosedCallback="onModalClosed"
|
:onModalClosedCallback="onModalClosed"
|
||||||
:onModalOpenedCallback="updateSelectedAnswer"
|
:onModalOpenedCallback="updateSelectedAnswer"
|
||||||
:footerButtonText="modalFooterText"
|
:footerButtonText="modalFooterText"
|
||||||
:footerButtonDisabled="
|
:footerButtonDisabled="isModalFooterButtonDisabled"
|
||||||
displayInvalidZipAlert || displayNoShopsAlert || !localSelectedProviderNumber
|
|
||||||
"
|
|
||||||
@footer-button-event="setZipCodeAndShop">
|
@footer-button-event="setZipCodeAndShop">
|
||||||
<form @submit.prevent>
|
<form @submit.prevent>
|
||||||
<serviceZipQuestion
|
<serviceZipQuestion
|
||||||
|
|
@ -189,6 +187,9 @@ export default {
|
||||||
updateSelectedAnswer() {
|
updateSelectedAnswer() {
|
||||||
this.localSelectedProviderNumber = this.selectedProviderNumberFromParent;
|
this.localSelectedProviderNumber = this.selectedProviderNumberFromParent;
|
||||||
},
|
},
|
||||||
|
isModalFooterButtonDisabled() {
|
||||||
|
return this.displayInvalidZipAlert || this.displayNoShopsAlert || !this.localSelectedProviderNumber;
|
||||||
|
},
|
||||||
updateShopListWithNextShops(numberToGet = 3) {
|
updateShopListWithNextShops(numberToGet = 3) {
|
||||||
//gaAction = this.GaActions.SHOPS_FIRST_DISPLAYED; --This needs to actually fire on initial display, can never happen here
|
//gaAction = this.GaActions.SHOPS_FIRST_DISPLAYED; --This needs to actually fire on initial display, can never happen here
|
||||||
|
|
||||||
|
|
@ -321,6 +322,9 @@ export default {
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
this.answers = mappedData;
|
this.answers = mappedData;
|
||||||
|
if (!this.answers.some((a) => String(a.value) === String(this.localSelectedProviderNumber))) {
|
||||||
|
this.localSelectedProviderNumber = null;
|
||||||
|
}
|
||||||
// I think we should call our new pushGA Event here with new mapped data
|
// I think we should call our new pushGA Event here with new mapped data
|
||||||
this.indexOfLastShopToBeDisplayed = mappedData.length;
|
this.indexOfLastShopToBeDisplayed = mappedData.length;
|
||||||
this.displayNoShopsAlert = this.answers.length === 0;
|
this.displayNoShopsAlert = this.answers.length === 0;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue