IA-955 : feat: Improve MatiereDialog with error feedback, niveauId guard, and ApprentissageView code cleanup
Summary
Improves the MatiereDialog with proper error/warning feedback and niveauId validation, and cleans up handler functions in ApprentissageView.
Changes
MatiereDialog
- Added
submitErrorstate with inline<Alert severity="error">displayed inside the dialog instead of silently failing - Added
niveauIdvalidation 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 ahandleClose()wrapper that resetssubmitErroron dismiss - Error message is now contextual: different wording for add vs edit mode
ApprentissageView
- Fixed
navigateToMatieresto useniveau.uuidinstead ofniveau.levelUuidfor settingcurrentNiveauId - 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