Skip to content

Commit

Permalink
excluded the suspended members from manage assignees popup
Browse files Browse the repository at this point in the history
  • Loading branch information
desperado1802 committed Dec 4, 2023
1 parent 7bea142 commit 7180cb5
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 7180cb5

Please sign in to comment.