From 7ce633af90f52475bff7238adf7cfcbec2d5628b Mon Sep 17 00:00:00 2001 From: Nicolay Arefyeu Date: Fri, 15 Nov 2024 17:30:39 +0200 Subject: [PATCH 1/3] Show card name instead of Bank for Company cards search --- .../SearchAdvancedFiltersPage/SearchFiltersCardPage.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersCardPage.tsx b/src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersCardPage.tsx index 67c8a6c9e09e..fd31cb635259 100644 --- a/src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersCardPage.tsx +++ b/src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersCardPage.tsx @@ -14,6 +14,7 @@ import type {CategorySection} from '@libs/OptionsListUtils'; import type {OptionData} from '@libs/ReportUtils'; import Navigation from '@navigation/Navigation'; import * as SearchActions from '@userActions/Search'; +import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; @@ -32,11 +33,10 @@ function SearchFiltersCardPage() { .sort((a, b) => a.bank.localeCompare(b.bank)) .map((card) => { const icon = getBankIcon({bankName: card.bank as BankName, isCard: true, styles}); - return { lastFourPAN: card.lastFourPAN, isVirtual: card?.nameValuePairs?.isVirtual, - text: card.bank, + text: card.bank === CONST.EXPENSIFY_CARD.BANK ? card.bank : card?.nameValuePairs?.cardTitle ?? card?.cardName, keyForList: card.cardID.toString(), isSelected: newCards.includes(card.cardID.toString()), bankIcon: icon, From 2d805dbe2ab44c083b3eb9f4469f260bc1d3d38f Mon Sep 17 00:00:00 2001 From: Nicolay Arefyeu Date: Fri, 15 Nov 2024 17:32:57 +0200 Subject: [PATCH 2/3] line --- .../Search/SearchAdvancedFiltersPage/SearchFiltersCardPage.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersCardPage.tsx b/src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersCardPage.tsx index fd31cb635259..4b6496e81f6b 100644 --- a/src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersCardPage.tsx +++ b/src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersCardPage.tsx @@ -33,6 +33,7 @@ function SearchFiltersCardPage() { .sort((a, b) => a.bank.localeCompare(b.bank)) .map((card) => { const icon = getBankIcon({bankName: card.bank as BankName, isCard: true, styles}); + return { lastFourPAN: card.lastFourPAN, isVirtual: card?.nameValuePairs?.isVirtual, From a0ec0c432a0e1a43e1b6aa77568774635847b8bf Mon Sep 17 00:00:00 2001 From: Nicolay Arefyeu Date: Tue, 19 Nov 2024 14:18:13 +0200 Subject: [PATCH 3/3] update after c+ review --- .../SearchAdvancedFiltersPage/SearchFiltersCardPage.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersCardPage.tsx b/src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersCardPage.tsx index 4b6496e81f6b..92d07c3caffc 100644 --- a/src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersCardPage.tsx +++ b/src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersCardPage.tsx @@ -33,11 +33,13 @@ function SearchFiltersCardPage() { .sort((a, b) => a.bank.localeCompare(b.bank)) .map((card) => { const icon = getBankIcon({bankName: card.bank as BankName, isCard: true, styles}); + const cardName = card?.nameValuePairs?.cardTitle ?? card?.cardName; + const text = card.bank === CONST.EXPENSIFY_CARD.BANK ? card.bank : cardName; return { lastFourPAN: card.lastFourPAN, isVirtual: card?.nameValuePairs?.isVirtual, - text: card.bank === CONST.EXPENSIFY_CARD.BANK ? card.bank : card?.nameValuePairs?.cardTitle ?? card?.cardName, + text, keyForList: card.cardID.toString(), isSelected: newCards.includes(card.cardID.toString()), bankIcon: icon,