Skip to content

169 21 19 8 6 5 shreyansh yadav - #331

Open
melowdiouss wants to merge 11 commits into
modelsuite-ai:masterfrom
melowdiouss:169-21-19-8-6-5-shreyansh-yadav
Open

169 21 19 8 6 5 shreyansh yadav#331
melowdiouss wants to merge 11 commits into
modelsuite-ai:masterfrom
melowdiouss:169-21-19-8-6-5-shreyansh-yadav

Conversation

@melowdiouss

Copy link
Copy Markdown

Summary (max 3 sentences)

Fixed three bugs: task deletion now cascades to remove orphaned submissions, approving/rejecting a submission updates the parent task's status accordingly, and logout now blacklists the JWT server-side so revoked tokens are rejected instead of remaining valid indefinitely. Added end-to-end multi-file upload support, letting talents submit and admins review multiple files per submission instead of just one. Implemented a persistent light/dark theme system with an animated sidebar toggle, and added a text label to the logout button for clearer affordance.

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 && npm run build 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 (required)


Required Checklist

Task & Workflow

  • [✓] Create a new Branch exactly matching your assigned name (e.g. 27-26-22-7-5-pranav-test)
  • [✓] 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

Incomplete or incorrect checklists will result in the PR being closed.

Copilot AI review requested due to automatic review settings July 21, 2026 14:27

Copilot AI left a comment

Copy link
Copy Markdown

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 updates the Task Pipeline app across server + client to support multi-file submissions, improve task/submission lifecycle consistency, add server-side JWT revocation via a token blacklist on logout, and introduce a persistent light/dark theme with updated UI styling.

Changes:

  • Backend: add token blacklist logout + JWT blacklist enforcement; cascade-delete submissions when deleting tasks; propagate submission review status to parent task.
  • Submissions: switch from single-file to multi-file upload end-to-end (routes, controller, model, UI review modal).
  • Frontend: introduce ThemeProvider + toggle, and migrate multiple pages/components to theme tokens + updated UI patterns.

Reviewed changes

Copilot reviewed 29 out of 34 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
test_seed.js Adds a local MongoDB debug script (prints submissions).
test_query.js Adds a local MongoDB debug script (populates task/talent on submissions).
server/routes/submissionRoutes.js Switch submission upload route to upload.array('files', 10).
server/routes/authRoutes.js Adds protected /logout route.
server/package-lock.json Updates locked multer version.
server/models/TokenBlacklist.js New model for storing revoked JWTs with TTL expiry.
server/models/Submission.js Adds fileUrls: [String] to support multi-file submissions.
server/middleware/authMiddleware.js Checks JWT blacklist during protect.
server/controllers/taskController.js Deletes related submissions when deleting a task.
server/controllers/submissionController.js Builds/records multiple file URLs and syncs task status on review.
server/controllers/authController.js Implements logout endpoint that blacklists the current token.
client/src/pages/talent/TalentDashboard.jsx Updates layout and styling to theme-token classes.
client/src/pages/RegisterPage.jsx Updates right-panel styling to theme-token classes.
client/src/pages/LoginPage.jsx Updates right-panel styling to theme-token classes.
client/src/pages/admin/SubmissionsPage.jsx Updates file column to show count of uploaded files.
client/src/pages/admin/AdminDashboard.jsx Updates styling to theme-token classes.
client/src/index.css Introduces light/dark theme variables and applies them to base styles.
client/src/context/ThemeContext.jsx Adds persisted theme context + toggle logic.
client/src/context/AuthContext.jsx Calls server logout endpoint before clearing local auth state.
client/src/components/ThemeToggle.jsx Adds UI control for toggling light/dark theme.
client/src/components/talent/TalentSidebar.jsx Adds theme toggle to sidebar + logout button label + theme styling.
client/src/components/talent/SubmitTaskModal.jsx Switches submission UI from single-file to multi-file upload.
client/src/components/talent/MyTasksList.jsx Updates styling to theme tokens and simplifies hover styling.
client/src/components/admin/TasksTable.jsx Updates styling, empty states, and fallbacks for task fields.
client/src/components/admin/SubmissionReviewModal.jsx Renders multiple submitted file links (with single-file fallback).
client/src/components/admin/Sidebar.jsx Adds theme toggle + logout label + theme styling.
client/src/App.jsx Wraps app with ThemeProvider.
client/src/api/axios.js Updates axios baseURL (and retains auth header interceptor).
client/package-lock.json Updates locked dependencies (notably ESLint-related packages).
client/eslint.config.js Updates flat ESLint config to include react plugin + rules.
client/.eslintrc.cjs Updates legacy ESLint config to include react plugin + rules.
Files not reviewed (1)
  • server/package-lock.json: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread client/src/api/axios.js
Comment on lines 2 to 4
const API = axios.create({
baseURL: 'http://localhost:5000/api',
baseURL: 'http://localhost:5001/api',
});
<TalentSidebar />

<main className="ml-[220px] flex-1 px-8 py-8" style={{ maxWidth: 'calc(100vw - 220px)' }}>
<main className="ml-[220px] flex-1 px-8 py-8 w-[calc(100vw-220px)]">
Comment on lines +17 to +23
const fileUrls = req.files && req.files.length > 0
? req.files.map(file => `http://localhost:5000/uploads/${file.filename}`)
: req.body.fileUrls || [];

// Also save the first file in fileUrl for fallback
const fileUrl = fileUrls.length > 0 ? fileUrls[0] : (req.body.fileUrl || null);

Comment on lines +75 to +77
if (token) {
await TokenBlacklist.create({ token });
}
Comment thread server/middleware/authMiddleware.js Outdated
Comment on lines 11 to 18
const isBlacklisted = await TokenBlacklist.findOne({ token });
if (isBlacklisted) {
return res.status(401).json({ message: 'Not authorized, token revoked' });
}

const decoded = jwt.verify(token, process.env.JWT_SECRET);
req.user = await User.findById(decoded.id).select('-password');
next();
Comment thread server/package-lock.json
Comment on lines +2048 to +2050
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/multer/-/multer-2.2.0.tgz",
"integrity": "sha512-6rdyFg2kLrMh9Jee7/BMPuV9lEAd7lLW2YUpF9/YxR7njyoUwwQ0ZPh3TaIY50Sw6vlyD2HW3wGOkTS4P79xrQ==",
Comment thread test_seed.js Outdated
Comment on lines +1 to +7
const mongoose = require('mongoose');
const Submission = require('./server/models/Submission');
mongoose.connect('mongodb://localhost:27017/task-pipeline').then(async () => {
const subs = await Submission.find({}).lean();
console.log('Submissions:', subs);
process.exit(0);
});
Comment thread test_query.js Outdated
Comment on lines +1 to +11
const mongoose = require('mongoose');
const Submission = require('./server/models/Submission');
const Task = require('./server/models/Task');
const User = require('./server/models/User');

mongoose.connect('mongodb://localhost:27017/task-pipeline')
.then(async () => {
const submissions = await Submission.find({}).populate('taskId').populate('talentId');
console.log(JSON.stringify(submissions, null, 2));
process.exit(0);
});
Comment on lines +105 to +106
// Update the task status to match the submission review status ('Approved' or 'Rejected')
await Task.findByIdAndUpdate(submission.taskId._id, { status: reviewStatus });
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.

2 participants