App: [HOLD for payment 2023-05-16] [$1000] Manage member search does not reconsider search terms after space like it does throughout the website and also on invite members
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
- Open the app
- Open settings
- Open Workspaces
- Open any workspace
- Open Manage members
- Search using terms which provides no result found message, enter space and again search for users using terms that should provide users in result eg
jsdlkjfskljgthenjsdlkjfskljg lauren
Expected Result:
App should reset search after space i.e. app should start new search after space and use the new terms after space to get the results like it does on invite members and on searches throughout the website
Actual Result:
App does not reset search after space on manage members page
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
- Android / native
- Android / Chrome
- iOS / native
- iOS / Safari
- MacOS / Chrome / Safari
- MacOS / Desktop
Version Number: v1.2.93-4 Reproducible in staging?: y Reproducible in production?: y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation
Expensify/Expensify Issue URL: Issue reported by: @dhanashree-sawant Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1680334833058189
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~0160c5e8329faf9c07
- Upwork Job ID: 1646544650618916864
- Last Price Increase: 2023-04-13
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 61 (44 by maintainers)
Looks good @mollfpr. Closing now as we done! Great job everyone
Everyone has been paid in Upwork ✔️
@mollfpr let me know when you have the update ready so we can pass onto QA and close this
Sharing the timeline of this issue to help with the eventual analysis, calculated with this tool.
🐛 Issue created at: Sat, 01 Apr 2023 16:51:09 GMT 🧯 Help Wanted at: Thu, 13 Apr 2023 16:03:48 GMT 🕵🏻 Contributor assigned at: Tue, 02 May 2023 07:32:28 GMT 🛸 PR created at: Tue, 02 May 2023 08:00:54 GMT 🎯 PR merged at: Wed, 03 May 2023 15:20:51 GMT ⌛ Business Days Elapsed between assignment and PR merge: 1
https://www.upwork.com/jobs/~01860ed02433df3246 new Upwork issue here - sent offers to @mollfpr @Prince-Mendiratta @dhanashree-sawant
Upwork is being weird - I’m creating a new GH issue here https://github.com/Expensify/App/issues/18334 to manage payment of this,
offers sent to @dhanashree-sawant @Prince-Mendiratta @mollfpr in Upwork
@mollfpr it took some time to look over the proposals, but I think the one from @Prince-Mendiratta looks good. Let’s move forward. @laurenreidexpensify do you need to do the assigning?
@dukenv0307 I see that I miss
searchValue === ''from your early proposal. That’s why it’s not showing the data the first time.@PrashantMangukiya Ah yes, sorry I just tested again your solution and it seems to show all the data filtered. I got distracted by another logic.
@mollfpr -
we would follow whatever logic we have in the code here for invite members -
@mollfpr In the current behaviour, whenever the user enters a text, let’s say “User One”, the whole string is taken as one term and this single term is iterated through all possible fields that can have this term:
Each of these fields is checked for the existence of the term “User One”, one by one by calling the
isKeywordMatcheach time.The
isKeywordMatchsimply converts each field value in lowercase, removes leading/trailing spaces and matches the search keyword, which is also lowercase and trimmed.If we were to use
isSearchStringMatch, then instead of searching for “User One”, we will search all the above fields for both, “User” and “One”, the existence of either would returntrue. This is the behaviour on the Search Page, which also deals with searching for users.However, we can also create another function that’ll cater to the needs of the
WorkspaceMembersPagebetter. This would be helpful in simplifying the logic here: https://github.com/Expensify/App/blob/e8bc6a86f13fd2f5561de5e6251abffa8f890384/src/pages/workspace/WorkspaceMembersPage.js#L333-L339We can create a function
getMemberOptions, where we will delegate the logic of filtering through all the fields and checking each word. The above mentioned lines can be simplified to simply be:The function will look something like this:
Logic:
This will get us the desired results, in an easy to understand way.
Results
https://user-images.githubusercontent.com/54077356/232119498-66676e1e-361e-4445-8773-919868ea9557.mp4