Skip to content

Commit

Permalink
fix: fe
Browse files Browse the repository at this point in the history
  • Loading branch information
FinleyGe committed Jan 10, 2025
1 parent e3b9f54 commit c4151f6
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 28 deletions.
56 changes: 29 additions & 27 deletions projects/app/src/pages/account/team/components/MemberTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { useRequest2 } from '@fastgpt/web/hooks/useRequest';
import { delLeaveTeam } from '@/web/support/user/team/api';
import { syncMembers } from '@/web/support/user/api';
import MyLoading from '@fastgpt/web/components/common/MyLoading';
import { TeamMemberRoleEnum } from '@fastgpt/global/support/user/team/constant';

const InviteModal = dynamic(() => import('./InviteModal'));
const TeamTagModal = dynamic(() => import('@/components/support/user/team/TeamTagModal'));
Expand All @@ -54,7 +55,7 @@ function MemberTable({ Tabs }: { Tabs: React.ReactNode }) {
const { ConfirmModal: ConfirmRemoveMemberModal, openConfirm: openRemoveMember } = useConfirm({
type: 'delete'
});
const isSyncMember = userInfo?.username === 'root' && feConfigs.register_method?.includes('sync');
const isSyncMember = feConfigs.register_method?.includes('sync');

const { runAsync: onLeaveTeam } = useRequest2(
async () => {
Expand Down Expand Up @@ -200,32 +201,33 @@ function MemberTable({ Tabs }: { Tabs: React.ReactNode }) {
</Td>
{!isSyncMember && (
<Td>
userInfo?.team.permission.hasManagePer && item.role !==
TeamMemberRoleEnum.owner && item.tmbId !== userInfo?.team.tmbId && (
<Icon
name={'common/trash'}
cursor={'pointer'}
w="1rem"
p="1"
borderRadius="sm"
_hover={{
color: 'red.600',
bgColor: 'myGray.100'
}}
onClick={() => {
openRemoveMember(
() =>
delRemoveMember(item.tmbId).then(() =>
Promise.all([refetchGroups(), refetchMembers()])
),
undefined,
t('account_team:remove_tip', {
username: item.memberName
})
)();
}}
/>
)
{userInfo?.team.permission.hasManagePer &&
item.role !== TeamMemberRoleEnum.owner &&
item.tmbId !== userInfo?.team.tmbId && (
<Icon
name={'common/trash'}
cursor={'pointer'}
w="1rem"
p="1"
borderRadius="sm"
_hover={{
color: 'red.600',
bgColor: 'myGray.100'
}}
onClick={() => {
openRemoveMember(
() =>
delRemoveMember(item.tmbId).then(() =>
Promise.all([refetchGroups(), refetchMembers()])
),
undefined,
t('account_team:remove_tip', {
username: item.memberName
})
)();
}}
/>
)}
</Td>
)}
</Tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function OrgTable({ Tabs }: { Tabs: React.ReactNode }) {
const { members } = useContextSelector(TeamContext, (v) => v);
const { feConfigs } = useSystemStore();

const isSyncMember = userInfo?.username === 'root' && feConfigs.register_method?.includes('sync');
const isSyncMember = feConfigs.register_method?.includes('sync');
const [parentPath, setParentPath] = useState('');
const {
data: orgs = [],
Expand Down

0 comments on commit c4151f6

Please sign in to comment.