diff --git a/.env b/.env index 70a1f07..4610a22 100644 --- a/.env +++ b/.env @@ -1,2 +1,3 @@ REACT_APP_API_URL=http://192.168.100.7:3000 REACT_APP_PORT=3001 +hola=https://venus.acatlan.unam.mx/directorio_test \ No newline at end of file diff --git a/src/components/Nav/Menu.css b/src/components/Nav/Menu.css index 6e655a7..aa5333f 100644 --- a/src/components/Nav/Menu.css +++ b/src/components/Nav/Menu.css @@ -1,5 +1,4 @@ -.nav-link .bg-warning { - background-color: #002b7a !important; +.nav-link { color: #212529 !important; } @@ -42,14 +41,27 @@ margin-left: auto; } -.red{ +.red { background-color: rgb(193, 17, 17); color: white; text-decoration: none; } -.container{ +.container { border: 2px solid rgb(77, 77, 77); border-radius: 8px; margin: 10px; -} \ No newline at end of file +} + +.notButton { + text-align: start; + background: none; + border: none; + box-shadow: none; +} + +.notButton:hover{ + background: none; + border: none; + box-shadow: none; +} diff --git a/src/components/Nav/Menu.js b/src/components/Nav/Menu.js index 485184a..6a3eeeb 100644 --- a/src/components/Nav/Menu.js +++ b/src/components/Nav/Menu.js @@ -92,47 +92,47 @@ const Menu = () => {
  • - (window.location.href = PrivateRoutes.CREARPROFESOR) } > Crear Profesor - +
  • - (window.location.href = PublicRoutes.FILTER)} > Editar Profesor - +
  • {permissions === 1 && (
  • - (window.location.href = PrivateRoutes.CREARUSUARIO) } > Crear Usuario - +
  • - (window.location.href = PrivateRoutes.FILTERUSUARIO) } > Editar Usuario - +
  • )} diff --git a/src/components/Teacher/CrearProfesor/FormProfesor.js b/src/components/Teacher/CrearProfesor/FormProfesor.js index 6fd0ef5..b33f52c 100644 --- a/src/components/Teacher/CrearProfesor/FormProfesor.js +++ b/src/components/Teacher/CrearProfesor/FormProfesor.js @@ -24,6 +24,7 @@ const FormProfesor = () => { const [fotoBase64, setFotoBase64] = useState(""); const [lineasInvestigacion, setLineasInvestigacion] = useState([]); const [proyectosAcademicos, setProyectosAcademicos] = useState([]); + const [datosAcademicos,setDatosAcademicos] = useState([]); const [id_usuario] = useState("1"); const [num_trabajador, setNum_trabajador] = useState(""); const [rfc, setRfc] = useState(""); @@ -37,7 +38,6 @@ const FormProfesor = () => { const [mostrar, setMostrar] = useState(true); const [nombre, setNombre] = useState(""); const [grado_maximo, setGrado_maximo] = useState(""); - const [grados_obtenidos, setGrados_obtenidos] = useState(""); const { registerTeacher } = useRegisterTeacher(); const { uploadImage } = useUploadImage(); @@ -46,6 +46,12 @@ const FormProfesor = () => { setPage(newPage); }; + const handleGrados_obtenidosChange = (index, value) => { + const newGrados = [...datosAcademicos]; + newGrados[index].grados_obtenidos = value; + setDatosAcademicos(newGrados); + }; + const handleLineaInvestigacionChange = (index, value) => { const newLineas = [...lineasInvestigacion]; newLineas[index].lineas_inv_html = value; @@ -58,6 +64,10 @@ const FormProfesor = () => { setProyectosAcademicos(newProyectos); }; + const addGrados_obtenidos = () => { + setDatosAcademicos([...datosAcademicos, { grados_obtenidos: "" }]); + }; + const addLineaInvestigacion = () => { setLineasInvestigacion([...lineasInvestigacion, { lineas_inv_html: "" }]); }; @@ -66,6 +76,11 @@ const FormProfesor = () => { setProyectosAcademicos([...proyectosAcademicos, { proyecto_html: "" }]); }; + const deleteGrados_obtenidos = (index) => { + const newGrados = datosAcademicos.filter((_, i) => i !== index); + setDatosAcademicos(newGrados); + }; + const deleteLineaInvestigacion = (index) => { const newLineas = lineasInvestigacion.filter((_, i) => i !== index); setLineasInvestigacion(newLineas); @@ -89,7 +104,7 @@ const FormProfesor = () => { return false; } - if (!grado_maximo || !grados_obtenidos || !correo_pcp) { + if (!grado_maximo || !correo_pcp) { alert( "Por favor, complete todos los campos requeridos en Datos Académicos." ); @@ -128,6 +143,11 @@ const FormProfesor = () => { imageUrl = await uploadImage(fotoBase64, nombre); } + const updatedDatosAcademicos = datosAcademicos.map(dato => ({ + ...dato, + grado_maximo: grado_maximo || dato.grado_maximo + })); + const data = { nombre, id_usuario, @@ -147,15 +167,11 @@ const FormProfesor = () => { activo, lineasInvestigacion, proyectosAcademicos, - datosAcademicos: [ - { - grado_maximo, - grados_obtenidos, - }, - ], + datosAcademicos: updatedDatosAcademicos, fotografia: imageUrl, }; + console.log(data) registerTeacher(data); } catch (error) { if (error.response && error.response.status === 403) { @@ -305,19 +321,6 @@ const FormProfesor = () => { /> -
    - - setGrados_obtenidos(e.target.value)} - /> -
    -