[Manager McTest] Clean up - Do not show Manager McTest for new users who are invited to a workspace#59660
Conversation
|
@DylanDylann 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] |
src/libs/OptionsListUtils.ts
Outdated
| ): Options { | ||
| const userHasReportWithManagerMcTest = canShowManagerMcTest && Object.values(options.reports).some((report) => isManagerMcTestReport(report)); | ||
| // If user has a workspace that he doesn't own, it means he was invited to it. | ||
| const isUserInvitedToWorkspace = Object.values(policies ?? {}).some((policy) => policy?.ownerAccountID !== currentUserAccountID && policy?.isPolicyExpenseChatEnabled); |
There was a problem hiding this comment.
| const isUserInvitedToWorkspace = Object.values(policies ?? {}).some((policy) => policy?.ownerAccountID !== currentUserAccountID && policy?.isPolicyExpenseChatEnabled); | |
| const isUserInvitedToWorkspace = Object.values(policies ?? {}).some((policy) => policy?.ownerAccountID !== currentUserAccountID && policy?.isPolicyExpenseChatEnabled && policy?.policyID && policy?.policyID !== CONST.POLICY.ID_FAKE); |
|
@JKobrynski In this case, We also should disable the test scanning tooltip ??? Screen.Recording.2025-04-08.at.15.35.22.mov |
|
I think so, does it only reproduce on this branch or main too? If it reproduces on main, we should create a separate issue for it |
|
🚧 @grgia has triggered a test app build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2025-04-09.at.11.33.33.movAndroid: mWeb ChromeScreen.Recording.2025-04-09.at.11.27.30.moviOS: NativeScreen.Recording.2025-04-09.at.11.29.14.moviOS: mWeb SafariScreen.Recording.2025-04-09.at.11.23.19.movMacOS: Chrome / SafariScreen.Recording.2025-04-09.at.11.14.56.mov |
src/libs/OptionsListUtils.ts
Outdated
| }: GetOptionsConfig = {}, | ||
| ): Options { | ||
| const userHasReportWithManagerMcTest = canShowManagerMcTest && Object.values(options.reports).some((report) => isManagerMcTestReport(report)); | ||
| // If user has a workspace that he doesn't own, it means he was invited to it. |
There was a problem hiding this comment.
| // If user has a workspace that he doesn't own, it means he was invited to it. | |
| // If user has a workspace that he isn't owner, it means he was invited to it. |
|
✋ 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/grgia in version: 9.1.26-0 🚀
|
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.1.26-10 🚀
|
| const userHasReportWithManagerMcTest = canShowManagerMcTest && Object.values(options.reports).some((report) => isManagerMcTestReport(report)); | ||
| // If user has a workspace that he isn't owner, it means he was invited to it. | ||
| const isUserInvitedToWorkspace = Object.values(policies ?? {}).some( | ||
| (policy) => policy?.ownerAccountID !== currentUserAccountID && policy?.isPolicyExpenseChatEnabled && policy?.id && policy.id !== CONST.POLICY.ID_FAKE, |
There was a problem hiding this comment.
Manager McTest should not appear for the user who created the workspace. We fixed this in #65359

…ed to workspaces
Explanation of Change
Exclude Manager McTest from recipients list for users who have a workspace that they are not an owner of - this basically means, they were invited to the workspace thus they shouldn't be able to access Manager McTest.
Fixed Issues
$ #59208
PROPOSAL: N/A
Tests
Offline tests
N/A
QA Steps
Same as Tests section above
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))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
MacOS: Chrome / Safari
web1-compressed.mov
web2-compressed.mov
web3-compressed.mov