feat: add teacher dashboard and support management#276
feat: add teacher dashboard and support management#276nissrinebechi794-eng wants to merge 2 commits into
Conversation
|
The PR description has the basic structure (features list, screenshots) - that's a good start. What's missing: there's no documentation file in docs/ for this feature (teacher dashboard, support management, file uploads). Per the project rule, this needs at least a technical doc (endpoints, data models for supports) and a user guide, since there's a UI for teachers. Could you add these before this is ready for review? |
There was a problem hiding this comment.
Pull request overview
Adds an initial teacher portal surface to the SvelteKit UI (dashboard + support-management UI) and introduces a new backend FastAPI router for teacher-related endpoints, wiring it into the main app.
Changes:
- Implemented a teacher dashboard page with an in-page sidebar and a support-requests CRUD UI (including file upload) in
ui/src/routes/teacher/+page.svelte. - Added placeholder teacher navigation route pages (
mes-cours,soutien,devoirs,planification,rapports,parametres). - Added a new backend teacher router and registered it under
/api/v1.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| ui/src/routes/teacher/+page.svelte | Teacher dashboard shell + support management UI (list/search/filter/create/edit/delete + file upload). |
| ui/src/routes/teacher/soutien/+page.svelte | Placeholder “Soutien” navigation page. |
| ui/src/routes/teacher/mes-cours/+page.svelte | Placeholder “Mes cours” navigation page. |
| ui/src/routes/teacher/devoirs/+page.svelte | Placeholder “Devoirs à corriger” navigation page. |
| ui/src/routes/teacher/planification/+page.svelte | Placeholder “Planification” navigation page. |
| ui/src/routes/teacher/rapports/+page.svelte | Placeholder “Rapports” navigation page. |
| ui/src/routes/teacher/parametres/+page.svelte | Placeholder “Paramètres” navigation page. |
| gateway/http/routers/teacher.py | New /teacher router with a /dashboard endpoint guarded by user role. |
| gateway/http/app.py | Registers teacher router under /api/v1. |
| from fastapi import APIRouter, Depends | ||
| from data.models import User | ||
| from gateway.http.dependencies import get_current_user | ||
|
|
||
| router = APIRouter( | ||
| prefix="/teacher", | ||
| tags=["teacher"] | ||
| ) | ||
|
|
||
|
|
||
| @router.get("/dashboard") | ||
| async def get_teacher_dashboard( | ||
| current_user: User = Depends(get_current_user) | ||
| ): | ||
| # Vérification du rôle | ||
| if current_user.role != "teacher": | ||
| return { | ||
| "success": False, | ||
| "message": "Access denied" | ||
| } |
| @router.get("/dashboard") | ||
| async def get_teacher_dashboard( | ||
| current_user: User = Depends(get_current_user) | ||
| ): |
| # /api/v1/auths/* → TUTOR_API_BASE_URL calls (signin, signout, session, …) | ||
| app.include_router(auth.router) | ||
| app.include_router(auth.router, prefix="/api/v1") | ||
|
|
|
|
||
| <input | ||
| type="text" | ||
| placeholder="Recherché..." |
| <button class="text-gray-500 text-xl"> | ||
| 🔔 | ||
| </button> |
| {#each filteredSupports as support} | ||
|
|
| on:change={(e) => { | ||
| selectedFile = e.target.files[0]; | ||
| }} |
| <div class="mt-4 flex gap-3"> | ||
|
|
||
|
|
||
|
|
||
| </div> |
| const token = localStorage.getItem('token') || ''; | ||
|
|
||
| supports = await getSupportRequests(token); | ||
|
|
| <h1 class="p-10 text-3xl font-bold"> | ||
| Soutien | ||
| </h1> No newline at end of file |
Description
This pull request introduces the teacher dashboard and support management module.
Features implemented
Teacher dashboard interface.
Navigation pages:
Support Management
Backend
gateway/http/app.py.UI
Screenshots