Skip to content

169-26-12-10-7-5-shubham-shinde - #344

Open
Shubham9528 wants to merge 10 commits into
modelsuite-ai:masterfrom
Shubham9528:169-26-12-10-7-5-shubham-shinde
Open

169-26-12-10-7-5-shubham-shinde#344
Shubham9528 wants to merge 10 commits into
modelsuite-ai:masterfrom
Shubham9528:169-26-12-10-7-5-shubham-shinde

Conversation

@Shubham9528

Copy link
Copy Markdown

PR Title

169-26-12-10-7-5-shubham-shinde

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

Required before opening this PR: Complete these checks locally to ensure the code is ready for review. PRs opened without these checks passing may be closed.

  • I ran cd client && npm run lint && npm run build and cd server && npm run lint && node -c index.js locally
  • All checks passed (lint, build)
  • No errors or warnings remain

Note: This is a pre-PR checklist completed before submission. Additional checklists below are completed after the PR is opened.

Short Demo Video

https://drive.google.com/file/d/1a7WOLAm1QP7Hf41vTkLqKRI1FZMLzhqn/view?usp=sharing

Screenshots & Previews

image image image image image image image

Required Checklist

Task & Workflow

  • Create a new Branch exactly matching your assigned name (169-26-12-10-7-5-shubham-shinde)
  • PR title is exactly your assigned branch name
  • Latest target branch (master) was pulled immediately before opening this PR

Quality & Safety

  • Change tested locally
  • Full diff reviewed before submitting (no blind copy/paste)
  • No secrets, keys, or personal data included

Checklist Completion Rule

The checklist must be completed after the Pull Request is opened.

Process:

  1. Create and submit the Pull Request
  2. Reopen the Pull Request page
  3. Complete all required checklist items
  4. Ensure your PR link and Voice recorded video are submitted before the deadline

Key Files Modified

  • client/src/context/ThemeContext.jsx
  • client/src/components/common/ThemeToggle.jsx
  • client/src/index.css
  • client/src/App.jsx
  • client/src/pages/admin/AdminDashboard.jsx
  • client/src/pages/admin/SubmissionsPage.jsx
  • client/src/pages/talent/TalentDashboard.jsx
  • client/src/components/admin/TasksTable.jsx
  • client/src/components/admin/SubmissionReviewModal.jsx
  • server/controllers/taskController.js
  • server/controllers/talentController.js
  • server/controllers/submissionController.js
  • server/routes/taskRoutes.js

How It Was Tested & Verified

  1. Client: cd client && npm run lint && npm run buildPASSED (0 Errors, 0 Warnings, build completed in ~500ms)
  2. Server: cd server && npm run lint && node -c index.jsPASSED (0 Errors, 0 Warnings, syntax check completed successfully)
  3. Verified atomic task claiming under concurrent request simulations.
  4. Verified IDOR authorization returns 403 Forbidden on unauthorized task lookups and 200 OK on owned/open tasks.
  5. Verified paginated table navigation and search/filter state resets.

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
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.

Premium Dark Mode Implementation

1 participant