diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index 76847f3e9..8a7714410 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -103,7 +103,7 @@ ref="promoModalQuestion" class="small mt-4" v-model="lineItems" - @addedPromo="handleAddedPromo" + emitToGrandparent="true" :availableVaps="availableVaps" modalWidgetName="PromoModalWidget" /> @@ -245,10 +245,6 @@ export default { } return []; }, - handleAddedPromo(lineItems) { - // NOTE: these lineItems are passed from promo-modal-question - this.$emit("update:modelValue", lineItems); - }, }, computed: { screenReaderTotalAmountDueText() { diff --git a/src/fmg-components/promo-modal-question/promo-modal-question.vue b/src/fmg-components/promo-modal-question/promo-modal-question.vue index 59c1523b2..56d235afc 100644 --- a/src/fmg-components/promo-modal-question/promo-modal-question.vue +++ b/src/fmg-components/promo-modal-question/promo-modal-question.vue @@ -106,6 +106,11 @@ export default { required: false, default: true, }, + emitToGrandparent: { + type: Boolean, + required: false, + default: false, + }, }, computed: { promoLinkText() { @@ -175,6 +180,7 @@ export default { }, onModalClosed() { this.resetAlerts(); + if (this.emitToGrandparent) this.$parent.$emit("update:modelValue", this.lineItems); this.$emit("update:modelValue", this.lineItems); this.promoCode = ""; this.modal.resetForm(); @@ -304,7 +310,6 @@ export default { this.lineItems.vaps?.push(...getVaps); } this.lineItems?.promos.push(...promoCodeData.promoCode); - this.$emit("added-promo", this.lineItems); this.closeModal(); } else { this.getErrorMessage(promoCodeData.errorCode, promoCodeData.additionalInfo); diff --git a/src/helpers/promotions-helper.js b/src/helpers/promotions-helper.js index c9b305f99..e8d5f4e8f 100644 --- a/src/helpers/promotions-helper.js +++ b/src/helpers/promotions-helper.js @@ -331,10 +331,10 @@ export function getNewlyInactivatedPromos(oldInactivePromos, newInactivePromos) export function createPromoSuccessAlert(promoCode) { return { - messageHeadline: "Promo applied!", - messageCopy: `Promo "${getPromoCodeWithoutBundleIdentifier( + messageHeadline: "Promo code applied!", + messageCopy: `Promo code ${getPromoCodeWithoutBundleIdentifier( promoCode.toUpperCase() - )}" was successfully applied to your cart.`, + )} was successfully applied to your cart.`, type: "alert-success", isDismissible: true, shouldAutoFade: true, @@ -343,19 +343,19 @@ export function createPromoSuccessAlert(promoCode) { export function createPromoErrorAlert(promoCode, errorCode = null, additionalInfo) { const alert = { - messageHeadline: "Promo error", + messageHeadline: "Promo code error", type: "alert-danger", shouldAutoFade: false, isDismissible: true, }; if (stackingPromoErrorCodes.includes(errorCode)) { - alert.messageCopy = `Sorry, promo code "${getPromoCodeWithoutBundleIdentifier( + alert.messageCopy = `Sorry, promo code ${getPromoCodeWithoutBundleIdentifier( promoCode.toUpperCase() - )}" cannot be combined with "${additionalInfo[0].toUpperCase()}"`; + )} cannot be combined with ${additionalInfo[0].toUpperCase()}`; } else { - alert.messageCopy = `Sorry, promo code "${getPromoCodeWithoutBundleIdentifier( + alert.messageCopy = `Sorry, promo code ${getPromoCodeWithoutBundleIdentifier( promoCode.toUpperCase() - )}" is not valid`; + )} is not valid`; } return alert; } diff --git a/src/layouts/vehicle-parts/glass-part-question/glass-part-question.vue b/src/layouts/vehicle-parts/glass-part-question/glass-part-question.vue index 25a73e112..280edfc6c 100644 --- a/src/layouts/vehicle-parts/glass-part-question/glass-part-question.vue +++ b/src/layouts/vehicle-parts/glass-part-question/glass-part-question.vue @@ -95,19 +95,14 @@ export default { }, tintSelectionOptions() { - let tintOptions = []; - - Object.keys(this.featureListData).forEach((tintOption) => { - tintOptions.push({ + const tintOptions = Object.keys(this.featureListData).map((tintOption) => { + const buttonImage = this.getTintSourceImage(this.glassLocation, tintOption); + return { value: tintOption, buttonLabel: tintOption, - buttonImage: require(`@/assets/img/tints/${this.getTintSourceImage( - this.glassLocation, - tintOption - )}`), - }); + buttonImage: buttonImage ? require(`@/assets/img/tints/${buttonImage}`) : null, + }; }); - return tintOptions; }, diff --git a/src/ux-components/list-card/list-card.vue b/src/ux-components/list-card/list-card.vue index 902baa1e1..ffdf4efc0 100644 --- a/src/ux-components/list-card/list-card.vue +++ b/src/ux-components/list-card/list-card.vue @@ -10,6 +10,7 @@ class="d-flex w-100 align-items-center px-2 h-100 list-card-content button-content rounded-3" :class="labelClasses">