Merge pull request #1782 from Safelite/feature/CSR-1977-ajc

CSR-1977: update copy in promotions-helper
This commit is contained in:
AdamCaouetteSafelite 2024-03-01 15:16:03 -05:00 committed by GitHub
commit 0ce58dbcb4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -331,10 +331,10 @@ export function getNewlyInactivatedPromos(oldInactivePromos, newInactivePromos)
export function createPromoSuccessAlert(promoCode) { export function createPromoSuccessAlert(promoCode) {
return { return {
messageHeadline: "Promo applied!", messageHeadline: "Promo code applied!",
messageCopy: `Promo "${getPromoCodeWithoutBundleIdentifier( messageCopy: `Promo code ${getPromoCodeWithoutBundleIdentifier(
promoCode.toUpperCase() promoCode.toUpperCase()
)}" was successfully applied to your cart.`, )} was successfully applied to your cart.`,
type: "alert-success", type: "alert-success",
isDismissible: true, isDismissible: true,
shouldAutoFade: true, shouldAutoFade: true,
@ -343,19 +343,19 @@ export function createPromoSuccessAlert(promoCode) {
export function createPromoErrorAlert(promoCode, errorCode = null, additionalInfo) { export function createPromoErrorAlert(promoCode, errorCode = null, additionalInfo) {
const alert = { const alert = {
messageHeadline: "Promo error", messageHeadline: "Promo code error",
type: "alert-danger", type: "alert-danger",
shouldAutoFade: false, shouldAutoFade: false,
isDismissible: true, isDismissible: true,
}; };
if (stackingPromoErrorCodes.includes(errorCode)) { if (stackingPromoErrorCodes.includes(errorCode)) {
alert.messageCopy = `Sorry, promo code "${getPromoCodeWithoutBundleIdentifier( alert.messageCopy = `Sorry, promo code ${getPromoCodeWithoutBundleIdentifier(
promoCode.toUpperCase() promoCode.toUpperCase()
)}" cannot be combined with "${additionalInfo[0].toUpperCase()}"`; )} cannot be combined with ${additionalInfo[0].toUpperCase()}`;
} else { } else {
alert.messageCopy = `Sorry, promo code "${getPromoCodeWithoutBundleIdentifier( alert.messageCopy = `Sorry, promo code ${getPromoCodeWithoutBundleIdentifier(
promoCode.toUpperCase() promoCode.toUpperCase()
)}" is not valid`; )} is not valid`;
} }
return alert; return alert;
} }