mirror of
https://github.com/mattermost/focalboard.git
synced 2025-03-29 21:01:01 +02:00
fix: filter at-mention users in private boards
This commit is contained in:
parent
7bf8f9ba41
commit
2e9e6ef771
@ -37,6 +37,7 @@ type MentionUser = {
|
|||||||
name: string
|
name: string
|
||||||
avatar: string
|
avatar: string
|
||||||
is_bot: boolean
|
is_bot: boolean
|
||||||
|
is_guest: boolean
|
||||||
displayName: string
|
displayName: string
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,10 +66,18 @@ const MarkdownEditorInput = (props: Props): ReactElement => {
|
|||||||
users = await octoClient.searchTeamUsers(term)
|
users = await octoClient.searchTeamUsers(term)
|
||||||
} else {
|
} else {
|
||||||
users = boardUsers
|
users = boardUsers
|
||||||
|
.filter(user => {
|
||||||
|
// no search term
|
||||||
|
if (!term) return true
|
||||||
|
// does the search term occur anywhere in the display name?
|
||||||
|
return Utils.getUserDisplayName(user, clientConfig.teammateNameDisplay).includes(term)
|
||||||
|
})
|
||||||
|
// first 10 results
|
||||||
|
.slice(0, 10)
|
||||||
}
|
}
|
||||||
|
|
||||||
const mentions = users.map(
|
const mentions: Array<MentionUser> = users.map(
|
||||||
(user) => ({
|
(user: IUser): MentionUser => ({
|
||||||
name: user.username,
|
name: user.username,
|
||||||
avatar: `${imageURLForUser ? imageURLForUser(user.id) : ''}`,
|
avatar: `${imageURLForUser ? imageURLForUser(user.id) : ''}`,
|
||||||
is_bot: user.is_bot,
|
is_bot: user.is_bot,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user