feat: Send multiple files into a single message#32703
feat: Send multiple files into a single message#32703abhipatel0211 wants to merge 337 commits intoRocketChat:developfrom
Conversation
🦋 Changeset detectedLatest commit: cb9ebf9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 41 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
apps/meteor/client/views/room/composer/messageBox/MessageBox.tsx
Outdated
Show resolved
Hide resolved
apps/meteor/client/views/room/composer/messageBox/MessageBox.tsx
Outdated
Show resolved
Hide resolved
apps/meteor/client/views/room/composer/messageBox/MessageBox.tsx
Outdated
Show resolved
Hide resolved
apps/meteor/client/views/room/composer/messageBox/MessageBox.tsx
Outdated
Show resolved
Hide resolved
apps/meteor/client/views/room/composer/messageBox/MessageBox.tsx
Outdated
Show resolved
Hide resolved
apps/meteor/client/views/room/composer/messageBox/MessageBox.tsx
Outdated
Show resolved
Hide resolved
apps/meteor/client/views/room/composer/messageBox/MessageBox.tsx
Outdated
Show resolved
Hide resolved
apps/meteor/client/views/room/composer/messageBox/MessageBox.tsx
Outdated
Show resolved
Hide resolved
apps/meteor/client/views/room/composer/messageBox/MessageBox.tsx
Outdated
Show resolved
Hide resolved
apps/meteor/client/views/room/composer/messageBox/MessageBox.tsx
Outdated
Show resolved
Hide resolved
apps/meteor/client/views/room/composer/messageBox/MessageBox.tsx
Outdated
Show resolved
Hide resolved
apps/meteor/client/views/room/modals/FileUploadModal/FileUploadModal.tsx
Outdated
Show resolved
Hide resolved
…message clarity for file upload limits
…nd update usage in HomeContent class
…tent type validation
|
Testing locally I've noticed I'm able to upload multiple files even though |
It depends, if the uploads are If the uploads are on multiple messges, then that should be the current behavior RC has for uploading (when you select/drop many files) |
please check carefully if it was sent in a single or multiple messages, I'm positive that it's working fine |
Then it's ok 👍 |
| before(async () => { | ||
| const channelInfoResponse = await request.get(api('channels.info')).set(credentials).query({ roomName: 'general' }).expect(200); | ||
| generalRoomId = channelInfoResponse.body.channel._id; | ||
|
|
There was a problem hiding this comment.
| generalRoomId = 'GENERAL'; |
| generalRoomId = channelInfoResponse.body.channel._id; | ||
|
|
||
| const file1Response = await request | ||
| .post(api(`rooms.media/${generalRoomId}`)) |
There was a problem hiding this comment.
I could not find the 'chat.sendMessage' implementation or tests related
| .expect(200) | ||
| .expect((res: Response) => { | ||
| expect(res.body).to.have.property('success', true); | ||
| }); |
There was a problem hiding this comment.
| .expect(200) | |
| .expect((res: Response) => { | |
| expect(res.body).to.have.property('success', true); | |
| }); | |
| .expect(200); |
| const data = JSON.parse(sendMessageResponse.body.message); | ||
| messageWithFiles = data.result; |
There was a problem hiding this comment.
| const data = JSON.parse(sendMessageResponse.body.message); | |
| messageWithFiles = data.result; | |
| messageWithFiles = JSON.parse(sendMessageResponse.body.message).result; |
| tshow, | ||
| previewUrls, | ||
| isSlashCommandAllowed, | ||
| tmid, |
There was a problem hiding this comment.
there is no reason to pass tmid here chat/this contains tmid
| const customCSS = css` | ||
| animation: spin-animation 0.8s linear infinite; | ||
|
|
||
| @keyframes spin-animation { | ||
| from { | ||
| transform: rotate(0deg); | ||
| } | ||
|
|
||
| to { | ||
| transform: rotate(360deg); | ||
| } | ||
| } | ||
| `; |
There was a problem hiding this comment.
this can be defined outside the MessageComposerFileLoader component
Proposed changes (including videos or screenshots)
This PR aims to introduce the ability to send multiple files into a single message. In order to keep the compatibility with old integrations we're introducing a new setting, in order to use it you'll need to enabled it first otherwise it will send one file per message
Note
It's not available for livechat rooms yet
Closes #35651
Closes #24776
Closes #25918
Closes RocketChat/feature-requests#31
Steps to test or reproduce
FileUpload_EnableMultipleFilesPerMessageFurther comments
This implementation is an initial version of the multiple file sharing feature. While it is functional, some minor bugs remain, particularly with image file sharing, which will be addressed in future updates.
CORE-847
This pull request introduces the ability to send multiple files in a single message within the Rocket.Chat application. Key changes include:
File Upload Enhancements: The file upload functionality has been significantly refactored to support multiple files, including updates to the UploadsAPI interface with new methods for managing uploads and handling encrypted content. The Upload type definition now includes both file and URL properties.
New Components and Hooks: Several new components and hooks have been added to manage file uploads, such as
MessageComposerFile,MessageComposerFileArea, andMessageComposerFileLoader, which provide UI elements for file management, preview, and error handling. TheuseFileUploadDropTargethook has been introduced to streamline file upload handling.Thread and Message Integration: The PR adds support for thread-specific uploads and integrates file upload capabilities into various components like
MessageBox,AudioMessageRecorder, andVideoMessageRecorder. TheconfirmFilesfunction is introduced to handle file confirmation and sending, with error handling and cleanup processes.Localization and API Updates: The English localization file has been updated with new messages related to upload failures and file count limitations. A new API endpoint for media editing has been added to the REST typings.
Overall, this pull request enhances the file upload experience by allowing multiple files to be sent in a single message, improving the user interface, and refining the underlying upload logic.
Summary by CodeRabbit
New Features
Improvements