feat: Add drag-and-drop module reordering with caching fix#3689
feat: Add drag-and-drop module reordering with caching fix#3689fasiho7 wants to merge 1 commit intoOWASP:mainfrom
Conversation
Resolves OWASP#3016 ## Features Added - Added position field to Module model for custom ordering support - Implemented GraphQL mutation to update module positions based on ordered input list - Added drag-and-drop reordering on frontend using dnd-kit library - Enhanced ModuleCard component with sortable functionality ## Technical Implementation - Frontend: dnd-kit integration for smooth drag-and-drop UX - Backend: GraphQL mutation for position updates - Caching: Version-based cache invalidation strategy - Error handling: Revert on mutation failure ## Changes Made - Module type: Added optional position field - GraphQL: Added UPDATE_MODULE_POSITIONS mutation - ModuleCard: Added drag-and-drop with grip handles - State management: Optimistic updates with error recovery ## Testing - Added support for ModuleCard component testing - Comprehensive error handling and validation - Accessibility support with keyboard navigation ## Benefits - Improved UX for mentors/admins managing module order - Real-time visual feedback during reordering - Consistent cache invalidation preventing stale data - Scalable solution for current user load (<500 admins/mentors) Checklist: - I followed the contributing workflow - I verified that my code works as intended and resolves the issue as described - I ran make check-test locally: all warnings addressed, tests passed - I used AI for code, documentation, tests, or communication related to this PR
|
Caution Review failedThe pull request is closed. Summary by CodeRabbitNew Features
✏️ Tip: You can customize this high-level summary in your review settings. WalkthroughThis PR implements drag-and-drop module reordering functionality for mentorship programs. It extends ModuleCard to support reordering mode with DnD Kit integration, adds a GraphQL mutation constant for persisting module positions, and extends the Module type with a position field to track order. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Suggested reviewers
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The linked issue must be assigned to the PR author. |
|


Resolves #3016
Features Added
Technical Implementation
Changes Made
Testing
Benefits
Checklist:
STOP AND READ BEFORE SUBMITTING! REMOVE THIS PARAGRAPH BEFORE OPENING THE PR
Thank you for your interest in contributing to OWASP Nest!
Before starting any work, all external contributors must first be assigned to an issue in the repository.
This is a mandatory step in the OWASP Nest workflow and ensures that effort is coordinated, approved, and tracked properly.
Exception: OWASP leaders are not required to follow this rule —- just make sure your username is included in the exception list.
If you were not assigned to the issue you are trying to resolve, stop right now and do NOT create this PR.
Unassigned pull requests are automatically closed by our workflows — please don't waste your time.
If you want to be assigned on any available issue, comment on it and wait for confirmation from the maintainers or project leads.
Proposed change
Resolves #(put the issue number here)
Add the PR description here.
Checklist
make check-testlocally: all warnings addressed, tests passed