[No QA]: Create a list of restricted login - #62079
Conversation
|
@marcochavezf 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] |
|
cc @grgia |
| }: GetOptionsConfig = {}, | ||
| ): Options { | ||
| const userHasReportWithManagerMcTest = Object.values(options.reports).some((report) => isManagerMcTestReport(report)); | ||
| const restrictedLogins = getRestrictedLogins(config, options, canShowManagerMcTest); |
There was a problem hiding this comment.
Not sure if we should pass down canShowManagerMcTest for this method
There was a problem hiding this comment.
its a bit misleading to pass it as true and then still have it end up as false
There was a problem hiding this comment.
canShowManagerMcTest is a flag to mark whether ManagerMcTest should be displayed or not in that place. For example, we only expect that ManagerMcTest displays on screen 1, then in screen 1 we will pass canShowManagerMcTest is true. But it doesn't mean that if canShowManagerMcTest is true, we will always display the ManagerMcTest option, we still need to check other conditions. Note that It is "canShow" not "shouldShow"
| function getRestrictedLogins(config: GetOptionsConfig, options: OptionList, canShowManagerMcTest: boolean): Record<string, boolean> { | ||
| const userHasReportWithManagerMcTest = Object.values(options.reports).some((report) => isManagerMcTestReport(report)); | ||
| return { | ||
| [CONST.EMAIL.MANAGER_MCTEST]: | ||
| !canShowManagerMcTest || | ||
| (getIsUserSubmittedExpenseOrScannedReceipt() && !userHasReportWithManagerMcTest) || | ||
| !Permissions.canUseManagerMcTest(config.betas) || | ||
| isUserInvitedToWorkspace(), | ||
| }; | ||
| } | ||
|
|
There was a problem hiding this comment.
Im wondering about other logins, like concierge or notifications, etc. that are also omitted
There was a problem hiding this comment.
concierge, notifications,.. already been handled in the excludedLogin param
|
@grgia Let me summarize that we already implemented in the codebase first App/src/libs/OptionsListUtils.ts Lines 1695 to 1700 in c4d89f0 The For example, let's see one place that is using App/src/pages/workspace/WorkspaceInvitePage.tsx Lines 78 to 91 in c4d89f0 When using In the case of MANAGER_MCTEST, this option isn't always excluded from getValidOptions function, we only exclude it if it satisfies the condition. So at this time, we even don't need to filter out these options on getValidOptions itself anymore. because when triggering getValidOptions we have already included it in the excludeLogins param. I want to confirm again your requirement: you want to move all logic to filter our excluded option to getValidOptions function itself and remove the excludeLogins param, right? |
I don't think we need to remove the excludeLogins param necessarily. There are probably cases where we exclude more than th restricted accounts. Ideally we want to create a LIST of restricted accounts like Manager McTest that we can add to as needed and will always be omitted from these places |
de53403 to
e363c52
Compare
|
@grgia I replied to your comments. Back to you |
grgia
left a comment
There was a problem hiding this comment.
thanks for the updates @DylanDylann. Minor request
|
@grgia Back to you |
|
@grgia Do we need a C+ to review? |
|
@DylanDylann yea let's have a C+ review |
|
Hi, I can help review based on this comment here: https://expensify.slack.com/archives/C02NK2DQWUX/p1749212047995279 |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2025-06-06.at.19.30.07.movAndroid: mWeb ChromeScreen.Recording.2025-06-06.at.19.27.14.moviOS: HybridAppScreen.Recording.2025-06-06.at.19.29.34.moviOS: mWeb SafariScreen.Recording.2025-06-06.at.19.25.59.movMacOS: Chrome / SafariScreen.Recording.2025-06-06.at.19.24.15.movMacOS: DesktopScreen.Recording.2025-06-06.at.19.30.49.mov |
|
🎯 @dukenv0307, thanks for reviewing and testing this PR! 🎉 An E/App issue has been created to issue payment here: #63647. |
|
Code looks good and tests well |
|
✋ 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.1.63-0 🚀
|
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.1.63-6 🚀
|
Explanation of Change
Fixed Issues
$ https://expensify.slack.com/archives/C08H9A65QNP/p1746783167005779
PROPOSAL:
Tests
Offline tests
QA Steps
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))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
Screen.Recording.2025-05-15.at.14.30.42.mov