169-26-12-10-7-5-shubham-shinde - #344
Open
Shubham9528 wants to merge 10 commits into
Open
Conversation
When a task is deleted, any linked Submission documents were left behind
as orphaned records. Added Submission.deleteMany({ taskId }) before
Task.findByIdAndDelete to clean up all related submissions atomically.
Closes modelsuite-ai#5
- Added window.confirm() in TasksTable.jsx before deleteTask API call - Added window.confirm() in SubmissionReviewModal.jsx before Reject action only - Approve action fires directly as it is non-destructive (closes modelsuite-ai#26)
Replace non-atomic findById + save pattern in claimTask with a single findOneAndUpdate call that includes status: 'Open' in the query filter. This ensures the status check and update happen atomically at the DB level, preventing two concurrent requests from both passing the Open check and claiming the same task simultaneously. Fix-(modelsuite-ai#10)
…ering for Tasks and Submissions - Add page-based pagination (limit 10) to GET /api/tasks and GET /api/submissions/admin/all - Support search (case-insensitive regex on title) and status filter as query params in taskController - Wire up pagination state, prev/next controls, and page reset on filter change in AdminDashboard - Add prev/next pagination controls with Page X of Y display in SubmissionsPage - Fix: replace undefined filteredTasks with pagination.total in AdminDashboard task count badge - Fix: sync Task.status to Approved/Rejected when admin reviews a submission Closes modelsuite-ai#12
…-7-5-shubham-shinde
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Title
Summary
Implemented six assigned issues (#169, #26, #12, #10, #7, #5): premium dark/light theme system, confirmation dialogs for destructive actions, task/submission pagination with search and status filters, an atomic task-claim fix to prevent race conditions, resource-level authorization on the task details endpoint (IDOR fix), and cascade deletion of orphaned submissions on task delete. Client and server lint/build were run locally and pass with no errors or warnings.
Closes #169, #26, #12, #10, #7, #5
Checklist
cd client && npm run lint && npm run buildandcd server && npm run lint && node -c index.jslocallyShort Demo Video
https://drive.google.com/file/d/1a7WOLAm1QP7Hf41vTkLqKRI1FZMLzhqn/view?usp=sharing
Screenshots & Previews
Required Checklist
Task & Workflow
169-26-12-10-7-5-shubham-shinde)master) was pulled immediately before opening this PRQuality & Safety
Checklist Completion Rule
The checklist must be completed after the Pull Request is opened.
Process:
Key Files Modified
client/src/context/ThemeContext.jsxclient/src/components/common/ThemeToggle.jsxclient/src/index.cssclient/src/App.jsxclient/src/pages/admin/AdminDashboard.jsxclient/src/pages/admin/SubmissionsPage.jsxclient/src/pages/talent/TalentDashboard.jsxclient/src/components/admin/TasksTable.jsxclient/src/components/admin/SubmissionReviewModal.jsxserver/controllers/taskController.jsserver/controllers/talentController.jsserver/controllers/submissionController.jsserver/routes/taskRoutes.jsHow It Was Tested & Verified
cd client && npm run lint && npm run build—PASSED (0 Errors, 0 Warnings, build completed in ~500ms)cd server && npm run lint && node -c index.js—PASSED (0 Errors, 0 Warnings, syntax check completed successfully)403 Forbiddenon unauthorized task lookups and200 OKon owned/open tasks.