Skip to content

IA-955 : feat: Improve MatiereDialog with error feedback, niveauId guard, and ApprentissageView code cleanup

khadija.elbachouri a demandé de fusionner feature/IA-955 vers develop

Summary

Improves the MatiereDialog with proper error/warning feedback and niveauId validation, and cleans up handler functions in ApprentissageView.

Changes

MatiereDialog

  • Added submitError state with inline <Alert severity="error"> displayed inside the dialog instead of silently failing
  • Added niveauId validation guard: shows a <Alert severity="warning"> banner when no niveau is selected, and blocks submission with a user-facing error message
  • Replaced onClose() calls with a handleClose() wrapper that resets submitError on dismiss
  • Error message is now contextual: different wording for add vs edit mode

ApprentissageView

  • Fixed navigateToMatieres to use niveau.uuid instead of niveau.levelUuid for setting currentNiveauId
  • Cleaned up handleDeleteNiveauRows, handleDeleteMatiereRows, handleDeleteChapitreRows, handleDeleteExerciceRows: removed redundant comments, simplified to direct await + refetch pattern
  • Cleaned up handleToggleMatiereActive, handleToggleChapitreActive, handleToggleActiveExercice: removed verbose comments and tightened handler bodies

Rapports de requête de fusion