taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 7d8d550a9d6679eb10a4d09de83664fb701a04bf
parent 9062038dfd433fdc5bb87fdef442a7c7f7440e64
Author: Sebastian <sebasjm@taler-systems.com>
Date:   Tue, 21 Jul 2026 18:19:44 -0300

dont import using relative

Diffstat:
Mpackages/web-util/src/components/NotificationBanner.tsx | 4+---
Mpackages/web-util/src/hooks/useNotifications.stories.tsx | 28++++++++++++++--------------
Mpackages/web-util/src/utils/buildPaginatedResult.ts | 3+--
3 files changed, 16 insertions(+), 19 deletions(-)

diff --git a/packages/web-util/src/components/NotificationBanner.tsx b/packages/web-util/src/components/NotificationBanner.tsx @@ -1,16 +1,14 @@ import { Fragment, h, VNode } from "preact"; import { useRef, useState } from "preact/compat"; -import { Duration } from "../../../taler-util/src/time.js"; import { CopyButton, - Notification, useCommonPreferences, useNotificationContext, useTranslationContext, } from "../index.browser.js"; import { Attention } from "./Attention.js"; import { composeRef, saveRef } from "./utils.js"; - +import { Duration } from "@gnu-taler/taler-util"; /** * Toasts should be considered when displaying these types of information to the user: * diff --git a/packages/web-util/src/hooks/useNotifications.stories.tsx b/packages/web-util/src/hooks/useNotifications.stories.tsx @@ -35,7 +35,7 @@ import { Notification, useNotificationHandler, } from "./useNotifications.js"; -import { dummyHttpResponse } from "../../../taler-util/src/http-common.js"; +import { HttpResponse } from "../../../taler-util/src/http-common.js"; export default { title: "Use Notifications NG", @@ -50,7 +50,7 @@ export const autoTriggered = tests.createExample(() => { const action = safe(async (ct) => { await delayMs(1500, ct); inc(); - return opEmptySuccess(dummyHttpResponse); + return opEmptySuccess({} as any); }, []); useEffect(() => { const id = setInterval(() => { @@ -101,7 +101,7 @@ export const withCancel = tests.createExample(() => { const action = safe(async (ct) => { await delayMs(5_000, ct); inc(); - return opEmptySuccess(dummyHttpResponse); + return opEmptySuccess({} as any); }, []); return ( <div> @@ -135,7 +135,7 @@ export const sharedButton = tests.createExample(() => { const action = safe(async (ct, size: number) => { await delayMs(1500, ct); inc(size); - return opEmptySuccess(dummyHttpResponse); + return opEmptySuccess({} as any); }); return ( @@ -180,7 +180,7 @@ export const conditionally = tests.createExample(() => { async (ct, s: string) => { await delayMs(500); inc(); - return opFixedSuccess(dummyHttpResponse, s); + return opFixedSuccess({} as any, s); }, name.length > 4 ? [name] : undefined, ); @@ -229,12 +229,12 @@ export const messages = tests.createExample(() => { const action = safe( async function (ct, name: string) { await delayMs(500); - if (!name.length) return opKnownFailure(dummyHttpResponse, "no-name"); + if (!name.length) return opKnownFailure({} as any, "no-name"); if (name.length <= 4) - return opKnownFailure(dummyHttpResponse, "short-name"); + return opKnownFailure({} as any, "short-name"); const id = inc(); - return opFixedSuccess(dummyHttpResponse, id); + return opFixedSuccess({} as any, id); }, [name], ); @@ -291,15 +291,15 @@ export const confirm = tests.createExample(() => { const action = safe( async function (ct, name: string, confirm?: boolean) { await delayMs(500); - if (!name.length) return opKnownFailure(dummyHttpResponse, "no-name"); + if (!name.length) return opKnownFailure({} as any, "no-name"); if (name.length <= 4) - return opKnownFailure(dummyHttpResponse, "short-name"); + return opKnownFailure({} as any, "short-name"); if (!confirm) { - return opKnownFailure(dummyHttpResponse, "confirm"); + return opKnownFailure({} as any, "confirm"); } const id = inc(); - return opFixedSuccess(dummyHttpResponse, name + id); + return opFixedSuccess({} as any, name + id); }, [name], ); @@ -401,10 +401,10 @@ export const unhandledError = tests.createExample(() => { await delayMs(1500, ct); if (!name.length) throw Error("missing name"); if (name.length <= 4) - return opKnownFailure(dummyHttpResponse, "short-name"); + return opKnownFailure({} as any, "short-name"); const id = inc(); - return opFixedSuccess(dummyHttpResponse, name + id); + return opFixedSuccess({} as any, name + id); }); action.addListener((e) => (e === "start" ? clear() : undefined)); diff --git a/packages/web-util/src/utils/buildPaginatedResult.ts b/packages/web-util/src/utils/buildPaginatedResult.ts @@ -1,6 +1,5 @@ import { assertUnreachable, OperationOk } from "@gnu-taler/taler-util"; import { useState } from "preact/hooks"; -import { dummyHttpResponse } from "../../../taler-util/src/http-common.js"; export type PaginationControl = { loadNext?(): void; @@ -34,7 +33,7 @@ export function buildPaginatedResult<R>( type: "ok", case: "ok", body, - response: dummyHttpResponse, + response: {} as any, loadNext: isLastPage ? undefined : () => {