[Domain Control] [Release 4] [FE] Update DomainMembersPage to filter by Security Group#81837
Conversation
|
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 |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
…-groups-filter-for-members
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7a0d882ff7
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4f3797cc32
ℹ️ 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 selectedGroupMemberIDs = matchedGroup | ||
| ? new Set( | ||
| Object.keys(matchedGroup.details.shared) |
There was a problem hiding this comment.
Guard missing shared map before computing group members
groupsSelector accepts any domain_securityGroup_* value and does not guarantee a shared object, so selecting such a group can make matchedGroup.details.shared be undefined; calling Object.keys on it throws at runtime and breaks the Members page when the filter is applied. Please default to an empty map (or validate shape) before building selectedGroupMemberIDs.
Useful? React with 👍 / 👎.
| if (!groups) { | ||
| return undefined; | ||
| } | ||
| const group = groups.find((g) => String(accountID) in g.details.shared); |
There was a problem hiding this comment.
Skip groups without shared when resolving row group labels
This lookup assumes every group has details.shared, but domain data can include partial security-group entries; in that case String(accountID) in g.details.shared throws (in on undefined) during list rendering, crashing the members table before any interaction. Add a guard for missing shared (e.g., fallback to {}) in the predicate.
Useful? React with 👍 / 👎.
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
Conflicts! And please check bot concerns above |
Updated, modified the security groups selector as well to filter if |
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
Builds are getting ready @Expensify/design @dubielzyk-expensify can you please check you are happy with the changes here? Thank you |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
src/selectors/Domain.ts
Outdated
| typeof value === 'object' && | ||
| value !== null && |
There was a problem hiding this comment.
We can use isObject from lodash to simplify this chain a bit
| const entries: Array<[string, unknown]> = Object.entries(domain); | ||
| return entries.filter(isSecurityGroupEntry).map(([key, value]) => ({ | ||
| id: key.replace(CONST.DOMAIN.DOMAIN_SECURITY_GROUP_PREFIX, ''), | ||
| details: value, |
There was a problem hiding this comment.
We can simplify it a bit to reduce the number of operations
return Object.entries(domain).reduce(
(acc, [key, value]) => {
if (isSecurityGroupEntry([key, value])) {
acc.push({
id: key.replace(CONST.DOMAIN.DOMAIN_SECURITY_GROUP_PREFIX, ''),
details: value,
});
}
return acc;
},
[],
);
There was a problem hiding this comment.
It was reduce before but I find the current version more redable. reduce does one less pass over the array but both solutions are effectively O(n)
mountiny
left a comment
There was a problem hiding this comment.
Thanks for testing and the review
| shouldShowRightCaret?: boolean; | ||
| /** Adjusts for fixed width avatar component in the first column */ | ||
| shouldAdjustWidthForAvatar?: boolean; | ||
| containerStyles?: StyleProp<ViewStyle>; |
There was a problem hiding this comment.
Overall I think we will need to improve this with the decomposition pattern
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.3.37-0 🚀
|
|
Deploy Blocker #85168 was identified to be related to this PR. |
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.3.37-10 🚀
|
Explanation of Change
This PR adds the ability to filter domain members by security group on the Members page.
Fixed Issues
$ #80135
PROPOSAL:
Tests
Pre requisites:
Domain membersAll membersbutton on the top left of the listOffline tests
Same as tests
QA Steps
Same as test
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand 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
0094.android.native.mov
Android: mWeb Chrome
0094.android.chrome.mov
iOS: Native
0094.ios.native.mov
iOS: mWeb Safari
0094.ios.safari.mov
MacOS: Chrome / Safari
Screen.Recording.2026-02-09.at.10.44.27.mov