From 86c8f62e8b11a4e3c85aff44f3583f9c7086221b Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 14 Nov 2023 07:32:24 -0500 Subject: [PATCH 01/11] CSR-1689: add cart to confirmation page --- src/fmg-components/cart/cart.vue | 35 +++++++++++++++--- src/layouts/confirmation/confirmation.spec.js | 4 ++ src/layouts/confirmation/confirmation.vue | 37 +++++++++++++++++-- src/layouts/payment-method/payment-method.vue | 6 +-- src/layouts/payment/payment.vue | 15 ++------ 5 files changed, 73 insertions(+), 24 deletions(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index afb13c0e1..1d1ba13b8 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -1,5 +1,5 @@ @@ -38,6 +39,11 @@ export default { }, }, }, + methods: { + validateAlphanumeric() { + this.value = this.value.replace(/[^a-zA-Z0-9]/g, ""); + }, + }, components: { textboxQuestion, }, From 5a7732382026b49a012e8002db73c3f25c03e962 Mon Sep 17 00:00:00 2001 From: hiteshkumar87 Date: Wed, 15 Nov 2023 16:42:37 +0530 Subject: [PATCH 09/11] Update date-helper.js replacing Math.floor with Math.round --- src/helpers/date-helper.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/date-helper.js b/src/helpers/date-helper.js index 482440431..b5afc535c 100644 --- a/src/helpers/date-helper.js +++ b/src/helpers/date-helper.js @@ -5,7 +5,7 @@ export function getDateDifferenceInDays(startDate, endDate) { // Use the built-in method to get the difference in milliseconds var difference = date1 - date2; // Convert milliseconds to days and return the result - return Math.floor(difference / (1000 * 3600 * 24)); + return Math.round(difference / (1000 * 3600 * 24)); } export function get12HourTimeFormat(time) { // Check correct time format and split into components From bc3468f8d62ca2f277b8a7d9255e8d29494da2b7 Mon Sep 17 00:00:00 2001 From: Sneha Date: Wed, 15 Nov 2023 18:14:52 +0530 Subject: [PATCH 10/11] Format --- .../promo-modal-question/promo-modal-question.vue | 6 ++---- .../promo-modal-question/promo-question/promo-question.vue | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/layouts/payment-method/promo-modal-question/promo-modal-question.vue b/src/layouts/payment-method/promo-modal-question/promo-modal-question.vue index ac42fce2e..deff594e5 100644 --- a/src/layouts/payment-method/promo-modal-question/promo-modal-question.vue +++ b/src/layouts/payment-method/promo-modal-question/promo-modal-question.vue @@ -217,13 +217,11 @@ export default { } else { if (promoCodeData.errorCode == promoErrorCodes.PROMO_STACKING_NOT_ALLOWED) { this.displayInvalidOnOrderPromoAlert = true; - this.focusOnPromoInput(); - this.resetModalButtonStyle(); } else { this.displayInvalidPromoAlert = true; - this.focusOnPromoInput(); - this.resetModalButtonStyle(); } + this.focusOnPromoInput(); + this.resetModalButtonStyle(); } } }, diff --git a/src/layouts/payment-method/promo-modal-question/promo-question/promo-question.vue b/src/layouts/payment-method/promo-modal-question/promo-question/promo-question.vue index 7b4fd9049..053e8eedc 100644 --- a/src/layouts/payment-method/promo-modal-question/promo-question/promo-question.vue +++ b/src/layouts/payment-method/promo-modal-question/promo-question/promo-question.vue @@ -23,6 +23,8 @@ import { errorMessages } from "@/constants/error-messages"; // Define Validation Rules defineRule("promo-required", required(errorMessages.PROMO_REQUIRED)); +const ALPHANUMERIC_REGEX = /[^a-zA-Z0-9]/g; + export default { name: "promo-question", props: { @@ -41,7 +43,7 @@ export default { }, methods: { validateAlphanumeric() { - this.value = this.value.replace(/[^a-zA-Z0-9]/g, ""); + this.value = this.value.replace(ALPHANUMERIC_REGEX, ""); }, }, components: { From 2b44e2274a4beeec64f9bf2f2b18fe8c115225b3 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Wed, 15 Nov 2023 09:50:02 -0500 Subject: [PATCH 11/11] CSR-1778: swap button positions --- .../add-vaps-modal-buttons.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/layouts/payment-method/add-vaps-modal-buttons/add-vaps-modal-buttons.vue b/src/layouts/payment-method/add-vaps-modal-buttons/add-vaps-modal-buttons.vue index c822fa318..0dac2d1db 100644 --- a/src/layouts/payment-method/add-vaps-modal-buttons/add-vaps-modal-buttons.vue +++ b/src/layouts/payment-method/add-vaps-modal-buttons/add-vaps-modal-buttons.vue @@ -287,13 +287,6 @@ export default { return answers[answerIndex]; }; - if (!this.rainDefenseInCart) { - // NO RAIN DEFENSE IN CART; SHOW RAIN DEFENSE BUTTON - const modalData = getAnswer("RainDefenseModal", this.answersCmsData); - modalData.SubText = "+$" + this.rainDefenseModal?.listPrice; - buttons.push(modalData); - } - const modalData = getAnswer("WipersModal", this.answersCmsData); if (this.wipersOffered === wipersOfferedStrings.BOTH) { // NO REAR WIPERS or FRONT WIPERS IN CART; SHOW COMBO BUTTON @@ -318,6 +311,13 @@ export default { buttons.push(modalData); } + if (!this.rainDefenseInCart) { + // NO RAIN DEFENSE IN CART; SHOW RAIN DEFENSE BUTTON + const modalData = getAnswer("RainDefenseModal", this.answersCmsData); + modalData.SubText = "+$" + this.rainDefenseModal?.listPrice; + buttons.push(modalData); + } + return buttons; }, wipersOfferedStrings() {