fix: add filtering to a group chat invite members#47051
fix: add filtering to a group chat invite members#47051marcochavezf merged 3 commits intoExpensify:mainfrom
Conversation
|
@hoangzinh Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
Hi @TMisiukiewicz can you describe a little bit about the root cause in PR "Details" description so I can quickly pick up the issue? Thank you |
|
@hoangzinh done! |
| } | ||
| return OptionsListUtils.getHeaderMessage(invitePersonalDetails.length !== 0, !!userToInvite, searchValue); | ||
| }, [searchTerm, userToInvite, excludedUsers, invitePersonalDetails, translate, reportName]); | ||
| return OptionsListUtils.getHeaderMessage(inviteOptions.recentReports.length + inviteOptions.personalDetails.length !== 0, !!inviteOptions.userToInvite, searchValue); |
There was a problem hiding this comment.
Can you explain why do we add "inviteOptions.recentReports.length" here?
There was a problem hiding this comment.
Oh sorry for not mentioning about that, while working on this PR I found out that there is a tiny bug, when there were no results found in personal details, but there were items in recentReports, it displayed both "No results found" and list of recent options matching the search

With this change "No results found" will appear only when there is actually no items in both recentReports and personalDetails
| const inviteOptions = OptionsListUtils.getMemberInviteOptions(options.personalDetails, betas ?? [], searchTerm, excludedUsers, false, options.reports, true); | ||
| const defaultOptions = useMemo(() => { | ||
| if (!areOptionsInitialized) { | ||
| return {recentReports: [], personalDetails: [], userToInvite: null, currentUserOption: null, categoryOptions: [], tagOptions: [], taxRatesOptions: []}; |
There was a problem hiding this comment.
I think it's worth to put this into a sharable function that returns an empty options object, what do you think?
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-08-09.at.20.53.45.android.movAndroid: mWeb ChromeScreen.Recording.2024-08-09.at.20.43.05.android.chrome.moviOS: NativeScreen.Recording.2024-08-09.at.20.48.21.ios.moviOS: mWeb SafariScreen.Recording.2024-08-09.at.20.47.04.ios.safari.movMacOS: Chrome / SafariScreen.Recording.2024-08-09.at.20.03.20.web.movMacOS: DesktopScreen.Recording.2024-08-09.at.20.10.55.desktop.mov |
|
Oh there are some conflicts |
|
@marcochavezf resolved ✅ |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/marcochavezf in version: 9.0.20-0 🚀
|
|
FYI I believe this was deployed to prod yesterday, from this checklist - #47356 |
Details
For the last couple of months we were migrating searchable lists from using
searchTextproperty , which was not a performant solution, to filtering based on options properties. Recently we migrated the last list that was still usingsearchTextproperty for searching, so we removed generating it for search options, which allowed to speed up creating options by around 40%.During migration, we accidentally skipped
InviteReportParticipantsPagecomponent, so oncesearchTextproperty was removed from options, it was not possible to use search in this page. This PR brings filtering to the option list the same way it works on the other searchable pages.Fixed Issues
$ #46972
PROPOSAL:
Tests
Offline tests
n/a
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
groupFiltering-android.mp4
Android: mWeb Chrome
https://github.com/user-attachments/assets/a439f5fd-6d52-4d1c-9029-966963995375iOS: Native
groupFiltering-ios.mp4
iOS: mWeb Safari
groupFiltering-ios-web.mp4
MacOS: Chrome / Safari
groupFiltering-web.mp4
MacOS: Desktop
groupFiltering-dektop.mp4