commit 92db7a8a68009d8e6cd184068b382e34b9a9c232
parent 61a0f3a0f4663ec40015ab7fbb90dfaba23f2e2a
Author: Sebastian <sebasjm@gmail.com>
Date: Thu, 29 May 2025 19:07:39 -0300
fix #9875
Diffstat:
4 files changed, 43 insertions(+), 16 deletions(-)
diff --git a/packages/taler-wallet-webextension/src/wallet/History.tsx b/packages/taler-wallet-webextension/src/wallet/History.tsx
@@ -188,7 +188,11 @@ export function HistoryView({
);
const balance = balances[balanceIndex];
if (!balance) {
- return <div>unknown scope</div>;
+ return (
+ <div>
+ <i18n.Translate>unknown scope</i18n.Translate>
+ </div>
+ );
}
const available = balance
@@ -197,6 +201,16 @@ export function HistoryView({
const datesWithTransaction: string[] = Object.keys(transactionsByDate);
+ const groupByScope = balances.reduce(
+ (prev, cur) => {
+ const key = stringifyScopeInfoShort(cur.scopeInfo);
+ const value = prev[key] ?? [];
+ value.push(cur);
+ prev[key] = value;
+ return prev;
+ },
+ {} as Record<string, WalletBalance[]>,
+ );
// scopes.sort((a, b) => {
// return a[1]
// });
@@ -270,7 +284,8 @@ export function HistoryView({
changeScope(sc);
}}
>
- {balances.map((entry, si) => {
+ {Object.keys(groupByScope).map((key, si) => {
+ const entry = groupByScope[key][0];
const st = stringifyScopeInfoShort(entry.scopeInfo);
const sc = entry.scopeInfo;
if (sc.type === ScopeType.Global) {
@@ -282,11 +297,23 @@ export function HistoryView({
}
return (
- <optgroup label={sc.currency}>
- <option value={st} key={st}>
- {new URL(sc.url).hostname}
- </option>
- </optgroup>
+ <Fragment>
+ {groupByScope[key].map((ex) => {
+ const st = stringifyScopeInfoShort(ex.scopeInfo);
+ if (ex.scopeInfo.type === ScopeType.Global) {
+ return <Fragment />;
+ }
+ return (
+ <optgroup
+ label={new URL(ex.scopeInfo.url).hostname}
+ >
+ <option value={st} key={st}>
+ {ex.scopeInfo.currency}
+ </option>
+ </optgroup>
+ );
+ })}
+ </Fragment>
);
})}
</select>
diff --git a/packages/web-util/src/forms/gana/challenger_email.ts b/packages/web-util/src/forms/gana/challenger_email.ts
@@ -27,8 +27,8 @@ export const form_challenger_email = (
): FormMetadata => ({
label: i18n.str`Challenger EMAIL`,
description: i18n.str`Challenge email ownership.`,
- id: "challenger_email",
- version: 1,
+ id: "challenger-email",
+ version: 0,
config: design_challenger_email(i18n),
});
diff --git a/packages/web-util/src/forms/gana/challenger_postal.ts b/packages/web-util/src/forms/gana/challenger_postal.ts
@@ -28,8 +28,8 @@ export const form_challenger_postal = (
): FormMetadata => ({
label: i18n.str`Challenger POSTAL`,
description: i18n.str`Challenge address ownership.`,
- id: "challenger_postal",
- version: 1,
+ id: "challenger-postal",
+ version: 0,
config: design_challenger_postal(i18n),
});
@@ -49,14 +49,14 @@ export function design_challenger_postal(
fields: [
{
id: TalerFormAttributes.CONTACT_NAME,
- label: i18n.str`Phone`,
+ label: i18n.str`Name`,
type: "text",
required: true,
disabled: true,
},
{
id: TalerFormAttributes.ADDRESS_LINES,
- label: i18n.str`Phone`,
+ label: i18n.str`Address`,
type: "textArea",
required: true,
disabled: true,
diff --git a/packages/web-util/src/forms/gana/challenger_sms.ts b/packages/web-util/src/forms/gana/challenger_sms.ts
@@ -27,8 +27,8 @@ export const form_challenger_sms = (
): FormMetadata => ({
label: i18n.str`Challenger SMS`,
description: i18n.str`Challenge phone number ownership.`,
- id: "challenger_phone",
- version: 1,
+ id: "challenger-sms",
+ version: 0,
config: design_challenger_phone(i18n),
});
@@ -47,7 +47,7 @@ export function design_challenger_phone(
title: i18n.str`Challenge`,
fields: [
{
- id: TalerFormAttributes.CONTACT_EMAIL,
+ id: TalerFormAttributes.CONTACT_PHONE,
label: i18n.str`Phone`,
type: "text",
required: true,