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

Feat: Hide member if no errors and deletion is pending #18257

Merged
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
12 changes: 12 additions & 0 deletions src/pages/workspace/WorkspaceMembersPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,15 @@ class WorkspaceMembersPage extends React.Component {
return value.trim().toLowerCase().includes(keyword);
}

/**
* Check if the policy member is deleted from the workspace
* @param {Object} policyMember
* @returns {Boolean}
*/
isDeletedPolicyMember(policyMember) {
return !this.props.network.isOffline && policyMember.pendingAction === 'delete' && _.isEmpty(policyMember.errors);
}

/**
* Do not move this or make it an anonymous function it is a method
* so it will not be recreated each time we render an item
Expand Down Expand Up @@ -320,6 +329,9 @@ class WorkspaceMembersPage extends React.Component {
const removableMembers = {};
let data = [];
_.each(policyMemberList, (policyMember, email) => {
if (this.isDeletedPolicyMember(policyMember)) {
return;
}
const details = lodashGet(this.props.personalDetails, email, {displayName: email, login: email});
data.push({
...policyMember,
Expand Down