From 58d45fc8aef174027b2855a3cd24b0eb73d6de2e Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 5 Feb 2024 14:58:05 -0300 Subject: some fixes from the last QC meeting --- .../src/components/Transactions/views.tsx | 10 +-- packages/demobank-ui/src/context/config.ts | 2 +- packages/demobank-ui/src/pages/BankFrame.tsx | 24 +++++-- packages/demobank-ui/src/pages/DownloadStats.tsx | 13 +--- packages/demobank-ui/src/pages/LoginForm.tsx | 4 +- packages/demobank-ui/src/pages/PaymentOptions.tsx | 6 +- .../src/pages/PaytoWireTransferForm.tsx | 46 ++++++------- .../demobank-ui/src/pages/RegistrationPage.tsx | 14 ++-- .../demobank-ui/src/pages/SolveChallengePage.tsx | 53 ++++++++++----- .../demobank-ui/src/pages/WalletWithdrawForm.tsx | 6 +- .../src/pages/account/ShowAccountDetails.tsx | 23 ++++--- .../src/pages/account/UpdateAccountPassword.tsx | 12 ++-- .../demobank-ui/src/pages/admin/AccountForm.tsx | 77 +++++++++------------- .../demobank-ui/src/pages/admin/AccountList.tsx | 8 +-- packages/demobank-ui/src/pages/admin/AdminHome.tsx | 2 +- .../demobank-ui/src/pages/admin/RemoveAccount.tsx | 6 +- .../src/pages/business/CreateCashout.tsx | 18 ++--- .../src/pages/business/ShowCashoutDetails.tsx | 2 +- 18 files changed, 165 insertions(+), 161 deletions(-) (limited to 'packages') diff --git a/packages/demobank-ui/src/components/Transactions/views.tsx b/packages/demobank-ui/src/components/Transactions/views.tsx index 1d63cc2cb..f4f6f66ba 100644 --- a/packages/demobank-ui/src/components/Transactions/views.tsx +++ b/packages/demobank-ui/src/components/Transactions/views.tsx @@ -49,7 +49,7 @@ export function ReadyView({

- Latest transactions + Transactions history

@@ -93,8 +93,8 @@ export function ReadyView({ item.when.t_ms === "never" ? "" : format(item.when.t_ms, "HH:mm:ss", { - locale: dateLocale, - }); + locale: dateLocale, + }); return ( ) : ( - <{i18n.str`invalid value`}> + <{i18n.str`Invalid value`}> )} @@ -163,7 +163,7 @@ export function ReadyView({ /> ) : ( - <{i18n.str`invalid value`}> + <{i18n.str`Invalid value`}> )} diff --git a/packages/demobank-ui/src/context/config.ts b/packages/demobank-ui/src/context/config.ts index f2e37a15f..5d8a5c73f 100644 --- a/packages/demobank-ui/src/context/config.ts +++ b/packages/demobank-ui/src/context/config.ts @@ -134,7 +134,7 @@ export const BankCoreApiProvider = ({ children: h( "div", {}, - i18n.str`the bank backend is not supported. supported version "${checked.supported}", server version "${checked.result.version}"`, + i18n.str`The bank backend is not supported. Supported version "${checked.supported}", server version "${checked.result.version}"`, ), }); } diff --git a/packages/demobank-ui/src/pages/BankFrame.tsx b/packages/demobank-ui/src/pages/BankFrame.tsx index a106f370d..35cb30065 100644 --- a/packages/demobank-ui/src/pages/BankFrame.tsx +++ b/packages/demobank-ui/src/pages/BankFrame.tsx @@ -86,9 +86,9 @@ export function BankFrame({ backend.state.status !== "loggedIn" ? undefined : () => { - backend.logOut(); - resetBankState(); - } + backend.logOut(); + resetBankState(); + } } sites={ !settings.topNavSites ? [] : Object.entries(settings.topNavSites) @@ -174,16 +174,26 @@ export function BankFrame({ ); } -function WelcomeAccount({ account: accountName }: { account: string }): VNode { +function WelcomeAccount({ account }: { account: string }): VNode { const { i18n } = useTranslationContext(); + const result = useAccountDetails(account) + if (!result) { + return ; + } + if (result instanceof TalerError) { + return
; + } + if (result.type === "fail") { + return + Welcome + ; + } return ( - - Welcome, {accountName} - + Welcome, {result.body.name} ); } diff --git a/packages/demobank-ui/src/pages/DownloadStats.tsx b/packages/demobank-ui/src/pages/DownloadStats.tsx index d149a0d9f..2a876d233 100644 --- a/packages/demobank-ui/src/pages/DownloadStats.tsx +++ b/packages/demobank-ui/src/pages/DownloadStats.tsx @@ -269,9 +269,7 @@ export function DownloadStats({ routeCancel }: Props): VNode { class="text-sm text-black font-medium leading-6 " id="availability-label" > - - Add previous metric for compare - + Add previous metric for compare
@@ -397,9 +392,7 @@ export function DownloadStats({ routeCancel }: Props): VNode { download={"bank-stats.csv"} > - - click here to save the file in your computer - + Click here to save the file in your computer. )} diff --git a/packages/demobank-ui/src/pages/LoginForm.tsx b/packages/demobank-ui/src/pages/LoginForm.tsx index 83aaff9fa..9816972ac 100644 --- a/packages/demobank-ui/src/pages/LoginForm.tsx +++ b/packages/demobank-ui/src/pages/LoginForm.tsx @@ -153,7 +153,7 @@ export function LoginForm({ enterkeyhint="next" placeholder="identification" autocomplete="username" - title={i18n.str`username of the account`} + title={i18n.str`Username of the account`} required onInput={(e): void => { setUsername(e.currentTarget.value); @@ -185,7 +185,7 @@ export function LoginForm({ enterkeyhint="send" value={password ?? ""} placeholder="Password" - title={i18n.str`password of the account`} + title={i18n.str`Password of the account`} required onInput={(e): void => { setPassword(e.currentTarget.value); diff --git a/packages/demobank-ui/src/pages/PaymentOptions.tsx b/packages/demobank-ui/src/pages/PaymentOptions.tsx index 51a6a17a9..9fa30cc41 100644 --- a/packages/demobank-ui/src/pages/PaymentOptions.tsx +++ b/packages/demobank-ui/src/pages/PaymentOptions.tsx @@ -47,7 +47,7 @@ function ShowOperationPendingTag({ woid, onOperationAlreadyCompleted }: { woid: > - operation ready + Operation ready } @@ -100,9 +100,7 @@ export function PaymentOptions({
💵
- - to a Taler wallet - + to a Taler wallet

- - IBAN of the recipient's account - + IBAN of the recipient's account

@@ -374,7 +372,7 @@ export function PaytoWireTransferForm({ name="subject" id="subject" autocomplete="off" - placeholder={i18n.str`subject`} + placeholder={i18n.str`Subject`} value={subject ?? ""} required onInput={(e): void => { @@ -387,9 +385,7 @@ export function PaytoWireTransferForm({ />

- - some text to identify the transfer - + Some text to identify the transfer

@@ -412,7 +408,7 @@ export function PaytoWireTransferForm({ isDirty={trimmedAmountStr !== undefined} />

- amount to transfer + Amount to transfer

@@ -422,7 +418,7 @@ export function PaytoWireTransferForm({ + >{i18n.str`Payto URI:`}