-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fix: add filtering to a group chat invite members #47051
fix: add filtering to a group chat invite members #47051
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! |
@@ -186,8 +192,8 @@ function InviteReportParticipantsPage({betas, personalDetails, report, didScreen | |||
) { | |||
return translate('messages.userIsAlreadyMember', {login: searchValue, name: reportName ?? ''}); | |||
} | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain why do we add "inviteOptions.recentReports.length" here?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's worth to put this into a sharable function that returns an empty options object, what do you think?
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.
done 👍
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 |
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.
LGTM, thanks!
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
searchText
property , which was not a performant solution, to filtering based on options properties. Recently we migrated the last list that was still usingsearchText
property 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
InviteReportParticipantsPage
component, so oncesearchText
property 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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.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
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