From f5608b5acac8bd3397ac3bb2954f165018703eb4 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Tue, 9 Apr 2024 15:19:49 -0300 Subject: wip #8424 --- .../src/components/BankDetailsByPaytoType.tsx | 2 +- .../src/popup/NoBalanceHelp.tsx | 2 +- .../src/wallet/Transaction.tsx | 113 ++++++++++----------- 3 files changed, 54 insertions(+), 63 deletions(-) diff --git a/packages/taler-wallet-webextension/src/components/BankDetailsByPaytoType.tsx b/packages/taler-wallet-webextension/src/components/BankDetailsByPaytoType.tsx index bf77174df..3bcf2d6ba 100644 --- a/packages/taler-wallet-webextension/src/components/BankDetailsByPaytoType.tsx +++ b/packages/taler-wallet-webextension/src/components/BankDetailsByPaytoType.tsx @@ -83,7 +83,7 @@ export function BankDetailsByPaytoType({ {accounts.length > 1 ? {accounts.map((ac, acIdx) => { - return - + Try the demo bank and withdraw test money. ยป diff --git a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx index 11fb88cf6..70a6e5491 100644 --- a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx +++ b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx @@ -231,13 +231,13 @@ function TransactionTemplate({
{transaction?.error && - // FIXME: wallet core should stop sending this error on KYC - transaction.error.code !== + // FIXME: wallet core should stop sending this error on KYC + transaction.error.code !== TalerErrorCode.WALLET_WITHDRAWAL_KYC_REQUIRED ? ( @@ -246,7 +246,7 @@ function TransactionTemplate({ @@ -257,12 +257,12 @@ function TransactionTemplate({ target="_bank" href={transaction.kycUrl} > - KYC verifier + KYC verifier. ) : ( - i18n.str`No more information has been provided` + i18n.str`No additional information has been provided.` ), }} /> @@ -271,7 +271,7 @@ function TransactionTemplate({ The transaction has been blocked since the account required an AML - check + check. )} @@ -291,12 +291,12 @@ function TransactionTemplate({ )} {transaction.txState.major === TransactionMajorState.Aborted && ( - This transaction was aborted + This transaction was aborted. )} {transaction.txState.major === TransactionMajorState.Failed && ( - This transaction failed + This transaction failed. )} {confirmBeforeForget ? ( @@ -427,7 +427,7 @@ export function TransactionView({ transaction, onDelete, onAbort, - onBack, + // onBack, onResume, onSuspend, onRetry, @@ -444,10 +444,13 @@ export function TransactionView({ transaction.type === TransactionType.Withdrawal || transaction.type === TransactionType.InternalWithdrawal ) { - const conversion = - transaction.withdrawalDetails.type === WithdrawalType.ManualTransfer - ? transaction.withdrawalDetails.exchangeCreditAccountDetails ?? [] - : []; + // const conversion = + // transaction.withdrawalDetails.type === WithdrawalType.ManualTransfer + // ? transaction.withdrawalDetails.exchangeCreditAccountDetails ?? [] + // : []; + const blockedByKycOrAml = + transaction.txState.minor === TransactionMinorState.KycRequired || + transaction.txState.minor === TransactionMinorState.AmlRequired; return ( - {transaction.txState.major !== - TransactionMajorState.Pending ? undefined : transaction.txState - .minor === TransactionMinorState.KycRequired || - transaction.txState.minor === - TransactionMinorState.AmlRequired ? undefined : transaction - .withdrawalDetails.type === WithdrawalType.ManualTransfer - && transaction.withdrawalDetails.exchangeCreditAccountDetails ? ( + {transaction.txState.major !== TransactionMajorState.Pending || + blockedByKycOrAml ? undefined : transaction.withdrawalDetails.type === + WithdrawalType.ManualTransfer && + transaction.withdrawalDetails.exchangeCreditAccountDetails ? ( - {transaction.withdrawalDetails.exchangeCreditAccountDetails.length > 1 ? + {transaction.withdrawalDetails.exchangeCreditAccountDetails + .length > 1 ? ( - Now the payment service provider is waiting for to - be transferred. Select one of the accounts and use the information below - to complete the operation by making a wire transfer from your bank account. + Now the payment service provider is waiting for{" "} + to be transferred. Select one of the + accounts and use the information below to complete the + operation by making a wire transfer from your bank account. - : - - Now the payment service provider is waiting for to - be transferred. Use the information below to complete the operation - by making a wire transfer from your bank account. - } - + ) : ( + + + Now the payment service provider is waiting for{" "} + to be transferred. Use the + information below to complete the operation by making a wire + transfer from your bank account. + + + )} - was refunded + Was refunded {" "} on{" "} { @@ -582,6 +587,7 @@ export function TransactionView({ format="dd MMMM yyyy" /> } + . @@ -696,7 +702,7 @@ export function TransactionView({ /> {!shouldBeWired ? ( } @@ -706,7 +712,7 @@ export function TransactionView({ @@ -715,7 +721,7 @@ export function TransactionView({ @@ -733,7 +739,7 @@ export function TransactionView({ @@ -1126,10 +1132,9 @@ export function TransactionView({ ); } default: { - assertUnreachable(transaction.lossEventType) + assertUnreachable(transaction.lossEventType); } } - } if (transaction.type === TransactionType.Recoup) { throw Error("recoup transaction not implemented"); @@ -1529,12 +1534,6 @@ export function WithdrawDetails({ }): VNode { const { i18n } = useTranslationContext(); - const maxFrac = [amount.fee, amount.fee] - .map((a) => Amounts.maxFractionalDigits(a)) - .reduce((c, p) => Math.max(c, p), 0); - - const total = Amounts.add(amount.value, amount.fee).amount; - return ( {conversion ? ( @@ -1548,7 +1547,7 @@ export function WithdrawDetails({ {conversion.fraction === amount.value.fraction && - conversion.value === amount.value.value ? undefined : ( + conversion.value === amount.value.value ? undefined : ( Converted @@ -1599,7 +1598,7 @@ export function WithdrawDetails({ export function PurchaseDetails({ price, effectiveRefund, - info, + info: _info, proposalId, }: { price: AmountWithFee; @@ -1611,15 +1610,6 @@ export function PurchaseDetails({ const total = Amounts.add(price.value, price.fee).amount; - // const hasProducts = info.products && info.products.length > 0; - - // const hasShipping = - // info.delivery_date !== undefined || info.delivery_location !== undefined; - - const showLargePic = (): void => { - return; - }; - return ( @@ -1845,7 +1835,7 @@ function TrackingDepositDetails({ {wireTransfers.map((wire) => ( - + {wire.id} @@ -2081,8 +2071,9 @@ function ShowWithdrawalDetailForBankIntegrated({ if ( transaction.txState.major !== TransactionMajorState.Pending || transaction.withdrawalDetails.type === WithdrawalType.ManualTransfer - ) + ) { return ; + } const raw = Amounts.parseOrThrow(transaction.amountRaw); return ( @@ -2094,7 +2085,7 @@ function ShowWithdrawalDetailForBankIntegrated({ setShowDetails(!showDetails); }} > - show details + Show details. @@ -2108,7 +2099,7 @@ function ShowWithdrawalDetailForBankIntegrated({ /> )} {!transaction.withdrawalDetails.confirmed && - transaction.withdrawalDetails.bankConfirmationUrl ? ( + transaction.withdrawalDetails.bankConfirmationUrl ? (
@@ -2131,7 +2122,7 @@ function ShowWithdrawalDetailForBankIntegrated({ Bank has confirmed the wire transfer. Waiting for the exchange to - send the coins + send the coins. )} -- cgit v1.2.3