From 65cf292fc36cd05863da918d2d55257303c46241 Mon Sep 17 00:00:00 2001 From: IO420 Date: Wed, 1 Oct 2025 10:12:41 -0600 Subject: [PATCH 01/14] fixing style and spelling --- app/(private)/AsignacionEquipo/page.tsx | 4 +- app/(private)/AsignacionMesas/page.tsx | 44 ++++--------------- app/(private)/Inscripcion/page.tsx | 2 +- app/(private)/Inscritos/page.tsx | 29 ++++++++++-- app/(private)/Programas/page.tsx | 4 +- app/Components/ActivosMantenimiento/Areas.tsx | 13 ++++-- app/Components/ActivosMantenimiento/Mesas.tsx | 8 ++-- .../BitacoraSanciones/TableSancion.tsx | 30 ++++++------- app/Components/Equipos/equipos.tsx | 19 ++++---- .../QuitarSancion/QuitarSancion.tsx | 6 +-- .../layout/BarNavigation/BarNavigation.tsx | 6 +-- 11 files changed, 85 insertions(+), 80 deletions(-) diff --git a/app/(private)/AsignacionEquipo/page.tsx b/app/(private)/AsignacionEquipo/page.tsx index 7e4976d..e541857 100644 --- a/app/(private)/AsignacionEquipo/page.tsx +++ b/app/(private)/AsignacionEquipo/page.tsx @@ -50,13 +50,14 @@ export default async function Page(props: {

ASIGNACION DE EQUIPOS

+ {student &&

No hay records disponibles

} @@ -68,6 +69,7 @@ export default async function Page(props: { label: "Cancelar tiempo", content: ( <> +
+ +
+ + + + + + + + + + + + + + + + + + + + +
Impresione B/NImpresiones ColorPlotteoEscanerTotal
5,00010,00010,00020,00045,000
+
); } diff --git a/app/(private)/Programas/page.tsx b/app/(private)/Programas/page.tsx index 014e048..078d3e4 100644 --- a/app/(private)/Programas/page.tsx +++ b/app/(private)/Programas/page.tsx @@ -18,7 +18,7 @@ export default function Page() { }; return ( - <> +
{modo === "ver" && (

PROGRAMAS

@@ -86,6 +86,6 @@ export default function Page() {
)} - +
); } diff --git a/app/Components/ActivosMantenimiento/Areas.tsx b/app/Components/ActivosMantenimiento/Areas.tsx index 16a06e4..9304175 100644 --- a/app/Components/ActivosMantenimiento/Areas.tsx +++ b/app/Components/ActivosMantenimiento/Areas.tsx @@ -1,6 +1,8 @@ "use client"; import { useState } from "react"; +import "@/app/globals.css" + export default function Areas() { const [area, setArea] = useState(""); // Área seleccionada const [activo, setActivo] = useState(false); // Checkbox Activo @@ -36,7 +38,7 @@ export default function Areas() { return (
-
+
{/* Select de áreas */} {/* Checkboxes */} +
+
-
+
{/* Botón Actualizar */} -

{button ?

desactivado

:

activado

}

+ ); } diff --git a/app/Components/Equipos/equipos.tsx b/app/Components/Equipos/equipos.tsx index 81afc2a..88ad08c 100644 --- a/app/Components/Equipos/equipos.tsx +++ b/app/Components/Equipos/equipos.tsx @@ -14,16 +14,17 @@ export default function Equipos() { const [Equipo, setEquipo] = useState(""); const [Data, setData] = useState(); - const handleSubmit = async () => { - const response = await axios.get( - `${envConfig.apiUrl}/InformacionEquipo/${Equipo}` - ); + const handleSubmit = async (e: React.MouseEvent) => { + e.preventDefault(); + // const response = await axios.get( + // `${envConfig.apiUrl}/equipo/${Equipo}` + // ); - if (!response) { - return; - } + // if (!response) { + // return; + // } - setData(response); + setData("response"); }; return ( @@ -37,7 +38,7 @@ export default function Equipos() { }} /> -
diff --git a/app/Components/QuitarSancion/QuitarSancion.tsx b/app/Components/QuitarSancion/QuitarSancion.tsx index 4249427..d40f252 100644 --- a/app/Components/QuitarSancion/QuitarSancion.tsx +++ b/app/Components/QuitarSancion/QuitarSancion.tsx @@ -22,9 +22,9 @@ function QuitarSancion() { id Nombre - Motivo Sancion + Motivo Sanción Duracion (semanas) - Fecha Sancion + Fecha Sanción Podria utilizar el servicio hasta @@ -42,7 +42,7 @@ function QuitarSancion() {
- + ); } diff --git a/app/Components/layout/BarNavigation/BarNavigation.tsx b/app/Components/layout/BarNavigation/BarNavigation.tsx index d8009bb..1b8b2a0 100644 --- a/app/Components/layout/BarNavigation/BarNavigation.tsx +++ b/app/Components/layout/BarNavigation/BarNavigation.tsx @@ -24,7 +24,7 @@ function BarNavigation() {
  • - toggleSubMenu(0)}>Inscripcion + toggleSubMenu(0)}>Inscripción
    • Alta
    • @@ -33,7 +33,7 @@ function BarNavigation() {
    • Agregar Tiempo
    • -
    • Inscripcion
    • +
    • Inscripción
  • @@ -90,7 +90,7 @@ function BarNavigation() {
  • - Quitar sancion + Quitar sanción
  • From b1165c8e70730002b0f2ce7cb376b74d98a90d57 Mon Sep 17 00:00:00 2001 From: IO420 Date: Wed, 1 Oct 2025 15:29:23 -0600 Subject: [PATCH 02/14] added toust and cleaned code --- app/(private)/ActivosMantenimiento/page.tsx | 19 ------- app/(private)/AgregarTiempo/page.tsx | 27 ++------- app/(private)/Alta/page.tsx | 20 ------- app/(private)/AsignacionEquipo/page.tsx | 18 ------ app/(private)/BitacoraSanciones/page.tsx | 19 ------- app/(private)/CambiarPass/page.tsx | 19 ------- app/(private)/Impresiones/page.tsx | 23 ++------ app/(private)/InformacionEquipo/page.tsx | 19 ------- app/(private)/Inscripcion/page.tsx | 25 ++------ app/(private)/Inscritos/page.tsx | 18 ------ app/(private)/Mensajes/page.tsx | 19 ------- app/(private)/Monitor/page.tsx | 4 -- app/(private)/QuitarSancion/page.tsx | 4 -- app/Components/ActivosMantenimiento/Areas.tsx | 2 +- .../ActivosMantenimiento/Equipos.tsx | 4 +- app/Components/ActivosMantenimiento/Mesas.tsx | 2 +- app/Components/EviarMensaje/EnviarMensaje.tsx | 2 +- app/Components/Global/AlertBox/AlertBox.css | 57 ------------------- app/Components/Global/AlertBox/AlertBox.tsx | 42 -------------- .../Global/ClearParams/ClearParams.tsx | 28 --------- app/Components/Global/FormHandle.tsx | 40 ------------- .../Global/SearchUser/searchUser.tsx | 3 +- app/Components/Global/ShowError.tsx | 14 +++++ app/Components/Global/visual/GlobalAlert.tsx | 36 ------------ app/Components/Impressions/impressions.tsx | 25 ++++---- app/Components/Receipt/Receipt.tsx | 31 ++++------ .../SearchDateBetween/SearchDateBetween.tsx | 2 +- .../auth/ChangePassword/changePassword.tsx | 2 +- app/Components/auth/Login/Login.tsx | 21 ++++--- app/Components/layout/ToastProvider.tsx | 44 ++++++++++++++ app/layout.tsx | 9 ++- app/lib/getSanciones.ts | 2 + package-lock.json | 28 ++++++++- package.json | 3 +- 34 files changed, 152 insertions(+), 479 deletions(-) delete mode 100644 app/Components/Global/AlertBox/AlertBox.css delete mode 100644 app/Components/Global/AlertBox/AlertBox.tsx delete mode 100644 app/Components/Global/ClearParams/ClearParams.tsx delete mode 100644 app/Components/Global/FormHandle.tsx create mode 100644 app/Components/Global/ShowError.tsx delete mode 100644 app/Components/Global/visual/GlobalAlert.tsx create mode 100644 app/Components/layout/ToastProvider.tsx diff --git a/app/(private)/ActivosMantenimiento/page.tsx b/app/(private)/ActivosMantenimiento/page.tsx index 2f0136d..9656692 100644 --- a/app/(private)/ActivosMantenimiento/page.tsx +++ b/app/(private)/ActivosMantenimiento/page.tsx @@ -1,8 +1,6 @@ import Areas from "@/app/Components/ActivosMantenimiento/Areas"; import Mesas from "@/app/Components/ActivosMantenimiento/Mesas"; import Equipos from "@/app/Components/Equipos/equipos"; -import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; -import ClearParams from "@/app/Components/Global/ClearParams/ClearParams"; import SearchUser from "@/app/Components/Global/SearchUser/searchUser"; import Toggle from "@/app/Components/Global/Toggle/Toggle"; @@ -10,30 +8,13 @@ export default async function Page(props: { searchParams?: Promise<{ numAcount?: string; machine?: string; - success?: string; - error?: string; }>; }) { const params = await props.searchParams; const numAcount = params?.numAcount ? params.numAcount : null; - const showSuccess = params?.success ? params.success : null; - const showError = params?.error ? params.error : null; return (
    - {showError && ( - <> - - - - )} - - {showSuccess && ( - <> - - - - )}

    EQUIPOS ACTIVOS Y EN MANTENIMIENTO

    diff --git a/app/(private)/AgregarTiempo/page.tsx b/app/(private)/AgregarTiempo/page.tsx index 723498d..3070b39 100644 --- a/app/(private)/AgregarTiempo/page.tsx +++ b/app/(private)/AgregarTiempo/page.tsx @@ -1,31 +1,27 @@ import SearchUser from "@/app/Components/Global/SearchUser/searchUser"; import Information from "@/app/Components/Global/Information/information"; import Receipt from "@/app/Components/Receipt/Receipt"; -import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; +import toast from "react-hot-toast"; import { GetStudent } from "@/app/lib/getStudent"; import "./addTime.css"; -import ClearParams from "@/app/Components/Global/ClearParams/ClearParams"; export default async function Page(props: { searchParams?: Promise<{ numAcount: string; - success?: string; - error?: string; }>; }) { const params = await props.searchParams; const numAcount = params?.numAcount ? params.numAcount : null; - const showSuccess = params?.success ? params.success : null; - let showError = params?.error ? params.error : null; let student: any = null; if (numAcount) { const result = await GetStudent(parseInt(numAcount)); if (result.error) { - showError = "Alumno no encontrado"; + toast.error("Alumno no encontrado"); + return } else { student = result; } @@ -33,25 +29,12 @@ export default async function Page(props: { return (
    - {showError && ( - <> - - - - )} - - {showSuccess && ( - <> - - - - )}

    AGREGAR TIEMPO

    - {student ? ( + {student && ( <> @@ -59,8 +42,6 @@ export default async function Page(props: { - ) : ( - <> )}
    ); diff --git a/app/(private)/Alta/page.tsx b/app/(private)/Alta/page.tsx index 2e51c0a..6f534c4 100644 --- a/app/(private)/Alta/page.tsx +++ b/app/(private)/Alta/page.tsx @@ -1,34 +1,14 @@ -import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; import RegisterAlta from "@/app/Components/Alta/registerAlta"; import "./style.css"; -import ClearParams from "@/app/Components/Global/ClearParams/ClearParams"; export default async function Page(props: { searchParams?: Promise<{ - success?: string; - error?: string; }>; }) { const params = await props.searchParams; - const showSuccess = params?.success ? params.success : null; - const showError = params?.error ? params.error : null; - return (
    - {showError && ( - <> - - - - )} - - {showSuccess && ( - <> - - - - )}

    ALTA

    diff --git a/app/(private)/AsignacionEquipo/page.tsx b/app/(private)/AsignacionEquipo/page.tsx index 51effbc..92cb5d2 100644 --- a/app/(private)/AsignacionEquipo/page.tsx +++ b/app/(private)/AsignacionEquipo/page.tsx @@ -1,5 +1,3 @@ -import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; -import ClearParams from "@/app/Components/Global/ClearParams/ClearParams"; import SearchUser from "@/app/Components/Global/SearchUser/searchUser"; import Toggle from "@/app/Components/Global/Toggle/Toggle"; import { GetStudent } from "@/app/lib/getStudent"; @@ -11,15 +9,11 @@ export default async function Page(props: { searchParams?: Promise<{ numAcount?: string; machine?: string; - success?: string; - error?: string; }>; }) { const params = await props.searchParams; const numAcount = params?.numAcount ? params.numAcount : null; const machine = params?.machine ? params.machine : null; - const showSuccess = params?.success ? params.success : null; - const showError = params?.error ? params.error : null; let student: any = null; @@ -34,19 +28,7 @@ export default async function Page(props: { return (
    - {showError && ( - <> - - - - )} - {showSuccess && ( - <> - - - - )}

    ASIGNACION DE EQUIPOS

    diff --git a/app/(private)/BitacoraSanciones/page.tsx b/app/(private)/BitacoraSanciones/page.tsx index cc6c2cd..02e5046 100644 --- a/app/(private)/BitacoraSanciones/page.tsx +++ b/app/(private)/BitacoraSanciones/page.tsx @@ -3,23 +3,17 @@ import BitacoraEquipo from "@/app/Components/BitacoraSanciones/BitacoraEquipo"; import BitacoraMesas from "@/app/Components/BitacoraSanciones/BitacoraMesas"; import Sanciones from "@/app/Components/BitacoraSanciones/Sanciones"; import Toggle from "@/app/Components/Global/Toggle/Toggle"; -import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; import { GetStudent } from "@/app/lib/getStudent"; -import ClearParams from "@/app/Components/Global/ClearParams/ClearParams"; export default async function Page(props: { searchParams?: Promise<{ key?: string; numAcount?: string; - success?: string; - error?: string; }>; }) { const params = await props.searchParams; const key = params?.key && params.key ; const numAcount = params?.numAcount ? params.numAcount : null; - const showSuccess = params?.success ? params.success : null; - const showError = params?.error ? params.error : null; let student: any = null; @@ -34,19 +28,6 @@ export default async function Page(props: { return (
    - {showError && ( - <> - - - - )} - - {showSuccess && ( - <> - - - - )}

    BITACORA Y SANCIONES

    diff --git a/app/(private)/CambiarPass/page.tsx b/app/(private)/CambiarPass/page.tsx index 23da32e..c6388ad 100644 --- a/app/(private)/CambiarPass/page.tsx +++ b/app/(private)/CambiarPass/page.tsx @@ -1,32 +1,13 @@ import ChangePassword from "@/app/Components/auth/ChangePassword/changePassword"; -import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; -import ClearParams from "@/app/Components/Global/ClearParams/ClearParams"; export default async function Page(props: { searchParams?: Promise<{ - success?: string; - error?: string; }>; }) { const params = await props.searchParams; - const showSuccess = params?.success ? params.success : null; - const showError = params?.error ? params.error : null; return (
    - {showError && ( - <> - - - - )} - - {showSuccess && ( - <> - - - - )}

    Cambiar contraseña

    diff --git a/app/(private)/Impresiones/page.tsx b/app/(private)/Impresiones/page.tsx index f78b77e..53494b1 100644 --- a/app/(private)/Impresiones/page.tsx +++ b/app/(private)/Impresiones/page.tsx @@ -2,33 +2,31 @@ import SearchUser from "../../Components/Global/SearchUser/searchUser"; import Receipt from "../../Components/Receipt/Receipt"; import Toggle from "../../Components/Global/Toggle/Toggle"; import Information from "../../Components/Global/Information/information"; -import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; import Impressions from "@/app/Components/Impressions/impressions"; +import ShowError from "@/app/Components/Global/ShowError"; + import { GetStudent } from "@/app/lib/getStudent"; import "@/app/globals.css"; -import ClearParams from "@/app/Components/Global/ClearParams/ClearParams"; export default async function Page(props: { searchParams?: Promise<{ key: string; numAcount: string; - success?: string; - error?: string; }>; }) { const params = await props.searchParams; const key = params?.key && params.key; const numAcount = params?.numAcount ? params.numAcount : null; - const showSuccess = params?.success ? params.success : null; - const showError = params?.error ? params.error : null; let student: any = null; + let errorMessage = ""; if (numAcount) { const result = await GetStudent(parseInt(numAcount)); if (result.error) { + errorMessage = `${result.error}`; } else { student = result; } @@ -36,19 +34,8 @@ export default async function Page(props: { return (
    - {showError && ( - <> - - - - )} - {showSuccess && ( - <> - - - - )} + {errorMessage && }

    IMPRESIONES Y PLOTEO

    diff --git a/app/(private)/InformacionEquipo/page.tsx b/app/(private)/InformacionEquipo/page.tsx index e664473..8b62831 100644 --- a/app/(private)/InformacionEquipo/page.tsx +++ b/app/(private)/InformacionEquipo/page.tsx @@ -1,40 +1,21 @@ import Toggle from "@/app/Components/Global/Toggle/Toggle"; import Equipos from "@/app/Components/Equipos/equipos"; -import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; import ProgramSelector from "@/app/Components/InformacionEquipos/ProgramSelector"; import "./informacionequipo.css"; -import ClearParams from "@/app/Components/Global/ClearParams/ClearParams"; export default async function Page(props: { searchParams?: Promise<{ key?:string; machine?: string; - success?: string; - error?: string; }>; }) { const params = await props.searchParams; const key = params?.key && params.key; const machine = params?.machine ? params.machine : null; - const showSuccess = params?.success ? params.success : null; - const showError = params?.error ? params.error : null; return (
    - {showError && ( - <> - - - - )} - - {showSuccess && ( - <> - - - - )}

    INFORMACION DE EQUIPOS

    diff --git a/app/(private)/Inscripcion/page.tsx b/app/(private)/Inscripcion/page.tsx index 96abb7f..3ebe703 100644 --- a/app/(private)/Inscripcion/page.tsx +++ b/app/(private)/Inscripcion/page.tsx @@ -2,30 +2,26 @@ import SearchUser from "@/app/Components/Global/SearchUser/searchUser"; import Information from "@/app/Components/Global/Information/information"; import Receipt from "@/app/Components/Receipt/Receipt"; import Selection from "@/app/Components/Selection/Selection"; -import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; -import ClearParams from "@/app/Components/Global/ClearParams/ClearParams"; import { GetStudent } from "@/app/lib/getStudent"; import "./inscripcion.css"; +import ShowError from "@/app/Components/Global/ShowError"; export default async function Page(props: { searchParams?: Promise<{ numAcount: string; - success?: string; - error?: string; }>; }) { const params = await props.searchParams; const numAcount = params?.numAcount ? params.numAcount : null; - const showSuccess = params?.success ? params.success : null; - let showError = params?.error ? params.error : null; let student: any = null; + let errorMessage = ""; if (numAcount) { const result = await GetStudent(parseInt(numAcount)); if (result.error) { - showError = "Alumno no encontrado"; + errorMessage = `${result.error}`; } else { student = result; } @@ -33,19 +29,8 @@ export default async function Page(props: { return (
    - {showError && ( - <> - - - - )} - - {showSuccess && ( - <> - - - - )} + + {errorMessage && }

    INSCRIPCIÓN

    diff --git a/app/(private)/Inscritos/page.tsx b/app/(private)/Inscritos/page.tsx index 25d5e10..33e0605 100644 --- a/app/(private)/Inscritos/page.tsx +++ b/app/(private)/Inscritos/page.tsx @@ -1,33 +1,15 @@ -import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; -import ClearParams from "@/app/Components/Global/ClearParams/ClearParams"; export default async function Page(props: { searchParams?: Promise<{ period: string; - success?: string; - error?: string; }>; }) { const params = await props.searchParams; const period = params?.period ? params.period : null; - const showSuccess = params?.success ? params.success : null; - const showError = params?.error ? params.error : null; return (
    - {showError && ( - <> - - - - )} - {showSuccess && ( - <> - - - - )}

    INSCRITOS

    diff --git a/app/(private)/Mensajes/page.tsx b/app/(private)/Mensajes/page.tsx index eaeaf38..4531cf4 100644 --- a/app/(private)/Mensajes/page.tsx +++ b/app/(private)/Mensajes/page.tsx @@ -1,35 +1,16 @@ import EnviarMensaje from "@/app/Components/EviarMensaje/EnviarMensaje"; -import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; -import ClearParams from "@/app/Components/Global/ClearParams/ClearParams"; import Toggle from "@/app/Components/Global/Toggle/Toggle"; export default async function Page(props: { searchParams?: Promise<{ key:string; - success?: string; - error?: string; }>; }) { const params = await props.searchParams; const key = params?.key && params.key ; - const showSuccess = params?.success ? params.success : null; - const showError = params?.error ? params.error : null; return (
    - {showError && ( - <> - - - - )} - - {showSuccess && ( - <> - - - - )}

    Enviar mensaje

    diff --git a/app/(private)/Monitor/page.tsx b/app/(private)/Monitor/page.tsx index f228ed9..6712b5c 100644 --- a/app/(private)/Monitor/page.tsx +++ b/app/(private)/Monitor/page.tsx @@ -3,14 +3,10 @@ import styles from "./Page.module.css"; export default async function Page(props: { searchParams?: Promise<{ numAcount: string; - success?: string; - error?: string; }>; }) { const params = await props.searchParams; const numAcount = params?.numAcount ? params.numAcount : null; - const showSuccess = params?.success ? params.success : null; - const showError = params?.error ? params.error : null; return (
    diff --git a/app/(private)/QuitarSancion/page.tsx b/app/(private)/QuitarSancion/page.tsx index 74d7ef3..bd1e1a5 100644 --- a/app/(private)/QuitarSancion/page.tsx +++ b/app/(private)/QuitarSancion/page.tsx @@ -4,14 +4,10 @@ import QuitarSancion from "@/app/Components/QuitarSancion/QuitarSancion"; export default async function Page(props: { searchParams?: Promise<{ numAcount: string; - success?: string; - error?: string; }>; }) { const params = await props.searchParams; const numAcount = params?.numAcount ? params.numAcount : null; - const showSuccess = params?.success ? params.success : null; - const showError = params?.error ? params.error : null; return ( <> diff --git a/app/Components/ActivosMantenimiento/Areas.tsx b/app/Components/ActivosMantenimiento/Areas.tsx index 9304175..9285ba2 100644 --- a/app/Components/ActivosMantenimiento/Areas.tsx +++ b/app/Components/ActivosMantenimiento/Areas.tsx @@ -9,7 +9,7 @@ export default function Areas() { const [mantenimiento, setMantenimiento] = useState(false); // Checkbox Mantenimiento const [mensaje, setMensaje] = useState(""); // Mensaje dinámico - const handleActualizar = (e: React.FormEvent) => { + const handleActualizar = (e: React.FormEvent) => { e.preventDefault(); if (!area) { diff --git a/app/Components/ActivosMantenimiento/Equipos.tsx b/app/Components/ActivosMantenimiento/Equipos.tsx index 9728709..53aa0e7 100644 --- a/app/Components/ActivosMantenimiento/Equipos.tsx +++ b/app/Components/ActivosMantenimiento/Equipos.tsx @@ -6,7 +6,7 @@ function Equipos() { const [tiempo, setTiempo] = useState(""); const [mensaje, setMensaje] = useState(""); - const handleBuscar = (e: React.FormEvent) => { + const handleBuscar = (e: React.FormEvent) => { e.preventDefault(); if (!cuenta) { setMensaje("Ingresa un número de cuenta antes de buscar"); @@ -15,7 +15,7 @@ function Equipos() { setMensaje(`Buscando información del No. de cuenta: ${cuenta}`); }; - const handleAsignar = (e: React.FormEvent) => { + const handleAsignar = (e: React.FormEvent) => { e.preventDefault(); if (!tiempo) { setMensaje("Selecciona un equipo antes de asignar"); diff --git a/app/Components/ActivosMantenimiento/Mesas.tsx b/app/Components/ActivosMantenimiento/Mesas.tsx index ff48be7..e37138c 100644 --- a/app/Components/ActivosMantenimiento/Mesas.tsx +++ b/app/Components/ActivosMantenimiento/Mesas.tsx @@ -8,7 +8,7 @@ function Mesas() { const [mantenimiento, setMantenimiento] = useState(false); // Checkbox Mantenimiento const [mensaje, setMensaje] = useState(""); // Mensaje dinámico - const handleConfirmar = (e: React.FormEvent) => { + const handleConfirmar = (e: React.FormEvent) => { e.preventDefault(); if (!mesa) { diff --git a/app/Components/EviarMensaje/EnviarMensaje.tsx b/app/Components/EviarMensaje/EnviarMensaje.tsx index 99aadfb..ac01900 100644 --- a/app/Components/EviarMensaje/EnviarMensaje.tsx +++ b/app/Components/EviarMensaje/EnviarMensaje.tsx @@ -12,7 +12,7 @@ const EnviarMensaje = ({ titulo, opciones }: EnviarMensajeProps) => { const [mensaje, setMensaje] = useState(""); const [customMsg, setCustomMsg] = useState(""); - const handleSubmit = (e: React.FormEvent) => { + const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); // Aquí puedes manejar el envío (guardar en estado global, enviar a backend, etc.) }; diff --git a/app/Components/Global/AlertBox/AlertBox.css b/app/Components/Global/AlertBox/AlertBox.css deleted file mode 100644 index cceac3f..0000000 --- a/app/Components/Global/AlertBox/AlertBox.css +++ /dev/null @@ -1,57 +0,0 @@ -@keyframes slideInLeft { - 0% { - opacity: 0; - transform: translateX(-100%); - } - 100% { - opacity: 0.9; - transform: translateX(0); - } -} - -@keyframes slideOutRight { - 0% { - opacity: 0.9; - transform: translateX(0); - } - 100% { - opacity: 0; - transform: translateX(100%); - } -} - -.messageBox { - display: flex; - position: absolute; - padding: 0.5rem 1.25rem; - border-radius: 0 4px 4px 0; - font-weight: bold; - font-size: 2rem; - text-align: center; - z-index: 100; - top: 0; - left: 0; - max-width: 500px; - max-height: min-content; - opacity: 0; -} - -.messageBox:not(.hidden) { - animation: slideInLeft 0.5s ease forwards; -} - -.messageBox.hidden { - animation: slideOutRight 0.5s ease forwards; -} - -.success { - background-color: #d1f7c4; - color: #000000; - border: 1px solid #a5d6a7; -} - -.error { - background-color: #ffcdd2; - color: #000000; - border: 1px solid #ef9a9a; -} diff --git a/app/Components/Global/AlertBox/AlertBox.tsx b/app/Components/Global/AlertBox/AlertBox.tsx deleted file mode 100644 index aa295e5..0000000 --- a/app/Components/Global/AlertBox/AlertBox.tsx +++ /dev/null @@ -1,42 +0,0 @@ -"use client"; - -import { useEffect, useState } from "react"; -import "./AlertBox.css"; -import ClearParams from "../ClearParams/ClearParams"; - -interface AlertBoxProps { - message: string | null; - type: "error" | "success"; - duration?: number; -} - -export default function AlertBox({ - message, - type, - duration = 6000, -}: AlertBoxProps) { - const [visible, setVisible] = useState(false); - const [text, setText] = useState(""); - - useEffect(() => { - if (message) { - setText(message); - setVisible(true); - - const timeout = setTimeout(() => { - setVisible(false); - setTimeout(() => setText(""), 500); - }, duration); - - return () => clearTimeout(timeout); - } - }, [message, duration]); - - if (!text) return null; - - return ( -
    - {text} -
    - ); -} diff --git a/app/Components/Global/ClearParams/ClearParams.tsx b/app/Components/Global/ClearParams/ClearParams.tsx deleted file mode 100644 index 7bf870c..0000000 --- a/app/Components/Global/ClearParams/ClearParams.tsx +++ /dev/null @@ -1,28 +0,0 @@ -"use client"; - -import { useEffect } from "react"; - -interface ClearParamsProps { - paramsToClear: string[]; -} - -export default function ClearParams({ paramsToClear }: ClearParamsProps) { - useEffect(() => { - if (typeof window === "undefined") return; - const url = new URL(window.location.href); - let changed = false; - - paramsToClear.forEach((param) => { - if (url.searchParams.has(param)) { - url.searchParams.delete(param); - changed = true; - } - }); - - if (changed) { - window.history.replaceState({}, "", url.toString()); - } - }, [paramsToClear]); - - return null; -} diff --git a/app/Components/Global/FormHandle.tsx b/app/Components/Global/FormHandle.tsx deleted file mode 100644 index 6f3d3c9..0000000 --- a/app/Components/Global/FormHandle.tsx +++ /dev/null @@ -1,40 +0,0 @@ -"use client"; - -import { ReactNode, useCallback } from "react"; -import { useRouter, usePathname, useSearchParams } from "next/navigation"; - -interface FormHandlerProps { - children: ReactNode; - onSubmit: () => Promise; -} - -export default function FormHandler({ children, onSubmit }: FormHandlerProps) { - const router = useRouter(); - const searchParams = useSearchParams(); - const pathname = usePathname(); - - const updateParams = useCallback( - (updates: Record) => { - const params = new URLSearchParams(searchParams.toString()); - - Object.entries(updates).forEach(([key, value]) => { - if (value === null) params.delete(key); - else params.set(key, value); - }); - - router.push(`${pathname}?${params.toString()}`); - }, - [searchParams, router, pathname] - ); - - const handleSubmit = async (e: React.FormEvent) => { - e.preventDefault(); - try { - await onSubmit(); - } catch (err: any) { - updateParams({ error: String(err) }); - } - }; - - return {children}; -} diff --git a/app/Components/Global/SearchUser/searchUser.tsx b/app/Components/Global/SearchUser/searchUser.tsx index 8057454..9251b8e 100644 --- a/app/Components/Global/SearchUser/searchUser.tsx +++ b/app/Components/Global/SearchUser/searchUser.tsx @@ -19,11 +19,10 @@ function SearchUser(props: urlProp) { } }, [props.value]); - const handleSubmit = (e: React.FormEvent) => { + const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); const params = new URLSearchParams(searchParams.toString()); if (numAcount) { - params.delete("error"); params.set("numAcount", `${numAcount}`); router.push(`${pathname}?${params.toString()}`); } diff --git a/app/Components/Global/ShowError.tsx b/app/Components/Global/ShowError.tsx new file mode 100644 index 0000000..ef7140b --- /dev/null +++ b/app/Components/Global/ShowError.tsx @@ -0,0 +1,14 @@ +"use client"; + +import { useEffect } from "react"; +import toast from "react-hot-toast"; + +export default function ShowError({ message }: { message: string }) { + useEffect(() => { + if (message) { + toast.error(message); + } + }, [message]); + + return null; +} diff --git a/app/Components/Global/visual/GlobalAlert.tsx b/app/Components/Global/visual/GlobalAlert.tsx deleted file mode 100644 index a1518bf..0000000 --- a/app/Components/Global/visual/GlobalAlert.tsx +++ /dev/null @@ -1,36 +0,0 @@ -"use client"; - -import { useEffect, useState } from "react"; -import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; -import ClearParams from "@/app/Components/Global/ClearParams/ClearParams"; -import { useSearchParams } from "next/navigation"; - -export default function GlobalAlert() { - const searchParams = useSearchParams(); - const [showSuccess, setShowSuccess] = useState(null); - const [showError, setShowError] = useState(null); - - useEffect(() => { - const success = searchParams.get("success"); - const error = searchParams.get("error"); - - if (success) setShowSuccess(success); - if (error) setShowError(error); - }, []); - - return ( -
    - {showError && ( - <> - - - )} - - {showSuccess && ( - <> - - - )} -
    - ); -} diff --git a/app/Components/Impressions/impressions.tsx b/app/Components/Impressions/impressions.tsx index 018a35d..534f634 100644 --- a/app/Components/Impressions/impressions.tsx +++ b/app/Components/Impressions/impressions.tsx @@ -4,6 +4,7 @@ import Cookies from "js-cookie"; import { useState } from "react"; import { useRouter } from "next/navigation"; import { PostImpressions } from "@/app/lib/postImpressions"; +import toast from "react-hot-toast"; interface CostOption { value: number; @@ -27,24 +28,19 @@ function Impressions({ costs, numAcount }: ImpressionsProps) { }; const handlePayment = async () => { - const currentUrl = new URL(window.location.href); - const params = new URLSearchParams(); - - const setError = (msg: string) => { - params.set("error", msg); - router.push(`${currentUrl}&${params.toString()}`); - }; - if (!numAcount) { - return setError("busca de nuevo al estudiante"); + toast.error("busca de nuevo al estudiante"); + return; } if (!pages) { - return setError("Ingresa el numero de hojas a imprimir"); + toast.error("Ingresa el numero de hojas a imprimir"); + return; } if (!cost) { - return setError("Selecciona un costo"); + toast.error("Selecciona un costo"); + return; } const result = await PostImpressions({ @@ -56,16 +52,15 @@ function Impressions({ costs, numAcount }: ImpressionsProps) { if (result.error) { if (result.error === "Token inválido") handleLogout(); else { - return setError(`Error: ${result.error}`); + toast.error(result.error); + return; } return; } setPages(""); setCost(""); - params.delete("error"); - params.set("success", "Impresion cobrada correctamente"); - router.push(`${currentUrl}&${params.toString()}`); + toast.success("Impresion cobrada correctamente"); }; return ( diff --git a/app/Components/Receipt/Receipt.tsx b/app/Components/Receipt/Receipt.tsx index 60efc9d..79b125d 100644 --- a/app/Components/Receipt/Receipt.tsx +++ b/app/Components/Receipt/Receipt.tsx @@ -1,5 +1,6 @@ "use client"; +import toast from "react-hot-toast"; import { useState } from "react"; import { PostReceipt } from "@/app/lib/postReceipt"; import { useRouter } from "next/navigation"; @@ -28,28 +29,25 @@ function Receipt({ numAcount }: ReceiptsProps) { //restrict this month// const handleSaveReceipt = async () => { - const currentUrl = new URL(window.location.href); - const params = new URLSearchParams(); - - const setError = (msg: string) => { - params.set("error", msg); - router.push(`${currentUrl}&${params.toString()}`); - }; if (!numAcount) { - return setError("busca de nuevo al estudiante"); + toast.error("busca de nuevo al estudiante"); + return; } if (!folio) { - return setError("Ingresa el folio del ticket"); + toast.error("Ingresa el folio del ticket"); + return; } if (!amount) { - return setError("Coloca el monto a depositar"); + toast.error("Coloca el monto a depositar"); + return; } if (!date) { - return setError("Coloca la fecha"); + toast.error("Coloca la fecha"); + return; } try { @@ -64,11 +62,9 @@ function Receipt({ numAcount }: ReceiptsProps) { setAmount(""); setDate(""); - params.delete("error"); - params.set("success", "Recibo guardado"); - router.push(`${currentUrl}&${params.toString()}`); + toast.success("Recibo guardado"); } catch (err: any) { - setError(String(err)); + toast.error(String(err)); } }; @@ -111,10 +107,7 @@ function Receipt({ numAcount }: ReceiptsProps) { if (value === "" || numericValue <= 1000) { setAmount(value); } else { - const currentUrl = new URL(window.location.href); - const params = new URLSearchParams(); - params.set("error", "El monto no puede superar $1000.00"); - router.push(`${currentUrl}&${params.toString()}`); + toast.error("El monto no puede superar $1000.00"); } } }} diff --git a/app/Components/SearchDateBetween/SearchDateBetween.tsx b/app/Components/SearchDateBetween/SearchDateBetween.tsx index 2cfb89b..38102bb 100644 --- a/app/Components/SearchDateBetween/SearchDateBetween.tsx +++ b/app/Components/SearchDateBetween/SearchDateBetween.tsx @@ -6,7 +6,7 @@ function SearchDateBetween() { const [startDate, setStartDate] = useState(""); const [endDate, setEndDate] = useState(""); - const handleSubmit = (e: React.FormEvent) => { + const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); console.log("Fecha inicio:", startDate); console.log("Fecha fin:", endDate); diff --git a/app/Components/auth/ChangePassword/changePassword.tsx b/app/Components/auth/ChangePassword/changePassword.tsx index c02db53..1a47db6 100644 --- a/app/Components/auth/ChangePassword/changePassword.tsx +++ b/app/Components/auth/ChangePassword/changePassword.tsx @@ -6,7 +6,7 @@ export default function ChangePassword() { const [newPass, setNewPass] = useState(""); const [confirmNewPass, setconfirmNewPass] = useState(""); - const handleChangePass = (e: React.FormEvent) => { + const handleChangePass = (e: React.FormEvent) => { e.preventDefault; const data = { pass, newPass, confirmNewPass }; console.log(data); diff --git a/app/Components/auth/Login/Login.tsx b/app/Components/auth/Login/Login.tsx index e5adf37..0e8fae2 100644 --- a/app/Components/auth/Login/Login.tsx +++ b/app/Components/auth/Login/Login.tsx @@ -3,24 +3,32 @@ import { useState } from "react"; import { loginUser } from "@/app/lib/login"; import { useRouter } from "next/navigation"; +import toast from "react-hot-toast"; import "./Login.css"; -import AlertBox from "../../Global/AlertBox/AlertBox"; function Login() { const [user, setUser] = useState(""); const [password, setPassword] = useState(""); - const [error, setError] = useState(""); - const [alert, setAlert] = useState(""); const router = useRouter(); const handleLogin = async (e: React.FormEvent) => { e.preventDefault(); + if (!user) { + toast.error("Coloca un usuario"); + return; + } + + if (!password) { + toast.error("Coloca una contraseña"); + return; + } + const data = await loginUser(user, password); if ("error" in data) { - setError(data.error); + toast.error(data.error); } else { const token = data.access_token; const payload = JSON.parse(atob(token.split(".")[1])); @@ -29,7 +37,7 @@ function Login() { document.cookie = `token=${token}; path=/; SameSite=Strict`; document.cookie = `usuario=${usuario}; path=/; SameSite=Strict`; - setAlert("Inicio de sesión exitoso"); + toast.success("Inicio de sesión exitoso"); router.push("/Impresiones"); } }; @@ -70,9 +78,6 @@ function Login() { > Iniciar sesión - - {error && } - {alert && }
    ); diff --git a/app/Components/layout/ToastProvider.tsx b/app/Components/layout/ToastProvider.tsx new file mode 100644 index 0000000..9cadd36 --- /dev/null +++ b/app/Components/layout/ToastProvider.tsx @@ -0,0 +1,44 @@ +"use client"; + +import { Toaster } from "react-hot-toast"; +import React from "react"; + +export function ToastProvider({ children }: { children: React.ReactNode }) { + return ( + <> + {children} + + + ); +} diff --git a/app/layout.tsx b/app/layout.tsx index b7a6f45..bb5e5fe 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -5,6 +5,7 @@ import Header from "./Components/layout/Header/Header"; import Footer from "./Components/layout/Footer/Footer"; import "./globals.css"; +import { ToastProvider } from "./Components/layout/ToastProvider"; const poppins = Poppins({ variable: "--font-poppins", @@ -27,9 +28,11 @@ export default function RootLayout({ return ( -
    -
    {children}
    -
    + +
    +
    {children}
    +
    + ); diff --git a/app/lib/getSanciones.ts b/app/lib/getSanciones.ts index 46fcbd0..2a8e22c 100644 --- a/app/lib/getSanciones.ts +++ b/app/lib/getSanciones.ts @@ -6,6 +6,7 @@ export async function GetSanciones(numAcount: number) { const response = await axios.get( `${envConfig.apiUrl}/alumno-sancion/${numAcount}` ); + return response.data; } catch (error: any) { const msg = @@ -15,3 +16,4 @@ export async function GetSanciones(numAcount: number) { return { error: msg }; } } +//IO \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index b03311e..9bc5488 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ "next": "^15.5.3", "react": "19.1.0", "react-dom": "19.1.0", + "react-hot-toast": "^2.6.0", "react-icons": "^5.5.0" }, "devDependencies": { @@ -748,7 +749,6 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", - "dev": true, "license": "MIT" }, "node_modules/delayed-stream": { @@ -911,6 +911,15 @@ "node": ">= 0.4" } }, + "node_modules/goober": { + "version": "2.1.16", + "resolved": "https://registry.npmjs.org/goober/-/goober-2.1.16.tgz", + "integrity": "sha512-erjk19y1U33+XAMe1VTvIONHYoSqE4iS7BYUZfHaqeohLmnC0FdxEh7rQU+6MZ4OajItzjZFSRtVANrQwNq6/g==", + "license": "MIT", + "peerDependencies": { + "csstype": "^3.0.10" + } + }, "node_modules/gopd": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", @@ -1139,6 +1148,23 @@ "react": "^19.1.0" } }, + "node_modules/react-hot-toast": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/react-hot-toast/-/react-hot-toast-2.6.0.tgz", + "integrity": "sha512-bH+2EBMZ4sdyou/DPrfgIouFpcRLCJ+HoCA32UoAYHn6T3Ur5yfcDCeSr5mwldl6pFOsiocmrXMuoCJ1vV8bWg==", + "license": "MIT", + "dependencies": { + "csstype": "^3.1.3", + "goober": "^2.1.16" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "react": ">=16", + "react-dom": ">=16" + } + }, "node_modules/react-icons": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-5.5.0.tgz", diff --git a/package.json b/package.json index 3e66ed6..c888ba7 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "scripts": { "dev": "next dev --turbopack", "build": "next build", - "start": "next start", + "start": "next start", "lint": "next lint" }, "dependencies": { @@ -14,6 +14,7 @@ "next": "^15.5.3", "react": "19.1.0", "react-dom": "19.1.0", + "react-hot-toast": "^2.6.0", "react-icons": "^5.5.0" }, "devDependencies": { From d65efc56ab00ec5719e0bd6896a7c1f8f264338d Mon Sep 17 00:00:00 2001 From: IO420 Date: Wed, 1 Oct 2025 15:57:38 -0600 Subject: [PATCH 03/14] added interceptors.response --- app/Components/auth/Login/Login.tsx | 2 +- app/lib/apiClient.ts | 49 ++++++++++++++++++++++++----- 2 files changed, 43 insertions(+), 8 deletions(-) diff --git a/app/Components/auth/Login/Login.tsx b/app/Components/auth/Login/Login.tsx index 0e8fae2..4cd7228 100644 --- a/app/Components/auth/Login/Login.tsx +++ b/app/Components/auth/Login/Login.tsx @@ -35,7 +35,7 @@ function Login() { const usuario = payload.usuario; document.cookie = `token=${token}; path=/; SameSite=Strict`; - document.cookie = `usuario=${usuario}; path=/; SameSite=Strict`; + document.cookie = `user=${usuario}; path=/; SameSite=Strict`; toast.success("Inicio de sesión exitoso"); router.push("/Impresiones"); diff --git a/app/lib/apiClient.ts b/app/lib/apiClient.ts index 0ffd831..4d321e6 100644 --- a/app/lib/apiClient.ts +++ b/app/lib/apiClient.ts @@ -2,22 +2,57 @@ import axios from "axios"; import Cookies from "js-cookie"; import { envConfig } from "./config"; +if (!envConfig.apiUrl) { + throw new Error("API URL is not defined in envConfig"); +} + const apiClient = axios.create({ baseURL: envConfig.apiUrl, + timeout: 10000, headers: { "Content-Type": "application/json", }, }); -apiClient.interceptors.request.use((config) => { - const token = Cookies.get("token"); - if (token) { - if (config.headers && "set" in config.headers) { - config.headers.set("Authorization", `Bearer ${token}`); +apiClient.interceptors.request.use( + (config) => { + const token = Cookies.get("token"); + if (token) { + config.headers.Authorization = `Bearer ${token}`; } + return config; + }, + (error) => { + return Promise.reject(error); } - return config; -}); +); + +apiClient.interceptors.response.use( + (response) => response, + (error) => { + if (error.response) { + const status = error.response.status; + + if (status === 401) { + Cookies.remove("token"); + Cookies.remove("user"); + + if ( + typeof window !== "undefined" && + !window.location.pathname.includes("/") + ) { + window.location.href = "/"; + } + } + + if (status === 403) { + window.location.href = "/Impresiones"; + } + } + return Promise.reject(error); + } +); export default apiClient; //IO +//Mike From 8c88698ddf3bedfb55fa383c17c10cd1cb924c59 Mon Sep 17 00:00:00 2001 From: tyrannusss Date: Thu, 2 Oct 2025 00:11:37 -0600 Subject: [PATCH 04/14] Centrar Quitar sanciones y componentes de reportes --- app/(private)/QuitarSancion/page.tsx | 10 +++- app/(private)/Reportes/page.tsx | 68 +++--------------------- app/Components/Reportes/Page.module.css | 69 +++++++++++++++++++++++++ app/Components/Reportes/porRecibo.tsx | 34 ++++++++++++ app/Components/Reportes/porServicio.tsx | 43 +++++++++++++++ 5 files changed, 160 insertions(+), 64 deletions(-) create mode 100644 app/Components/Reportes/Page.module.css create mode 100644 app/Components/Reportes/porRecibo.tsx create mode 100644 app/Components/Reportes/porServicio.tsx diff --git a/app/(private)/QuitarSancion/page.tsx b/app/(private)/QuitarSancion/page.tsx index 1040422..86eb0b8 100644 --- a/app/(private)/QuitarSancion/page.tsx +++ b/app/(private)/QuitarSancion/page.tsx @@ -2,10 +2,16 @@ import SearchUser from "@/app/Components/SearchUser/searchUser"; import QuitarSancion from "@/app/Components/QuitarSancion/QuitarSancion"; - export default function Page() { return ( -
    +

    Quitar Sanciones

    diff --git a/app/(private)/Reportes/page.tsx b/app/(private)/Reportes/page.tsx index 9624bec..ac6bf32 100644 --- a/app/(private)/Reportes/page.tsx +++ b/app/(private)/Reportes/page.tsx @@ -1,28 +1,12 @@ "use client"; -import { useState } from "react"; -import styles from "./Page.module.css"; // importamos el css import Toggle from "@/app/Components/Toggle/Toggle"; import SearchDateBetween from "@/app/Components/SearchDateBetween/SearchDateBetween"; +import Porservicio from "@/app/Components/Reportes/porServicio"; +import PorServicios from "@/app/Components/Reportes/porServicio"; +import PorRecibos from "@/app/Components/Reportes/porRecibo"; export default function Page() { - const [reportes] = useState([ - { - Servicio: "Plotter", - Total: "$1440.00", - }, - ]); - - const [recibos] = useState([ - { - folio_recibo: "100255", - monto: "40.00", - fecha_recibo: "10/10/2025", - fecha_registro: "10/10/2025 05:32:20 pm", - usuario: "modulo1", - }, - ]); - return (

    REPORTES

    @@ -36,30 +20,7 @@ export default function Page() { content: ( <> -
    - - - - - - - - - - - - {recibos.map((recibo, index) => ( - - - - - - - - ))} - -
    Folio ReciboMontoFecha ReciboFecha RegistroUsuario
    {recibo.folio_recibo}{recibo.monto}{recibo.fecha_recibo}{recibo.fecha_registro}{recibo.usuario}
    -
    + ), }, @@ -69,25 +30,8 @@ export default function Page() { label: "Por Servicio", content: ( <> - -
    - - - - - - - - - {reportes.map((reporte, index) => ( - - - - - ))} - -
    ServicioTotal
    {reporte.Servicio}{reporte.Total}
    -
    + + ), }, diff --git a/app/Components/Reportes/Page.module.css b/app/Components/Reportes/Page.module.css new file mode 100644 index 0000000..d48a3c1 --- /dev/null +++ b/app/Components/Reportes/Page.module.css @@ -0,0 +1,69 @@ +.tableContainer { + overflow-y: auto; + overflow-x: auto; + border-radius: 4px; + border: 1px solid #cfcfcf; + max-height: 430px; + scrollbar-color: rgb(1, 92, 184) rgba(0, 0, 0, 0); + background-color: #f9f9f9; + width: 100%; +} + +.machineTable { + width: 100%; + border-collapse: collapse; + table-layout: auto; +} + +.machineTable th, +.machineTable td { + padding: 10px; + text-align: center; + border-bottom: 1px solid #cfcfcf; + word-wrap: break-word; + overflow-wrap: break-word; +} + +.machineTable th { + position: sticky; + top: 0px; + background-color: rgb(1, 92, 184); + color: white; +} + +.machineTable tr { + min-width: 400px; +} + +.disponible { + display: flex; + width: 100%; + height: 100%; + background-color: green; + color: green; + font-weight: bold; +} + +.ocupado { + color: red; + font-weight: bold; +} + +.actions { + text-align: center; +} + +.resetButton { + padding: 8px 16px; + background-color: #ff4d4d; + color: white; + border: none; + border-radius: 6px; + cursor: pointer; + font-weight: bold; + transition: 0.3s; +} + +.resetButton:hover { + background-color: #cc0000; +} diff --git a/app/Components/Reportes/porRecibo.tsx b/app/Components/Reportes/porRecibo.tsx new file mode 100644 index 0000000..8590296 --- /dev/null +++ b/app/Components/Reportes/porRecibo.tsx @@ -0,0 +1,34 @@ +"use client"; +import { useState } from "react"; +import styles from "./Page.module.css"; + +interface reportes { + Servicio: "Plotter"; + Total: "$1440.00"; +} + +function PorRecibos() { + const [reportes, SetQuitarSanciones] = useState([]); + return ( +
    + + + + + + + + + {reportes.map((reporte, index) => ( + + + + + ))} + +
    ServicioTotal
    {reporte.Servicio}{reporte.Total}
    +
    + ); +} + +export default PorRecibos; diff --git a/app/Components/Reportes/porServicio.tsx b/app/Components/Reportes/porServicio.tsx new file mode 100644 index 0000000..0259344 --- /dev/null +++ b/app/Components/Reportes/porServicio.tsx @@ -0,0 +1,43 @@ +"use client"; +import { useState } from "react"; +import styles from "./Page.module.css"; + +interface servicios { + folio_recibo: "100255"; + monto: "40.00"; + fecha_recibo: "10/10/2025"; + fecha_registro: "10/10/2025 05:32:20 pm"; + usuario: "modulo1"; +} + +function PorServicios() { + const [recibos, setRecibos] = useState([]); + return ( +
    + + + + + + + + + + + + {recibos.map((recibo, index) => ( + + + + + + + + ))} + +
    Folio ReciboMontoFecha ReciboFecha RegistroUsuario
    {recibo.folio_recibo}{recibo.monto}{recibo.fecha_recibo}{recibo.fecha_registro}{recibo.usuario}
    +
    + ); +} + +export default PorServicios; From 08401ce82a8db8825762c940c9bed81880ca9479 Mon Sep 17 00:00:00 2001 From: IO420 Date: Thu, 2 Oct 2025 01:41:41 -0600 Subject: [PATCH 05/14] add types --- app/(private)/Impresiones/page.tsx | 2 +- app/Components/Global/Information/information.tsx | 7 ++----- app/Components/Global/SearchUser/searchUser.tsx | 1 + app/types/student.ts | 10 ++++++++++ 4 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 app/types/student.ts diff --git a/app/(private)/Impresiones/page.tsx b/app/(private)/Impresiones/page.tsx index 53494b1..ca95c16 100644 --- a/app/(private)/Impresiones/page.tsx +++ b/app/(private)/Impresiones/page.tsx @@ -28,7 +28,7 @@ export default async function Page(props: { if (result.error) { errorMessage = `${result.error}`; } else { - student = result; + student = result as Student; } } diff --git a/app/Components/Global/Information/information.tsx b/app/Components/Global/Information/information.tsx index 3b1db2c..60c23c8 100644 --- a/app/Components/Global/Information/information.tsx +++ b/app/Components/Global/Information/information.tsx @@ -1,14 +1,11 @@ -'use client'; - interface InformationProps { [key: string]: string | number | undefined; } export default function Information(props: InformationProps) { - // Obtenemos las entradas (key + value) y filtramos los que sean undefined const entries = Object.entries(props).filter(([_, value]) => value !== undefined); - if (entries.length === 0) return null; // no mostrar nada si no hay datos + if (entries.length === 0) return null; return (
    @@ -21,5 +18,5 @@ export default function Information(props: InformationProps) {
); -} +} //IO \ No newline at end of file diff --git a/app/Components/Global/SearchUser/searchUser.tsx b/app/Components/Global/SearchUser/searchUser.tsx index 9251b8e..3dc6881 100644 --- a/app/Components/Global/SearchUser/searchUser.tsx +++ b/app/Components/Global/SearchUser/searchUser.tsx @@ -56,3 +56,4 @@ function SearchUser(props: urlProp) { } export default SearchUser; +//IO \ No newline at end of file diff --git a/app/types/student.ts b/app/types/student.ts new file mode 100644 index 0000000..9a5d9de --- /dev/null +++ b/app/types/student.ts @@ -0,0 +1,10 @@ +interface Carrera { + carrera: string; +} + +interface Student { + id_cuenta: number; + nombre: string; + carrera: Carrera; + credito: number; +} \ No newline at end of file From 70dc03d6d67c511bdaa36e29d99a71044f044650 Mon Sep 17 00:00:00 2001 From: IO420 Date: Thu, 2 Oct 2025 02:05:57 -0600 Subject: [PATCH 06/14] added new styles --- app/(private)/AsignacionEquipo/page.tsx | 45 ++++++++++++---------- app/(private)/AsignacionMesas/page.tsx | 50 ++++++++++++++++++++----- app/Components/SearchEquipo.tsx | 9 +++-- app/Components/SearchTable.tsx | 11 +++--- 4 files changed, 77 insertions(+), 38 deletions(-) diff --git a/app/(private)/AsignacionEquipo/page.tsx b/app/(private)/AsignacionEquipo/page.tsx index b793471..45b616b 100644 --- a/app/(private)/AsignacionEquipo/page.tsx +++ b/app/(private)/AsignacionEquipo/page.tsx @@ -2,12 +2,12 @@ import SearchUser from "@/app/Components/Global/SearchUser/searchUser"; import Toggle from "@/app/Components/Global/Toggle/Toggle"; import { GetStudent } from "@/app/lib/getStudent"; -import "@/app/globals.css"; -import SearchBoxEquipo from "@/app/Components/SearchEquipo"; -import CheckBox from "@/app/Components/CheckBox"; import CheckBoxEquipo from "@/app/Components/CheckBoxEquipo"; import Information from "@/app/Components/Global/Information/information"; +import "@/app/globals.css"; +import ShowError from "@/app/Components/Global/ShowError"; + export default async function Page(props: { searchParams?: Promise<{ numAcount?: string; @@ -19,45 +19,52 @@ export default async function Page(props: { const machine = params?.machine ? params.machine : null; let student: any = null; + let errorMessage = ""; if (numAcount) { const result = await GetStudent(parseInt(numAcount)); if (result.error) { + errorMessage = `${result.error}`; } else { - student = result; + student = result as Student; } } return (
- + {errorMessage && }

ASIGNACION DE EQUIPOS

- - - - - - - + {student && ( + <> + + + + + + + + )} ), }, diff --git a/app/(private)/AsignacionMesas/page.tsx b/app/(private)/AsignacionMesas/page.tsx index 4ca0f7e..2bf4b88 100644 --- a/app/(private)/AsignacionMesas/page.tsx +++ b/app/(private)/AsignacionMesas/page.tsx @@ -2,11 +2,36 @@ import AsignacionMesas from "@/app/Components/AsignacionMesas"; import CheckBox from "@/app/Components/CheckBox"; import Information from "@/app/Components/Global/Information/information"; import SearchUser from "@/app/Components/Global/SearchUser/searchUser"; +import ShowError from "@/app/Components/Global/ShowError"; import Toggle from "@/app/Components/Global/Toggle/Toggle"; +import { GetStudent } from "@/app/lib/getStudent"; + +export default async function Page(props: { + searchParams?: Promise<{ + key: string; + numAcount: string; + }>; +}) { + const params = await props.searchParams; + const key = params?.key && params.key; + const numAcount = params?.numAcount ? params.numAcount : null; + + let student: any = null; + let errorMessage = ""; + + if (numAcount) { + const result = await GetStudent(parseInt(numAcount)); + + if (result.error) { + errorMessage = `${result.error}`; + } else { + student = result as Student; + } + } -export default function Page() { return (
+ {errorMessage && }

ASIGNACION DE MESAS

- - - - - - + + {student && ( + <> + + + + + + + )} ), }, diff --git a/app/Components/SearchEquipo.tsx b/app/Components/SearchEquipo.tsx index 926c232..80384a7 100644 --- a/app/Components/SearchEquipo.tsx +++ b/app/Components/SearchEquipo.tsx @@ -1,11 +1,12 @@ "use client"; export default function SearchEquipo() { return ( -
+ - - - +
+ + +
); } diff --git a/app/Components/SearchTable.tsx b/app/Components/SearchTable.tsx index 76e27b8..a22933c 100644 --- a/app/Components/SearchTable.tsx +++ b/app/Components/SearchTable.tsx @@ -1,12 +1,11 @@ export default function SearchTable() { return (
- {" "} - -
- - -
+ +
+ + +
); } From f07954eef2a1e9b98054437dc70a49efe6ca68b2 Mon Sep 17 00:00:00 2001 From: IO420 Date: Thu, 2 Oct 2025 20:47:38 -0600 Subject: [PATCH 07/14] tring to fix styles problems --- app/(private)/ActivosMantenimiento/page.tsx | 12 ++-- app/(private)/AgregarTiempo/page.tsx | 14 +++- app/(private)/AsignacionEquipo/page.tsx | 24 +++++-- app/(private)/AsignacionMesas/page.tsx | 17 +++-- app/(private)/BitacoraSanciones/page.tsx | 2 + app/(private)/Inscripcion/page.tsx | 19 ++++- app/(private)/Mensajes/page.tsx | 2 + app/(private)/Monitor/page.tsx | 39 +++++++++-- app/(private)/QuitarSancion/page.tsx | 18 ++--- app/(private)/Reportes/page.tsx | 5 +- app/Components/ActivosMantenimiento/Areas.tsx | 7 +- .../ActivosMantenimiento/MesasDisponibles.tsx | 33 +++++++++ .../ActivosMantenimiento/Page.module.css | 70 +++++++++++++++++++ .../BitacoraSanciones/BitacoraAlumno.tsx | 2 +- .../BitacoraSanciones/BitacoraEquipo.tsx | 2 +- .../BitacoraSanciones/BitacoraMesas.tsx | 2 +- .../BitacoraSanciones/Sanciones.tsx | 2 +- .../BitacoraSanciones/TableSancion.tsx | 5 +- app/Components/Equipos/Page.module.css | 70 +++++++++++++++++++ app/Components/Equipos/equipos.tsx | 2 +- app/Components/Equipos/tableequipos.tsx | 63 +++++++++++++++++ app/Components/EviarMensaje/EnviarMensaje.tsx | 5 +- app/Components/QuitarSancion/Page.module.css | 1 - .../QuitarSancion/QuitarSancion.tsx | 4 +- 24 files changed, 362 insertions(+), 58 deletions(-) create mode 100644 app/Components/ActivosMantenimiento/MesasDisponibles.tsx create mode 100644 app/Components/ActivosMantenimiento/Page.module.css create mode 100644 app/Components/Equipos/Page.module.css create mode 100644 app/Components/Equipos/tableequipos.tsx diff --git a/app/(private)/ActivosMantenimiento/page.tsx b/app/(private)/ActivosMantenimiento/page.tsx index 9656692..76ce0c5 100644 --- a/app/(private)/ActivosMantenimiento/page.tsx +++ b/app/(private)/ActivosMantenimiento/page.tsx @@ -1,7 +1,6 @@ import Areas from "@/app/Components/ActivosMantenimiento/Areas"; -import Mesas from "@/app/Components/ActivosMantenimiento/Mesas"; -import Equipos from "@/app/Components/Equipos/equipos"; -import SearchUser from "@/app/Components/Global/SearchUser/searchUser"; +import MesasDisponibles from "@/app/Components/ActivosMantenimiento/MesasDisponibles"; +import TableEquipos from "@/app/Components/Equipos/tableequipos"; import Toggle from "@/app/Components/Global/Toggle/Toggle"; export default async function Page(props: { @@ -26,8 +25,7 @@ export default async function Page(props: { label: "Equipos", content: ( <> - - + ), }, @@ -42,10 +40,10 @@ export default async function Page(props: { }, { key: "Mesas", - label: "Liberar mesa", + label: "Mesas", content: ( <> - + ), }, diff --git a/app/(private)/AgregarTiempo/page.tsx b/app/(private)/AgregarTiempo/page.tsx index 3070b39..b944840 100644 --- a/app/(private)/AgregarTiempo/page.tsx +++ b/app/(private)/AgregarTiempo/page.tsx @@ -21,7 +21,7 @@ export default async function Page(props: { if (result.error) { toast.error("Alumno no encontrado"); - return + return; } else { student = result; } @@ -29,7 +29,6 @@ export default async function Page(props: { return (
-

AGREGAR TIEMPO

@@ -39,6 +38,17 @@ export default async function Page(props: {
+
+ + +
diff --git a/app/(private)/AsignacionEquipo/page.tsx b/app/(private)/AsignacionEquipo/page.tsx index 45b616b..4844964 100644 --- a/app/(private)/AsignacionEquipo/page.tsx +++ b/app/(private)/AsignacionEquipo/page.tsx @@ -52,17 +52,27 @@ export default async function Page(props: { + - - - - - + {/*
+ + + +
+ + +
+
*/} )} diff --git a/app/(private)/AsignacionMesas/page.tsx b/app/(private)/AsignacionMesas/page.tsx index 2bf4b88..cc3d645 100644 --- a/app/(private)/AsignacionMesas/page.tsx +++ b/app/(private)/AsignacionMesas/page.tsx @@ -49,12 +49,19 @@ export default async function Page(props: { cuenta={student.id_cuenta} nombre={student.nombre} /> - + {/*
- - +
+ + +
+
*/} + )} diff --git a/app/(private)/BitacoraSanciones/page.tsx b/app/(private)/BitacoraSanciones/page.tsx index 02e5046..5ebe1ff 100644 --- a/app/(private)/BitacoraSanciones/page.tsx +++ b/app/(private)/BitacoraSanciones/page.tsx @@ -2,6 +2,7 @@ import BitacoraAlumno from "@/app/Components/BitacoraSanciones/BitacoraAlumno"; import BitacoraEquipo from "@/app/Components/BitacoraSanciones/BitacoraEquipo"; import BitacoraMesas from "@/app/Components/BitacoraSanciones/BitacoraMesas"; import Sanciones from "@/app/Components/BitacoraSanciones/Sanciones"; +import SearchUser from "@/app/Components/Global/SearchUser/searchUser"; import Toggle from "@/app/Components/Global/Toggle/Toggle"; import { GetStudent } from "@/app/lib/getStudent"; @@ -48,6 +49,7 @@ export default async function Page(props: { label: "Bitacora alumno", content: ( <> + ), diff --git a/app/(private)/Inscripcion/page.tsx b/app/(private)/Inscripcion/page.tsx index 3ebe703..55578f9 100644 --- a/app/(private)/Inscripcion/page.tsx +++ b/app/(private)/Inscripcion/page.tsx @@ -29,7 +29,6 @@ export default async function Page(props: { return (
- {errorMessage && }

INSCRIPCIÓN

@@ -44,8 +43,26 @@ export default async function Page(props: { Carrera={student.carrera.carrera} Credito={student.credito} /> + +
+ + +
diff --git a/app/(private)/Mensajes/page.tsx b/app/(private)/Mensajes/page.tsx index 4531cf4..7b9eeba 100644 --- a/app/(private)/Mensajes/page.tsx +++ b/app/(private)/Mensajes/page.tsx @@ -22,6 +22,7 @@ export default async function Page(props: { label: "Equipo", content: ( @@ -32,6 +33,7 @@ export default async function Page(props: { label: "Sala", content: ( diff --git a/app/(private)/Monitor/page.tsx b/app/(private)/Monitor/page.tsx index 6712b5c..9700015 100644 --- a/app/(private)/Monitor/page.tsx +++ b/app/(private)/Monitor/page.tsx @@ -9,25 +9,50 @@ export default async function Page(props: { const numAcount = params?.numAcount ? params.numAcount : null; return ( -
-

MONITOR DE MÁQUINAS DISPONIBLES

+
+

MONITOR DE MÁQUINAS DISPONIBLES

- +
- + + + + + + + + {/* {machines.map((machine, index) => ( @@ -47,4 +72,4 @@ export default async function Page(props: { ); } -//IO \ No newline at end of file +//IO diff --git a/app/(private)/QuitarSancion/page.tsx b/app/(private)/QuitarSancion/page.tsx index 678b186..7e2a7ed 100644 --- a/app/(private)/QuitarSancion/page.tsx +++ b/app/(private)/QuitarSancion/page.tsx @@ -10,18 +10,14 @@ export default async function Page(props: { const numAcount = params?.numAcount ? params.numAcount : null; return ( -
+ <>

Quitar Sanciones

- - -
+
+ + +
+ ); } //IO diff --git a/app/(private)/Reportes/page.tsx b/app/(private)/Reportes/page.tsx index 8c6f0aa..6835db7 100644 --- a/app/(private)/Reportes/page.tsx +++ b/app/(private)/Reportes/page.tsx @@ -21,7 +21,8 @@ export default function Page() { content: ( <> - + + ), }, @@ -32,7 +33,7 @@ export default function Page() { content: ( <> - + ), }, diff --git a/app/Components/ActivosMantenimiento/Areas.tsx b/app/Components/ActivosMantenimiento/Areas.tsx index 9285ba2..e76508f 100644 --- a/app/Components/ActivosMantenimiento/Areas.tsx +++ b/app/Components/ActivosMantenimiento/Areas.tsx @@ -37,11 +37,10 @@ export default function Areas() { return (
- -
- {/* Select de áreas */} + +
Ubicación Nombre Equipo Plataforma Área Disponible
+ + + + + + + + + +
+ + + + + + + + {/* {machines.map((machine, index) => ( + + + + + + + + ))} */} + +
MesaActivo
{machine.ubicacion}{machine.nombre}{machine.plataforma}{machine.area} + {machine.disponible ? "si" : "no"} +
+
+
+ ); +} +//IO diff --git a/app/Components/ActivosMantenimiento/Page.module.css b/app/Components/ActivosMantenimiento/Page.module.css new file mode 100644 index 0000000..21769a9 --- /dev/null +++ b/app/Components/ActivosMantenimiento/Page.module.css @@ -0,0 +1,70 @@ +.tableContainer { + overflow-y: auto; + overflow-x: auto; + border-radius: 4px; + border: 1px solid #cfcfcf; + max-height: 430px; + scrollbar-color: rgb(1, 92, 184) rgba(0, 0, 0, 0); + background-color: #f9f9f9; + width: 100%; +} + +.machineTable { + width: 100%; + border-collapse: collapse; + table-layout: auto; +} + +.machineTable th, +.machineTable td { + padding: 10px; + text-align: center; + border-bottom: 1px solid #cfcfcf; + word-wrap: break-word; + overflow-wrap: break-word; +} + +.machineTable th { + position: sticky; + top: 0px; + background-color: rgb(1, 92, 184); + color: white; +} + +.machineTable tr { + min-width: 400px; +} + +.disponible { + display: flex; + width: 100%; + height: 100%; + background-color: green; + color: green; + font-weight: bold; +} + +.ocupado { + color: red; + font-weight: bold; +} + + +.actions { + text-align: center; +} + +.resetButton { + padding: 8px 16px; + background-color: #ff4d4d; + color: white; + border: none; + border-radius: 6px; + cursor: pointer; + font-weight: bold; + transition: 0.3s; +} + +.resetButton:hover { + background-color: #cc0000; +} \ No newline at end of file diff --git a/app/Components/BitacoraSanciones/BitacoraAlumno.tsx b/app/Components/BitacoraSanciones/BitacoraAlumno.tsx index 4d0ffe1..fc793b1 100644 --- a/app/Components/BitacoraSanciones/BitacoraAlumno.tsx +++ b/app/Components/BitacoraSanciones/BitacoraAlumno.tsx @@ -15,7 +15,7 @@ function BitacoraAlumno() { return ( <> -
+
diff --git a/app/Components/BitacoraSanciones/BitacoraEquipo.tsx b/app/Components/BitacoraSanciones/BitacoraEquipo.tsx index e243683..a335743 100644 --- a/app/Components/BitacoraSanciones/BitacoraEquipo.tsx +++ b/app/Components/BitacoraSanciones/BitacoraEquipo.tsx @@ -33,7 +33,7 @@ function BitacoraEquipo() { -
+
diff --git a/app/Components/BitacoraSanciones/BitacoraMesas.tsx b/app/Components/BitacoraSanciones/BitacoraMesas.tsx index 59ef913..d27e3d3 100644 --- a/app/Components/BitacoraSanciones/BitacoraMesas.tsx +++ b/app/Components/BitacoraSanciones/BitacoraMesas.tsx @@ -18,7 +18,7 @@ function BitacoraMesas() { return ( <> -
+
diff --git a/app/Components/BitacoraSanciones/Sanciones.tsx b/app/Components/BitacoraSanciones/Sanciones.tsx index 0e4824b..b4442e9 100644 --- a/app/Components/BitacoraSanciones/Sanciones.tsx +++ b/app/Components/BitacoraSanciones/Sanciones.tsx @@ -20,7 +20,7 @@ export default async function Sanciones(props: { student?: Student }) { Nombre={props.student.nombre} /> - + )} diff --git a/app/Components/BitacoraSanciones/TableSancion.tsx b/app/Components/BitacoraSanciones/TableSancion.tsx index 54197b8..e45662e 100644 --- a/app/Components/BitacoraSanciones/TableSancion.tsx +++ b/app/Components/BitacoraSanciones/TableSancion.tsx @@ -41,8 +41,7 @@ export default function TableSancion() { return ( <> -

{sanciones}

-
+
@@ -65,7 +64,7 @@ export default function TableSancion() { - diff --git a/app/Components/Equipos/Page.module.css b/app/Components/Equipos/Page.module.css new file mode 100644 index 0000000..21769a9 --- /dev/null +++ b/app/Components/Equipos/Page.module.css @@ -0,0 +1,70 @@ +.tableContainer { + overflow-y: auto; + overflow-x: auto; + border-radius: 4px; + border: 1px solid #cfcfcf; + max-height: 430px; + scrollbar-color: rgb(1, 92, 184) rgba(0, 0, 0, 0); + background-color: #f9f9f9; + width: 100%; +} + +.machineTable { + width: 100%; + border-collapse: collapse; + table-layout: auto; +} + +.machineTable th, +.machineTable td { + padding: 10px; + text-align: center; + border-bottom: 1px solid #cfcfcf; + word-wrap: break-word; + overflow-wrap: break-word; +} + +.machineTable th { + position: sticky; + top: 0px; + background-color: rgb(1, 92, 184); + color: white; +} + +.machineTable tr { + min-width: 400px; +} + +.disponible { + display: flex; + width: 100%; + height: 100%; + background-color: green; + color: green; + font-weight: bold; +} + +.ocupado { + color: red; + font-weight: bold; +} + + +.actions { + text-align: center; +} + +.resetButton { + padding: 8px 16px; + background-color: #ff4d4d; + color: white; + border: none; + border-radius: 6px; + cursor: pointer; + font-weight: bold; + transition: 0.3s; +} + +.resetButton:hover { + background-color: #cc0000; +} \ No newline at end of file diff --git a/app/Components/Equipos/equipos.tsx b/app/Components/Equipos/equipos.tsx index 88ad08c..2902ca0 100644 --- a/app/Components/Equipos/equipos.tsx +++ b/app/Components/Equipos/equipos.tsx @@ -74,7 +74,7 @@ export default function Equipos() { -
+
diff --git a/app/Components/Equipos/tableequipos.tsx b/app/Components/Equipos/tableequipos.tsx new file mode 100644 index 0000000..a072348 --- /dev/null +++ b/app/Components/Equipos/tableequipos.tsx @@ -0,0 +1,63 @@ +import styles from "./Page.module.css"; + +export default async function TableEquipos() { + return ( +
+ +
+
+ + + + + + + + + + + + + + + + + + {/* {machines.map((machine, index) => ( + + + + + + + + ))} */} + +
UbicaciónNombrePlataformaÁreaActivo
+ + + + + + + + + +
{machine.ubicacion}{machine.nombre}{machine.plataforma}{machine.area} + {machine.disponible ? "si" : "no"} +
+
+
+ ); +} +//IO diff --git a/app/Components/EviarMensaje/EnviarMensaje.tsx b/app/Components/EviarMensaje/EnviarMensaje.tsx index ac01900..3a6f637 100644 --- a/app/Components/EviarMensaje/EnviarMensaje.tsx +++ b/app/Components/EviarMensaje/EnviarMensaje.tsx @@ -51,6 +51,7 @@ const EnviarMensaje = ({ titulo, opciones }: EnviarMensajeProps) => { ))} + {/* Mensaje personalizado */} @@ -62,10 +63,12 @@ const EnviarMensaje = ({ titulo, opciones }: EnviarMensajeProps) => { onChange={(e) => setCustomMsg(e.target.value)} placeholder="Escribe tu mensaje..." /> + + {/* Botón de enviar */} - diff --git a/app/Components/QuitarSancion/Page.module.css b/app/Components/QuitarSancion/Page.module.css index b8783c6..5cf0020 100644 --- a/app/Components/QuitarSancion/Page.module.css +++ b/app/Components/QuitarSancion/Page.module.css @@ -6,7 +6,6 @@ max-height: 430px; scrollbar-color: rgb(1, 92, 184) rgba(0, 0, 0, 0); background-color: #f9f9f9; - width: 65%; } .machineTable { diff --git a/app/Components/QuitarSancion/QuitarSancion.tsx b/app/Components/QuitarSancion/QuitarSancion.tsx index d40f252..03516d2 100644 --- a/app/Components/QuitarSancion/QuitarSancion.tsx +++ b/app/Components/QuitarSancion/QuitarSancion.tsx @@ -16,7 +16,7 @@ function QuitarSancion() { const [quitarSanciones, SetQuitarSanciones] = useState([]); return (
-
+
@@ -42,7 +42,7 @@ function QuitarSancion() {
- +
); } From 02e06f10bf1e2feb92ddcc71b8ffd60e18e8b3cd Mon Sep 17 00:00:00 2001 From: IO420 Date: Fri, 3 Oct 2025 17:29:53 -0600 Subject: [PATCH 08/14] builded --- app/(private)/ActivosMantenimiento/page.tsx | 7 ++++--- app/(private)/AsignacionEquipo/page.tsx | 6 ++++-- app/(private)/AsignacionMesas/page.tsx | 2 +- app/(private)/Reportes/page.tsx | 21 ++++++++++++--------- app/Components/Impressions/impressions.tsx | 1 + app/Components/Receipt/Receipt.tsx | 6 ++++-- 6 files changed, 26 insertions(+), 17 deletions(-) diff --git a/app/(private)/ActivosMantenimiento/page.tsx b/app/(private)/ActivosMantenimiento/page.tsx index 76ce0c5..66332ee 100644 --- a/app/(private)/ActivosMantenimiento/page.tsx +++ b/app/(private)/ActivosMantenimiento/page.tsx @@ -5,20 +5,21 @@ import Toggle from "@/app/Components/Global/Toggle/Toggle"; export default async function Page(props: { searchParams?: Promise<{ + key?: string; numAcount?: string; machine?: string; }>; }) { const params = await props.searchParams; + const key = params?.key && params.key; const numAcount = params?.numAcount ? params.numAcount : null; return (
-

EQUIPOS ACTIVOS Y EN MANTENIMIENTO

- + ), }, diff --git a/app/(private)/AsignacionEquipo/page.tsx b/app/(private)/AsignacionEquipo/page.tsx index 4844964..700a708 100644 --- a/app/(private)/AsignacionEquipo/page.tsx +++ b/app/(private)/AsignacionEquipo/page.tsx @@ -4,17 +4,19 @@ import { GetStudent } from "@/app/lib/getStudent"; import CheckBoxEquipo from "@/app/Components/CheckBoxEquipo"; import Information from "@/app/Components/Global/Information/information"; +import ShowError from "@/app/Components/Global/ShowError"; import "@/app/globals.css"; -import ShowError from "@/app/Components/Global/ShowError"; export default async function Page(props: { searchParams?: Promise<{ + key?:string numAcount?: string; machine?: string; }>; }) { const params = await props.searchParams; + const key = params?.key && params.key; const numAcount = params?.numAcount ? params.numAcount : null; const machine = params?.machine ? params.machine : null; @@ -38,7 +40,7 @@ export default async function Page(props: {

ASIGNACION DE EQUIPOS

ASIGNACION DE MESAS ; +}) { + const params = await props.searchParams; + const key = params?.key && params.key; + return (

REPORTES

- ), }, { - key: "2", + key: "Por Servicio", label: "Por Servicio", content: ( <> diff --git a/app/Components/Impressions/impressions.tsx b/app/Components/Impressions/impressions.tsx index 534f634..6a03ba4 100644 --- a/app/Components/Impressions/impressions.tsx +++ b/app/Components/Impressions/impressions.tsx @@ -61,6 +61,7 @@ function Impressions({ costs, numAcount }: ImpressionsProps) { setPages(""); setCost(""); toast.success("Impresion cobrada correctamente"); + router.refresh(); }; return ( diff --git a/app/Components/Receipt/Receipt.tsx b/app/Components/Receipt/Receipt.tsx index 79b125d..cf8f6bb 100644 --- a/app/Components/Receipt/Receipt.tsx +++ b/app/Components/Receipt/Receipt.tsx @@ -3,7 +3,7 @@ import toast from "react-hot-toast"; import { useState } from "react"; import { PostReceipt } from "@/app/lib/postReceipt"; -import { useRouter } from "next/navigation"; +import { useParams, usePathname, useRouter } from "next/navigation"; import "./Receipt.css"; @@ -13,6 +13,8 @@ interface ReceiptsProps { function Receipt({ numAcount }: ReceiptsProps) { const router = useRouter(); + const path = usePathname(); + console.log(path); const [folio, setFolio] = useState(""); const [amount, setAmount] = useState(""); @@ -29,7 +31,6 @@ function Receipt({ numAcount }: ReceiptsProps) { //restrict this month// const handleSaveReceipt = async () => { - if (!numAcount) { toast.error("busca de nuevo al estudiante"); return; @@ -63,6 +64,7 @@ function Receipt({ numAcount }: ReceiptsProps) { setDate(""); toast.success("Recibo guardado"); + router.refresh(); } catch (err: any) { toast.error(String(err)); } From 7e864e30fec5e0939c629c4a73e84ddc7c5fe432 Mon Sep 17 00:00:00 2001 From: IO420 <320154041@pcpuma.acatlan.unam.mx> Date: Mon, 6 Oct 2025 17:26:14 -0600 Subject: [PATCH 09/14] add new request --- app/(private)/AgregarTiempo/page.tsx | 12 +------ app/Components/Alta/registerAlta.tsx | 29 ++++++++++++++- app/Components/Global/selectArea.tsx | 33 +++++++++++++++++ app/Components/Receipt/Receipt.css | 24 +++++++++++++ app/Components/Receipt/Receipt.tsx | 36 ++++++++++--------- .../auth/ChangePassword/changePassword.tsx | 9 +++-- app/Components/layout/ToastProvider.tsx | 5 +-- app/globals.css | 32 +++++------------ app/lib/postReceipt.ts | 2 +- 9 files changed, 125 insertions(+), 57 deletions(-) create mode 100644 app/Components/Global/selectArea.tsx diff --git a/app/(private)/AgregarTiempo/page.tsx b/app/(private)/AgregarTiempo/page.tsx index b944840..df7fc96 100644 --- a/app/(private)/AgregarTiempo/page.tsx +++ b/app/(private)/AgregarTiempo/page.tsx @@ -38,17 +38,7 @@ export default async function Page(props: {
-
- - -
+
diff --git a/app/Components/Alta/registerAlta.tsx b/app/Components/Alta/registerAlta.tsx index 6e0aebf..e3e8089 100644 --- a/app/Components/Alta/registerAlta.tsx +++ b/app/Components/Alta/registerAlta.tsx @@ -1,8 +1,30 @@ "use client"; -import { useState } from "react"; +import axios from "axios"; +import { useEffect, useState } from "react"; export default function RegisterAlta() { + const [listMajor, setListMajor] = useState([]); const [major, setMajor] = useState(""); + + useEffect(() => { + const fetchCarreras = async () => { + try { + const response = await axios.get( + "https://venus.acatlan.unam.mx/asignacionTiempo_test/carrera" + ); + + const sortedCarreras = response.data.sort((a: any, b: any) => + a.carrera.localeCompare(b.carrera) + ); + + setListMajor(sortedCarreras); + } catch (error) { + console.error("Error al obtener carreras:", error); + } + }; + fetchCarreras(); + }, []); + return (
@@ -59,6 +81,11 @@ export default function RegisterAlta() {
diff --git a/app/Components/Global/selectArea.tsx b/app/Components/Global/selectArea.tsx new file mode 100644 index 0000000..37a9350 --- /dev/null +++ b/app/Components/Global/selectArea.tsx @@ -0,0 +1,33 @@ +import axios from "axios"; +import { useEffect, useState } from "react"; + +export default function selectArea() { + const [area, setArea] = useState([]); + + useEffect(() => { + const fetchArea = async () => { + const response = await axios.get( + "https://venus.acatlan.unam.mx/asignacionTiempo_test/area-ubicacion" + ); + setArea(response.data); + }; + + fetchArea(); + }); + return ( + <> + + + + ); +} diff --git a/app/Components/Receipt/Receipt.css b/app/Components/Receipt/Receipt.css index e69de29..94a4965 100644 --- a/app/Components/Receipt/Receipt.css +++ b/app/Components/Receipt/Receipt.css @@ -0,0 +1,24 @@ +.groupInformation { + display: flex; + max-width: 500px; + min-width: 40px; + width: 100%; + justify-content: end; + gap: 10px; +} + +.informationButton { + text-align: center; + appearance: none; + -webkit-appearance: none; + -moz-appearance: none; + border: 1px solid #cfcfcf; + background-color: #fff; + max-width: 40px; + min-width: 40px; +} + +.informationButton:hover { + border: 1px solid #cfcfcf; + background-color: #cfcfcf; +} diff --git a/app/Components/Receipt/Receipt.tsx b/app/Components/Receipt/Receipt.tsx index cf8f6bb..9d0d281 100644 --- a/app/Components/Receipt/Receipt.tsx +++ b/app/Components/Receipt/Receipt.tsx @@ -3,7 +3,7 @@ import toast from "react-hot-toast"; import { useState } from "react"; import { PostReceipt } from "@/app/lib/postReceipt"; -import { useParams, usePathname, useRouter } from "next/navigation"; +import { useRouter } from "next/navigation"; import "./Receipt.css"; @@ -13,8 +13,6 @@ interface ReceiptsProps { function Receipt({ numAcount }: ReceiptsProps) { const router = useRouter(); - const path = usePathname(); - console.log(path); const [folio, setFolio] = useState(""); const [amount, setAmount] = useState(""); @@ -80,19 +78,25 @@ function Receipt({ numAcount }: ReceiptsProps) {
- { - const value = error.target.value; - if (/^\d*$/.test(value) && value.length <= 7) { - setFolio(value); - } - }} - placeholder="Numero de tiket..." - inputMode="numeric" - pattern="[0-9]*" - /> +
+ { + const value = error.target.value; + if (/^\d*$/.test(value) && value.length <= 7) { + setFolio(value); + } + }} + placeholder="Numero de tiket..." + inputMode="numeric" + pattern="[0-9]*" + /> + +
diff --git a/app/Components/auth/ChangePassword/changePassword.tsx b/app/Components/auth/ChangePassword/changePassword.tsx index 1a47db6..7f4eac1 100644 --- a/app/Components/auth/ChangePassword/changePassword.tsx +++ b/app/Components/auth/ChangePassword/changePassword.tsx @@ -1,4 +1,5 @@ "use client"; +import axios from "axios"; import { useState } from "react"; export default function ChangePassword() { @@ -6,10 +7,14 @@ export default function ChangePassword() { const [newPass, setNewPass] = useState(""); const [confirmNewPass, setconfirmNewPass] = useState(""); - const handleChangePass = (e: React.FormEvent) => { + const handleChangePass = async (e: React.FormEvent) => { e.preventDefault; const data = { pass, newPass, confirmNewPass }; - console.log(data); + + await axios.post( + "https://venus.acatlan.unam.mx/asignacionTiempo_test/user/create", + data + ); }; return ( diff --git a/app/Components/layout/ToastProvider.tsx b/app/Components/layout/ToastProvider.tsx index 9cadd36..af3d64b 100644 --- a/app/Components/layout/ToastProvider.tsx +++ b/app/Components/layout/ToastProvider.tsx @@ -12,6 +12,7 @@ export function ToastProvider({ children }: { children: React.ReactNode }) { style: { padding: "16px", fontSize: "16px", + maxWidth: "400px", }, error: { @@ -21,7 +22,7 @@ export function ToastProvider({ children }: { children: React.ReactNode }) { backgroundColor: "#fee2e2dd", color: "#000000ff", fontWeight: "600", - padding:"1.5rem" + padding: "1.5rem", }, }, @@ -32,7 +33,7 @@ export function ToastProvider({ children }: { children: React.ReactNode }) { backgroundColor: "#d1fae5dd", color: "#000000ff", fontWeight: "600", - padding:"1.5rem" + padding: "1.5rem", }, }, }} diff --git a/app/globals.css b/app/globals.css index 136fc4e..f6675ee 100644 --- a/app/globals.css +++ b/app/globals.css @@ -88,11 +88,12 @@ footer p { .mainContainer { position: relative; display: grid; - grid-template-rows: 40px 1fr; + grid-template-rows: auto 1fr; align-items: center; justify-items: center; height: 100%; width: 100%; + background-color: #f9f9f9; } @keyframes fadeInUp { @@ -180,12 +181,12 @@ select { input:focus, select:focus { background-color: #f9f9f9; - outline:none; - box-shadow: 0px 0px 8px 2px rgba(0, 62, 121, 0.5); + outline: none; + box-shadow: 0px 0px 8px 2px rgba(0, 62, 121, 0.5); transition: all 0.2s ease-in-out; } -input[type="checkbox"]{ +input[type="checkbox"] { min-width: 3rem; } @@ -196,7 +197,7 @@ label { } button { - font-size: 2rem; + font-size: 1.5rem; padding: 1rem 1.75rem; border-radius: 4px; cursor: pointer; @@ -296,7 +297,7 @@ a { font-size: 3rem; font-weight: bold; text-align: start; - color:#bd8c01; + color: #bd8c01; border-bottom: 1px solid #cfcfcf; margin-bottom: 10px; } @@ -352,7 +353,7 @@ form { } .toggleButton.active { - font-weight: 700; + font-weight: 600; background-color: #e5e7eb; color: rgb(1, 92, 184); border-radius: 4px 4px 0 0; @@ -462,22 +463,6 @@ table tr { align-items: center; } - .img { - width: 100%; - } - - .img::after { - background: linear-gradient(to right, #f9f9f993, rgba(128, 128, 128, 0)); - } - - .img::before { - display: flex; - content: ""; - position: absolute; - inset: 0; - background: linear-gradient(to left, #f9f9f993, rgba(128, 128, 128, 0)); - } - .title { text-align: center; } @@ -563,7 +548,6 @@ table tr { } button { - font-size: 1.5rem; padding: 1rem 1.5rem; } diff --git a/app/lib/postReceipt.ts b/app/lib/postReceipt.ts index 099ccd4..dd9b6e1 100644 --- a/app/lib/postReceipt.ts +++ b/app/lib/postReceipt.ts @@ -9,7 +9,7 @@ export async function PostReceipt(data: any) { error.response?.data?.message || error.message || "Error desconocido al crear recibo"; - return { error: msg }; + throw new Error(msg); } } //IO From b507eb157b6c4bd9d6f0d944f59a65eba5ec5180 Mon Sep 17 00:00:00 2001 From: IO420 <320154041@pcpuma.acatlan.unam.mx> Date: Mon, 6 Oct 2025 17:27:59 -0600 Subject: [PATCH 10/14] because yes --- app/Components/Global/selectArea.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/Components/Global/selectArea.tsx b/app/Components/Global/selectArea.tsx index 37a9350..5da0cf7 100644 --- a/app/Components/Global/selectArea.tsx +++ b/app/Components/Global/selectArea.tsx @@ -6,9 +6,6 @@ export default function selectArea() { useEffect(() => { const fetchArea = async () => { - const response = await axios.get( - "https://venus.acatlan.unam.mx/asignacionTiempo_test/area-ubicacion" - ); setArea(response.data); }; From c6c42e914a793481f7e8d76cc7faa6dec3e4e0a4 Mon Sep 17 00:00:00 2001 From: IO420 <320154041@pcpuma.acatlan.unam.mx> Date: Wed, 8 Oct 2025 12:01:52 -0600 Subject: [PATCH 11/14] styles changes --- app/(private)/AgregarTiempo/addTime.css | 20 +-- app/(private)/Alta/style.css | 3 +- app/(private)/Inscripcion/inscripcion.css | 46 ++++-- app/(private)/Inscripcion/page.tsx | 51 ++++-- app/(private)/Monitor/Page.module.css | 79 +++------- app/Components/Alta/registerAlta.tsx | 7 +- .../Global/Information/information.tsx | 17 +- .../Global/StepNavigator/StepNavigator.tsx | 75 +++++---- app/Components/Global/selectArea.tsx | 3 +- app/Components/Global/table.module.css | 8 + app/Components/Global/table.tsx | 40 +++++ app/Components/Receipt/Receipt.tsx | 32 ++-- app/Components/Selection/Selection.css | 1 - .../auth/ChangePassword/changePassword.tsx | 7 +- app/globals.css | 148 ++++++++++++++---- 15 files changed, 345 insertions(+), 192 deletions(-) create mode 100644 app/Components/Global/table.module.css create mode 100644 app/Components/Global/table.tsx diff --git a/app/(private)/AgregarTiempo/addTime.css b/app/(private)/AgregarTiempo/addTime.css index 8a95b1d..1fe80b1 100644 --- a/app/(private)/AgregarTiempo/addTime.css +++ b/app/(private)/AgregarTiempo/addTime.css @@ -1,11 +1,11 @@ .addTime { - position: relative; - max-width: 600px; - margin-top: 1rem; - border: 1px solid #e5e7eb; - border-radius: 4px; - background-color: #f9fafb; - padding: 1rem; - display: flex; - flex-direction: column; -} \ No newline at end of file + position: relative; + max-width: 600px; + margin-top: 1rem; + border-radius: 4px; + background-color: #fff; + padding: 1rem; + display: flex; + flex-direction: column; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); +} diff --git a/app/(private)/Alta/style.css b/app/(private)/Alta/style.css index bf559d8..4bf3b2f 100644 --- a/app/(private)/Alta/style.css +++ b/app/(private)/Alta/style.css @@ -3,7 +3,8 @@ grid-template-columns: 1fr 1fr; } .containerAlta { - background-color: #f9f9f9; + background-color: #fff; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); width: 100%; max-width: 900px; padding: 1rem; diff --git a/app/(private)/Inscripcion/inscripcion.css b/app/(private)/Inscripcion/inscripcion.css index 7b05ca4..c448ebb 100644 --- a/app/(private)/Inscripcion/inscripcion.css +++ b/app/(private)/Inscripcion/inscripcion.css @@ -1,9 +1,37 @@ -.inscripcion{ - background-color: #f9f9f9; - width: 100%; - max-width: 700px; - border-radius: 4px; - padding: 1rem; - margin-top: 1rem; - outline: 1px solid #cfcfcf; -} \ No newline at end of file +.inscripcion { + position: relative; + top: 0; + background-color: #ffffff; + width: 100%; + max-width: 700px; + border-radius: 4px; + padding: 1rem; + margin-top: 1rem; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); +} + +.containeInformation { + display: flex; + gap: 10px; + width: 100%; +} + +.firstPartInformation { + display: flex; + flex-direction: column; + width: 100%; + max-width: 450px; +} + +@media (max-width: 800px) { + .containeInformation { + justify-content: center; + align-items: center; + } +} + +@media (max-width: 800px) { + .containeInformation { + flex-direction: column; + } +} diff --git a/app/(private)/Inscripcion/page.tsx b/app/(private)/Inscripcion/page.tsx index 55578f9..6dc0f1c 100644 --- a/app/(private)/Inscripcion/page.tsx +++ b/app/(private)/Inscripcion/page.tsx @@ -2,10 +2,11 @@ import SearchUser from "@/app/Components/Global/SearchUser/searchUser"; import Information from "@/app/Components/Global/Information/information"; import Receipt from "@/app/Components/Receipt/Receipt"; import Selection from "@/app/Components/Selection/Selection"; +import ShowError from "@/app/Components/Global/ShowError"; import { GetStudent } from "@/app/lib/getStudent"; import "./inscripcion.css"; -import ShowError from "@/app/Components/Global/ShowError"; +import Table from "@/app/Components/Global/table"; export default async function Page(props: { searchParams?: Promise<{ @@ -27,28 +28,50 @@ export default async function Page(props: { } } + const headers = ["Inscrito", "Tiempo", "Confirmó"]; + const data = [ + { + Inscrito: "WINDOWS", + Tiempo: "9 minutos", + Confirmó: "si", + }, + { + Inscrito: "WINDOWS", + Tiempo: "9 minutos", + Confirmó: "si/no", + }, + { + Inscrito: "WINDOWS", + Tiempo: "9 minutos", + Confirmó: "si/no", + }, + ]; + return (
{errorMessage && }

INSCRIPCIÓN

- +
+
+ + + {student && ( + + )} +
+ + {student && } + {student && ( <> - - -
diff --git a/app/(private)/Monitor/Page.module.css b/app/(private)/Monitor/Page.module.css index 21769a9..7ea84a2 100644 --- a/app/(private)/Monitor/Page.module.css +++ b/app/(private)/Monitor/Page.module.css @@ -1,70 +1,41 @@ .tableContainer { - overflow-y: auto; - overflow-x: auto; - border-radius: 4px; - border: 1px solid #cfcfcf; - max-height: 430px; - scrollbar-color: rgb(1, 92, 184) rgba(0, 0, 0, 0); - background-color: #f9f9f9; - width: 100%; -} - -.machineTable { - width: 100%; - border-collapse: collapse; - table-layout: auto; -} - -.machineTable th, -.machineTable td { - padding: 10px; - text-align: center; - border-bottom: 1px solid #cfcfcf; - word-wrap: break-word; - overflow-wrap: break-word; -} - -.machineTable th { - position: sticky; - top: 0px; - background-color: rgb(1, 92, 184); - color: white; -} - -.machineTable tr { - min-width: 400px; + overflow-y: auto; + overflow-x: auto; + border-radius: 4px; + max-height: 430px; + scrollbar-color: rgb(1, 92, 184) rgba(0, 0, 0, 0); + width: 100%; } .disponible { - display: flex; - width: 100%; - height: 100%; - background-color: green; - color: green; - font-weight: bold; + display: flex; + width: 100%; + height: 100%; + background-color: green; + color: green; + font-weight: bold; } .ocupado { - color: red; - font-weight: bold; + color: red; + font-weight: bold; } - .actions { - text-align: center; + text-align: center; } .resetButton { - padding: 8px 16px; - background-color: #ff4d4d; - color: white; - border: none; - border-radius: 6px; - cursor: pointer; - font-weight: bold; - transition: 0.3s; + padding: 8px 16px; + background-color: #ff4d4d; + color: white; + border: none; + border-radius: 6px; + cursor: pointer; + font-weight: bold; + transition: 0.3s; } .resetButton:hover { - background-color: #cc0000; -} \ No newline at end of file + background-color: #cc0000; +} diff --git a/app/Components/Alta/registerAlta.tsx b/app/Components/Alta/registerAlta.tsx index e3e8089..5a078c4 100644 --- a/app/Components/Alta/registerAlta.tsx +++ b/app/Components/Alta/registerAlta.tsx @@ -1,5 +1,6 @@ "use client"; -import axios from "axios"; +import apiClient from "@/app/lib/apiClient"; + import { useEffect, useState } from "react"; export default function RegisterAlta() { @@ -9,9 +10,7 @@ export default function RegisterAlta() { useEffect(() => { const fetchCarreras = async () => { try { - const response = await axios.get( - "https://venus.acatlan.unam.mx/asignacionTiempo_test/carrera" - ); + const response = await apiClient.get("/carrera"); const sortedCarreras = response.data.sort((a: any, b: any) => a.carrera.localeCompare(b.carrera) diff --git a/app/Components/Global/Information/information.tsx b/app/Components/Global/Information/information.tsx index 60c23c8..d1a4f9d 100644 --- a/app/Components/Global/Information/information.tsx +++ b/app/Components/Global/Information/information.tsx @@ -3,20 +3,23 @@ interface InformationProps { } export default function Information(props: InformationProps) { - const entries = Object.entries(props).filter(([_, value]) => value !== undefined); + const entries = Object.entries(props).filter( + ([_, value]) => value !== undefined + ); - if (entries.length === 0) return null; + if (entries.length === 0) return null; return (
-
    +
      {entries.map(([key, value]) => ( -
    • - {key}: {value} +
    • + {key} + {value}
    • ))}
); -} -//IO \ No newline at end of file +} +//IO diff --git a/app/Components/Global/StepNavigator/StepNavigator.tsx b/app/Components/Global/StepNavigator/StepNavigator.tsx index a91a7e2..ac25728 100644 --- a/app/Components/Global/StepNavigator/StepNavigator.tsx +++ b/app/Components/Global/StepNavigator/StepNavigator.tsx @@ -1,50 +1,49 @@ -'use client' +"use client"; import { useState, ReactNode } from "react"; -import "./StepNavigator.css" +import "./StepNavigator.css"; interface StepNavigatorProps { - totalSteps: number; - children: ReactNode[]; - onFinish?: () => void; + totalSteps: number; + children: ReactNode[]; + onFinish?: () => void; } -export default function StepNavigator({ totalSteps, children, onFinish }: StepNavigatorProps) { - const [step, setStep] = useState(1); +export default function StepNavigator({ + totalSteps, + children, + onFinish, +}: StepNavigatorProps) { + const [step, setStep] = useState(1); - const handleNext = (e: React.MouseEvent) => { - e.preventDefault(); - if (step < totalSteps) setStep(step + 1); - else if (onFinish) onFinish(); - }; + const handleNext = (e: React.MouseEvent) => { + e.preventDefault(); + if (step < totalSteps) setStep(step + 1); + else if (onFinish) onFinish(); + }; - const handlePrev = (e: React.MouseEvent) => { - e.preventDefault(); - if (step > 1) setStep(step - 1); - }; + const handlePrev = (e: React.MouseEvent) => { + e.preventDefault(); + if (step > 1) setStep(step - 1); + }; - return ( -
- {children[step - 1]} + return ( +
+ {children[step - 1]} -
- {step > 1 && ( - - )} +
+ {step > 1 && ( + + )} - {step < totalSteps && - -} -
-
- ); + {step < totalSteps && ( + + )} + +
+ ); } diff --git a/app/Components/Global/selectArea.tsx b/app/Components/Global/selectArea.tsx index 5da0cf7..d17cc3e 100644 --- a/app/Components/Global/selectArea.tsx +++ b/app/Components/Global/selectArea.tsx @@ -1,4 +1,4 @@ -import axios from "axios"; +import apiClient from "@/app/lib/apiClient"; import { useEffect, useState } from "react"; export default function selectArea() { @@ -6,6 +6,7 @@ export default function selectArea() { useEffect(() => { const fetchArea = async () => { + const response = await apiClient.get("/area-ubicacion"); setArea(response.data); }; diff --git a/app/Components/Global/table.module.css b/app/Components/Global/table.module.css new file mode 100644 index 0000000..b25dd2e --- /dev/null +++ b/app/Components/Global/table.module.css @@ -0,0 +1,8 @@ +.tableContainer { + width: 100%; + max-width: 450px; + overflow-x: hidden; + scrollbar-color: #2563eb #ffffff00; + scroll-behavior: smooth; + transition: all 0.3s ease; +} diff --git a/app/Components/Global/table.tsx b/app/Components/Global/table.tsx new file mode 100644 index 0000000..a44a1b4 --- /dev/null +++ b/app/Components/Global/table.tsx @@ -0,0 +1,40 @@ +"use client"; + +import React from "react"; +import styles from "./table.module.css"; + +interface TableProps { + headers: string[]; + data: Array>; +} + +export default function Table({ headers, data }: TableProps) { + return ( +
+
+ + + {headers.map((header, index) => ( + + ))} + + + + {data.length > 0 ? ( + data.map((row, rowIndex) => ( + + {headers.map((header, colIndex) => ( + + ))} + + )) + ) : ( + + + + )} + +
{header}
{row[header]}
No hay registros
+
+ ); +} diff --git a/app/Components/Receipt/Receipt.tsx b/app/Components/Receipt/Receipt.tsx index 9d0d281..4c0891d 100644 --- a/app/Components/Receipt/Receipt.tsx +++ b/app/Components/Receipt/Receipt.tsx @@ -78,25 +78,19 @@ function Receipt({ numAcount }: ReceiptsProps) {
-
- { - const value = error.target.value; - if (/^\d*$/.test(value) && value.length <= 7) { - setFolio(value); - } - }} - placeholder="Numero de tiket..." - inputMode="numeric" - pattern="[0-9]*" - /> - -
+ { + const value = error.target.value; + if (/^\d*$/.test(value) && value.length <= 7) { + setFolio(value); + } + }} + placeholder="Numero de tiket..." + inputMode="numeric" + pattern="[0-9]*" + />
diff --git a/app/Components/Selection/Selection.css b/app/Components/Selection/Selection.css index f1f30ce..1c70764 100644 --- a/app/Components/Selection/Selection.css +++ b/app/Components/Selection/Selection.css @@ -3,7 +3,6 @@ gap: 1rem; justify-content: center; align-items: center; - margin: 10px; flex-wrap: wrap; } diff --git a/app/Components/auth/ChangePassword/changePassword.tsx b/app/Components/auth/ChangePassword/changePassword.tsx index 7f4eac1..e59abfc 100644 --- a/app/Components/auth/ChangePassword/changePassword.tsx +++ b/app/Components/auth/ChangePassword/changePassword.tsx @@ -1,5 +1,5 @@ "use client"; -import axios from "axios"; +import apiClient from "@/app/lib/apiClient"; import { useState } from "react"; export default function ChangePassword() { @@ -11,10 +11,7 @@ export default function ChangePassword() { e.preventDefault; const data = { pass, newPass, confirmNewPass }; - await axios.post( - "https://venus.acatlan.unam.mx/asignacionTiempo_test/user/create", - data - ); + await apiClient.post("/user/create", data); }; return ( diff --git a/app/globals.css b/app/globals.css index f6675ee..d6fa085 100644 --- a/app/globals.css +++ b/app/globals.css @@ -23,7 +23,7 @@ body { display: grid; grid-template-rows: auto 1fr auto; min-height: 100dvh; - width: 100dvw; + width: 100vw; overflow: hidden; } @@ -173,9 +173,9 @@ select { border: 1px solid #cfcfcf; background-color: #fff; border-radius: 4px; - font-size: 2rem; + font-size: 1.5rem; color: black; - height: 4rem; + height: 3.5rem; } input:focus, @@ -186,12 +186,20 @@ select:focus { transition: all 0.2s ease-in-out; } +select:-webkit-scrollbar { + width: 6px; +} + +option { + font-size: 1.5rem; +} + input[type="checkbox"] { min-width: 3rem; } label { - font-size: 2rem; + font-size: 1.5rem; font-weight: bold; display: block; } @@ -201,7 +209,7 @@ button { padding: 1rem 1.75rem; border-radius: 4px; cursor: pointer; - height: 4rem; + height: 3.5rem; } .groupInput { @@ -210,6 +218,8 @@ button { gap: 10px; align-items: center; justify-content: space-between; + width: 100%; + max-width: 450px; } .button { @@ -278,23 +288,50 @@ a { .information { display: flex; flex-direction: column; - border: 1px solid #e5e7eb; + background-color: #ffffff; border-radius: 4px; - background-color: #f3f4f6; width: 100%; max-width: 450px; - margin-top: 10px; + margin-top: 1rem; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); + overflow: hidden; + transition: box-shadow 0.3s ease, transform 0.3s ease; } -.information ul { - padding: 1rem; +.informationList { + list-style: none; + padding: 0 1rem; + margin: 0; +} + +.informationItem { + display: flex; + justify-content: flex-start; + align-items: center; + padding: 5px 0; + border-bottom: 1px solid #e5e5e5; +} + +.informationItem:last-child { + border-bottom: none; +} + +.informationKey { + font-weight: 600; + text-transform: capitalize; + width: 100px; +} + +.informationValue { + color: #555; + font-size: 1.5rem; } .title { top: 0; left: 0; width: 100%; - font-size: 3rem; + font-size: 2.5rem; font-weight: bold; text-align: start; color: #bd8c01; @@ -324,9 +361,9 @@ form { width: 100%; max-width: 750px; margin-top: 1rem; - border: 1px solid #e5e7eb; border-radius: 4px; - background-color: #f9fafb; + background-color: #fff; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); } .toggleGroup { @@ -354,10 +391,10 @@ form { .toggleButton.active { font-weight: 600; - background-color: #e5e7eb; + background-color: #ffffff; color: rgb(1, 92, 184); border-radius: 4px 4px 0 0; - border-bottom: 1px solid rgb(1, 92, 184); + border-bottom: none; } p { @@ -366,28 +403,78 @@ p { table { width: 100%; - border-collapse: collapse; + border-collapse: separate; + border-spacing: 0 1rem; table-layout: auto; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 1.5rem; + color: #333; } table th, table td { - padding: 10px; - text-align: center; - border-bottom: 1px solid #cfcfcf; - word-wrap: break-word; - overflow-wrap: break-word; + padding: 0.85rem 1.5rem; } table th { position: sticky; - top: 0px; - background-color: rgb(1, 92, 184); - color: white; + top: 0; + color: #ffffff; + font-weight: 800; + text-transform: uppercase; + letter-spacing: 1px; + text-align: center; + z-index: 2; + border: none; +} + +table td { + text-align: center; + word-wrap: break-word; + overflow-wrap: break-word; + border: none; } table tr { - min-width: 400px; + background-color: rgb(255, 255, 255); + transition: background-color 0.2s ease; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); +} + +thead tr { + background-color: #2563eb; + position: relative; + z-index: 1; +} + +tbody tr { + transition: transform 0.3s ease, opacity 0.3s ease; + opacity: 1; + z-index: 0; +} + +tbody tr.hidden { + transform: translateY(-10px); + opacity: 0; + height: 0; +} + +table tr:nth-child(even) { + background-color: #f9f9f9; +} + +table tr:hover { + background-color: #cfcfcf; +} + +table th:first-child, +table td:first-child { + border-radius: 4px 0 0 4px; +} + +table th:last-child, +table td:last-child { + border-radius: 0 4px 4px 0; } .tableContainer { @@ -462,10 +549,6 @@ table tr { justify-content: center; align-items: center; } - - .title { - text-align: center; - } } @media (max-width: 1300px) { @@ -473,6 +556,11 @@ table tr { width: 100%; max-width: none; } + + .containerSection { + overflow: auto; + scrollbar-width: none; + } } @media (max-width: 800px) { @@ -526,6 +614,7 @@ table tr { .containerSection { align-items: center; + scrollbar-width: none; } .centerGrid { @@ -564,6 +653,7 @@ table tr { @media (max-width: 450px) { .title { + text-align: center; max-width: 250px; overflow-wrap: break-word; } From 95f1c51ccc262643aace58e52cf4444f1d9b6285 Mon Sep 17 00:00:00 2001 From: IO420 <320154041@pcpuma.acatlan.unam.mx> Date: Wed, 8 Oct 2025 15:47:08 -0600 Subject: [PATCH 12/14] merge all and fixed SelectArea.tsx --- .../InformacionEquipos/ProgramSelector.tsx | 5 ++-- .../{SelectAreas.jsx => SelectAreas.tsx} | 25 ++++++++----------- 2 files changed, 13 insertions(+), 17 deletions(-) rename app/Components/{SelectAreas.jsx => SelectAreas.tsx} (51%) diff --git a/app/Components/InformacionEquipos/ProgramSelector.tsx b/app/Components/InformacionEquipos/ProgramSelector.tsx index 0459d34..928688a 100644 --- a/app/Components/InformacionEquipos/ProgramSelector.tsx +++ b/app/Components/InformacionEquipos/ProgramSelector.tsx @@ -1,5 +1,6 @@ "use client"; import { useState } from "react"; +import SelectAreas from "../SelectAreas"; interface DatosEquipo { titulo: string; @@ -43,7 +44,7 @@ const caracteristicasPorEquipo: Record = { // Agrega más equipos según necesites }; -function ProgramSelector({ titulo, opcion }: DatosEquipo) { +export default function ProgramSelector({ titulo, opcion }: DatosEquipo) { // Estado del equipo seleccionado const [equipoSeleccionado, setEquipoSeleccionado] = useState(""); // Estado de los checkboxes (programas) @@ -110,5 +111,3 @@ function ProgramSelector({ titulo, opcion }: DatosEquipo) { ); } - -export default ProgramSelector; diff --git a/app/Components/SelectAreas.jsx b/app/Components/SelectAreas.tsx similarity index 51% rename from app/Components/SelectAreas.jsx rename to app/Components/SelectAreas.tsx index 380f1dc..71933bc 100644 --- a/app/Components/SelectAreas.jsx +++ b/app/Components/SelectAreas.tsx @@ -1,16 +1,14 @@ -"use clien"; -import React, { useEffect, useState } from "react"; +"use client"; +import { useEffect, useState } from "react"; export default function SelectAreas() { - const [areas, setAreas] = useState([]); // aquí guardaremos los datos del servidor + const [areas, setAreas] = useState([]); const [selectedArea, setSelectedArea] = useState(""); - // useEffect se ejecuta una vez al montar el componente useEffect(() => { fetch("https://venus.acatlan.unam.mx/asignacionTiempo_test/area-ubicacion") .then((response) => response.json()) .then((data) => { - console.log("Áreas obtenidas:", data); setAreas(data); }) .catch((error) => { @@ -18,19 +16,18 @@ export default function SelectAreas() { }); }, []); - const handleChange = (e) => { - setSelectedArea(e.target.value); - console.log("Área seleccionada:", e.target.value); - }; - return (
- setSelectedArea(e.target.value)} + > - {areas.map((area) => ( - ))} From d2db905a0b47e56deab4a7f97f84cad4732337a8 Mon Sep 17 00:00:00 2001 From: IO420 <320154041@pcpuma.acatlan.unam.mx> Date: Thu, 9 Oct 2025 10:54:53 -0600 Subject: [PATCH 13/14] fixed SelectArea --- app/Components/SelectAreas.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/Components/SelectAreas.tsx b/app/Components/SelectAreas.tsx index 71933bc..0dc8ea8 100644 --- a/app/Components/SelectAreas.tsx +++ b/app/Components/SelectAreas.tsx @@ -1,4 +1,5 @@ "use client"; +import axios from "axios"; import { useEffect, useState } from "react"; export default function SelectAreas() { @@ -6,10 +7,10 @@ export default function SelectAreas() { const [selectedArea, setSelectedArea] = useState(""); useEffect(() => { - fetch("https://venus.acatlan.unam.mx/asignacionTiempo_test/area-ubicacion") - .then((response) => response.json()) + axios + .get("https://venus.acatlan.unam.mx/asignacionTiempo_test/area-ubicacion") .then((data) => { - setAreas(data); + setAreas(data.data); }) .catch((error) => { console.error("Error al traer las áreas:", error); @@ -26,8 +27,8 @@ export default function SelectAreas() { > {areas.map((area: any, index) => ( - ))} From c6e8ef81c69cc838989ab5dc734dc7b383c5961f Mon Sep 17 00:00:00 2001 From: IO420 <320154041@pcpuma.acatlan.unam.mx> Date: Fri, 10 Oct 2025 10:44:42 -0600 Subject: [PATCH 14/14] added sign --- app/Components/SelectAreas.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Components/SelectAreas.tsx b/app/Components/SelectAreas.tsx index 0dc8ea8..0cda5ba 100644 --- a/app/Components/SelectAreas.tsx +++ b/app/Components/SelectAreas.tsx @@ -35,3 +35,4 @@ export default function SelectAreas() {
); } +//IO