From 68094fe3818b5ba54c7b6e6879eb5d5a02fc12a2 Mon Sep 17 00:00:00 2001 From: Peter Hellstrand Date: Thu, 28 Nov 2024 13:44:23 +0100 Subject: [PATCH] fix(ffe-account-selector-react): format account number in drodown --- .../src/account-selector/AccountDetails.tsx | 2 +- .../src/account-selector/AccountSelector.tsx | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/ffe-account-selector-react/src/account-selector/AccountDetails.tsx b/packages/ffe-account-selector-react/src/account-selector/AccountDetails.tsx index 208301572c..dfeba24cbd 100644 --- a/packages/ffe-account-selector-react/src/account-selector/AccountDetails.tsx +++ b/packages/ffe-account-selector-react/src/account-selector/AccountDetails.tsx @@ -32,7 +32,7 @@ export function AccountDetails({ {account && ( <>
- {accountFormatter(accountNumber)} + {accountFormatter(accountNumber?.replace(/\s/g, ''))}
{showBalance && (
diff --git a/packages/ffe-account-selector-react/src/account-selector/AccountSelector.tsx b/packages/ffe-account-selector-react/src/account-selector/AccountSelector.tsx index 5ddf8e40f4..feaee9bab9 100644 --- a/packages/ffe-account-selector-react/src/account-selector/AccountSelector.tsx +++ b/packages/ffe-account-selector-react/src/account-selector/AccountSelector.tsx @@ -7,6 +7,7 @@ import { SearchableDropdown } from '@sb1/ffe-searchable-dropdown-react'; import { getAccountsWithCustomAccounts } from './getAccountsWithCustomAccounts'; import { searchMatcherIgnoringAccountNumberFormatting } from '../searchMatcherIgnoringAccountNumberFormatting'; import { texts } from '../texts'; +import { formatAccountNumber as formatAccountNumberFFE } from '@sb1/ffe-formatters'; export interface AccountSelectorProps { /** @@ -126,6 +127,9 @@ export const AccountSelector = ({ const dropdownListAccounts = accounts.map(it => ({ ...it, + accountNumber: formatAccountNumberFFE( + it.accountNumber.replace(/\s/g, ''), + ), balance: OptionBody ? it.balance : balanceWithCurrency(it.balance, locale, it.currencyCode),