fix: resolve issues #27, #19, #14, #9, #7, #6 - #336
Open
vinoth12345678910 wants to merge 1 commit into
Open
Conversation
, modelsuite-ai#9, modelsuite-ai#7, modelsuite-ai#6 - modelsuite-ai#27: Fix long text breaking table layout with word-break and truncation - modelsuite-ai#19: Add 'Sign out' text label to logout button for clear affordance - modelsuite-ai#14: Add 'Overdue' and 'Due Soon' visual badges for task due dates - modelsuite-ai#9: Add server-side validation for task creation (title, status, dueDate) - modelsuite-ai#7: Add talentOnly middleware to prevent IDOR on talent routes - modelsuite-ai#6: Implement token versioning for server-side session invalidation on logout
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.
Summary
This PR fixes 6 assigned issues (#27, #19, #14, #9, #7, #6) across the Task Pipeline application. Frontend changes include table text overflow handling, logout button with "Sign out" text label, and "Overdue"/"Due Soon" visual badges for task due dates. Backend changes include server-side validation for task creation, role-based access control (talentOnly middleware) to prevent IDOR, and JWT token versioning for server-side session invalidation on logout.
What Was Done
Issue #27 — [UI] Long Text Strings Break Table Constraints
table-cell-truncateandtext-truncateCSS classes to handle word-break and ellipsis truncationclient/src/components/admin/TasksTable.jsx,client/src/pages/admin/SubmissionsPage.jsx,client/src/index.cssIssue #19 — [UX] Logout Button Lacks Clear Affordance
.logout-btnCSS to support icon+text layout with gap spacingclient/src/components/admin/Sidebar.jsx,client/src/components/talent/TalentSidebar.jsx,client/src/index.cssIssue #14 — [Feature] Add "Due Soon" and "Overdue" Visual Badges
getDueDateStatus()utility that returns "Overdue" (past due) or "Due Soon" (within 3 days)client/src/components/admin/TasksTable.jsx,client/src/components/talent/TaskCard.jsx,client/src/components/talent/MyTasksList.jsx,client/src/index.cssIssue #9 — [Bug] Task Creation API Allows Empty Payloads
server/controllers/taskController.jsIssue #7 — [Security] IDOR Vulnerability in Task Details API
talentOnlymiddleware that verifiesreq.user.role === 'Talent'/tasks/available,/tasks/mine,/tasks/:id/claimserver/middleware/authMiddleware.js,server/routes/talentRoutes.jsIssue #6 — [Security] Lack of Server-Side Session Invalidation Upon Logout
tokenVersionfield to User model (default: 0)generateTokennow includestokenVersionin JWT payloadprotectmiddleware verifiestokenVersionmatches on each requestPOST /api/auth/logoutendpoint that incrementstokenVersionlogout()calls server endpoint before clearing localStorageserver/models/User.js,server/controllers/authController.js,server/routes/authRoutes.js,server/middleware/authMiddleware.js,client/src/context/AuthContext.jsx,client/src/components/admin/Sidebar.jsx,client/src/components/talent/TalentSidebar.jsxHow It Was Tested
Frontend (Issues #27, #19, #14)
Backend (Issues #9, #7, #6)
POST /api/taskswith empty body{}→ 400 "Title is required"/api/talent/tasks/mine→ 403 "Access denied: Talent only"/api/talent/tasks/mine→ 200 with task listBuild
npm run build— passednode -c index.js— passedFiles Changed
client/src/index.cssclient/src/components/admin/TasksTable.jsxclient/src/pages/admin/SubmissionsPage.jsxclient/src/components/admin/Sidebar.jsxclient/src/components/talent/TalentSidebar.jsxclient/src/components/talent/TaskCard.jsxclient/src/components/talent/MyTasksList.jsxclient/src/context/AuthContext.jsxserver/controllers/taskController.jsserver/controllers/authController.jsserver/middleware/authMiddleware.jsserver/models/User.jsserver/routes/authRoutes.jsserver/routes/talentRoutes.jsTesting Notes
docker compose up -dcd server && npm run seedcd server && npm run devcd client && npm run devadmin@taskpipeline.com/admin123alice@taskpipeline.com/talent123Note on Lint
All 40 client lint errors and 1 server lint error are pre-existing in the original codebase (unused imports, unused variables). None were introduced by this PR. These are not related to the 6 assigned issues.
Checklist
cd client && npm run lint && npm run buildandcd server && npm run lint && npm run buildlocallyShort Demo Video (required)
Required Checklist
Task & Workflow
27-26-22-7-5-pranav-test)master) was pulled immediately before opening this PRQuality & Safety