Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add multi-delete functionality for messages. #34952

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

AyushKumar123456789
Copy link

Proposed changes (including videos or screenshots)

This PR implements a new multi-delete functionality . The changes include:

  • Added Checkbox in Default Message Items:
    A checkbox now appears with each message; however, it is rendered only if the current user has permission to delete that message.

  • Implemented MultiDeleteButton Component:
    A new component, MultiDeleteButton, has been added. When multiple messages are selected, this button appears (via the Room header toolbox). Upon clicking, a confirmation modal is shown, and on confirmation, the component uses hook to call the existing chat.delete endpoint for each selected message.

  • Integration into RoomHeader:
    The MultiDeleteButton is injected into the RoomHeader ,So that the multi-delete option is easily accessible in the header's toolbox area.

Issue(s)

Closes #917

Steps to test or reproduce

  1. Navigate to any chat room where you have permission to delete messages.
  2. Verify that each message shows a delete checkbox only if you have permission to delete that message.
  3. Select multiple messages by clicking their checkboxes.
  4. Ensure that when more than one message is selected, a trash icon appears in the room header’s toolbox.
  5. Click the trash icon to open the confirmation modal.
  6. Confirm deletion, and verify that:
    • A success toast is displayed upon successful deletion,
    • The selected messages are removed,
    • The checkbox state is cleared.

Further comments

This change improves message management efficiency by enabling bulk deletion of messages. The implementation builds upon our existing deletion endpoint for individual messages. I have taken great care to preserve the existing code structure wherever possible. In areas such as the header title and the generic modal, I used raw message strings (with underscores) in cases where a proper translation did not yet exist, to ensure accurate rendering in the meantime. It is recommended that new translation keys be added to our i18n files for complete localization. I appreciate any feedback on further refinements or additional requirements.

multidelete.mp4

@AyushKumar123456789 AyushKumar123456789 requested a review from a team as a code owner January 16, 2025 11:49
Copy link

changeset-bot bot commented Jan 16, 2025

🦋 Changeset detected

Latest commit: 5d9be3d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 35 packages
Name Type
@rocket.chat/meteor Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/api-client Patch
@rocket.chat/apps Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/ddp-client Patch
@rocket.chat/freeswitch Patch
@rocket.chat/fuselage-ui-kit Patch
@rocket.chat/gazzodown Patch
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-contexts Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/stream-hub-service Patch
@rocket.chat/license Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/models Patch
@rocket.chat/network-broker Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-video-conf Patch
@rocket.chat/ui-voip Patch
@rocket.chat/web-ui-registration Patch
@rocket.chat/instance-status Patch

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

Copy link
Contributor

dionisio-bot bot commented Jan 16, 2025

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@AyushKumar123456789 AyushKumar123456789 changed the title [NEW] Multi-delete functionality for messages (#917) feat: add multi-delete functionality for messages. Jan 16, 2025
@AyushKumar123456789
Copy link
Author

I’ve updated the PR title, trying to ensure it might align with the required format. Please let me know if there’s anything else I need to address or improve. I’m happy to make further changes if required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request : Multiple Messages Select and Delete Functionality.
2 participants