Skip to content

Commit 288a340

Browse files
Merge branch 'develop' into feat/openapi-oauth-apps-list
2 parents b91fe20 + 1a23b72 commit 288a340

File tree

17 files changed

+247
-29
lines changed

17 files changed

+247
-29
lines changed

.changeset/pretty-geckos-lick.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@rocket.chat/meteor": patch
3+
---
4+
5+
Fixes an issue that caused some types of messages to generate an empty thread preview

.changeset/seven-gorillas-sell.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@rocket.chat/meteor": patch
3+
---
4+
5+
Fixes order on featured room header actions

.changeset/soft-suns-sip.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@rocket.chat/meteor": minor
3+
"@rocket.chat/i18n": minor
4+
---
5+
6+
Adds a "Collapse All" button to the Apps Logs Filter and moves existing "Expand All" button to a kebab menu
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
import { mockAppRoot } from '@rocket.chat/mock-providers';
2+
import { composeStories } from '@storybook/react';
3+
import { render, screen } from '@testing-library/react';
4+
import { axe } from 'jest-axe';
5+
6+
import * as stories from './ThreadMessagePreviewBody.stories';
7+
8+
const { Default } = composeStories(stories);
9+
10+
const testCases = Object.values(composeStories(stories)).map((Story) => [Story.storyName || 'Story', Story]);
11+
12+
jest.mock('../../../../lib/utils/fireGlobalEvent', () => ({
13+
fireGlobalEvent: jest.fn(),
14+
}));
15+
16+
jest.mock('../../../../views/room/hooks/useGoToRoom', () => ({
17+
useGoToRoom: jest.fn(),
18+
}));
19+
20+
test.each(testCases)(`renders ThreadMessagePreviewBody without crashing`, async (_storyname, Story) => {
21+
const view = render(<Story />, { wrapper: mockAppRoot().build() });
22+
23+
expect(view.baseElement).toMatchSnapshot();
24+
});
25+
26+
test.each(testCases)('ThreadMessagePreviewBody should have no a11y violations', async (_storyname, Story) => {
27+
const { container } = render(<Story />, { wrapper: mockAppRoot().build() });
28+
29+
const results = await axe(container);
30+
31+
expect(results).toHaveNoViolations();
32+
});
33+
34+
it('should not show an empty thread preview', async () => {
35+
const { container } = render(
36+
<Default
37+
message={{
38+
_id: 'message-id',
39+
ts: new Date(),
40+
msg: 'http://localhost:3000/group/ds?msg=ZoX9pDowqNb4BiWxf',
41+
md: [
42+
{
43+
type: 'PARAGRAPH',
44+
value: [
45+
{
46+
type: 'PLAIN_TEXT',
47+
value: 'message attachment text quote',
48+
},
49+
],
50+
},
51+
],
52+
attachments: [
53+
{
54+
text: 'message attachment text quote',
55+
md: [
56+
{
57+
type: 'PARAGRAPH',
58+
value: [
59+
{
60+
type: 'PLAIN_TEXT',
61+
value: 'message attachment text quote',
62+
},
63+
],
64+
},
65+
],
66+
message_link: 'http://localhost:3000/group/ds?msg=ZoX9pDowqNb4BiWxf',
67+
author_name: 'b',
68+
author_icon: '/avatar/b',
69+
attachments: [],
70+
ts: new Date('2025-07-24T18:05:45.339Z'),
71+
},
72+
],
73+
u: {
74+
_id: 'user-id',
75+
username: 'username',
76+
},
77+
rid: 'room-id',
78+
_updatedAt: new Date(),
79+
}}
80+
/>,
81+
{ wrapper: mockAppRoot().build() },
82+
);
83+
expect(container).toMatchSnapshot();
84+
const text = screen.getByText('http://localhost:3000/group/ds?msg=ZoX9pDowqNb4BiWxf');
85+
86+
expect(text).toBeInTheDocument;
87+
});
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { mockAppRoot } from '@rocket.chat/mock-providers';
2+
import type { Meta, StoryFn } from '@storybook/react';
3+
import type { ComponentProps } from 'react';
4+
5+
import ThreadMessagePreviewBody from './ThreadMessagePreviewBody';
6+
7+
export default {
8+
title: 'Components/ThreadMessagePreviewBody',
9+
component: ThreadMessagePreviewBody,
10+
parameters: {
11+
layout: 'fullscreen',
12+
},
13+
decorators: [mockAppRoot().withSetting('UI_Use_Real_Name', true).withJohnDoe().buildStoryDecorator()],
14+
args: {
15+
message: {
16+
_id: 'message-id',
17+
ts: new Date(),
18+
msg: 'This is a message',
19+
u: {
20+
_id: 'user-id',
21+
username: 'username',
22+
},
23+
rid: 'room-id',
24+
_updatedAt: new Date(),
25+
},
26+
},
27+
} satisfies Meta<typeof ThreadMessagePreviewBody>;
28+
29+
export const Default: StoryFn<ComponentProps<typeof ThreadMessagePreviewBody>> = (args) => <ThreadMessagePreviewBody {...args} />;

apps/meteor/client/components/message/variants/threadPreview/ThreadMessagePreviewBody.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const ThreadMessagePreviewBody = ({ message }: ThreadMessagePreviewBodyProps): R
3030
return <>{t('Message_with_attachment')}</>;
3131
}
3232
if (!isEncryptedMessage || message.e2e === 'done') {
33-
return mdTokens ? (
33+
return mdTokens?.length ? (
3434
<GazzodownText>
3535
<PreviewMarkup tokens={mdTokens} />
3636
</GazzodownText>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
2+
3+
exports[`renders ThreadMessagePreviewBody without crashing 1`] = `
4+
<body>
5+
<div>
6+
This is a message
7+
</div>
8+
</body>
9+
`;
10+
11+
exports[`should not show an empty thread preview 1`] = `
12+
<div>
13+
http://localhost:3000/group/ds?msg=ZoX9pDowqNb4BiWxf
14+
</div>
15+
`;

apps/meteor/client/hooks/roomActions/useAppsRoomStarActions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ export const useAppsRoomStarActions = () => {
2424
if (!result.data) {
2525
return undefined;
2626
}
27-
2827
const filteredActions = result.data.filter(applyButtonFilters);
2928

3029
if (filteredActions.length === 0) {
@@ -37,6 +36,7 @@ export const useAppsRoomStarActions = () => {
3736
icon: 'stars',
3837
groups: ['group', 'channel', 'live', 'team', 'direct', 'direct_multiple'],
3938
featured: true,
39+
order: 3,
4040
renderToolboxItem: ({ id, icon, title, disabled, className }) => (
4141
<GenericMenu
4242
button={<HeaderToolbarAction />}

apps/meteor/client/hooks/roomActions/useVideoCallRoomAction.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export const useVideoCallRoomAction = () => {
7777
icon: 'video',
7878
featured: true,
7979
action: handleOpenVideoConf,
80-
order: -1,
80+
order: 1,
8181
groups,
8282
disabled,
8383
tooltip,

apps/meteor/client/hooks/roomActions/useVoiceCallRoomAction.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export const useVoiceCallRoomAction = () => {
6565
featured: true,
6666
action: handleOnClick,
6767
groups: ['direct'] as const,
68+
order: 2,
6869
disabled,
6970
tooltip,
7071
};

0 commit comments

Comments
 (0)