Skip to content

E2602 - Spring - Frontend Changes#161

Closed
ravisatyarsg wants to merge 0 commit intoexpertiza:mainfrom
ravisatyarsg:main
Closed

E2602 - Spring - Frontend Changes#161
ravisatyarsg wants to merge 0 commit intoexpertiza:mainfrom
ravisatyarsg:main

Conversation

@ravisatyarsg
Copy link
Copy Markdown

This PR implements the frontend for the Student Task View (E2602) in React + TypeScript. The previous StudentTasks component was incorrectly implemented as a topic signup sheet. This PR replaces it with a correct task list view and adds a new task detail view, both fully integrated with the backend API.ChangesNew files:

src/pages/StudentTasks/StudentTasks.tsx — rewrites the list view to call GET /student_tasks and render a table of all assigned tasks
src/pages/StudentTasks/StudentTaskDetail.tsx — new detail view calling GET /student_tasks/:id, renders assignment info, team, stage timeline, reviewer feedback, submission feedback, and revision request form
src/pages/StudentTasks/StudentTaskColumns.tsx — TanStack column definitions with clickable assignment name links and colored stage badges
src/pages/StudentTasks/studentTaskTypes.ts — TypeScript interfaces matching the backend as_json response shape
src/pages/StudentTasks/tests/StudentTasks.test.tsx — 14 tests for the list view
src/pages/StudentTasks/tests/StudentTaskDetail.test.tsx — 20 tests for the detail view
Modified files:

src/App.tsx — added StudentTaskDetail import and updated the student_tasks/:participantId route to point to the new detail component
Features

Task list table with assignment, course, topic, current stage badge, stage deadline, and review grade columns
Navigation from list to detail via assignment name link or "View Details" button
Detail page with stage timeline (submission → review → feedback phases with status badges), team members, reviewer feedback, submission feedback, and revision request form
Loading state, empty state, and error state handled in both views
Redux alert dispatched on API failure
Both routes protected with ProtectedRoute
Tests (34 total, all passing)

Rendering: task table, column data, stage badges, grade display
Navigation: assignment name click, View Details button click, back button
States: loading, empty, error alert dispatch
Detail rendering: assignment title, course, stage badge, topic, team, timeline, feedback, submission feedback, revision card
Revision form: show/hide, submit disabled when empty, enabled after typing, existing status display
API: correct URL and method called on mount for both components

Testing
npm test
(press 'p' then type 'StudentTask' to filter to E2602 tests)

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.

1 participant