From 50005b06bfd38b738de6835b511378a36219060d Mon Sep 17 00:00:00 2001 From: Sebastian Date: Fri, 8 Mar 2024 23:11:45 -0300 Subject: fix #8578 --- packages/bank-ui/src/Routing.tsx | 4 ++-- packages/bank-ui/src/settings.ts | 5 ----- packages/bank-ui/src/stories.test.ts | 2 ++ packages/taler-util/src/http-client/types.ts | 8 +++++++- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/packages/bank-ui/src/Routing.tsx b/packages/bank-ui/src/Routing.tsx index f9b388ed1..75f070e4b 100644 --- a/packages/bank-ui/src/Routing.tsx +++ b/packages/bank-ui/src/Routing.tsx @@ -94,7 +94,7 @@ function PublicRounting({ const { i18n } = useTranslationContext(); const location = useCurrentLocation(publicPages); const { navigateTo } = useNavigationContext(); - const { bank, authenticator } = useBankCoreApiContext(); + const { config, authenticator } = useBankCoreApiContext(); const [notification, notify, handleError] = useLocalNotification(); useEffect(() => { @@ -145,7 +145,7 @@ function PublicRounting({ return (
-

{i18n.str`Welcome to ${settings.bankName}!`}

+

{i18n.str`Welcome to ${config.bank_name}!`}

diff --git a/packages/bank-ui/src/settings.ts b/packages/bank-ui/src/settings.ts index 91790d10d..c7c56d299 100644 --- a/packages/bank-ui/src/settings.ts +++ b/packages/bank-ui/src/settings.ts @@ -35,9 +35,6 @@ export interface BankUiSettings { // Useful for testing // default: false simplePasswordForRandomAccounts?: boolean; - // Bank name shown in the header - // default: "Taler Bank" - bankName?: string; // URL where the user is going to be redirected after // clicking in Taler Logo // default: home page @@ -55,7 +52,6 @@ export interface BankUiSettings { const defaultSettings: BankUiSettings = { backendBaseURL: buildDefaultBackendBaseURL(), iconLinkURL: undefined, - bankName: "Taler Bank", simplePasswordForRandomAccounts: false, allowRandomAccountCreation: false, topNavSites: {}, @@ -69,7 +65,6 @@ const codecForBankUISettings = (): Codec => "simplePasswordForRandomAccounts", codecOptional(codecForBoolean()), ) - .property("bankName", codecOptional(codecForString())) .property("iconLinkURL", codecOptional(codecForString())) .property("topNavSites", codecOptional(codecForMap(codecForString()))) .build("BankUiSettings"); diff --git a/packages/bank-ui/src/stories.test.ts b/packages/bank-ui/src/stories.test.ts index 8171c6d8f..207945865 100644 --- a/packages/bank-ui/src/stories.test.ts +++ b/packages/bank-ui/src/stories.test.ts @@ -59,6 +59,8 @@ function DefaultTestingContext({ const cfg: TalerCorebankApi.Config = { name: "libeufin-bank", allow_deletions: true, + bank_name: "taler bank", + wire_type: "wire t", supported_tan_channels: [], allow_registrations: true, allow_conversion: true, diff --git a/packages/taler-util/src/http-client/types.ts b/packages/taler-util/src/http-client/types.ts index e7c7eb4c9..22272d12f 100644 --- a/packages/taler-util/src/http-client/types.ts +++ b/packages/taler-util/src/http-client/types.ts @@ -265,6 +265,7 @@ export const codecForCoreBankConfig = (): Codec => buildCodecForObject() .property("name", codecForConstString("libeufin-bank")) .property("version", codecForString()) + .property("bank_name", codecForString()) .property("allow_conversion", codecForBoolean()) .property("allow_registrations", codecForBoolean()) .property("allow_deletions", codecForBoolean()) @@ -1320,6 +1321,11 @@ export namespace TalerCorebankApi { // API version in the form $n:$n:$n version: string; + // Bank display name to be used in user interfaces. + // For consistency use "Taler Bank" if missing. + // @since v4, will become mandatory in the next version. + bank_name: string; + // If 'true' the server provides local currency conversion support // If 'false' some parts of the API are not supported and return 501 allow_conversion: boolean; @@ -1355,7 +1361,7 @@ export namespace TalerCorebankApi { // Wire transfer type supported by the bank. // Default to 'iban' is missing // @since v4, may become mandatory in the future. - wire_type?: string; + wire_type: string; } export interface BankAccountCreateWithdrawalRequest { -- cgit v1.2.3