Skip to content

Commit

Permalink
Merge pull request #1954 from ever-co/improve/filter-out-suspended-me…
Browse files Browse the repository at this point in the history
…mbers-in-manage-assignees

excluded the suspended members from manage assignees popup
  • Loading branch information
evereq authored Dec 4, 2023
2 parents 5e9853e + 7180cb5 commit 493f144
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,21 @@ const ManageAssignees: React.FC<IManageAssignees> = ({ memberList, task }) => {
const assignedToTaskMembers = useMemo(
() =>
memberList?.filter((member) =>
member.employee ? task?.members.map((item) => item.userId).includes(member.employee?.userId) : false
member.employee
? task?.members.map((item) => item.userId).includes(member.employee?.userId) &&
member.employee?.isActive
: false
),
[memberList, task?.members]
);

const unassignedMembers = useMemo(
() =>
memberList?.filter((member) =>
member.employee ? !task?.members.map((item) => item.userId).includes(member.employee.userId) : false
member.employee
? !task?.members.map((item) => item.userId).includes(member.employee.userId) &&
member.employee?.isActive
: false
),
[memberList, task?.members]
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-mixed-spaces-and-tabs */
import { calculateRemainingDays, formatDateString } from '@app/helpers';
import { useOrganizationTeams, useSyncRef, useTeamMemberCard, useTeamTasks } from '@app/hooks';
import { ITeamTask, OT_Member } from '@app/interfaces';
Expand Down Expand Up @@ -217,15 +218,21 @@ const ManageMembersPopover = (memberList: OT_Member[], task: ITeamTask | null) =
const unassignedMembers = useMemo(
() =>
memberList.filter((member) =>
member.employee ? !task?.members.map((item) => item.userId).includes(member.employee.userId) : false
member.employee
? !task?.members.map((item) => item.userId).includes(member.employee.userId) &&
member.employee?.isActive
: false
),
[memberList, task?.members]
);

const assignedTaskMembers = useMemo(
() =>
memberList.filter((member) =>
member.employee ? task?.members.map((item) => item.userId).includes(member.employee?.userId) : false
member.employee
? task?.members.map((item) => item.userId).includes(member.employee?.userId) &&
member.employee?.isActive
: false
),
[memberList, task?.members]
);
Expand Down

0 comments on commit 493f144

Please sign in to comment.