|
|
@ -146,25 +146,13 @@ export function TeamMembersPage() { |
|
|
|
toast.success('Reminder has been sent'); |
|
|
|
toast.success('Reminder has been sent'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const enrichedMembers = teamMembers.map((member) => { |
|
|
|
const joinedMembers = teamMembers.filter( |
|
|
|
const shouldNotShowProgressWarning = |
|
|
|
|
|
|
|
team?.personalProgressOnly && |
|
|
|
|
|
|
|
!canManageCurrentTeam && |
|
|
|
|
|
|
|
member.userId !== user?.id; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
|
|
|
...member, |
|
|
|
|
|
|
|
...(shouldNotShowProgressWarning ? { hasProgress: true } : {}), |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const joinedMembers = enrichedMembers.filter( |
|
|
|
|
|
|
|
(member) => member.status === 'joined', |
|
|
|
(member) => member.status === 'joined', |
|
|
|
); |
|
|
|
); |
|
|
|
const invitedMembers = enrichedMembers.filter( |
|
|
|
const invitedMembers = teamMembers.filter( |
|
|
|
(member) => member.status === 'invited', |
|
|
|
(member) => member.status === 'invited', |
|
|
|
); |
|
|
|
); |
|
|
|
const rejectedMembers = enrichedMembers.filter( |
|
|
|
const rejectedMembers = teamMembers.filter( |
|
|
|
(member) => member.status === 'rejected', |
|
|
|
(member) => member.status === 'rejected', |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
@ -217,6 +205,11 @@ export function TeamMembersPage() { |
|
|
|
index={index} |
|
|
|
index={index} |
|
|
|
teamId={teamId} |
|
|
|
teamId={teamId} |
|
|
|
userId={user?.id!} |
|
|
|
userId={user?.id!} |
|
|
|
|
|
|
|
canViewProgress={ |
|
|
|
|
|
|
|
canManageCurrentTeam || |
|
|
|
|
|
|
|
!team?.personalProgressOnly || |
|
|
|
|
|
|
|
String(member.userId) === user?.id |
|
|
|
|
|
|
|
} |
|
|
|
onResendInvite={() => { |
|
|
|
onResendInvite={() => { |
|
|
|
resendInvite(teamId, member._id!).finally(() => { |
|
|
|
resendInvite(teamId, member._id!).finally(() => { |
|
|
|
pageProgressMessage.set(''); |
|
|
|
pageProgressMessage.set(''); |
|
|
@ -253,6 +246,7 @@ export function TeamMembersPage() { |
|
|
|
index={index} |
|
|
|
index={index} |
|
|
|
teamId={teamId} |
|
|
|
teamId={teamId} |
|
|
|
userId={user?.id!} |
|
|
|
userId={user?.id!} |
|
|
|
|
|
|
|
canViewProgress={false} |
|
|
|
onResendInvite={() => { |
|
|
|
onResendInvite={() => { |
|
|
|
resendInvite(teamId, member._id!).finally(() => { |
|
|
|
resendInvite(teamId, member._id!).finally(() => { |
|
|
|
pageProgressMessage.set(''); |
|
|
|
pageProgressMessage.set(''); |
|
|
@ -292,6 +286,7 @@ export function TeamMembersPage() { |
|
|
|
member={member} |
|
|
|
member={member} |
|
|
|
index={index} |
|
|
|
index={index} |
|
|
|
teamId={teamId} |
|
|
|
teamId={teamId} |
|
|
|
|
|
|
|
canViewProgress={false} |
|
|
|
userId={user?.id!} |
|
|
|
userId={user?.id!} |
|
|
|
onResendInvite={() => { |
|
|
|
onResendInvite={() => { |
|
|
|
resendInvite(teamId, member._id!).finally(() => { |
|
|
|
resendInvite(teamId, member._id!).finally(() => { |
|
|
|