commit 4937b40a71699a21006eeb08be36e177ec7a4a71
parent 11246df837159189b4b1c415abf7577eb0bb9a61
Author: Florian Dold <dold@taler.net>
Date: Tue, 25 Aug 2026 22:22:10 +0200
bank web UI: add public accounts overview link
Diffstat:
3 files changed, 42 insertions(+), 3 deletions(-)
diff --git a/packages/libeufin-bank-webui/src/Routing.tsx b/packages/libeufin-bank-webui/src/Routing.tsx
@@ -351,7 +351,7 @@ function PrivatePageRouting({
);
}
case "publicAccountList": {
- return <PublicHistoriesPage />;
+ return <PublicHistoriesPage routeOverview={privatePages.home} />;
}
case "statsDownload": {
return <DownloadStats routeCancel={privatePages.home} />;
diff --git a/packages/libeufin-bank-webui/src/pages/PublicHistoriesPage.tsx b/packages/libeufin-bank-webui/src/pages/PublicHistoriesPage.tsx
@@ -18,6 +18,7 @@ import { TalerError } from "@gnu-taler/taler-util";
import {
Attention,
Loading,
+ RouteDefinition,
useTranslationContext,
} from "@gnu-taler/web-util/browser";
import { Fragment, VNode, h } from "preact";
@@ -31,7 +32,11 @@ import {
/**
* Show histories of public accounts.
*/
-export function PublicHistoriesPage(): VNode {
+export function PublicHistoriesPage({
+ routeOverview,
+}: {
+ routeOverview?: RouteDefinition;
+}): VNode {
const { i18n } = useTranslationContext();
// TODO: implemented filter by account name
@@ -67,6 +72,28 @@ export function PublicHistoriesPage(): VNode {
return (
<section>
+ {routeOverview ? (
+ <a
+ class="mb-3 inline-flex items-center gap-2 text-sm font-semibold text-primaryDark hover:underline focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary"
+ href={routeOverview.url({})}
+ >
+ <svg
+ class="h-4 w-4"
+ fill="none"
+ viewBox="0 0 24 24"
+ stroke-width="2"
+ stroke="currentColor"
+ aria-hidden="true"
+ >
+ <path
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ d="M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"
+ />
+ </svg>
+ <i18n.Translate>Back to overview</i18n.Translate>
+ </a>
+ ) : undefined}
<header>
<h1 class="text-2xl font-bold tracking-tight text-onBackground">
<i18n.Translate>Public accounts</i18n.Translate>
diff --git a/packages/taler-harness/src/integrationtests/test-libeufin-bank-webui.ts b/packages/taler-harness/src/integrationtests/test-libeufin-bank-webui.ts
@@ -548,13 +548,19 @@ export async function runLibeufinBankWebuiCoreTest(t: GlobalTestState) {
await page
.getByRole("heading", { name: "Public accounts", exact: true })
.waitFor();
+ const publicAccountsBackToOverview = page.getByRole("link", {
+ name: "Back to overview",
+ exact: true,
+ });
+ await publicAccountsBackToOverview.waitFor();
t.assertDeepEqual(
await page
.getByRole("navigation", { name: "Bank account", exact: true })
.count(),
0,
);
- await page.goto(`${webui.url}#/account`);
+ await publicAccountsBackToOverview.click();
+ await page.waitForURL(/#\/account$/);
await logout(page);
await page.goto(`${webui.url}#/dev`);
@@ -608,6 +614,12 @@ export async function runLibeufinBankWebuiCoreTest(t: GlobalTestState) {
await page
.getByRole("heading", { name: "Public accounts", exact: true })
.waitFor();
+ t.assertDeepEqual(
+ await page
+ .getByRole("link", { name: "Back to overview", exact: true })
+ .count(),
+ 0,
+ );
await login(page, webui.url, "missing-webui-user", "missing-password");
// The token endpoint intentionally does not reveal whether an account