Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ describe('convertCollaborators', () => {
avatarUrlMap: mockAvatarUrlMap,
collab: mockCollaborations[5],
currentUserId: mockOwnerId,
isCurrentUserOwner: false,
isCurrentUserOwner: true,
ownerEmailDomain,
});

Expand Down Expand Up @@ -225,7 +225,7 @@ describe('convertCollaborators', () => {
avatarUrlMap: mockAvatarUrlMap,
collab: mockCollaborations[2],
currentUserId: mockOwnerId,
isCurrentUserOwner: false,
isCurrentUserOwner: true,
ownerEmailDomain,
});

Expand Down Expand Up @@ -310,7 +310,7 @@ describe('convertCollaborators', () => {
hasCustomAvatar: false,
id: '124',
isCurrentUser: false,
isExternal: false,
isExternal: true,
isPending: false,
name: 'Raccoon Queen',
role: 'viewer',
Expand All @@ -336,7 +336,7 @@ describe('convertCollaborators', () => {
hasCustomAvatar: false,
id: '127',
isCurrentUser: false,
isExternal: false,
isExternal: true,
isPending: true,
name: 'bbear@external.example.com',
role: 'editor',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ export const convertCollab = ({
return null;
}

// External collaborator icons will only be displayed in the USM if the current user owns
// the item and if the collaborator's email domain differs from the owner's email domain.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

no

const isExternal =
!isCurrentUserOwner && !!collabEmail && !!ownerEmailDomain && collabEmail.split('@')[1] !== ownerEmailDomain;
isCurrentUserOwner && !!collabEmail && !!ownerEmailDomain && collabEmail.split('@')[1] !== ownerEmailDomain;
const avatarUrl = avatarUrlMap ? avatarUrlMap[collabId] : undefined;

return {
Expand Down
Loading