Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't show GBR to AM/guides for managed customer employee invitations #40160

Merged
merged 5 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1172,6 +1172,15 @@ function isJoinRequestInAdminRoom(report: OnyxEntry<Report>): boolean {
if (!report) {
return false;
}
// If this policy isn't owned by Expensify,
// Account manager/guide should not have the workspace join request pinned to their LHN,
// since they are not a part of the company, and should not action it on their behalf.
if (report.policyID) {
const policy = getPolicy(report.policyID);
if (!PolicyUtils.isExpensifyTeam(policy.owner) && PolicyUtils.isExpensifyTeam(currentUserPersonalDetails?.login)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nkdengineer plz add a comment on why we are doing this, can inspire by this comment

// If this policy is owned by Expensify then show all support (expensify.com or team.expensify.com) emails
// We don't want to show guides as policy members unless the user is a guide. Some customers get confused when they
// see random people added to their policy, but guides having access to the policies help set them up.
if (PolicyUtils.isExpensifyTeam(details?.login ?? details?.displayName)) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Pujan92 I updated the comment. Please help to check again.

return false;
}
}
return ReportActionsUtils.isActionableJoinRequestPending(report.reportID);
}

Expand Down
2 changes: 1 addition & 1 deletion src/libs/SidebarUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ function getOptionData({

result.isIOUReportOwner = ReportUtils.isIOUOwnedByCurrentUser(result as Report);

if (ReportActionsUtils.isActionableJoinRequestPending(report.reportID)) {
if (ReportUtils.isJoinRequestInAdminRoom(report)) {
result.isPinned = true;
result.isUnread = true;
result.brickRoadIndicator = CONST.BRICK_ROAD_INDICATOR_STATUS.INFO;
Expand Down
Loading