From 27e4ff3011527d9c0b7630dc7a4080f8fb817300 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Tue, 6 Feb 2024 17:06:56 -0300 Subject: fixes #8336 remove rewards --- .../src/wallet/AddNewActionView.tsx | 2 - .../src/wallet/Application.tsx | 29 ------- .../src/wallet/History.stories.tsx | 9 --- .../src/wallet/Transaction.stories.tsx | 34 +------- .../src/wallet/Transaction.tsx | 92 +++------------------- 5 files changed, 11 insertions(+), 155 deletions(-) (limited to 'packages/taler-wallet-webextension/src/wallet') diff --git a/packages/taler-wallet-webextension/src/wallet/AddNewActionView.tsx b/packages/taler-wallet-webextension/src/wallet/AddNewActionView.tsx index fc3a0916c..dd1777fd1 100644 --- a/packages/taler-wallet-webextension/src/wallet/AddNewActionView.tsx +++ b/packages/taler-wallet-webextension/src/wallet/AddNewActionView.tsx @@ -66,8 +66,6 @@ export function AddNewActionView({ onCancel }: Props): VNode { return Open pay page; case TalerUriAction.Refund: return Open refund page; - case TalerUriAction.Reward: - return Open tip page; case TalerUriAction.Withdraw: return Open withdraw page; } diff --git a/packages/taler-wallet-webextension/src/wallet/Application.tsx b/packages/taler-wallet-webextension/src/wallet/Application.tsx index 3867845f2..140bb5683 100644 --- a/packages/taler-wallet-webextension/src/wallet/Application.tsx +++ b/packages/taler-wallet-webextension/src/wallet/Application.tsx @@ -59,7 +59,6 @@ import { PaymentPage } from "../cta/Payment/index.js"; import { PaymentTemplatePage } from "../cta/PaymentTemplate/index.js"; import { RecoveryPage } from "../cta/Recovery/index.js"; import { RefundPage } from "../cta/Refund/index.js"; -import { TipPage } from "../cta/Reward/index.js"; import { TransferCreatePage } from "../cta/TransferCreate/index.js"; import { TransferPickupPage } from "../cta/TransferPickup/index.js"; import { @@ -365,34 +364,6 @@ export function Application(): VNode { )} /> - ( - - redirectTo(Pages.balance)} - onSuccess={(tid: string) => - redirectTo(Pages.balanceTransaction({ tid })) - } - /> - - )} - /> - ( - - redirectTo(Pages.balance)} - onSuccess={(tid: string) => - redirectTo(Pages.balanceTransaction({ tid })) - } - /> - - )} - /> ( diff --git a/packages/taler-wallet-webextension/src/wallet/History.stories.tsx b/packages/taler-wallet-webextension/src/wallet/History.stories.tsx index 8b4f64a93..cc87cb992 100644 --- a/packages/taler-wallet-webextension/src/wallet/History.stories.tsx +++ b/packages/taler-wallet-webextension/src/wallet/History.stories.tsx @@ -35,7 +35,6 @@ import { TransactionPeerPushDebit, TransactionRefresh, TransactionRefund, - TransactionReward, TransactionType, TransactionWithdrawal, WithdrawalType, @@ -112,11 +111,6 @@ const exampleData = { exchangeBaseUrl: "http://exchange.taler", refreshReason: RefreshReason.PayMerchant, } as TransactionRefresh, - tip: { - ...commonTransaction(), - type: TransactionType.Reward, - merchantBaseUrl: "http://ads.merchant.taler.net/", - } as TransactionReward, refund: { ...commonTransaction(), type: TransactionType.Refund, @@ -277,7 +271,6 @@ export const SomeTransactions = tests.createExample(TestedComponent, { }, }, exampleData.refund, - exampleData.tip, exampleData.deposit, ], balances: [ @@ -371,7 +364,6 @@ export const SomeTransactionsInDifferentStates = tests.createExample( }, }, exampleData.refund, - exampleData.tip, exampleData.deposit, ], balances: [ @@ -402,7 +394,6 @@ export const SomeTransactionsWithTwoCurrencies = tests.createExample( exampleData.payment, exampleData.refresh, exampleData.refund, - exampleData.tip, exampleData.deposit, ], balances: [ diff --git a/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx b/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx index c17d15b01..194f0e0bb 100644 --- a/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx +++ b/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx @@ -38,11 +38,10 @@ import { TransactionPeerPushDebit, TransactionRefresh, TransactionRefund, - TransactionReward, TransactionType, TransactionWithdrawal, WithdrawalDetails, - WithdrawalType, + WithdrawalType } from "@gnu-taler/taler-util"; import * as tests from "@gnu-taler/web-util/testing"; import beer from "../../static-dev/beer.png"; @@ -137,17 +136,6 @@ const exampleData = { exchangeBaseUrl: "http://exchange.taler", refreshReason: RefreshReason.Manual, } as TransactionRefresh, - tip: { - ...commonTransaction, - type: TransactionType.Reward, - // merchant: { - // name: "the merchant", - // logo: merchantIcon, - // website: "https://www.themerchant.taler", - // email: "contact@merchant.taler", - // }, - merchantBaseUrl: "http://merchant.taler", - } as TransactionReward, refund: { ...commonTransaction, type: TransactionType.Refund, @@ -584,26 +572,6 @@ export const RefreshError = tests.createExample(TestedComponent, { }, }); -export const Tip = tests.createExample(TestedComponent, { - transaction: exampleData.tip, -}); - -export const TipError = tests.createExample(TestedComponent, { - transaction: { - ...exampleData.tip, - error: transactionError, - }, -}); - -export const TipPending = tests.createExample(TestedComponent, { - transaction: { - ...exampleData.tip, - txState: { - major: TransactionMajorState.Pending, - }, - }, -}); - export const Refund = tests.createExample(TestedComponent, { transaction: exampleData.refund, }); diff --git a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx index f6c98952e..65fc90f44 100644 --- a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx +++ b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx @@ -229,8 +229,8 @@ 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 ? ( {transaction.txState.major !== - TransactionMajorState.Pending ? undefined : transaction.txState + TransactionMajorState.Pending ? undefined : transaction.txState .minor === TransactionMinorState.KycRequired || - transaction.txState.minor === + transaction.txState.minor === TransactionMinorState.AmlRequired ? undefined : transaction - .withdrawalDetails.type === WithdrawalType.ManualTransfer ? ( + .withdrawalDetails.type === WithdrawalType.ManualTransfer ? ( //manual withdrawal -
- {transaction.merchantBaseUrl} -
- {/* } - kind="neutral" - /> */} - - } - /> - - ); - } - if (transaction.type === TransactionType.Refund) { return ( {conversion.fraction === amount.value.fraction && - conversion.value === amount.value.value ? undefined : ( + conversion.value === amount.value.value ? undefined : ( Converted @@ -1839,47 +1808,6 @@ function RefreshDetails({ amount }: { amount: AmountWithFee }): VNode { ); } -function TipDetails({ amount }: { amount: AmountWithFee }): VNode { - const { i18n } = useTranslationContext(); - - return ( - - - - Tip - - - - - - - {Amounts.isNonZero(amount.fee) && ( - - - Fees - - - - - - )} - - -
- - - - - Total - - - - - -
- ); -} - function Header({ timestamp, total, @@ -2054,7 +1982,7 @@ function ShowWithdrawalDetailForBankIntegrated({ /> )} {!transaction.withdrawalDetails.confirmed && - transaction.withdrawalDetails.bankConfirmationUrl ? ( + transaction.withdrawalDetails.bankConfirmationUrl ? (
-- cgit v1.2.3