Repository navigation
connected the backend to the frontend - #21
Merged
Merged
Conversation
✅ Deploy Preview for scenepilot ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Task Frontend UI & API Integration
🚀 Summary
Connects the frontend production task UI to the backend API endpoints, introducing state management, real-time board interactivity, task modal creation, detail slide-overs, and type-safe member extraction.
This PR links the frontend Kanban interfaces directly to backend API routes (
/api/projects/[projectId]/tasksand/api/tasks/[taskId]). Project teams can now create, inspect, update, and comment on tasks within the UI while maintaining dynamic local state and strict TypeScript compliance across varied user/membership data shapes.The implementation establishes a clear operational workflow for:
@typescript-eslint/no-explicit-anyESLint errors.Authenticated project members can now:
Backlog,To Do,In Production,In Review,Done).LOW,MEDIUM,HIGH,URGENT).📦 Changes Made
🎨 Task Kanban Board Component
Updated
ProductionTasksBoard(components/ProductionTasksBoard.tsx):useProjectTasksto fetch initial task lists and bind mutation functions (createTask,updateTask).TaskStatus.TaskPriority.getMemberDetailsusingunknownand property type checks to replace explicitanycasts.🎣 Custom Task Hook
Integrated
useProjectTasks(hooks/useProjectTasks.ts):createTaskAPI calls to handle payload formatting and local state prepend.updateTaskAPI calls for status changes, assignee updates, and comment additions with optimism/resynchronization.🌐 API Integration Points
Connected client actions to backend routes:
GET /api/projects/[projectId]/tasks: Consumed byuseProjectTaskson component mount to retrieve populated tasks.POST /api/projects/[projectId]/tasks: Triggered by the task creation modal.PATCH /api/tasks/[taskId]: Triggered via drawer selectors (status/assignee) and comment submission inputs.💡 Why It Changed
Eliminating ESLint Violations
The helper function
getMemberDetailspreviously relied onconst m = member as Record<string, any>;, which triggered@typescript-eslint/no-explicit-anylint errors. Transitioning tounknownwith runtime type narrowing resolves lint errors while strictly preserving robust support for both raw user objects and nested membership structures.Connecting Visual Interfaces to Persistent Data
The visual board needed direct binding to asynchronous API operations so state modifications (such as updating task status or appending comments) reflect immediately in the UI without full page reloads.
🧪 How to Test
TypeScript & ESLint Validation
Run:
Expected result: 0 errors, 0 warnings (no
@typescript-eslint/no-explicit-anyflags).Create Task via UI Modal
ProductionTasksBoard.Expected behavior: The modal closes, and the newly created task card appears in the target status column.
Interacting with the Task Drawer
Expected behavior: Dropdown updates trigger background
PATCHrequests; the comment feed updates immediately; activity log reflects recent changes upon refresh.📋 Pre-Merge Checklist
anytypes withunknownand runtime type guards ingetMemberDetailsProductionTasksBoardUI touseProjectTaskshooknpx tsc --noEmitpassesnpm run lintpasses🔐 Security & Safety Notes
TypeErrorcrashes when rendering dynamic or incompleteProjectMemberrecords.🔄 Next Steps
@hello-pangea/dndintoProductionTasksBoardfor intuitive drag-and-drop status changes.