-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Filter out assigned guides from the policy members #16338
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e007b95
Filter out assigned guides from the policy members
marcaaron 62082cb
remove eslint disable rule
marcaaron 45ffd35
disable for Expensify
marcaaron aaa1024
Merge branch 'main' into marcaaron-hideAssignedGuides
marcaaron c27b780
fix trailing space
marcaaron 0f0f885
remove unnecessary style
marcaaron File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,8 @@ import * as ReportUtils from '../../libs/ReportUtils'; | |
import FormHelpMessage from '../../components/FormHelpMessage'; | ||
import TextInput from '../../components/TextInput'; | ||
import KeyboardDismissingFlatList from '../../components/KeyboardDismissingFlatList'; | ||
import withCurrentUserPersonalDetails from '../../components/withCurrentUserPersonalDetails'; | ||
import * as PolicyUtils from '../../libs/PolicyUtils'; | ||
|
||
const propTypes = { | ||
/** The personal details of the person who is logged in */ | ||
|
@@ -235,11 +237,11 @@ class WorkspaceMembersPage extends React.Component { | |
} | ||
|
||
/** | ||
* @param {String} value | ||
* @param {String} [value = ''] | ||
* @param {String} keyword | ||
* @returns {Boolean} | ||
*/ | ||
isKeywordMatch(value, keyword) { | ||
isKeywordMatch(value = '', keyword) { | ||
return value.trim().toLowerCase().includes(keyword); | ||
} | ||
|
||
|
@@ -323,6 +325,19 @@ class WorkspaceMembersPage extends React.Component { | |
|| this.isKeywordMatch(member.firstName, searchValue) | ||
|| this.isKeywordMatch(member.lastName, searchValue)); | ||
|
||
// eslint-disable-next-line arrow-body-style | ||
data = _.reject(data, (member) => { | ||
// If this policy is owned by Expensify then show all support (expensify.com or team.expensify.com) emails | ||
if (PolicyUtils.isExpensifyTeam(lodashGet(this.props.policy, 'owner'))) { | ||
return; | ||
} | ||
Comment on lines
+329
to
+332
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This caused a "bug" #17252. The root cause was internal, just noting here for reference. If we delete the workspace the owner would be |
||
|
||
// We don't want to show guides as policy members unless the user is not 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. | ||
const isCurrentUserExpensifyTeam = PolicyUtils.isExpensifyTeam(this.props.currentUserPersonalDetails.login); | ||
return !isCurrentUserExpensifyTeam && PolicyUtils.isExpensifyTeam(member.login); | ||
}); | ||
|
||
_.each(data, (member) => { | ||
if (member.login === this.props.session.email || member.login === this.props.policy.owner || member.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) { | ||
return; | ||
|
@@ -414,13 +429,11 @@ class WorkspaceMembersPage extends React.Component { | |
/> | ||
</View> | ||
) : ( | ||
!_.isEmpty(policyMemberList) && ( | ||
<View style={[styles.ph5]}> | ||
<Text style={[styles.textLabel, styles.colorMuted]}> | ||
{this.props.translate('common.noResultsFound')} | ||
</Text> | ||
</View> | ||
) | ||
<View style={[styles.ph5]}> | ||
<Text style={[styles.textLabel, styles.colorMuted]}> | ||
{this.props.translate('common.noResultsFound')} | ||
</Text> | ||
</View> | ||
)} | ||
</View> | ||
</FullPageNotFoundView> | ||
|
@@ -446,4 +459,5 @@ export default compose( | |
key: ONYXKEYS.SESSION, | ||
}, | ||
}), | ||
withCurrentUserPersonalDetails, | ||
)(WorkspaceMembersPage); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NAB: We already have other arrow-body-style functions, so I think this is not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a disable next line not disable for the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're right it's not needed though because the style is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That comment is for when you want to use a curly brace for style reasons but the linter wants you to do it all on one line.