refactor: refactoring du FRONT page subscribe

This commit is contained in:
Luc SORIGNET
2025-01-12 14:37:49 +01:00
parent 58fe509734
commit 427b6c7588
25 changed files with 671 additions and 652 deletions

View File

@ -4,20 +4,20 @@ import InputTextIcon from '@/components/InputTextIcon';
import ToggleSwitch from '@/components/ToggleSwitch';
import Button from '@/components/Button';
const InscriptionForm = ( { eleves, onSubmit }) => {
const InscriptionForm = ( { students, onSubmit }) => {
const [formData, setFormData] = useState({
eleveNom: '',
elevePrenom: '',
responsableEmail: '',
responsableTel: '',
selectedResponsables: [],
studentLastName: '',
studentFirstName: '',
guardianEmail: '',
guardianPhone: '',
selectedGuardians: [],
responsableType: 'new',
autoMail: false
});
const [step, setStep] = useState(1);
const [selectedEleve, setSelectedEleve] = useState('');
const [existingResponsables, setExistingResponsables] = useState([]);
const [selectedStudent, setSelectedEleve] = useState('');
const [existingGuardians, setExistingGuardians] = useState([]);
const maxStep = 4
const handleToggleChange = () => {
@ -44,21 +44,21 @@ const InscriptionForm = ( { eleves, onSubmit }) => {
}
};
const handleEleveSelection = (eleve) => {
setSelectedEleve(eleve);
const handleEleveSelection = (student) => {
setSelectedEleve(student);
setFormData((prevData) => ({
...prevData,
selectedResponsables: []
selectedGuardians: []
}));
setExistingResponsables(eleve.responsables);
setExistingGuardians(student.guardians);
};
const handleResponsableSelection = (responsableId) => {
const handleResponsableSelection = (guardianId) => {
setFormData((prevData) => {
const selectedResponsables = prevData.selectedResponsables.includes(responsableId)
? prevData.selectedResponsables.filter(id => id !== responsableId)
: [...prevData.selectedResponsables, responsableId];
return { ...prevData, selectedResponsables };
const selectedGuardians = prevData.selectedGuardians.includes(guardianId)
? prevData.selectedGuardians.filter(id => id !== guardianId)
: [...prevData.selectedGuardians, guardianId];
return { ...prevData, selectedGuardians };
});
};
@ -72,20 +72,20 @@ const InscriptionForm = ( { eleves, onSubmit }) => {
<div>
<h2 className="text-l font-bold mb-4">Nouvel élève</h2>
<InputTextIcon
name="eleveNom"
name="studentLastName"
type="text"
IconItem={User}
placeholder="Nom de l'élève"
value={formData.eleveNom}
value={formData.studentLastName}
onChange={handleChange}
className="w-full"
/>
<InputTextIcon
name="elevePrenom"
name="studentFirstName"
type="text"
IconItem={User}
placeholder="Prénom de l'élève"
value={formData.elevePrenom}
value={formData.studentFirstName}
onChange={handleChange}
className="w-full"
/>
@ -121,11 +121,11 @@ const InscriptionForm = ( { eleves, onSubmit }) => {
</div>
{formData.responsableType === 'new' && (
<InputTextIcon
name="responsableEmail"
name="guardianEmail"
type="email"
IconItem={Mail}
placeholder="Email du responsable"
value={formData.responsableEmail}
value={formData.guardianEmail}
onChange={handleChange}
className="w-full mt-4"
/>
@ -142,33 +142,33 @@ const InscriptionForm = ( { eleves, onSubmit }) => {
</tr>
</thead>
<tbody>
{eleves.map((eleve, index) => (
{students.map((student, index) => (
<tr
key={eleve.id}
className={`cursor-pointer ${selectedEleve && selectedEleve.id === eleve.id ? 'bg-emerald-600 text-white' : index % 2 === 0 ? 'bg-emerald-100' : ''}`}
onClick={() => handleEleveSelection(eleve)}
key={student.id}
className={`cursor-pointer ${selectedStudent && selectedStudent.id === student.id ? 'bg-emerald-600 text-white' : index % 2 === 0 ? 'bg-emerald-100' : ''}`}
onClick={() => handleEleveSelection(student)}
>
<td className="px-4 py-2 border">{eleve.nom}</td>
<td className="px-4 py-2 border">{eleve.prenom}</td>
<td className="px-4 py-2 border">{student.last_name}</td>
<td className="px-4 py-2 border">{student.first_name}</td>
</tr>
))}
</tbody>
</table>
</div>
{selectedEleve && (
{selectedStudent && (
<div className="mt-4">
<h3 className="font-bold">Responsables associés à {selectedEleve.nom} {selectedEleve.prenom} :</h3>
{existingResponsables.map((responsable) => (
<div key={responsable.id}>
<h3 className="font-bold">Responsables associés à {selectedStudent.last_name} {selectedStudent.first_name} :</h3>
{existingGuardians.map((guardian) => (
<div key={guardian.id}>
<label className="flex items-center space-x-3 mt-2">
<input
type="checkbox"
checked={formData.selectedResponsables.includes(responsable.id)}
checked={formData.selectedGuardians.includes(guardian.id)}
className="form-checkbox h-5 w-5 text-emerald-600"
onChange={() => handleResponsableSelection(responsable.id)}
onChange={() => handleResponsableSelection(guardian.id)}
/>
<span className="text-gray-900">
{responsable.nom && responsable.prenom ? `${responsable.nom} ${responsable.prenom}` : `${responsable.mail}`}
{guardian.last_name && guardian.first_name ? `${guardian.last_name} ${guardian.first_name}` : `${guardian.email}`}
</span>
</label>
</div>
@ -184,11 +184,11 @@ const InscriptionForm = ( { eleves, onSubmit }) => {
<div className="mt-6">
<h2 className="text-l font-bold mb-4">Téléphone (optionnel)</h2>
<InputTextIcon
name="responsableTel"
name="guardianPhone"
type="tel"
IconItem={Phone}
placeholder="Numéro de téléphone"
value={formData.responsableTel}
value={formData.guardianPhone}
onChange={handleChange}
className="w-full mt-4"
/>
@ -210,8 +210,8 @@ const InscriptionForm = ( { eleves, onSubmit }) => {
</thead>
<tbody>
<tr>
<td className="px-4 py-2 border">{formData.eleveNom}</td>
<td className="px-4 py-2 border">{formData.elevePrenom}</td>
<td className="px-4 py-2 border">{formData.studentLastName}</td>
<td className="px-4 py-2 border">{formData.studentFirstName}</td>
</tr>
</tbody>
</table>
@ -228,15 +228,15 @@ const InscriptionForm = ( { eleves, onSubmit }) => {
</thead>
<tbody>
<tr>
<td className="px-4 py-2 border">{formData.responsableEmail}</td>
<td className="px-4 py-2 border">{formData.responsableTel}</td>
<td className="px-4 py-2 border">{formData.guardianEmail}</td>
<td className="px-4 py-2 border">{formData.guardianPhone}</td>
</tr>
</tbody>
</table>
)}
{formData.responsableType === 'existing' && selectedEleve && (
{formData.responsableType === 'existing' && selectedStudent && (
<div>
<p>Associé(s) à : {selectedEleve.nom} {selectedEleve.prenom}</p>
<p>Associé(s) à : {selectedStudent.nom} {selectedStudent.prenom}</p>
<table className="min-w-full bg-white border">
<thead>
<tr>
@ -246,11 +246,11 @@ const InscriptionForm = ( { eleves, onSubmit }) => {
</tr>
</thead>
<tbody>
{existingResponsables.filter(responsable => formData.selectedResponsables.includes(responsable.id)).map((responsable) => (
<tr key={responsable.id}>
<td className="px-4 py-2 border">{responsable.nom}</td>
<td className="px-4 py-2 border">{responsable.prenom}</td>
<td className="px-4 py-2 border">{responsable.mail}</td>
{existingGuardians.filter(guardian => formData.selectedGuardians.includes(guardian.id)).map((guardian) => (
<tr key={guardian.id}>
<td className="px-4 py-2 border">{guardian.last_name}</td>
<td className="px-4 py-2 border">{guardian.first_name}</td>
<td className="px-4 py-2 border">{guardian.email}</td>
</tr>
))}
</tbody>
@ -281,15 +281,15 @@ const InscriptionForm = ( { eleves, onSubmit }) => {
<Button text="Suivant"
onClick={nextStep}
className={`px-4 py-2 rounded-md shadow-sm focus:outline-none ${
(step === 1 && (!formData.eleveNom || !formData.elevePrenom)) ||
(step === 2 && formData.responsableType === "new" && !formData.responsableEmail) ||
(step === 2 && formData.responsableType === "existing" && formData.selectedResponsables.length === 0)
(step === 1 && (!formData.studentLastName || !formData.studentFirstName)) ||
(step === 2 && formData.responsableType === "new" && !formData.guardianEmail) ||
(step === 2 && formData.responsableType === "existing" && formData.selectedGuardians.length === 0)
? "bg-gray-300 text-gray-700 cursor-not-allowed"
: "bg-emerald-500 text-white hover:bg-emerald-600"
}`}
disabled={(step === 1 && (!formData.eleveNom || !formData.elevePrenom)) ||
(step === 2 && formData.responsableType === "new" && !formData.responsableEmail) ||
(step === 2 && formData.responsableType === "existing" && formData.selectedResponsables.length === 0)
disabled={(step === 1 && (!formData.studentLastName || !formData.studentFirstName)) ||
(step === 2 && formData.responsableType === "new" && !formData.guardianEmail) ||
(step === 2 && formData.responsableType === "existing" && formData.selectedGuardians.length === 0)
}
primary
name="Next" />

View File

@ -5,7 +5,8 @@ import ResponsableInputFields from '@/components/Inscription/ResponsableInputFie
import Loader from '@/components/Loader';
import Button from '@/components/Button';
import DjangoCSRFToken from '@/components/DjangoCSRFToken';
import FileUpload from '@/app/[locale]/admin/subscriptions/components/FileUpload';
import Table from '@/components/Table';
const niveaux = [
{ value:'1', label: 'TPS - Très Petite Section'},
@ -39,6 +40,8 @@ export default function InscriptionFormShared({
initialData?.responsables || []
);
const [uploadedFiles, setUploadedFiles] = useState([]);
// Mettre à jour les données quand initialData change
useEffect(() => {
if (initialData) {
@ -62,6 +65,10 @@ export default function InscriptionFormShared({
setFormData(prev => ({...prev, [field]: value}));
};
const handleFileUpload = (file, fileName) => {
setUploadedFiles([...uploadedFiles, { file, fileName }]);
};
const handleSubmit = (e) => {
e.preventDefault();
onSubmit({
@ -72,6 +79,15 @@ export default function InscriptionFormShared({
});
};
const columns = [
{ name: 'Nom du fichier', transform: (row) => row.nom },
{ name: 'Actions', transform: (row) => (
<a href={URL.createObjectURL(row.fichier)} target='_blank' className="text-blue-500 hover:text-blue-700">
Télécharger
</a>
) },
];
if (isLoading) return <Loader />;
return (
@ -170,6 +186,20 @@ export default function InscriptionFormShared({
/>
</div>
{/* Section Fichiers d'inscription */}
<div className="bg-white p-6 rounded-lg shadow-sm border border-gray-200">
<h2 className="text-xl font-bold mb-4 text-gray-800">Fichiers à remplir</h2>
<Table
data={uploadedFiles}
columns={columns}
itemsPerPage={5}
currentPage={1}
totalPages={1}
onPageChange={() => {}}
/>
<FileUpload onFileUpload={handleFileUpload} />
</div>
{/* Boutons de contrôle */}
<div className="flex justify-end space-x-4">
<Button href={cancelUrl} text="Annuler" />

View File

@ -4,41 +4,41 @@ import TeachersSection from '@/components/Structure/Configuration/TeachersSectio
import ClassesSection from '@/components/Structure/Configuration/ClassesSection';
import { ClassesProvider } from '@/context/ClassesContext';
import { BK_GESTIONENSEIGNANTS_SPECIALITE_URL,
BK_GESTIONENSEIGNANTS_TEACHER_URL,
BK_GESTIONENSEIGNANTS_CLASSE_URL } from '@/utils/Url';
import { BE_SCHOOL_SPECIALITY_URL,
BE_SCHOOL_TEACHER_URL,
BE_SCHOOL_SCHOOLCLASS_URL } from '@/utils/Url';
const StructureManagement = ({ specialities, setSpecialities, teachers, setTeachers, classes, setClasses, handleCreate, handleEdit, handleDelete }) => {
return (
<div className='p-8'>
<div className='p-8'>
<ClassesProvider>
<SpecialitiesSection
specialities={specialities}
<SpecialitiesSection
specialities={specialities}
setSpecialities={setSpecialities}
handleCreate={(newData) => handleCreate(`${BK_GESTIONENSEIGNANTS_SPECIALITE_URL}`, newData, setSpecialities)}
handleEdit={(id, updatedData) => handleEdit(`${BK_GESTIONENSEIGNANTS_SPECIALITE_URL}`, id, updatedData, setSpecialities)}
handleDelete={(id) => handleDelete(`${BK_GESTIONENSEIGNANTS_SPECIALITE_URL}`, id, setSpecialities)}
handleCreate={(newData) => handleCreate(`${BE_SCHOOL_SPECIALITY_URL}`, newData, setSpecialities)}
handleEdit={(id, updatedData) => handleEdit(`${BE_SCHOOL_SPECIALITY_URL}`, id, updatedData, setSpecialities)}
handleDelete={(id) => handleDelete(`${BE_SCHOOL_SPECIALITY_URL}`, id, setSpecialities)}
/>
<TeachersSection
teachers={teachers}
specialities={specialities}
handleCreate={(newData) => handleCreate(`${BK_GESTIONENSEIGNANTS_TEACHER_URL}`, newData, setTeachers)}
handleEdit={(id, updatedData) => handleEdit(`${BK_GESTIONENSEIGNANTS_TEACHER_URL}`, id, updatedData, setTeachers)}
handleDelete={(id) => handleDelete(`${BK_GESTIONENSEIGNANTS_TEACHER_URL}`, id, setTeachers)}
handleCreate={(newData) => handleCreate(`${BE_SCHOOL_TEACHER_URL}`, newData, setTeachers)}
handleEdit={(id, updatedData) => handleEdit(`${BE_SCHOOL_TEACHER_URL}`, id, updatedData, setTeachers)}
handleDelete={(id) => handleDelete(`${BE_SCHOOL_TEACHER_URL}`, id, setTeachers)}
/>
<ClassesSection
classes={classes}
<ClassesSection
classes={classes}
specialities={specialities}
teachers={teachers}
handleCreate={(newData) => handleCreate(`${BK_GESTIONENSEIGNANTS_CLASSE_URL}`, newData, setClasses)}
handleEdit={(id, updatedData) => handleEdit(`${BK_GESTIONENSEIGNANTS_CLASSE_URL}`, id, updatedData, setClasses)}
handleDelete={(id) => handleDelete(`${BK_GESTIONENSEIGNANTS_CLASSE_URL}`, id, setClasses)}
handleCreate={(newData) => handleCreate(`${BE_SCHOOL_SCHOOLCLASS_URL}`, newData, setClasses)}
handleEdit={(id, updatedData) => handleEdit(`${BE_SCHOOL_SCHOOLCLASS_URL}`, id, updatedData, setClasses)}
handleDelete={(id) => handleDelete(`${BE_SCHOOL_SCHOOLCLASS_URL}`, id, setClasses)}
/>
</ClassesProvider>
</div>
);
};

View File

@ -4,9 +4,10 @@ import Table from '@/components/Table';
import DropdownMenu from '@/components/DropdownMenu';
import Modal from '@/components/Modal';
import TeacherForm from '@/components/Structure/Configuration/TeacherForm';
import {BK_PROFILE_URL} from '@/utils/Url';
import useCsrfToken from '@/hooks/useCsrfToken';
import { TeacherFormProvider } from '@/context/TeacherFormContext';
import { createProfile, updateProfile } from '@/app/lib/authAction';
const TeachersSection = ({ teachers, handleCreate, handleEdit, handleDelete, specialities }) => {
@ -20,31 +21,21 @@ const TeachersSection = ({ teachers, handleCreate, handleEdit, handleDelete, spe
setEditingTeacher(teacher);
}
const closeEditModal = () => {
setIsOpen(false);
setEditingTeacher(null);
const closeEditModal = () => {
setIsOpen(false);
setEditingTeacher(null);
};
const handleModalSubmit = (updatedData) => {
if (editingTeacher) {
// Modification du profil
const request = new Request(
`${BK_PROFILE_URL}/${updatedData.profilAssocie_id}`,
{
method:'PUT',
headers: {
'Content-Type':'application/json',
'X-CSRFToken': csrfToken
},
credentials: 'include',
body: JSON.stringify( {
email: updatedData.mail,
username: updatedData.mail,
droit:updatedData.droit
}),
}
);
fetch(request).then(response => response.json())
const data = {
email: updatedData.mail,
username: updatedData.mail,
droit:updatedData.droit
}
updateProfile(updatedData.profilAssocie_id,data,csrfToken)
.then(response => {
console.log('Success:', response);
console.log('UpdateData:', updatedData);
@ -58,25 +49,14 @@ const TeachersSection = ({ teachers, handleCreate, handleEdit, handleDelete, spe
} else {
// Création d'un profil associé à l'adresse mail du responsable saisie
// Le profil est inactif
const request = new Request(
`${BK_PROFILE_URL}`,
{
method:'POST',
headers: {
'Content-Type':'application/json',
'X-CSRFToken': csrfToken
},
credentials: 'include',
body: JSON.stringify( {
email: updatedData.mail,
password: 'Provisoire01!',
username: updatedData.mail,
is_active: 1, // On rend le profil actif : on considère qu'au moment de la configuration de l'école un abonnement a été souscrit
droit:updatedData.droit
}),
}
);
fetch(request).then(response => response.json())
const data = {
email: updatedData.mail,
password: 'Provisoire01!',
username: updatedData.mail,
is_active: 1, // On rend le profil actif : on considère qu'au moment de la configuration de l'école un abonnement a été souscrit
droit:updatedData.droit
}
createProfile(data,csrfToken)
.then(response => {
console.log('Success:', response);
console.log('UpdateData:', updatedData);
@ -133,7 +113,7 @@ const TeachersSection = ({ teachers, handleCreate, handleEdit, handleDelete, spe
)
},
{
name: 'TYPE PROFIL',
name: 'TYPE PROFIL',
transform: (row) => {
if (row.profilAssocie) {
const badgeClass = row.DroitLabel === 'ECOLE' ? 'bg-blue-100 text-blue-600' : 'bg-red-100 text-red-600';
@ -168,9 +148,9 @@ const TeachersSection = ({ teachers, handleCreate, handleEdit, handleDelete, spe
</div>
{isOpen && (
<TeacherFormProvider initialTeacher={editingTeacher || {}}>
<Modal
isOpen={isOpen}
setIsOpen={setIsOpen}
<Modal
isOpen={isOpen}
setIsOpen={setIsOpen}
title={editingTeacher ? "Modification de l'enseignant" : "Création d'un nouvel enseignant"}
size='sm:w-1/4'
ContentComponent={() => (

View File

@ -6,7 +6,7 @@ import { DndProvider } from 'react-dnd';
import { AnimatePresence, motion } from 'framer-motion';
import PlanningClassView from '@/components/Structure/Planning/PlanningClassView';
import SpecialitiesList from '@/components/Structure/Planning/SpecialitiesList';
import { BK_GESTIONENSEIGNANTS_PLANNING_URL } from '@/utils/Url';
import { BE_SCHOOL_PLANNING_URL } from '@/utils/Url';
import { useClasses } from '@/context/ClassesContext';
import { ClasseFormProvider } from '@/context/ClasseFormContext';
import TabsStructure from '@/components/Structure/Configuration/TabsStructure';
@ -60,14 +60,14 @@ const ScheduleManagement = ({ handleUpdatePlanning, classes }) => {
const onDrop = (item, hour, day) => {
const { id, name, color, teachers } = item;
const newSchedule = { ...schedule, emploiDuTemps: schedule.emploiDuTemps || {} };
if (!newSchedule.emploiDuTemps[day]) {
newSchedule.emploiDuTemps[day] = [];
}
const courseTime = `${hour.toString().padStart(2, '0')}:00`;
const existingCourseIndex = newSchedule.emploiDuTemps[day].findIndex(course => course.heure === courseTime);
const newCourse = {
duree: '1',
heure: courseTime,
@ -75,21 +75,21 @@ const ScheduleManagement = ({ handleUpdatePlanning, classes }) => {
teachers: teachers,
color: color,
};
if (existingCourseIndex !== -1) {
newSchedule.emploiDuTemps[day][existingCourseIndex] = newCourse;
} else {
newSchedule.emploiDuTemps[day].push(newCourse);
}
// Mettre à jour scheduleRef
setSchedule(newSchedule)
// Utiliser `handleUpdatePlanning` pour mettre à jour le planning du niveau de la classe
const planningId = selectedClass.plannings_read.find(planning => planning.niveau === selectedLevel)?.planning.id;
if (planningId) {
console.log('newSchedule : ', newSchedule)
handleUpdatePlanning(BK_GESTIONENSEIGNANTS_PLANNING_URL, planningId, newSchedule);
handleUpdatePlanning(BE_SCHOOL_PLANNING_URL, planningId, newSchedule);
}
};
@ -110,7 +110,7 @@ const ScheduleManagement = ({ handleUpdatePlanning, classes }) => {
<DndProvider backend={HTML5Backend}>
<div className="p-4 bg-gray-100 border-b">
<div className="grid grid-cols-3 gap-4">
{/* Colonne Classes */}
<div className="p-4 bg-gray-50 rounded-lg shadow-inner">
<div className="flex justify-between items-center mb-4">
@ -131,7 +131,7 @@ const ScheduleManagement = ({ handleUpdatePlanning, classes }) => {
/>
}
</div>
{/* Colonne Niveaux */}
<div className="p-4 bg-gray-50 rounded-lg shadow-inner">
<div className="flex justify-between items-center mb-4">
@ -144,7 +144,7 @@ const ScheduleManagement = ({ handleUpdatePlanning, classes }) => {
<TabsStructure activeTab={selectedLevel} setActiveTab={handleLevelSelect} tabs={niveauxLabels} />
}
</div>
{/* Colonne Spécialités */}
<div className="p-4 bg-gray-50 rounded-lg shadow-inner">
<div className="flex justify-between items-center mb-4">
@ -155,10 +155,10 @@ const ScheduleManagement = ({ handleUpdatePlanning, classes }) => {
</div>
<SpecialitiesList teachers={selectedClass ? selectedClass.enseignants : []} />
</div>
</div>
</div>
<div className="flex-1 p-4 overflow-y-auto">
<AnimatePresence mode="wait">
<motion.div
@ -178,7 +178,7 @@ const ScheduleManagement = ({ handleUpdatePlanning, classes }) => {
</DndProvider>
</div>
);
};
export default ScheduleManagement;

View File

@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
import SelectChoice from '@/components/SelectChoice';
import { useClasses } from '@/context/ClassesContext';
import { useClasseForm } from '@/context/ClasseFormContext';
import { BK_GESTIONENSEIGNANTS_PLANNING_URL } from '@/utils/Url';
import { BE_SCHOOL_PLANNING_URL } from '@/utils/Url';
import { BookOpen, Users } from 'lucide-react';
const SpecialityEventModal = ({ isOpen, onClose, selectedCell, existingEvent, handleUpdatePlanning, classe }) => {
@ -56,17 +56,17 @@ const SpecialityEventModal = ({ isOpen, onClose, selectedCell, existingEvent, ha
const handleSubmit = (e) => {
e.preventDefault();
if (!eventData.specialiteId) {
alert('Veuillez sélectionner une spécialité');
return;
}
if (!eventData.teacherId) {
alert('Veuillez sélectionner un enseignant');
return;
}
// Transformer eventData pour correspondre au format du planning
const selectedTeacherData = formData.enseignants.find(teacher => teacher.id === parseInt(eventData.teacherId, 10));
const newCourse = {
@ -114,14 +114,14 @@ const SpecialityEventModal = ({ isOpen, onClose, selectedCell, existingEvent, ha
const planningId = updatedPlanning ? updatedPlanning.planning.id : null;
console.log("id : ", planningId)
if (planningId) {
handleUpdatePlanning(BK_GESTIONENSEIGNANTS_PLANNING_URL, planningId, updatedPlanning.emploiDuTemps);
handleUpdatePlanning(BE_SCHOOL_PLANNING_URL, planningId, updatedPlanning.emploiDuTemps);
}
onClose();
};
const filteredTeachers = selectedSpeciality
? formData.enseignants.filter(teacher =>
const filteredTeachers = selectedSpeciality
? formData.enseignants.filter(teacher =>
teacher.specialites_ids.includes(parseInt(selectedSpeciality, 10))
)
: formData.enseignants;