mirror of
https://github.com/mattermost/focalboard.git
synced 2025-01-08 15:06:08 +02:00
add setting admin role when add member (#3961)
* add setting admin role when add member * change variable name
This commit is contained in:
parent
3025690b08
commit
590540e887
@ -120,14 +120,15 @@ const MarkdownEditorInput = (props: Props): ReactElement => {
|
||||
const [editorState, setEditorState] = useState(() => generateEditorState(initialText))
|
||||
|
||||
const addUser = useCallback(async (userId: string, role: string) => {
|
||||
const minimumRole = role || MemberRole.Viewer
|
||||
const newRole = role || MemberRole.Viewer
|
||||
const newMember = {
|
||||
boardId: board.id,
|
||||
userId,
|
||||
roles: role,
|
||||
schemeEditor: minimumRole === MemberRole.Editor,
|
||||
schemeCommenter: minimumRole === MemberRole.Editor || minimumRole === MemberRole.Commenter,
|
||||
schemeViewer: minimumRole === MemberRole.Editor || minimumRole === MemberRole.Commenter || minimumRole === MemberRole.Viewer,
|
||||
schemeAdmin: newRole === MemberRole.Admin,
|
||||
schemeEditor: newRole === MemberRole.Admin || MemberRole.Editor,
|
||||
schemeCommenter: newRole === MemberRole.Admin || MemberRole.Editor || newRole === MemberRole.Commenter,
|
||||
schemeViewer: newRole === MemberRole.Admin || MemberRole.Editor || newRole === MemberRole.Commenter || newRole === MemberRole.Viewer,
|
||||
} as BoardMember
|
||||
|
||||
setConfirmAddUser(null)
|
||||
|
@ -110,14 +110,15 @@ const MultiPerson = (props: PropertyProps): JSX.Element => {
|
||||
}
|
||||
|
||||
const addUser = useCallback(async (userId: string, role: string) => {
|
||||
const minimumRole = role || MemberRole.Viewer
|
||||
const newRole = role || MemberRole.Viewer
|
||||
const newMember = {
|
||||
boardId: board.id,
|
||||
userId,
|
||||
roles: role,
|
||||
schemeEditor: minimumRole === MemberRole.Editor,
|
||||
schemeCommenter: minimumRole === MemberRole.Editor || minimumRole === MemberRole.Commenter,
|
||||
schemeViewer: minimumRole === MemberRole.Editor || minimumRole === MemberRole.Commenter || minimumRole === MemberRole.Viewer,
|
||||
schemeAdmin: newRole === MemberRole.Admin,
|
||||
schemeEditor: newRole === MemberRole.Admin || MemberRole.Editor,
|
||||
schemeCommenter: newRole === MemberRole.Admin || MemberRole.Editor || newRole === MemberRole.Commenter,
|
||||
schemeViewer: newRole === MemberRole.Admin || MemberRole.Editor || newRole === MemberRole.Commenter || newRole === MemberRole.Viewer,
|
||||
} as BoardMember
|
||||
|
||||
setConfirmAddUser(null)
|
||||
|
@ -94,14 +94,15 @@ const Person = (props: PropertyProps): JSX.Element => {
|
||||
}
|
||||
|
||||
const addUser = useCallback(async (userId: string, role: string) => {
|
||||
const minimumRole = role || MemberRole.Viewer
|
||||
const newRole = role || MemberRole.Viewer
|
||||
const newMember = {
|
||||
boardId: board.id,
|
||||
userId,
|
||||
roles: role,
|
||||
schemeEditor: minimumRole === MemberRole.Editor,
|
||||
schemeCommenter: minimumRole === MemberRole.Editor || minimumRole === MemberRole.Commenter,
|
||||
schemeViewer: minimumRole === MemberRole.Editor || minimumRole === MemberRole.Commenter || minimumRole === MemberRole.Viewer,
|
||||
schemeAdmin: newRole === MemberRole.Admin,
|
||||
schemeEditor: newRole === MemberRole.Admin || MemberRole.Editor,
|
||||
schemeCommenter: newRole === MemberRole.Admin || MemberRole.Editor || newRole === MemberRole.Commenter,
|
||||
schemeViewer: newRole === MemberRole.Admin || MemberRole.Editor || newRole === MemberRole.Commenter || newRole === MemberRole.Viewer,
|
||||
} as BoardMember
|
||||
|
||||
setConfirmAddUser(null)
|
||||
|
Loading…
Reference in New Issue
Block a user