-
Notifications
You must be signed in to change notification settings - Fork 0
feat: restore bulk delete user posts feature for privileged users #2
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR restores bulk delete user posts functionality for privileged users in discussion forums, allowing course and organization-scoped deletion of user posts. This feature was previously reverted in issue openedx#818 and is now being restored with proper privilege controls.
- Added bulk delete APIs and Redux state management for user post deletion
- Created learner actions dropdown component with delete options for course/org scoped deletion
- Implemented confirmation dialog with post count statistics before deletion
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/index.scss | Updated dropdown item width from fixed to min-width for better responsiveness |
src/discussions/learners/utils.js | Added utility functions and constants for learner actions including delete operations |
src/discussions/learners/test-utils.js | Extended test utilities to support bulk delete functionality and privilege setup |
src/discussions/learners/messages.js | Added internationalization messages for delete confirmation dialogs |
src/discussions/learners/data/thunks.js | Implemented deleteUserPosts thunk for API communication |
src/discussions/learners/data/slices.js | Added Redux state management for bulk delete operations and statistics |
src/discussions/learners/data/selectors.js | Added selector for bulk delete statistics |
src/discussions/learners/data/constants.js | Defined bulk delete type constants for course/org scoping |
src/discussions/learners/data/api.test.jsx | Added comprehensive tests for bulk delete API functionality |
src/discussions/learners/data/api.js | Implemented bulk delete API endpoint and documentation |
src/discussions/learners/LearnerPostsView.test.jsx | Added tests for bulk delete UI interactions and confirmation flows |
src/discussions/learners/LearnerPostsView.jsx | Integrated bulk delete dropdown and confirmation dialog into main view |
src/discussions/learners/LearnerActionsDropdown.test.jsx | Added tests for the actions dropdown component |
src/discussions/learners/LearnerActionsDropdown.jsx | Created dropdown component for learner actions including delete options |
src/discussions/data/slices.js | Added bulk delete privileges to course configuration state |
src/discussions/data/selectors.js | Added selector for bulk delete privileges |
src/data/constants.js | Added content action constants for delete operations |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
handleActions(action.action); | ||
}} | ||
className="d-flex justify-content-start actions-dropdown-item" | ||
data-testId={action.id} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'data-testId' to 'data-testid' (lowercase 'i' in 'id').
data-testId={action.id} | |
data-testid={action.id} |
Copilot uses AI. Check for mistakes.
); | ||
|
||
it('Failed to bulk delete user posts', async () => { | ||
const learners = await setupPostsMockResponse({ statusCode: 400 }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test is calling setupPostsMockResponse instead of setupDeleteUserPostsMockResponse for testing bulk delete failure. This will test the wrong API endpoint.
const learners = await setupPostsMockResponse({ statusCode: 400 }); | |
const learners = await setupDeleteUserPostsMockResponse({ statusCode: 400 }); |
Copilot uses AI. Check for mistakes.
Description
Restores bulk delete user posts feature that was reverted in #818, bringing back course/org-scoped deletion with privilege controls.
Original implementation: #37030
Issues with original implementation: #37402
The frontend changes were removed from Open edX but are being restored in the edX fork.
Backend PRs for feature removal are still unmerged : #37401, #37403
Jira Ticket: LP-120