-
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 revert-30321-new/dmnotify
- Loading branch information
Showing
37 changed files
with
497 additions
and
544 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,8 @@ | ||
--- | ||
'@rocket.chat/model-typings': patch | ||
'@rocket.chat/meteor': patch | ||
--- | ||
|
||
Change SAU aggregation to consider only sessions from few days ago instead of the whole past. | ||
|
||
This is particularly important for large workspaces in case the cron job did not run for some time, in that case the amount of sessions would accumulate and the aggregation would take a long time to run. |
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/rest-typings': minor | ||
'@rocket.chat/meteor': minor | ||
--- | ||
|
||
fix: missing params on updateOwnBasicInfo endpoint |
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 | ||
--- | ||
|
||
Fixed the issue of apps icon uneven alignment in case of missing icons inside message composer toolbar & message toolbar menu. |
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
25 changes: 25 additions & 0 deletions
25
apps/meteor/app/mentions/server/getMentionedTeamMembers.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,25 @@ | ||
import { Team } from '@rocket.chat/core-services'; | ||
import type { IMessage } from '@rocket.chat/core-typings'; | ||
|
||
import { callbacks } from '../../../lib/callbacks'; | ||
|
||
interface IExtraDataForNotification { | ||
userMentions: any[]; | ||
otherMentions: any[]; | ||
message: IMessage; | ||
} | ||
|
||
callbacks.add('beforeGetMentions', async (mentionIds: string[], extra?: IExtraDataForNotification) => { | ||
const { otherMentions } = extra ?? {}; | ||
|
||
const teamIds = otherMentions?.filter(({ type }) => type === 'team').map(({ _id }) => _id); | ||
|
||
if (!teamIds?.length) { | ||
return mentionIds; | ||
} | ||
|
||
const members = await Team.getMembersByTeamIds(teamIds, { projection: { userId: 1 } }); | ||
mentionIds.push(...new Set(members.map(({ userId }) => userId).filter((userId) => !mentionIds.includes(userId)))); | ||
|
||
return mentionIds; | ||
}); |
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,2 +1,3 @@ | ||
import './server'; | ||
import './getMentionedTeamMembers'; | ||
import './methods/getUserMentionsByChannel'; | ||
import './server'; |
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
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,13 +1,15 @@ | ||
import '../ee/client/ecdh'; | ||
import './polyfills'; | ||
import { FlowRouter } from 'meteor/kadira:flow-router'; | ||
|
||
import '../lib/oauthRedirectUriClient'; | ||
import './lib/meteorCallWrapper'; | ||
import './importPackages'; | ||
FlowRouter.wait(); | ||
|
||
import '../ee/client'; | ||
import './methods'; | ||
import './startup'; | ||
import './views/admin'; | ||
import './views/marketplace'; | ||
import './views/account'; | ||
FlowRouter.notFound = { | ||
action: () => undefined, | ||
}; | ||
|
||
import('./polyfills') | ||
.then(() => Promise.all([import('./lib/meteorCallWrapper'), import('../lib/oauthRedirectUriClient')])) | ||
.then(() => import('../ee/client/ecdh')) | ||
.then(() => import('./importPackages')) | ||
.then(() => Promise.all([import('./methods'), import('./startup')])) | ||
.then(() => import('../ee/client')) | ||
.then(() => Promise.all([import('./views/admin'), import('./views/marketplace'), import('./views/account')])); |
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 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,90 @@ | ||
import { isDiscussion } from '@rocket.chat/core-typings'; | ||
import type { IRoom, RoomAdminFieldsType } from '@rocket.chat/core-typings'; | ||
import { Box, Icon } from '@rocket.chat/fuselage'; | ||
import { useMediaQuery } from '@rocket.chat/fuselage-hooks'; | ||
import { useRouter, useTranslation } from '@rocket.chat/ui-contexts'; | ||
import React, { useCallback } from 'react'; | ||
|
||
import { GenericTableCell, GenericTableRow } from '../../../components/GenericTable'; | ||
import RoomAvatar from '../../../components/avatar/RoomAvatar'; | ||
import { roomCoordinator } from '../../../lib/rooms/roomCoordinator'; | ||
|
||
const roomTypeI18nMap = { | ||
l: 'Omnichannel', | ||
c: 'Channel', | ||
d: 'Direct_Message', | ||
p: 'Private_Channel', | ||
} as const; | ||
|
||
const getRoomDisplayName = (room: Pick<IRoom, RoomAdminFieldsType>): string | undefined => | ||
room.t === 'd' ? room.usernames?.join(' x ') : roomCoordinator.getRoomName(room.t, room); | ||
|
||
const RoomRow = ({ room }: { room: Pick<IRoom, RoomAdminFieldsType> }) => { | ||
const t = useTranslation(); | ||
const mediaQuery = useMediaQuery('(min-width: 1024px)'); | ||
const router = useRouter(); | ||
|
||
const { _id, t: type, usersCount, msgs, default: isDefault, featured, ...args } = room; | ||
const icon = roomCoordinator.getRoomDirectives(room.t).getIcon?.(room); | ||
const roomName = getRoomDisplayName(room); | ||
|
||
const getRoomType = ( | ||
room: Pick<IRoom, RoomAdminFieldsType>, | ||
): (typeof roomTypeI18nMap)[keyof typeof roomTypeI18nMap] | 'Teams_Public_Team' | 'Teams_Private_Team' | 'Discussion' => { | ||
if (room.teamMain) { | ||
return room.t === 'c' ? 'Teams_Public_Team' : 'Teams_Private_Team'; | ||
} | ||
if (isDiscussion(room)) { | ||
return 'Discussion'; | ||
} | ||
return roomTypeI18nMap[(room as IRoom).t as keyof typeof roomTypeI18nMap]; | ||
}; | ||
|
||
const onClick = useCallback( | ||
(rid) => (): void => | ||
router.navigate({ | ||
name: 'admin-rooms', | ||
params: { | ||
context: 'edit', | ||
id: rid, | ||
}, | ||
}), | ||
[router], | ||
); | ||
|
||
return ( | ||
<GenericTableRow action key={_id} onKeyDown={onClick(_id)} onClick={onClick(_id)} tabIndex={0} role='link' qa-room-id={_id}> | ||
<GenericTableCell withTruncatedText> | ||
<Box display='flex' alignContent='center'> | ||
<RoomAvatar size={mediaQuery ? 'x28' : 'x40'} room={{ type, name: roomName, _id, ...args }} /> | ||
<Box | ||
display='flex' | ||
flexGrow={1} | ||
flexShrink={1} | ||
flexBasis='0%' | ||
flexDirection='row' | ||
alignSelf='center' | ||
alignItems='center' | ||
withTruncatedText | ||
> | ||
{icon && <Icon mi={4} name={icon} fontScale='p2m' color='hint' />} | ||
<Box fontScale='p2m' withTruncatedText color='default' qa-room-name={roomName}> | ||
{roomName} | ||
</Box> | ||
</Box> | ||
</Box> | ||
</GenericTableCell> | ||
<GenericTableCell> | ||
<Box color='hint' fontScale='p2m' withTruncatedText> | ||
{t(getRoomType(room))} | ||
</Box> | ||
</GenericTableCell> | ||
<GenericTableCell withTruncatedText>{usersCount}</GenericTableCell> | ||
{mediaQuery && <GenericTableCell withTruncatedText>{msgs}</GenericTableCell>} | ||
{mediaQuery && <GenericTableCell withTruncatedText>{isDefault ? t('True') : t('False')}</GenericTableCell>} | ||
{mediaQuery && <GenericTableCell withTruncatedText>{featured ? t('True') : t('False')}</GenericTableCell>} | ||
</GenericTableRow> | ||
); | ||
}; | ||
|
||
export default RoomRow; |
Oops, something went wrong.