From 91379ef2711246d59473c6d327305c5bcb849435 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Wed, 30 Aug 2023 17:20:26 -0400 Subject: [PATCH 01/16] Initial blockout --- .../payment-method-question.spec.js | 0 .../payment-method-question.vue | 135 ++++++++++++++++++ src/layouts/payment-method/payment-method.vue | 7 +- 3 files changed, 141 insertions(+), 1 deletion(-) create mode 100644 src/layouts/payment-method/payment-method-question/payment-method-question.spec.js create mode 100644 src/layouts/payment-method/payment-method-question/payment-method-question.vue diff --git a/src/layouts/payment-method/payment-method-question/payment-method-question.spec.js b/src/layouts/payment-method/payment-method-question/payment-method-question.spec.js new file mode 100644 index 000000000..e69de29bb diff --git a/src/layouts/payment-method/payment-method-question/payment-method-question.vue b/src/layouts/payment-method/payment-method-question/payment-method-question.vue new file mode 100644 index 000000000..6622837f1 --- /dev/null +++ b/src/layouts/payment-method/payment-method-question/payment-method-question.vue @@ -0,0 +1,135 @@ + + + + + diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index ff5cb0e35..2cafd9a1d 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -5,6 +5,7 @@
+
From 0777a1ec578a82919e88a34f103f88503d26a405 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Thu, 31 Aug 2023 13:14:59 -0400 Subject: [PATCH 02/16] Shift conditional rendering order --- .../payment-method-question/payment-method-question.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/layouts/payment-method/payment-method-question/payment-method-question.vue b/src/layouts/payment-method/payment-method-question/payment-method-question.vue index 6622837f1..116470041 100644 --- a/src/layouts/payment-method/payment-method-question/payment-method-question.vue +++ b/src/layouts/payment-method/payment-method-question/payment-method-question.vue @@ -7,10 +7,9 @@ isRequired v-model="paymentTime" textPosition="text-start" /> -
+

Date: Thu, 31 Aug 2023 15:38:12 -0400 Subject: [PATCH 03/16] Fetch text from cms --- .../payment-method-question.vue | 74 ++++++++++--------- 1 file changed, 38 insertions(+), 36 deletions(-) diff --git a/src/layouts/payment-method/payment-method-question/payment-method-question.vue b/src/layouts/payment-method/payment-method-question/payment-method-question.vue index 116470041..72d1c7732 100644 --- a/src/layouts/payment-method/payment-method-question/payment-method-question.vue +++ b/src/layouts/payment-method/payment-method-question/payment-method-question.vue @@ -2,7 +2,7 @@
+ v-model="selectedMethod" + textPosition="text-start" />
@@ -58,6 +59,15 @@ export default { return payTimes.ADVANCE; }, + getAnswersNullSafe(widgetName) { + const rawData = this.getCmsContent(widgetName, "Answers"); + + if (!rawData) { + return []; + } else { + return rawData; + } + }, }, computed: { selectedMethod: { @@ -71,43 +81,35 @@ export default { shouldDisplaySecondaryQuestion() { return this.paymentTime === payTimes.ADVANCE; }, + paymentTimeQuestionText() { + return this.getCmsContent("PaymentTimeWidget", "QuestionText"); + }, + paymentMethodQuestionText() { + return this.getCmsContent("PaymentMethodWidget", "QuestionText"); + }, paymentTimeAnswerData() { - return [ - { - buttonLabel: "Pay now", - altText: "Pay now", + const cmsData = this.getAnswersNullSafe("PaymentTimeWidget"); + + return cmsData.map((answer) => { + return { + buttonLabel: answer.Text, + altText: answer.Text, groupName: "payment-time", - value: payTimes.ADVANCE, - }, - { - buttonLabel: "Pay during my appointment", - altText: "Pay during my appointment", - groupName: "payment-time", - value: payTimes.LATER, - }, - ]; + value: answer.Name, + }; + }); }, paymentMethodAnswerData() { - return [ - { - buttonLabel: "Credit or Debit", - altText: "Credit or Debit", + const cmsData = this.getAnswersNullSafe("PaymentMethodWidget"); + + return cmsData.map((answer) => { + return { + buttonLabel: answer.Text, + altText: answer.Text, groupName: "payment-method", - value: paymentMethods.CREDIT_CARD, - }, - { - buttonLabel: "Paypal", - altText: "Paypal", - groupName: "payment-method", - value: paymentMethods.PAYPAL, - }, - { - buttonLabel: "Afterpay", - altText: "Afterpay", - groupName: "payment-method", - value: paymentMethods.AFTERPAY, - }, - ]; + value: answer.Name, + }; + }); }, }, watch: { @@ -127,7 +129,7 @@ export default { \ No newline at end of file diff --git a/src/layouts/payment-method/payment-method-question/payment-method-question.vue b/src/layouts/payment-method/payment-method-question/payment-method-question.vue index ecd461bec..473e36114 100644 --- a/src/layouts/payment-method/payment-method-question/payment-method-question.vue +++ b/src/layouts/payment-method/payment-method-question/payment-method-question.vue @@ -1,52 +1,34 @@