Skip to content

feat: add new pages and components for Cahier de texte and Notes & Ex…#30

Merged
codeline401 merged 3 commits into
developfrom
feature/notes-saisie-note
May 27, 2026
Merged

feat: add new pages and components for Cahier de texte and Notes & Ex…#30
codeline401 merged 3 commits into
developfrom
feature/notes-saisie-note

Conversation

@codeline401

@codeline401 codeline401 commented May 27, 2026

Copy link
Copy Markdown
Owner

…amens modules

  • Implemented Cahier de texte module with tabs for Programme réalisé, Devoirs donnés, Suivi des chapitres, Documents pédagogiques, and E-learning.
  • Implemented Notes & Examens module with tabs for Saisie des notes, Bulletins, Moyenne auto, Classement, Délibération, Gestion des examens, Export PDF, and Signature numérique.
  • Each tab currently displays a maintenance placeholder indicating future functionality.
  • Updated App routing to include new pages for Cahier de texte and Notes & Examens.

Summary by CodeRabbit

  • New Features
    • Added "Notes & Examens" area with full grade-entry UI (create/edit/delete notes) plus tabs for bulletins, rankings, deliberation, exam management, PDF export, and digital signature (placeholders/maintenance).
    • Added "Cahier de texte" area with tabbed UI and placeholder pages for programme, assignments, chapter tracking, pedagogical documents, and e‑learning.
    • Both sections added to the sidebar and gated by role-based access.

Review Change Stack

…amens modules

- Implemented Cahier de texte module with tabs for Programme réalisé, Devoirs donnés, Suivi des chapitres, Documents pédagogiques, and E-learning.
- Implemented Notes & Examens module with tabs for Saisie des notes, Bulletins, Moyenne auto, Classement, Délibération, Gestion des examens, Export PDF, and Signature numérique.
- Each tab currently displays a maintenance placeholder indicating future functionality.
- Updated App routing to include new pages for Cahier de texte and Notes & Examens.
@coderabbitai

coderabbitai Bot commented May 27, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 16dd034f-9143-427a-9bb0-32dc8387cd08

📥 Commits

Reviewing files that changed from the base of the PR and between 2f490fa and c3144ac.

📒 Files selected for processing (2)
  • apps/web/src/components/notes/SaisieNotesTab.tsx
  • apps/web/src/pages/NotesExamensPage.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/web/src/components/notes/SaisieNotesTab.tsx

📝 Walkthrough

Walkthrough

This PR adds two protected dashboard features: Notes & Examens (tabbed page with a full note-entry CRUD tab and several maintenance tabs) and Cahier de Texte (tabbed curriculum pages in maintenance). Routes and sidebar entries are wired for both features.

Changes

Notes & Examens and Cahier de Texte

Layer / File(s) Summary
Routing and sidebar navigation
apps/web/src/App.tsx, apps/web/src/components/Sidebar.tsx
Routes /notes-examens and /cahier-texte are added under the protected dashboard. Sidebar imports ClipboardList and NotebookPen icons and adds two new role-gated menu items under "Gestion Pédagogique".
Notes & Examens page framework
apps/web/src/pages/NotesExamensPage.tsx, apps/web/src/components/notes/MaintenancePlaceholder.tsx
NotesExamensPage defines 8 tabs and renders the active tab; MaintenancePlaceholder is a typed component rendering a centered "En maintenance" UI used by placeholder tabs.
Placeholder tabs for Notes & Examens
apps/web/src/components/notes/*
Seven maintenance-mode tab components (BulletinsTab, ClassementTab, DeliberationTab, ExportPdfTab, GestionExamensTab, MoyenneAutoTab, SignatureNumeriqueTab) each render MaintenancePlaceholder with module-specific French text.
Note entry implementation (SaisieNotesTab)
apps/web/src/components/notes/SaisieNotesTab.tsx
Fully implemented notes CRUD: form model, queries for classes/notes/students/subjects, create/update (FormData with optional file), delete with confirmation, cache invalidation, toasts, role-gated create/edit/delete UI, table and modal form.
Cahier de Texte page framework
apps/web/src/pages/CahierTextePage.tsx, apps/web/src/components/cahierTexte/MaintenancePlaceholder.tsx
CahierTextePage defines 5 tabs and accessible tablist/panel structure; MaintenancePlaceholder renders the curriculum maintenance UI.
Curriculum tabs for Cahier de Texte
apps/web/src/components/cahierTexte/*
Five maintenance-mode tab components (ProgrammeRealiseTab, DevoirsDonnesTab, SuiviChapitresTab, DocumentsPedagogiquesTab, ELearningTab) each render MaintenancePlaceholder with module-specific French text.

Sequence Diagram

sequenceDiagram
  participant User
  participant Sidebar
  participant NotesExamensPage
  participant SaisieNotesTab
  participant ReactQuery as React Query
  participant API
  User->>Sidebar: click "Notes & Examens"
  Sidebar->>NotesExamensPage: navigate to /notes-examens
  NotesExamensPage->>NotesExamensPage: set activeTab = "saisie-notes"
  NotesExamensPage->>SaisieNotesTab: render tab component
  SaisieNotesTab->>ReactQuery: useQuery(classes)
  SaisieNotesTab->>ReactQuery: useQuery(notes for filtered class)
  ReactQuery->>API: GET /classes, GET /notes?classeId
  API-->>ReactQuery: class list, notes data
  ReactQuery-->>SaisieNotesTab: populate table & filter
  User->>SaisieNotesTab: click "Saisir une note"
  SaisieNotesTab->>SaisieNotesTab: open modal, load students/subjects
  User->>SaisieNotesTab: fill form, upload sheet, submit
  SaisieNotesTab->>ReactQuery: useMutation(POST/PUT /notes)
  ReactQuery->>API: POST/PUT with FormData (grades, comment, file)
  API-->>ReactQuery: created/updated note
  ReactQuery->>ReactQuery: invalidate notes query
  ReactQuery-->>SaisieNotesTab: refresh table, show toast, close modal
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 Notes and cahiers in a tidy row,
Tabs that whisper "maintenance" soft and low,
A modal for grades where teachers may write,
Sidebar guides pupils back to the light,
Soon these sprouts will blossom into sight.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 72.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: adding new pages and components for two major modules (Cahier de texte and Notes & Examens), which aligns with the file changes showing new page components, tab components, and routing updates.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/notes-saisie-note

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/web/src/components/notes/SaisieNotesTab.tsx`:
- Around line 176-179: The invalidation uses stale component state
(deleteTarget?.classeId) which may be cleared before the mutation completes;
change the mutation handlers (the onSuccess/onSettled for the delete mutation in
SaisieNotesTab) to use the mutation's variables/response instead of deleteTarget
state (e.g., use the second onSuccess argument "variables" or the onSettled args
to read variables.classeId) when calling
queryClient.invalidateQueries(["classe-notes", ...]); update the other
occurrence at the block around lines 614-622 the same way so invalidation always
uses the mutation's classeId rather than deleteTarget.
- Around line 198-204: openEdit pre-fills matiereId from the optional relation
note.matiere, which can be undefined and yields an empty string that users
cannot change in edit mode; update the setForm call in openEdit to use the
persisted foreign key (note.matiereId) as the primary source (e.g., matiereId:
note.matiereId ?? note.matiere?.id ?? ""), so the edit form always receives a
valid id when available.

In `@apps/web/src/pages/NotesExamensPage.tsx`:
- Around line 91-110: Tabs currently set aria-controls but buttons lack explicit
id and the panel (role="tabpanel" with id={`tabpanel-${activeTab}`}) lacks
aria-labelledby; add a deterministic id on each tab button (e.g., `tab-${id}`
inside the button rendered in the map) and set the panel's aria-labelledby to
that tab id (aria-labelledby={`tab-${activeTab}`}) so the TABS mapping,
activeTab state, the button render and the panel div (role="tabpanel") are
reciprocally linked for screen readers.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e010dc2d-4b0a-4a75-8ff5-9e00791529a8

📥 Commits

Reviewing files that changed from the base of the PR and between d0ba7b8 and 2f490fa.

📒 Files selected for processing (19)
  • apps/web/src/App.tsx
  • apps/web/src/components/Sidebar.tsx
  • apps/web/src/components/cahierTexte/DevoirsDonnesTab.tsx
  • apps/web/src/components/cahierTexte/DocumentsPedagogiquesTab.tsx
  • apps/web/src/components/cahierTexte/ELearningTab.tsx
  • apps/web/src/components/cahierTexte/MaintenancePlaceholder.tsx
  • apps/web/src/components/cahierTexte/ProgrammeRealiseTab.tsx
  • apps/web/src/components/cahierTexte/SuiviChapitresTab.tsx
  • apps/web/src/components/notes/BulletinsTab.tsx
  • apps/web/src/components/notes/ClassementTab.tsx
  • apps/web/src/components/notes/DeliberationTab.tsx
  • apps/web/src/components/notes/ExportPdfTab.tsx
  • apps/web/src/components/notes/GestionExamensTab.tsx
  • apps/web/src/components/notes/MaintenancePlaceholder.tsx
  • apps/web/src/components/notes/MoyenneAutoTab.tsx
  • apps/web/src/components/notes/SaisieNotesTab.tsx
  • apps/web/src/components/notes/SignatureNumeriqueTab.tsx
  • apps/web/src/pages/CahierTextePage.tsx
  • apps/web/src/pages/NotesExamensPage.tsx

Comment on lines +176 to +179
onSuccess: () => {
queryClient.invalidateQueries({
queryKey: ["classe-notes", deleteTarget?.classeId],
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Invalidate delete cache with mutation variables, not deleteTarget state.

At Lines 177-179, invalidation uses deleteTarget?.classeId. deleteTarget can be cleared via cancel/backdrop flow before the request resolves, which can produce ["classe-notes", undefined] and leave stale notes in view.

Suggested fix
-    onSuccess: () => {
+    onSuccess: (_, variables) => {
       queryClient.invalidateQueries({
-        queryKey: ["classe-notes", deleteTarget?.classeId],
+        queryKey: ["classe-notes", variables.classeId],
       });
       toast.success("Note supprimée.");
       setDeleteTarget(null);
     },

Also applies to: 614-622

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/web/src/components/notes/SaisieNotesTab.tsx` around lines 176 - 179, The
invalidation uses stale component state (deleteTarget?.classeId) which may be
cleared before the mutation completes; change the mutation handlers (the
onSuccess/onSettled for the delete mutation in SaisieNotesTab) to use the
mutation's variables/response instead of deleteTarget state (e.g., use the
second onSuccess argument "variables" or the onSettled args to read
variables.classeId) when calling queryClient.invalidateQueries(["classe-notes",
...]); update the other occurrence at the block around lines 614-622 the same
way so invalidation always uses the mutation's classeId rather than
deleteTarget.

Comment thread apps/web/src/components/notes/SaisieNotesTab.tsx
Comment thread apps/web/src/pages/NotesExamensPage.tsx
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