Merge branch 'develop' into feature/CSR-1072

This commit is contained in:
CarlNation 2024-03-01 15:41:43 -05:00
commit 5733ae6b82
5 changed files with 21 additions and 24 deletions

View file

@ -103,7 +103,7 @@
ref="promoModalQuestion"
class="small mt-4"
v-model="lineItems"
@addedPromo="handleAddedPromo"
emitToGrandparent="true"
:availableVaps="availableVaps"
modalWidgetName="PromoModalWidget" />
</div>
@ -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() {

View file

@ -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);

View file

@ -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;
}

View file

@ -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;
},

View file

@ -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">
<img
v-if="buttonImage"
:id="buttonImageId"
:class="!isWide ? 'order-1' : 'ms-auto order-3'"
:src="buttonImage"