From 0d9f54cbf35391bb4cd95c30c3b09eb80b31cc42 Mon Sep 17 00:00:00 2001 From: Finley Ge <32237950+FinleyGe@users.noreply.github.com> Date: Tue, 14 Jan 2025 19:16:52 +0800 Subject: [PATCH] fix: scroll fetch (#3592) --- .../permission/MemberManager/MemberModal.tsx | 245 +++++++++--------- 1 file changed, 124 insertions(+), 121 deletions(-) diff --git a/projects/app/src/components/support/permission/MemberManager/MemberModal.tsx b/projects/app/src/components/support/permission/MemberManager/MemberModal.tsx index 46ab85954d76..21b45d4ef2c6 100644 --- a/projects/app/src/components/support/permission/MemberManager/MemberModal.tsx +++ b/projects/app/src/components/support/permission/MemberManager/MemberModal.tsx @@ -51,7 +51,7 @@ function MemberModal({ addPermissionOnly?: boolean; }) { const { t } = useTranslation(); - const { userInfo, myGroups } = useUserStore(); + const { userInfo } = useUserStore(); const collaboratorList = useContextSelector(CollaboratorContext, (v) => v.collaboratorList); const [searchText, setSearchText] = useState(''); const [filterClass, setFilterClass] = useState<'member' | 'org' | 'group'>(); @@ -299,130 +299,133 @@ function MemberModal({ )} - - - {filterMembers.map((member) => { - const onChange = () => { - setSelectedMembers((state) => { - if (state.includes(member.tmbId)) { - return state.filter((v) => v !== member.tmbId); - } - return [...state, member.tmbId]; - }); - }; - const collaborator = collaboratorList?.find((v) => v.tmbId === member.tmbId); - return ( - - - - - {member.memberName} - - - - ); - })} - {filterOrgs.map((org) => { - const onChange = () => { - setSelectedOrgIdList((state) => { - if (state.includes(org._id)) { - return state.filter((v) => v !== org._id); - } - return [...state, org._id]; - }); - }; - const collaborator = collaboratorList?.find((v) => v.orgId === org._id); - return ( - - - - - {org.name} - {org.count && ( - <> - - {org.count} - - - )} - - + + {filterMembers.map((member) => { + const onChange = () => { + setSelectedMembers((state) => { + if (state.includes(member.tmbId)) { + return state.filter((v) => v !== member.tmbId); + } + return [...state, member.tmbId]; + }); + }; + const collaborator = collaboratorList?.find((v) => v.tmbId === member.tmbId); + return ( + + + + + {member.memberName} + + + + ); + })} + {filterOrgs.map((org) => { + const onChange = () => { + setSelectedOrgIdList((state) => { + if (state.includes(org._id)) { + return state.filter((v) => v !== org._id); + } + return [...state, org._id]; + }); + }; + const collaborator = collaboratorList?.find((v) => v.orgId === org._id); + return ( + + + + + {org.name} {org.count && ( - { - setParentPath(getOrgChildrenPath(org)); - }} - /> + <> + + {org.count} + + )} - ); - })} - {filterGroups.map((group) => { - const onChange = () => { - setSelectedGroupIdList((state) => { - if (state.includes(group._id)) { - return state.filter((v) => v !== group._id); - } - return [...state, group._id]; - }); - }; - const collaborator = collaboratorList?.find((v) => v.groupId === group._id); - return ( - - + {org.count && ( + { + setParentPath(getOrgChildrenPath(org)); + }} /> - - - {group.name === DefaultGroupName ? userInfo?.team.teamName : group.name} - - - - ); - })} - - + )} + + ); + })} + {filterGroups.map((group) => { + const onChange = () => { + setSelectedGroupIdList((state) => { + if (state.includes(group._id)) { + return state.filter((v) => v !== group._id); + } + return [...state, group._id]; + }); + }; + const collaborator = collaboratorList?.find((v) => v.groupId === group._id); + return ( + + + + + {group.name === DefaultGroupName ? userInfo?.team.teamName : group.name} + + + + ); + })} +