Add admin project#1636
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds a comprehensive project management system to the application, including database schema, admin interface, and user dashboard functionality.
- Adds project table to database with comprehensive project information tracking
- Implements admin dashboard for project CRUD operations with form-based management
- Creates user dashboard showing project participation and application opportunities
Reviewed Changes
Copilot reviewed 50 out of 51 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/server/db/schema.ts | Adds Project table schema with all necessary fields and enums |
| src/server/api/routers/projects/ | Creates project API endpoints for public access and user queries |
| src/server/api/routers/admin/projects/ | Implements admin-only project management endpoints |
| src/app/dashboard/admin/@projects/ | Admin UI components for project creation, editing, and management |
| src/app/dashboard/(root)/ | User dashboard showing project participation and applications |
| src/app/projects/ | Updates project pages to support database-driven content |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| application_url: input.application_url?.trim() ?? null, | ||
| is_public: input.is_public ?? false, | ||
| }) | ||
| .where(eq(Project.name, input.name)) |
There was a problem hiding this comment.
The update operation is filtering by input.name but should filter by input.id to ensure the correct project is updated. Using name could update the wrong project if names are changed.
| .where(eq(Project.name, input.name)) | |
| .where(eq(Project.id, input.id)) |
|
Looks good, but maybe we should check that the logo and images exist before accepting them? Otherwise we get broken image links when displaying them. |
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a comprehensive project management system with database integration, admin dashboard functionality, and user-facing project discovery features.
Key changes:
- Database schema extension with new Project table and related types/enums
- Admin dashboard for project CRUD operations with form validation
- Public project display and user dashboard for project discovery and applications
Reviewed Changes
Copilot reviewed 49 out of 50 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| Database files | Added Project table schema, migrations, and type definitions |
| Admin router/API | Created project management endpoints for CRUD operations |
| Public API | Added endpoints for public project retrieval and user project queries |
| Admin dashboard | Built comprehensive project management UI with forms and validation |
| User dashboard | Added project discovery and application features |
| Project pages | Enhanced to support both static and database-driven projects |
| UI components | Updated dialog and command components for better UX |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| application_url: input.application_url?.trim() ?? null, | ||
| is_public: input.is_public ?? false, | ||
| }) | ||
| .where(eq(Project.name, input.name)) |
There was a problem hiding this comment.
The WHERE clause uses Project.name but should use Project.id since the input contains an id field and the function is updating by ID, not name. Using name could update the wrong project if names are changed.
| .where(eq(Project.name, input.name)) | |
| .where(eq(Project.id, input.id)) |
| is_public: values.is_public, | ||
| logo_path: values.logo_path.trim(), | ||
| img_path: values.img_path?.trim(), | ||
| id: formDefaultValues.id ?? "", |
There was a problem hiding this comment.
Empty string is passed as fallback for ID, but the update mutation expects a valid UUID. This could cause database errors when trying to update without a proper ID.
| ref={ref} | ||
| className={cn( | ||
| "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]", | ||
| "fixed left-[50%] top-[50%] z-50 w-full max-w-5xl translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]", |
There was a problem hiding this comment.
The grid class was removed from this component. This could break layouts that depend on grid behavior in dialogs. Consider if this change affects other dialog usage throughout the application.
| "fixed left-[50%] top-[50%] z-50 w-full max-w-5xl translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]", | |
| "fixed left-[50%] top-[50%] z-50 w-full max-w-5xl translate-x-[-50%] translate-y-[-50%] grid gap-4 border bg-background p-6 duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]", |
| export type User = typeof User.$inferSelect | ||
|
|
||
| export type Payment = typeof User.$inferSelect | ||
| export type Payment = typeof Payment.$inferSelect |
There was a problem hiding this comment.
This line was corrected from using User to Payment, which fixes the incorrect type inference for the Payment type.
| export type Payment = typeof Payment.$inferSelect | |
| export type PaymentType = typeof Payment.$inferSelect |
Change Summary
[Briefly summarise the changes that you made. Just high-level stuff]
Change Form
Fill this up (NA if not available). If a certain criteria is not met, can you please give a reason.
Other Information
[Is there anything in particular in the review that I should be aware of?]