-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Implement Bulk Post Deletion Workflow with Enhanced Confirmation and Selection
Description
We currently support deleting a single post via a confirmation modal that renders the full post. This feature should be enhanced to allow moderators to delete multiple posts at once. In bulk deletion mode, moderators will be able to select multiple posts for deletion. When more than one post is selected, the confirmation modal should render all selected posts in a feed-like layout (displaying each full post) so that moderators can review the entire selection before confirming the deletion. The modal must also provide controls to remove individual posts from the selection or clear all selections. Upon confirmation, the bulk deletion API—which accepts an array of post URIs and handles partial failures—is invoked. The existing toast notifications for success or error should remain unchanged.
Acceptance Criteria
- Multi-Selection Mode:
- Moderators can select multiple posts via checkboxes.
- There is an option to "Select All" posts (e.g., among filtered posts).
- Confirmation Modal:
- When more than one post is selected, the modal renders each selected post fully (as seen in single post deletion), arranged in a feed-like format.
- The modal includes controls to:
- Remove individual posts from the selection.
- Clear all selected posts.
- Confirm deletion.
- API Integration:
- Once confirmed, the client calls the bulk deletion API with an array of selected post URIs.
- The backend endpoint is already designed to handle an array and return an error if there is a partial failure.
- Feedback:
- Upon API response, the same toast notifications used for single post deletion are displayed, indicating success or error.
- Existing Functionality:
- If only one post is selected, the existing single post deletion behavior remains unchanged.
Tasks
- Update the moderation feed to enable selecting multiple posts.
- Modify the confirmation modal:
- Detect when multiple posts are selected.
- Render each selected post fully in a feed-like layout.
- Provide controls to remove individual posts from the selection or clear all selections.
- Integrate the bulk deletion API call using the array of selected post URIs.
- Ensure the existing toast notifications (for success or error) are triggered after the deletion request.
- Write unit and integration tests to cover:
- Multi-selection functionality in the feed.
- Correct rendering of the confirmation modal.
- Removal of individual posts and clearing selections in the confirmation modal.
- Successful API integration and proper feedback via toast notifications.