From 860cd81f35eb87932916eba1f23fa6ae9cde1eae Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Tue, 4 Apr 2023 10:04:28 -0300
Subject: add fullfilment url and message if the are present

---
 .../src/pages/ShowOrderDetails.tsx                 | 30 ++++++++++++++++------
 1 file changed, 22 insertions(+), 8 deletions(-)

(limited to 'packages/merchant-backend-ui/src/pages/ShowOrderDetails.tsx')

diff --git a/packages/merchant-backend-ui/src/pages/ShowOrderDetails.tsx b/packages/merchant-backend-ui/src/pages/ShowOrderDetails.tsx
index aa62c2932..ca93c3f7d 100644
--- a/packages/merchant-backend-ui/src/pages/ShowOrderDetails.tsx
+++ b/packages/merchant-backend-ui/src/pages/ShowOrderDetails.tsx
@@ -171,10 +171,24 @@ export function ShowOrderDetails({
         )}
         {btr && `{{/refund_amount}}`}
 
+        {btr && `{{#contract_terms.fulfillment_message}}`}
+        {(btr || contract_terms?.fulfillment_message) && (
+          <section>
+            <InfoBox>
+              <b>{contract_terms?.fulfillment_message || `{{ contract_terms.fulfillment_message }}`}</b>.
+            </InfoBox>
+          </section>
+        )}
+        {btr && `{{/contract_terms.fulfillment_message}}`}
+
         <section>
           <TableExpanded>
             <dt>Order summary:</dt>
             <dd>{contract_terms?.summary || `{{ contract_terms.summary }}`}</dd>
+            {btr && `{{#contract_terms.fulfillment_url}}`}
+            <dt>Fulfillment URL:</dt>
+            <dd><a href={contract_terms?.fulfillment_url || `{{ contract_terms.fulfillment_url }}`}>{contract_terms?.fulfillment_url || `{{ contract_terms.fulfillment_url }}`}</a></dd>
+            {btr && `{{/contract_terms.fulfillment_url}}`}
             <dt>Amount paid:</dt>
             <dd>{contract_terms?.amount || `{{ contract_terms.amount }}`}</dd>
             <dt>Order date:</dt>
@@ -183,7 +197,7 @@ export function ShowOrderDetails({
                 ? contract_terms?.timestamp.t_s != "never"
                   ? format(
                       contract_terms?.timestamp.t_s,
-                      "dd MMM yyyy HH:mm:ss"
+                      "dd MMM yyyy HH:mm:ss",
                     )
                   : "never"
                 : `{{ contract_terms.timestamp_str }}`}{" "}
@@ -243,7 +257,7 @@ export function ShowOrderDetails({
                               ? p.delivery_date.t_s != "never"
                                 ? format(
                                     p.delivery_date.t_s,
-                                    "dd MMM yyyy HH:mm:ss"
+                                    "dd MMM yyyy HH:mm:ss",
                                   )
                                 : "never"
                               : `{{ delivery_date_str }}`}{" "}
@@ -293,7 +307,7 @@ export function ShowOrderDetails({
                       ? contract_terms?.delivery_date.t_s != "never"
                         ? format(
                             contract_terms?.delivery_date.t_s,
-                            "dd MMM yyyy HH:mm:ss"
+                            "dd MMM yyyy HH:mm:ss",
                           )
                         : "never"
                       : `{{ contract_terms.delivery_date_str }}`}{" "}
@@ -335,7 +349,7 @@ export function ShowOrderDetails({
                 ? contract_terms?.pay_deadline.t_s != "never"
                   ? format(
                       contract_terms?.pay_deadline.t_s,
-                      "dd MMM yyyy HH:mm:ss"
+                      "dd MMM yyyy HH:mm:ss",
                     )
                   : "never"
                 : `{{ contract_terms.pay_deadline_str }}`}{" "}
@@ -346,7 +360,7 @@ export function ShowOrderDetails({
                 ? contract_terms?.wire_transfer_deadline.t_s != "never"
                   ? format(
                       contract_terms?.wire_transfer_deadline.t_s,
-                      "dd MMM yyyy HH:mm:ss"
+                      "dd MMM yyyy HH:mm:ss",
                     )
                   : "never"
                 : `{{ contract_terms.wire_transfer_deadline_str }}`}{" "}
@@ -376,7 +390,7 @@ export function ShowOrderDetails({
                 ? contract_terms?.refund_deadline.t_s != "never"
                   ? format(
                       contract_terms?.refund_deadline.t_s,
-                      "dd MMM yyyy HH:mm:ss"
+                      "dd MMM yyyy HH:mm:ss",
                     )
                   : "never"
                 : `{{ contract_terms.refund_deadline_str }}`}{" "}
@@ -393,7 +407,7 @@ export function ShowOrderDetails({
                           intervalToDuration({
                             start: 0,
                             end: contract_terms?.auto_refund.d_us,
-                          })
+                          }),
                         )
                       : "forever"
                     : `{{ contract_terms.auto_refund_str }}`}{" "}
@@ -533,7 +547,7 @@ export function mount(): void {
         order_summary={os}
         refund_amount={ra}
       />,
-      document.body
+      document.body,
     );
   } catch (e) {
     console.error("got error", e);
-- 
cgit v1.2.3

