From a4a505ba43ec3dac456e429e9dd93544eee056a3 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Mon, 18 Mar 2024 09:54:34 -0400 Subject: [PATCH 1/4] CSR-1977: fix for TypeError: availableLineItems.filter is not a function --- src/fmg-components/cart/cart.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index d9d399921..3cb99f941 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -102,7 +102,7 @@ ref="promoModalQuestion" class="small mt-4" v-model="lineItems" - :availableVaps="availableVaps" + :addableVaps="availableVaps" modalWidgetName="PromoModalWidget" /> From 99152df2198f7525e2ebd816ff72ebea9f9400be Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Mon, 18 Mar 2024 11:16:45 -0400 Subject: [PATCH 2/4] CSR-1977: ensures promo codes are in ALL CAPS even if they are returned from API call that way --- .../promo-modal-question/promo-modal-question.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 dd64321bb..00811a9f1 100644 --- a/src/fmg-components/promo-modal-question/promo-modal-question.vue +++ b/src/fmg-components/promo-modal-question/promo-modal-question.vue @@ -199,9 +199,14 @@ export default { false ); + // ensure that all promo codes that return are in all caps format + promoValidationResponse?.orderPromos?.forEach((orderPromo) => { + orderPromo.promoCode = orderPromo.promoCode.toUpperCase(); + }); + return { isValid: !("errorCode" in promoValidationResponse), - promoCode: promoValidationResponse?.orderPromos, + promoCode: promoValidationResponse?.orderPromos, // should be an array of promos errorCode: promoValidationResponse?.errorCode, additionalInfo: promoValidationResponse?.additionalInfo, }; @@ -264,7 +269,7 @@ export default { if (promoCodeData.isValid) { if (this.taxPromos) { const pricedLineItemsToTax = []; - pricedLineItemsToTax.push(...promoCodeData.promoCode); + pricedLineItemsToTax.push(...promoCodeData.promoCode); // promoCodeData.promoCode should be an array const taxedLineItems = await baseMixin.methods.dispatchStoreActionWithLogging( storeActions.TAX_ORDER_ITEMS_AND_SAVE_SERVER_DATA, From 13dbad3680c95b6f9cceb9901c61524a04eb5f07 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Mon, 18 Mar 2024 13:31:59 -0400 Subject: [PATCH 3/4] CSR-1977: format change per prettier --- .../promo-modal-question/promo-modal-question.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 00811a9f1..716cba88c 100644 --- a/src/fmg-components/promo-modal-question/promo-modal-question.vue +++ b/src/fmg-components/promo-modal-question/promo-modal-question.vue @@ -199,7 +199,7 @@ export default { false ); - // ensure that all promo codes that return are in all caps format + // ensure that all promo codes that return are in all caps format promoValidationResponse?.orderPromos?.forEach((orderPromo) => { orderPromo.promoCode = orderPromo.promoCode.toUpperCase(); }); From fc9e445843f7a88ef32244ccc5d9a005a3b82156 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Mon, 18 Mar 2024 16:16:33 -0400 Subject: [PATCH 4/4] CSR-1977: instead of transforming data, only present as all uppercase --- src/fmg-components/cart/cart.vue | 19 +++++++++++++++---- .../promo-modal-question.vue | 5 ----- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index 19e190f5f..01ebe64be 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -33,9 +33,10 @@ :key="i" class="packaged-cart-item"> {{ cartItem.name - }} + >{{ + cartItem.name + }} - Promo code {{ promoCode }} applied + Promo code {{ promoCode }} applied + @@ -919,6 +922,9 @@ export default { &:last-child { justify-content: flex-end; } + &.promo { + text-transform: uppercase; + } } a { font-size: 0.875rem; @@ -1012,6 +1018,11 @@ export default { padding: 2px 8px; background-color: $green-100; border-radius: 12px; + + &.promo-code { + text-transform: uppercase; + padding: 0; + } } } } 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 716cba88c..7db0acc94 100644 --- a/src/fmg-components/promo-modal-question/promo-modal-question.vue +++ b/src/fmg-components/promo-modal-question/promo-modal-question.vue @@ -199,11 +199,6 @@ export default { false ); - // ensure that all promo codes that return are in all caps format - promoValidationResponse?.orderPromos?.forEach((orderPromo) => { - orderPromo.promoCode = orderPromo.promoCode.toUpperCase(); - }); - return { isValid: !("errorCode" in promoValidationResponse), promoCode: promoValidationResponse?.orderPromos, // should be an array of promos