-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to bulk select cards from the same bank in the Card filter #53389
base: main
Are you sure you want to change the base?
Add ability to bulk select cards from the same bank in the Card filter #53389
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of these stuff looks ok, although logic is pretty complex 😅
Left some small comments
src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersCardPage.tsx
Outdated
Show resolved
Hide resolved
src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersCardPage.tsx
Outdated
Show resolved
Hide resolved
src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersCardPage.tsx
Outdated
Show resolved
Hide resolved
import type {BankIcon} from '@src/types/onyx/Bank'; | ||
import {isEmptyObject} from '@src/types/utils/EmptyObject'; | ||
|
||
type CardFilterItem = Partial<OptionData> & {bankIcon?: BankIcon; lastFourPAN?: string; isVirtual?: boolean; isCardFeed?: boolean; correspondingCards?: string[]}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe everything inside optionData is optional, the only problem here would be reportID
I think? (please confirm).
If yes, then maybe instead let's do Omit< OptionData, reportID>
- that would be more explicit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sadly, we have to adapt to ListItem type, because SelectionList item has to extend it. So we connot use Omit 😞
src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersCardPage.tsx
Outdated
Show resolved
Hide resolved
src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersCardPage.tsx
Outdated
Show resolved
Hide resolved
src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersCardPage.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dropped small comments
// return 'Visa - 1234'; | ||
// }, | ||
// }; | ||
// }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clean this up
|
||
const domainFeedData = {testDomain: {domainName: 'testDomain', bank: 'Expensify Card', correspondingCardIDs: ['11111111']}}; | ||
|
||
function translateMock(key: string, obj: {cardFeedBankName: string; cardFeedLabel: string}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can simplify this mock, like we discussed on slack
return `All ${obj.cardFeedBankName}${obj.cardFeedLabel ? ` - ${obj.cardFeedLabel}` : ''}`; | ||
} | ||
|
||
describe('Build individual cards data from given cardList and workspaceCardFeeds objects', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just do describe('buildCardFeedsData')
and add at least one case with wrong data, for example empty cardFeeds or something
Explanation of Change
This PR adds Card feeds secion to Card filter on Search page, which is only visible to workspace admin. With this PR admin will be able to bulk select cards from the same feed.
PR also makes workspace admins see all the cards linked to workspace(taken from
cards_
Onyx key).Card feeds secion is built from workspace feeds(
cards_
Onyx key) and domain feeds which are separeted from cardList object(cardList
Onyx key), because right now New Dot doesn't fully support domain cards and it's the only Onyx object that contains it. Admin cannot see all domain cards yet.Fixed Issues
$ #53231
PROPOSAL: N/A
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
android.mov
Android: mWeb Chrome
androidweb.mov
iOS: Native
ios.mov
iOS: mWeb Safari
ioweb.mov
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov