From 60f179d8ab7e1f151bcc53bd3eaa1fd3f72bac59 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 13 Feb 2024 09:49:25 -0500 Subject: [PATCH 1/2] CSR-1952: restore all the original changes EXCEPT the second added watcher that broke QA --- src/fmg-components/cart/cart.vue | 175 +++++++++++------- src/layouts/payment-method/payment-method.vue | 8 - 2 files changed, 106 insertions(+), 77 deletions(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index 65701db71..eb5391c35 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -13,78 +13,96 @@ {{ getFormattedAmount("", amountDue) }} -
-
- - - {{ getFormattedAmount("", packagePrice) }} - -
+
+
+
+ + + {{ getFormattedAmount("", packagePrice) }} + +
- -
- {{ cartItem.name }} - - - -
+ +
+ <{{ cartItem.name + }}> + + + +
- -
- {{ cartItem.name }} - - - - {{ recycleFeeCartItem.name }} - - {{ getFormattedAmount(cartItem.category, cartItem.subTotal) }} -
+ +
+ {{ cartItem.name }} + + + + {{ recycleFeeCartItem.name }} + + {{ getFormattedAmount(cartItem.category, cartItem.subTotal) }} +
- -
- {{ subtotalText }}{{ getFormattedAmount("", subTotal) }} -
-
- {{ salesTaxText }}{{ getFormattedAmount("", salesTax) }} -
-
- {{ amountPaidText }}{{ getFormattedAmount("", amountPaid) }} -
-
- {{ amountDueText }}{{ getFormattedAmount("", amountDue) }} + +
+ {{ subtotalText }}{{ getFormattedAmount("", subTotal) }} +
+
+ {{ salesTaxText }}{{ getFormattedAmount("", salesTax) }} +
+
+ {{ amountPaidText }}{{ getFormattedAmount("", amountPaid) }} +
+
+ {{ amountDueText }}{{ getFormattedAmount("", amountDue) }} +
+
+
+ Promo code <{{ promoCode }}> applied +
@@ -96,6 +114,7 @@ import textLink from "@/ux-components/text-link/text-link"; import textBlock from "@/digital-components/text-block/text-block"; import contentGroupModal from "@/fmg-components/content-group-modal/content-group-modal"; +import promoModalQuestion from "@/fmg-components/promo-modal-question/promo-modal-question"; // Mixins import baseMixin from "@/mixins/base-mixin.js"; @@ -198,6 +217,12 @@ export default { this.$emit("update:modelValue", this.lineItems); }, + getPromoCodeList() { + if (this.$refs["promoModalQuestion"]) { + return this.$refs["promoModalQuestion"].getPromoCodeList(); + } + return []; + }, }, computed: { screenReaderTotalAmountDueText() { @@ -801,6 +826,7 @@ export default { textBlock, textLink, contentGroupModal, + promoModalQuestion, }, }; @@ -830,12 +856,14 @@ export default { .amount-due { color: $green; } - .price-table { + .cart-panel { max-height: 0; transition: all 350ms ease-in; overflow: hidden; visibility: hidden; color: $gray-600; + } + .price-table { div { display: flex; justify-content: space-between; @@ -940,17 +968,26 @@ export default { &.expanded:after { transform: rotate(180deg); } - &.expanded + .price-table { + &.expanded + .cart-panel { max-height: 650px; transition: all 150ms ease-in; overflow: hidden; - padding-top: 1rem; + padding: 1rem 0 0.5rem; visibility: visible; } a { text-decoration: none; } } + .applied-promo { + span { + color: $green-700; + font-weight: 500; + padding: 2px 8px; + background-color: $green-100; + border-radius: 12px; + } + } } .payment-method-question { .question-text { diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index 259db5d77..6640e5ea7 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -29,12 +29,6 @@ servicePackageOptionsCmsName="ServicePackageTitle" recyclingModalCmsWidgetName="RecycleModal" /> - -
@@ -82,7 +76,6 @@ import paymentMethodQuestion from "@/layouts/payment-method/payment-method-quest import loadingModal from "@/fmg-components/loading-modal/loading-modal.vue"; import cart from "@/fmg-components/cart/cart"; import reviewDropdown from "@/layouts/payment-method/review-dropdown/review-dropdown"; -import promoModalQuestion from "@/fmg-components/promo-modal-question/promo-modal-question"; import { submitWorkOrder } from "@/helpers/heritage-integration/order-helper.js"; import alert from "@/ux-components/alert/alert"; @@ -596,7 +589,6 @@ export default { cart, alert, paymentMethodQuestion, - promoModalQuestion, reviewDropdown, }, }; From ce348ec560c3a24ff78833cee7a28d2018347bc5 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 13 Feb 2024 13:13:57 -0500 Subject: [PATCH 2/2] CSR-1952: revised updates for triggering toast message upon promo applied --- src/fmg-components/cart/cart.vue | 17 ++++++++++++----- .../promo-modal-question.vue | 1 + 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index eb5391c35..221210c5e 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -23,7 +23,10 @@
-
+
<{{ cartItem.name @@ -60,7 +63,9 @@ href="javascript:void(0)" @click-event="removeItem(cartItem.cartItemType, cartItem.category)" />
@@ -223,6 +229,10 @@ export default { } return []; }, + handleAddedPromo(lineItems) { + // NOTE: these lineItems are passed from promo-modal-question + this.$emit("update:modelValue", lineItems); + }, }, computed: { screenReaderTotalAmountDueText() { @@ -571,7 +581,6 @@ export default { return cartItem; }, - suppliesRepairCartItemName() { return this.getCmsContent("SuppliesRepairTextWidget", "Text"); }, @@ -609,7 +618,6 @@ export default { return cartItem; }, - mobileFeeCartItemName() { return this.getCmsContent("MobileServiceTextWidget", "Text"); }, @@ -765,7 +773,6 @@ export default { return promoCartItems; }, - removeLinkText() { return this.getCmsContent("RemoveCartItemTextWidget", "Text"); }, 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 aed1bba21..a2a552d93 100644 --- a/src/fmg-components/promo-modal-question/promo-modal-question.vue +++ b/src/fmg-components/promo-modal-question/promo-modal-question.vue @@ -305,6 +305,7 @@ 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);