From b64bb455a2d51f7e19e517c0bd158ff7d7d9557f Mon Sep 17 00:00:00 2001 From: Sebastian Date: Fri, 5 May 2023 08:38:28 -0300 Subject: update to new web-utils imports --- .../src/paths/instance/details/DetailPage.tsx | 10 +- .../src/paths/instance/details/index.tsx | 2 +- .../paths/instance/kyc/list/ListPage.stories.tsx | 2 +- .../src/paths/instance/kyc/list/ListPage.tsx | 2 +- .../src/paths/instance/kyc/list/index.tsx | 2 +- .../paths/instance/orders/create/CreatePage.tsx | 2 +- .../orders/create/OrderCreatedSuccessfully.tsx | 2 +- .../src/paths/instance/orders/create/index.tsx | 2 +- .../paths/instance/orders/details/DetailPage.tsx | 2 +- .../src/paths/instance/orders/details/index.tsx | 2 +- .../src/paths/instance/orders/list/ListPage.tsx | 2 +- .../src/paths/instance/orders/list/Table.tsx | 2 +- .../src/paths/instance/orders/list/index.tsx | 2 +- .../paths/instance/products/create/CreatePage.tsx | 2 +- .../src/paths/instance/products/create/index.tsx | 2 +- .../src/paths/instance/products/list/Table.tsx | 2 +- .../src/paths/instance/products/list/index.tsx | 2 +- .../paths/instance/products/update/UpdatePage.tsx | 2 +- .../src/paths/instance/products/update/index.tsx | 2 +- .../paths/instance/reserves/create/CreatePage.tsx | 2 +- .../create/CreatedSuccessfully.stories.tsx | 2 +- .../reserves/create/CreatedSuccessfully.tsx | 197 ++++++++++++--------- .../src/paths/instance/reserves/create/index.tsx | 2 +- .../paths/instance/reserves/details/DetailPage.tsx | 46 +---- .../instance/reserves/details/Details.stories.tsx | 27 ++- .../src/paths/instance/reserves/details/index.tsx | 2 +- .../instance/reserves/list/AutorizeTipModal.tsx | 2 +- .../src/paths/instance/reserves/list/Table.tsx | 2 +- .../src/paths/instance/reserves/list/index.tsx | 2 +- .../paths/instance/templates/create/CreatePage.tsx | 2 +- .../src/paths/instance/templates/create/index.tsx | 2 +- .../src/paths/instance/templates/list/ListPage.tsx | 2 +- .../src/paths/instance/templates/list/Table.tsx | 2 +- .../src/paths/instance/templates/list/index.tsx | 2 +- .../src/paths/instance/templates/qr/QrPage.tsx | 2 +- .../src/paths/instance/templates/qr/index.tsx | 2 +- .../paths/instance/templates/update/UpdatePage.tsx | 2 +- .../src/paths/instance/templates/update/index.tsx | 2 +- .../src/paths/instance/templates/use/UsePage.tsx | 2 +- .../src/paths/instance/templates/use/index.tsx | 2 +- .../paths/instance/transfers/create/CreatePage.tsx | 2 +- .../src/paths/instance/transfers/create/index.tsx | 2 +- .../src/paths/instance/transfers/list/ListPage.tsx | 2 +- .../src/paths/instance/transfers/list/Table.tsx | 2 +- .../src/paths/instance/transfers/list/index.tsx | 2 +- .../src/paths/instance/update/UpdatePage.tsx | 2 +- .../src/paths/instance/update/index.tsx | 2 +- .../paths/instance/webhooks/create/CreatePage.tsx | 2 +- .../src/paths/instance/webhooks/create/index.tsx | 2 +- .../src/paths/instance/webhooks/list/ListPage.tsx | 2 +- .../src/paths/instance/webhooks/list/Table.tsx | 2 +- .../src/paths/instance/webhooks/list/index.tsx | 2 +- .../paths/instance/webhooks/update/UpdatePage.tsx | 2 +- .../src/paths/instance/webhooks/update/index.tsx | 2 +- 54 files changed, 199 insertions(+), 181 deletions(-) (limited to 'packages/merchant-backoffice-ui/src/paths/instance') diff --git a/packages/merchant-backoffice-ui/src/paths/instance/details/DetailPage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/details/DetailPage.tsx index 9a35b0797..e5937ab7b 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/details/DetailPage.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/details/DetailPage.tsx @@ -19,7 +19,7 @@ * @author Sebastian Javier Marchano (sebasjm) */ -import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser"; +import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { h, VNode } from "preact"; import { useState } from "preact/hooks"; import { FormProvider } from "../../../components/form/FormProvider.js"; @@ -36,14 +36,14 @@ interface Props { function convert( from: MerchantBackend.Instances.QueryInstancesResponse, ): Entity { - const { accounts, ...rest } = from; - const payto_uris = accounts.filter((a) => a.active).map((a) => a.payto_uri); + const { accounts: allAccounts, ...rest } = from; + const accounts = allAccounts.filter((a) => a.active); const defaults = { default_wire_fee_amortization: 1, default_pay_delay: { d_us: 1000 * 60 * 60 * 1000 }, //one hour default_wire_transfer_delay: { d_us: 1000 * 60 * 60 * 2 * 1000 }, //two hours }; - return { ...defaults, ...rest, payto_uris }; + return { ...defaults, ...rest, accounts }; } export function DetailPage({ selected }: Props): VNode { @@ -75,7 +75,7 @@ export function DetailPage({ selected }: Props): VNode { object={value} valueHandler={valueHandler}> name="name" readonly label={i18n.str`Name`} /> - name="payto_uris" + name="accounts" readonly label={i18n.str`Account address`} /> diff --git a/packages/merchant-backoffice-ui/src/paths/instance/details/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/details/index.tsx index 17089c555..9b393b818 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/details/index.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/details/index.tsx @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with GNU Taler; see the file COPYING. If not, see */ -import { ErrorType, HttpError } from "@gnu-taler/web-util/lib/index.browser"; +import { ErrorType, HttpError } from "@gnu-taler/web-util/browser"; import { Fragment, h, VNode } from "preact"; import { useState } from "preact/hooks"; import { Loading } from "../../../components/exception/loading.js"; diff --git a/packages/merchant-backoffice-ui/src/paths/instance/kyc/list/ListPage.stories.tsx b/packages/merchant-backoffice-ui/src/paths/instance/kyc/list/ListPage.stories.tsx index 6c48c6d55..6f50ac830 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/kyc/list/ListPage.stories.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/kyc/list/ListPage.stories.tsx @@ -21,7 +21,7 @@ import { h, VNode, FunctionalComponent } from "preact"; import { ListPage as TestedComponent } from "./ListPage.js"; -import { tests } from "@gnu-taler/web-util/lib/index.browser"; +import * as tests from "@gnu-taler/web-util/testing"; import { MerchantBackend } from "../../../../declaration.js"; export default { diff --git a/packages/merchant-backoffice-ui/src/paths/instance/kyc/list/ListPage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/kyc/list/ListPage.tsx index 4de70a84c..67005d3cc 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/kyc/list/ListPage.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/kyc/list/ListPage.tsx @@ -19,7 +19,7 @@ * @author Sebastian Javier Marchano (sebasjm) */ -import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser"; +import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { h, VNode } from "preact"; import { MerchantBackend } from "../../../../declaration.js"; diff --git a/packages/merchant-backoffice-ui/src/paths/instance/kyc/list/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/kyc/list/index.tsx index dc74acdb6..5b93ac169 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/kyc/list/index.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/kyc/list/index.tsx @@ -19,7 +19,7 @@ * @author Sebastian Javier Marchano (sebasjm) */ -import { ErrorType, HttpError } from "@gnu-taler/web-util/lib/index.browser"; +import { ErrorType, HttpError } from "@gnu-taler/web-util/browser"; import { h, VNode } from "preact"; import { Loading } from "../../../../components/exception/loading.js"; import { MerchantBackend } from "../../../../declaration.js"; diff --git a/packages/merchant-backoffice-ui/src/paths/instance/orders/create/CreatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/orders/create/CreatePage.tsx index d5c888f1c..c8cc20ae0 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/orders/create/CreatePage.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/orders/create/CreatePage.tsx @@ -20,7 +20,7 @@ */ import { Amounts } from "@gnu-taler/taler-util"; -import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser"; +import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { add, isAfter, isBefore, isFuture } from "date-fns"; import { Fragment, h, VNode } from "preact"; import { useEffect, useState } from "preact/hooks"; diff --git a/packages/merchant-backoffice-ui/src/paths/instance/orders/create/OrderCreatedSuccessfully.tsx b/packages/merchant-backoffice-ui/src/paths/instance/orders/create/OrderCreatedSuccessfully.tsx index 88c33e2f8..88a984c97 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/orders/create/OrderCreatedSuccessfully.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/orders/create/OrderCreatedSuccessfully.tsx @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with GNU Taler; see the file COPYING. If not, see */ -import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser"; +import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { h, VNode } from "preact"; import { useEffect, useState } from "preact/hooks"; import { CreatedSuccessfully } from "../../../../components/notifications/CreatedSuccessfully.js"; diff --git a/packages/merchant-backoffice-ui/src/paths/instance/orders/create/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/orders/create/index.tsx index 82556d25a..ffefd5302 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/orders/create/index.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/orders/create/index.tsx @@ -19,7 +19,7 @@ * @author Sebastian Javier Marchano (sebasjm) */ -import { ErrorType, HttpError } from "@gnu-taler/web-util/lib/index.browser"; +import { ErrorType, HttpError } from "@gnu-taler/web-util/browser"; import { Fragment, h, VNode } from "preact"; import { useState } from "preact/hooks"; import { Loading } from "../../../../components/exception/loading.js"; diff --git a/packages/merchant-backoffice-ui/src/paths/instance/orders/details/DetailPage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/orders/details/DetailPage.tsx index 1fba3c3e9..8dabfbe12 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/orders/details/DetailPage.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/orders/details/DetailPage.tsx @@ -20,7 +20,7 @@ */ import { AmountJson, Amounts } from "@gnu-taler/taler-util"; -import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser"; +import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { format } from "date-fns"; import { Fragment, h, VNode } from "preact"; import { useState } from "preact/hooks"; diff --git a/packages/merchant-backoffice-ui/src/paths/instance/orders/details/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/orders/details/index.tsx index 4d0d48e47..1517a3c42 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/orders/details/index.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/orders/details/index.tsx @@ -17,7 +17,7 @@ import { useTranslationContext, HttpError, ErrorType, -} from "@gnu-taler/web-util/lib/index.browser"; +} from "@gnu-taler/web-util/browser"; import { Fragment, h, VNode } from "preact"; import { useState } from "preact/hooks"; import { Loading } from "../../../../components/exception/loading.js"; diff --git a/packages/merchant-backoffice-ui/src/paths/instance/orders/list/ListPage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/orders/list/ListPage.tsx index 3639ae912..56d9dda74 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/orders/list/ListPage.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/orders/list/ListPage.tsx @@ -19,7 +19,7 @@ * @author Sebastian Javier Marchano (sebasjm) */ -import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser"; +import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { format } from "date-fns"; import { h, VNode } from "preact"; import { useState } from "preact/hooks"; diff --git a/packages/merchant-backoffice-ui/src/paths/instance/orders/list/Table.tsx b/packages/merchant-backoffice-ui/src/paths/instance/orders/list/Table.tsx index b0a836f81..3c927033b 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/orders/list/Table.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/orders/list/Table.tsx @@ -20,7 +20,7 @@ */ import { Amounts } from "@gnu-taler/taler-util"; -import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser"; +import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { format } from "date-fns"; import { h, VNode } from "preact"; import { StateUpdater, useState } from "preact/hooks"; diff --git a/packages/merchant-backoffice-ui/src/paths/instance/orders/list/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/orders/list/index.tsx index 9a367291f..6888eda58 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/orders/list/index.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/orders/list/index.tsx @@ -23,7 +23,7 @@ import { ErrorType, HttpError, useTranslationContext, -} from "@gnu-taler/web-util/lib/index.browser"; +} from "@gnu-taler/web-util/browser"; import { Fragment, h, VNode } from "preact"; import { useState } from "preact/hooks"; import { Loading } from "../../../../components/exception/loading.js"; diff --git a/packages/merchant-backoffice-ui/src/paths/instance/products/create/CreatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/products/create/CreatePage.tsx index c18646be0..becaf8f3a 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/products/create/CreatePage.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/products/create/CreatePage.tsx @@ -19,7 +19,7 @@ * @author Sebastian Javier Marchano (sebasjm) */ -import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser"; +import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { h, VNode } from "preact"; import { AsyncButton } from "../../../../components/exception/AsyncButton.js"; import { ProductForm } from "../../../../components/product/ProductForm.js"; diff --git a/packages/merchant-backoffice-ui/src/paths/instance/products/create/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/products/create/index.tsx index f82d85e94..775690bd1 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/products/create/index.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/products/create/index.tsx @@ -19,7 +19,7 @@ * @author Sebastian Javier Marchano (sebasjm) */ -import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser"; +import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { Fragment, h, VNode } from "preact"; import { useState } from "preact/hooks"; import { NotificationCard } from "../../../../components/menu/index.js"; diff --git a/packages/merchant-backoffice-ui/src/paths/instance/products/list/Table.tsx b/packages/merchant-backoffice-ui/src/paths/instance/products/list/Table.tsx index 97d5afee5..6bbb89dfa 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/products/list/Table.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/products/list/Table.tsx @@ -20,7 +20,7 @@ */ import { Amounts } from "@gnu-taler/taler-util"; -import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser"; +import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { format } from "date-fns"; import { ComponentChildren, Fragment, h, VNode } from "preact"; import { StateUpdater, useState } from "preact/hooks"; diff --git a/packages/merchant-backoffice-ui/src/paths/instance/products/list/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/products/list/index.tsx index 216ab59e7..87efd1554 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/products/list/index.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/products/list/index.tsx @@ -23,7 +23,7 @@ import { ErrorType, HttpError, useTranslationContext, -} from "@gnu-taler/web-util/lib/index.browser"; +} from "@gnu-taler/web-util/browser"; import { h, VNode } from "preact"; import { useState } from "preact/hooks"; import { Loading } from "../../../../components/exception/loading.js"; diff --git a/packages/merchant-backoffice-ui/src/paths/instance/products/update/UpdatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/products/update/UpdatePage.tsx index d179ef87c..97715171e 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/products/update/UpdatePage.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/products/update/UpdatePage.tsx @@ -19,7 +19,7 @@ * @author Sebastian Javier Marchano (sebasjm) */ -import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser"; +import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { h, VNode } from "preact"; import { AsyncButton } from "../../../../components/exception/AsyncButton.js"; import { ProductForm } from "../../../../components/product/ProductForm.js"; diff --git a/packages/merchant-backoffice-ui/src/paths/instance/products/update/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/products/update/index.tsx index 86255b0fe..8e0f7647f 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/products/update/index.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/products/update/index.tsx @@ -23,7 +23,7 @@ import { ErrorType, HttpError, useTranslationContext, -} from "@gnu-taler/web-util/lib/index.browser"; +} from "@gnu-taler/web-util/browser"; import { Fragment, h, VNode } from "preact"; import { useState } from "preact/hooks"; import { Loading } from "../../../../components/exception/loading.js"; diff --git a/packages/merchant-backoffice-ui/src/paths/instance/reserves/create/CreatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/reserves/create/CreatePage.tsx index c0c36e651..fccb20121 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/reserves/create/CreatePage.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/reserves/create/CreatePage.tsx @@ -19,7 +19,7 @@ * @author Sebastian Javier Marchano (sebasjm) */ -import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser"; +import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { Fragment, h, VNode } from "preact"; import { StateUpdater, useEffect, useState } from "preact/hooks"; import { AsyncButton } from "../../../../components/exception/AsyncButton.js"; diff --git a/packages/merchant-backoffice-ui/src/paths/instance/reserves/create/CreatedSuccessfully.stories.tsx b/packages/merchant-backoffice-ui/src/paths/instance/reserves/create/CreatedSuccessfully.stories.tsx index 4b634c6c0..445ca3ef0 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/reserves/create/CreatedSuccessfully.stories.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/reserves/create/CreatedSuccessfully.stories.tsx @@ -21,7 +21,7 @@ import { h, VNode, FunctionalComponent } from "preact"; import { CreatedSuccessfully as TestedComponent } from "./CreatedSuccessfully.js"; -import { tests } from "@gnu-taler/web-util/lib/index.browser"; +import * as tests from "@gnu-taler/web-util/testing"; export default { title: "Pages/Reserve/CreatedSuccessfully", diff --git a/packages/merchant-backoffice-ui/src/paths/instance/reserves/create/CreatedSuccessfully.tsx b/packages/merchant-backoffice-ui/src/paths/instance/reserves/create/CreatedSuccessfully.tsx index 7ba531a94..94fcdaff7 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/reserves/create/CreatedSuccessfully.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/reserves/create/CreatedSuccessfully.tsx @@ -15,11 +15,11 @@ */ import { parsePaytoUri, stringifyPaytoUri } from "@gnu-taler/taler-util"; -import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser"; -import { Fragment, h, VNode } from "preact"; +import { useTranslationContext } from "@gnu-taler/web-util/browser"; +import { Fragment, VNode, h } from "preact"; import { QR } from "../../../../components/exception/QR.js"; import { CreatedSuccessfully as Template } from "../../../../components/notifications/CreatedSuccessfully.js"; -import { MerchantBackend } from "../../../../declaration.js"; +import { MerchantBackend, WireAccount } from "../../../../declaration.js"; type Entity = { request: MerchantBackend.Tips.ReserveCreateRequest; @@ -41,20 +41,6 @@ export function CreatedSuccessfully({ onConfirm, onCreateAnother, }: Props): VNode { - const accountsInfo = !entity.response.accounts - ? [] - : entity.response.accounts - .map((acc) => { - const p = parsePaytoUri(acc.payto_uri); - if (p) { - p.params["message"] = entity.response.reserve_pub; - p.params["amount"] = entity.request.initial_balance; - } - return p; - }) - .filter(isNotUndefined); - - const links = accountsInfo.map((a) => stringifyPaytoUri(a)); const { i18n } = useTranslationContext(); return ( + ); +} -

- Exchange bank accounts -

-

- - If your system supports RFC 8905, you can do this by clicking on - the URI below the QR code: - -

- {links.map((link) => { - return ( - - -
-                  
-                    {link}
-                  
-                
-
- ); +export function ShowAccountsOfReserveAsQRWithLink({ + accounts, + message, + amount, +}: { + accounts: WireAccount[]; + message: string; + amount: string; +}): VNode { + const { i18n } = useTranslationContext(); + const accountsInfo = !accounts + ? [] + : accounts + .map((acc) => { + const p = parsePaytoUri(acc.payto_uri); + if (p) { + p.params["message"] = message; + p.params["amount"] = amount; + } + return p; + }) + .filter(isNotUndefined); + + const links = accountsInfo.map((a) => stringifyPaytoUri(a)); + + if (links.length === 0) { + return ( + +

+ The reserve have invalid accounts. List of invalid payto URIs below: +

+
    + {accounts.map((a, idx) => { + return
  • {a.payto_uri}
  • ; })} - - )} - +
+
+ ); + } + + if (links.length === 1) { + return ( + +

+ + To complete the setup of the reserve, you must now initiate a wire + transfer using the given wire transfer subject and crediting the + specified amount to the indicated account of the exchange. + +

+

+ Exchange bank account +

+ +

+ + If your system supports RFC 8905, you can do this by opening this + URI: + +

+
+          
+            {links[0]}
+          
+        
+
+ ); + } + + return ( +
+

+ + To complete the setup of the reserve, you must now initiate a wire + transfer using the given wire transfer subject and crediting the + specified amount to one of the indicated account of the exchange. + +

+ +

+ Exchange bank accounts +

+

+ + If your system supports RFC 8905, you can do this by clicking on the + URI below the QR code: + +

+ {links.map((link) => { + return ( + + +
+              
+                {link}
+              
+            
+
+ ); + })} +
); } diff --git a/packages/merchant-backoffice-ui/src/paths/instance/reserves/create/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/reserves/create/index.tsx index 0d39fc298..8a4fe1565 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/reserves/create/index.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/reserves/create/index.tsx @@ -19,7 +19,7 @@ * @author Sebastian Javier Marchano (sebasjm) */ -import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser"; +import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { Fragment, h, VNode } from "preact"; import { useState } from "preact/hooks"; import { NotificationCard } from "../../../../components/menu/index.js"; diff --git a/packages/merchant-backoffice-ui/src/paths/instance/reserves/details/DetailPage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/reserves/details/DetailPage.tsx index 54e8123e4..b0173b5d3 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/reserves/details/DetailPage.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/reserves/details/DetailPage.tsx @@ -24,7 +24,7 @@ import { parsePaytoUri, stringifyPaytoUri, } from "@gnu-taler/taler-util"; -import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser"; +import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { format } from "date-fns"; import { Fragment, h, VNode } from "preact"; import { useState } from "preact/hooks"; @@ -38,6 +38,7 @@ import { SimpleModal } from "../../../../components/modal/index.js"; import { MerchantBackend } from "../../../../declaration.js"; import { useTipDetails } from "../../../../hooks/reserves.js"; import { TipInfo } from "./TipInfo.js"; +import { ShowAccountsOfReserveAsQRWithLink } from "../create/CreatedSuccessfully.js"; type Entity = MerchantBackend.Tips.ReserveDetail; type CT = MerchantBackend.ContractTerms; @@ -53,13 +54,6 @@ export function DetailPage({ id, selected, onBack }: Props): VNode { const didExchangeAckTransfer = Amounts.isNonZero( Amounts.parseOrThrow(selected.exchange_initial_amount), ); - const p = parsePaytoUri(selected.payto_uri); - if (p) { - p.params["message"] = id; - p.params["amount"] = selected.merchant_initial_amount; - } - - const link = !p ? selected.payto_uri : stringifyPaytoUri(p); return (
@@ -111,11 +105,6 @@ export function DetailPage({ id, selected, onBack }: Props): VNode { /> )} - - name="payto_uri" - label={i18n.str`Account address`} - readonly - /> @@ -143,30 +132,13 @@ export function DetailPage({ id, selected, onBack }: Props): VNode {
- ) : ( - -

- - To complete the setup of the reserve, you must now initiate a - wire transfer using the given wire transfer subject and - crediting the specified amount to the indicated account of the - exchange. - -

-

- - If your system supports RFC 8905, you can do this by opening - this URI: - -

-
-                
-                  {link}
-                
-              
- -
- )} + ) : selected.accounts ? ( + + ) : undefined}