feat: Make the Workspace and Domain member filter list multi-select, and update All members to Members (V2)#94122
Conversation
… for role filtering
…rsFilterButton for group filtering
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx ts-node ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e59f3778be
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const isEditor = employee?.role === CONST.POLICY.ROLE.EDITOR; | ||
| const isMember = !isAdmin && !isApprover && !isAuditor && !isCardAdmin && !isEditor; | ||
|
|
||
| return selectedRoleFilters.some(({value}) => { |
There was a problem hiding this comment.
Clear unavailable role filters before applying them
If the workspace type changes while this page is mounted, selectedRoleFilters can still contain roles that are no longer present in roleFilterOptions (for example, select Auditor/Card Admin on a Control workspace, then switch to a Collect workspace or receive that policy update). Because the filter still iterates over the stale selected values here, the member list remains filtered by a role that the dropdown no longer shows, and the label can degrade to Role: with no checked item to unselect except using Reset. Please derive the active selection from the current roleFilterOptions before filtering/labeling, like the previous fallback did.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Yes this can be happen as edge case, I'll update theeffectiveRoleFilter behavior for multi-select by deriving effectiveSelectedRoleFilters from the current roleFilterOptions before filtering and labeling. That will prevents stale role selections from sticking around after the workspace type changes to collect or any group removed in domain members.
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
Explanation of Change
Add multi-select filters on Workspace members (role) and Domain Members (group), replacing single-select dropdowns so users can filter by multiple roles or groups at once. Filter label text now show selected values with proper truncation when sharing a row with search bar.
Fixed Issues
$ #90637
PROPOSAL: #90637 (comment)
Tests
Precondition:
Test 01
Role: Members, Admins, Approvers).Test 02
Group: Managers.Offline tests
QA Steps
Same as tests
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)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
android.native.mp4
Android: mWeb Chrome
android.mWeb.Chrome.mp4
iOS: Native
IOS.Native.mp4
iOS: mWeb Safari
IOS.mWeb.Safari.mp4
MacOS: Chrome / Safari
macOS.Chrome.mp4