-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(member-group): Team (#2616) * feat: member-group schema define * feat(fe): create group * feat: add group edit modal * feat(fe): add avatar group component * feat: edit group fix: permission select menu style * feat: bio-mode support for select-member component * fix: avatar group key unique * feat: group manage * feat: divide member into group and clbs * feat: finish team permission * chore: adjust * fix: get clbs * perf: groups code * pref: member group for team (#2706) * chore: fe adjust fix: remove the member from groups when removing from team feat: change the groups avatar when updating the team's avatar * chore: DefaultGroupName as a constant string '' * fix: create default group when create team for root * feat: comment * feat: 4811 init * pref: member group for team (#2732) * chore: default group name * feat: get default group when get by tmbid * feat(fe): adjust * member ui * fix: delete group (#2736) * perf: init4811 * pref: member group (#2818) * fix: update clb per then refetch clb list * fix: calculate group permission * feat(fe): group tag * refactor(fe): team and group manage * feat: manage group member * feat: add group transfer owner modal * feat: group manage member * chore: adjust the file structure * pref: member group * chore: adjust fe style * fix: ts error * chore: fe adjust * chore: fe adjust * chore: adjust * chore: adjust the code * perf: i18n and schema name * pref: member-group (#2862) * feat: group list ordered by updateTime * fix: transfer ownership of group when deleting member * fix: i18n fix * feat: can not set member as admin/owner when user is not active * fix: GroupInfoModal hover input do not change color * fix(fe): searchinput do not scroll * perf: team group ui * doc * remove enum --------- Co-authored-by: Finley Ge <[email protected]>
- Loading branch information
Showing
80 changed files
with
2,663 additions
and
744 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export const HUMAN_ICON = `/icon/human.svg`; | ||
export const LOGO_ICON = `/icon/logo.svg`; | ||
export const HUGGING_FACE_ICON = `/imgs/model/huggingface.svg`; | ||
export const DEFAULT_TEAM_AVATAR = `/imgs/avatar/defaultTeamAvatar.svg`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
packages/global/support/permission/memberGroup/constant.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { PermissionKeyEnum, PermissionList } from '../constant'; | ||
import { PermissionListType } from '../type'; | ||
|
||
export enum GroupMemberRole { | ||
owner = 'owner', | ||
admin = 'admin', | ||
member = 'member' | ||
} | ||
|
||
export const memberGroupPermissionList: PermissionListType = { | ||
[PermissionKeyEnum.read]: { | ||
...PermissionList[PermissionKeyEnum.read], | ||
value: 0b100 | ||
}, | ||
[PermissionKeyEnum.write]: { | ||
...PermissionList[PermissionKeyEnum.write], | ||
value: 0b010 | ||
}, | ||
[PermissionKeyEnum.manage]: { | ||
...PermissionList[PermissionKeyEnum.manage], | ||
value: 0b001 | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { TeamMemberItemType } from 'support/user/team/type'; | ||
import { TeamPermission } from '../user/controller'; | ||
import { GroupMemberRole } from './constant'; | ||
|
||
type MemberGroupSchemaType = { | ||
_id: string; | ||
teamId: string; | ||
name: string; | ||
avatar: string; | ||
updateTime: Date; | ||
}; | ||
|
||
type GroupMemberSchemaType = { | ||
groupId: string; | ||
tmbId: string; | ||
role: `${GroupMemberRole}`; | ||
}; | ||
|
||
type MemberGroupType = MemberGroupSchemaType & { | ||
members: { | ||
tmbId: string; | ||
role: `${GroupMemberRole}`; | ||
}[]; // we can get tmb's info from other api. there is no need but only need to get tmb's id | ||
permission: TeamPermission; | ||
}; | ||
|
||
type MemberGroupListType = MemberGroupType[]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
import { PermissionKeyEnum, PermissionList, ReadPermissionVal } from '../constant'; | ||
import { PermissionKeyEnum } from '../constant'; | ||
import { PermissionListType } from '../type'; | ||
import { i18nT } from '../../../../web/i18n/utils'; | ||
import { PermissionList } from '../constant'; | ||
export const TeamPermissionList: PermissionListType = { | ||
[PermissionKeyEnum.read]: { | ||
...PermissionList[PermissionKeyEnum.read], | ||
description: i18nT('user:permission_des.read') | ||
value: 0b100 | ||
}, | ||
[PermissionKeyEnum.write]: { | ||
...PermissionList[PermissionKeyEnum.write], | ||
description: i18nT('user:permission_des.write') | ||
value: 0b010 | ||
}, | ||
[PermissionKeyEnum.manage]: { | ||
...PermissionList[PermissionKeyEnum.manage], | ||
description: i18nT('user:permission_des.manage') | ||
value: 0b001 | ||
} | ||
}; | ||
|
||
export const TeamDefaultPermissionVal = ReadPermissionVal; | ||
export const TeamReadPermissionVal = TeamPermissionList['read'].value; | ||
export const TeamWritePermissionVal = TeamPermissionList['write'].value; | ||
export const TeamManagePermissionVal = TeamPermissionList['manage'].value; | ||
export const TeamDefaultPermissionVal = TeamReadPermissionVal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { GroupMemberRole } from '../../../../support/permission/memberGroup/constant'; | ||
|
||
export type postCreateGroupData = { | ||
name: string; | ||
avatar?: string; | ||
memberIdList?: string[]; | ||
}; | ||
|
||
export type putUpdateGroupData = { | ||
groupId: string; | ||
name?: string; | ||
avatar?: string; | ||
memberList?: { | ||
tmbId: string; | ||
role: `${GroupMemberRole}`; | ||
}[]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const DefaultGroupName = 'DEFAULT_GROUP'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.