Skip to content

Commit 2c65dcc

Browse files
Merge branch 'develop' into fix/videoconf-display-avatars
2 parents 72145e2 + 03cac4f commit 2c65dcc

File tree

9 files changed

+70
-4
lines changed

9 files changed

+70
-4
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@rocket.chat/meteor': minor
3+
---
4+
5+
Includes attachments metadata in JSON export if type is file when exporting messages

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
/apps/meteor/app/voip @RocketChat/omnichannel
2121
/apps/meteor/app/sms @RocketChat/omnichannel
2222
/apps/meteor/server @RocketChat/backend
23-
/apps/meteor/server/models @RocketChat/Architecture
23+
/packages/models @RocketChat/Architecture
2424
apps/meteor/server/startup/migrations @RocketChat/Architecture
2525
/apps/meteor/packages/rocketchat-livechat @RocketChat/omnichannel
2626
/apps/meteor/server/services/voip-asterisk @RocketChat/omnichannel

apps/meteor/client/views/composer/AudioMessageRecorder/AudioMessageRecorder.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ const AudioMessageRecorder = ({ rid, chatContext, isMicrophoneDenied }: AudioMes
5151
});
5252

5353
const handleRecord = useEffectEvent(async () => {
54+
chat?.composer?.setRecordingMode(true);
55+
5456
if (recordingRoomId && recordingRoomId !== rid) {
5557
return;
5658
}
@@ -105,7 +107,7 @@ const AudioMessageRecorder = ({ rid, chatContext, isMicrophoneDenied }: AudioMes
105107
}
106108

107109
return (
108-
<Box display='flex' position='absolute' color='default' pi={4} pb={12}>
110+
<Box display='flex' position='absolute' color='default' pi={4} pb={12} role='group' aria-label={t('Audio_recorder')}>
109111
{state === 'recording' && (
110112
<>
111113
<MessageComposerAction icon='circle-cross' title={t('Cancel_recording')} onClick={handleCancelButtonClick} />

apps/meteor/client/views/room/contextualBar/ExportMessages/useDownloadExportMutation.ts

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,29 @@ import { Messages } from '../../../../../app/models/client';
88
import { downloadJsonAs } from '../../../../lib/download';
99
import { useRoom } from '../../contexts/RoomContext';
1010

11-
const messagesFields: FindOptions<IMessage> = { projection: { _id: 1, ts: 1, u: 1, msg: 1, _updatedAt: 1, tlm: 1, replies: 1, tmid: 1 } };
11+
const messagesFields: FindOptions<IMessage> = {
12+
projection: {
13+
'_id': 1,
14+
'ts': 1,
15+
'u': 1,
16+
'msg': 1,
17+
'_updatedAt': 1,
18+
'tlm': 1,
19+
'replies': 1,
20+
'tmid': 1,
21+
'attachments.ts': 1,
22+
'attachments.title': 1,
23+
'attachments.title_link': 1,
24+
'attachments.title_link_download': 1,
25+
'attachments.image_dimensions': 1,
26+
'attachments.image_preview': 1,
27+
'attachments.image_url': 1,
28+
'attachments.image_type': 1,
29+
'attachments.image_size': 1,
30+
'attachments.type': 1,
31+
'attachments.description': 1,
32+
},
33+
};
1234

1335
export const useDownloadExportMutation = () => {
1436
const { t } = useTranslation();

apps/meteor/playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default {
1515
launchOptions: {
1616
// force GPU hardware acceleration
1717
// (even in headless mode)
18-
args: ['--use-gl=egl', '--use-fake-ui-for-media-stream'],
18+
args: ['--use-gl=egl', '--use-fake-ui-for-media-stream', '--use-fake-device-for-media-stream'],
1919
},
2020
permissions: ['microphone'],
2121
},

apps/meteor/tests/e2e/message-composer.spec.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,32 @@ test.describe.serial('message-composer', () => {
115115
await expect(poHomeChannel.composerBoxPopup.getByText('rocket.cat')).toBeVisible();
116116
});
117117
});
118+
119+
test.describe('audio recorder', () => {
120+
test('should open audio recorder', async () => {
121+
await poHomeChannel.sidenav.openChat(targetChannel);
122+
await poHomeChannel.composerToolbar.getByRole('button', { name: 'Audio message', exact: true }).click();
123+
124+
await expect(poHomeChannel.audioRecorder).toBeVisible();
125+
});
126+
127+
test('should stop recording when clicking on cancel', async () => {
128+
await poHomeChannel.sidenav.openChat(targetChannel);
129+
await poHomeChannel.composerToolbar.getByRole('button', { name: 'Audio message', exact: true }).click();
130+
await expect(poHomeChannel.audioRecorder).toBeVisible();
131+
132+
await poHomeChannel.audioRecorder.getByRole('button', { name: 'Cancel recording', exact: true }).click();
133+
await expect(poHomeChannel.audioRecorder).not.toBeVisible();
134+
});
135+
136+
test('should open file modal when clicking on "Finish recording"', async ({ page }) => {
137+
await poHomeChannel.sidenav.openChat(targetChannel);
138+
await poHomeChannel.composerToolbar.getByRole('button', { name: 'Audio message', exact: true }).click();
139+
await expect(poHomeChannel.audioRecorder).toBeVisible();
140+
141+
await page.waitForTimeout(1000);
142+
await poHomeChannel.audioRecorder.getByRole('button', { name: 'Finish Recording', exact: true }).click();
143+
await expect(poHomeChannel.content.fileUploadModal).toBeVisible();
144+
});
145+
});
118146
});

apps/meteor/tests/e2e/page-objects/fragments/home-content.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ export class HomeContent {
112112
return this.page.locator('#modal-root .rcx-button-group--align-end .rcx-button--secondary');
113113
}
114114

115+
get fileUploadModal(): Locator {
116+
return this.page.getByRole('dialog', { name: 'File Upload' });
117+
}
118+
115119
get modalFilePreview(): Locator {
116120
return this.page.locator(
117121
'//div[@id="modal-root"]//header//following-sibling::div[1]//div//div//img | //div[@id="modal-root"]//header//following-sibling::div[1]//div//div//div//i',

apps/meteor/tests/e2e/page-objects/home-channel.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,8 @@ export class HomeChannel {
116116
get btnNotPossibleDecodeKey(): Locator {
117117
return this.page.getByRole('button', { name: "Wasn't possible to decode your encryption key to be imported." });
118118
}
119+
120+
get audioRecorder(): Locator {
121+
return this.page.getByRole('group', { name: 'Audio recorder', exact: true });
122+
}
119123
}

packages/i18n/src/locales/en.i18n.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,7 @@
748748
"Audio_Notifications_Default_Alert": "Audio Notifications Default Alert",
749749
"Audio_Notifications_Value": "Default Message Notification Audio",
750750
"Audio_record": "Audio record",
751+
"Audio_recorder": "Audio recorder",
751752
"Audios": "Audios",
752753
"Audit": "Audit",
753754
"Auditing": "Auditing",

0 commit comments

Comments
 (0)