-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into favorite-setting-functioning
- Loading branch information
Showing
99 changed files
with
2,264 additions
and
467 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@rocket.chat/meteor": patch | ||
--- | ||
|
||
fixed an issue with the composer losing its edit state and highlighted after resizing the window. |
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,6 @@ | ||
--- | ||
"@rocket.chat/meteor": patch | ||
"@rocket.chat/web-ui-registration": patch | ||
--- | ||
|
||
Fixed login email verification flow when a user tries to join with username |
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,5 @@ | ||
--- | ||
'@rocket.chat/meteor': minor | ||
--- | ||
|
||
feat: add a11y doc links |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
88 changes: 88 additions & 0 deletions
88
apps/meteor/client/components/message/content/reactions/ReactionTooltip.tsx
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,88 @@ | ||
import { useTranslation } from '@rocket.chat/ui-contexts'; | ||
import type { TranslationKey } from '@rocket.chat/ui-contexts'; | ||
import { useQuery } from '@tanstack/react-query'; | ||
import React from 'react'; | ||
|
||
import { useGetMessageByID } from '../../../../views/room/contextualBar/Threads/hooks/useGetMessageByID'; | ||
import MarkdownText from '../../../MarkdownText'; | ||
|
||
type ReactionTooltipProps = { | ||
emojiName: string; | ||
usernames: string[]; | ||
username: string | undefined; | ||
mine: boolean; | ||
showRealName: boolean; | ||
messageId: string; | ||
}; | ||
|
||
const getTranslationKey = (users: string[], mine: boolean): TranslationKey => { | ||
if (users.length === 0) { | ||
if (mine) { | ||
return 'You_reacted_with'; | ||
} | ||
} | ||
|
||
if (users.length > 10) { | ||
if (mine) { | ||
return 'You_users_and_more_Reacted_with'; | ||
} | ||
return 'Users_and_more_reacted_with'; | ||
} | ||
|
||
if (mine) { | ||
return 'You_and_users_Reacted_with'; | ||
} | ||
return 'Users_reacted_with'; | ||
}; | ||
|
||
const ReactionTooltip = ({ emojiName, usernames, mine, messageId, showRealName, username }: ReactionTooltipProps) => { | ||
const t = useTranslation(); | ||
|
||
const key = getTranslationKey(usernames, mine); | ||
|
||
const getMessage = useGetMessageByID(); | ||
|
||
const { data: users } = useQuery( | ||
['chat.getMessage', 'reactions', messageId, usernames], | ||
async () => { | ||
// This happens if the only reaction is from the current user | ||
if (!usernames.length) { | ||
return []; | ||
} | ||
|
||
if (!showRealName) { | ||
return usernames; | ||
} | ||
|
||
const data = await getMessage(messageId); | ||
|
||
const { reactions } = data; | ||
|
||
if (!reactions) { | ||
return []; | ||
} | ||
|
||
if (username) { | ||
const index = reactions[emojiName].usernames.indexOf(username); | ||
index >= 0 && reactions[emojiName].names?.splice(index, 1); | ||
return (reactions[emojiName].names || usernames).filter(Boolean); | ||
} | ||
|
||
return reactions[emojiName].names || usernames; | ||
}, | ||
{ staleTime: 1000 * 60 * 5 }, | ||
); | ||
|
||
return ( | ||
<MarkdownText | ||
content={t(key, { | ||
counter: usernames.length > 10 ? usernames.length - 10 : usernames.length, | ||
users: users?.slice(0, 10).join(', ') || '', | ||
emoji: emojiName, | ||
})} | ||
variant='inline' | ||
/> | ||
); | ||
}; | ||
|
||
export default ReactionTooltip; |
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.