From 6fc1677654f35adf5cd88eaf8de6895574af1bc7 Mon Sep 17 00:00:00 2001 From: Guillermo Arrieta Medina Date: Fri, 6 Feb 2026 12:23:17 -0600 Subject: [PATCH] =?UTF-8?q?Se=20limitaron=20el=20n=C3=BAmero=20de=20caract?= =?UTF-8?q?eres=20y=20de=20digitos=20en=20los=20inputs=20de=20los=20wizard?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../asignaturas/wizard/PasoBasicosForm.tsx | 92 +++++++++++-------- .../asignaturas/wizard/PasoDetallesPanel.tsx | 2 + .../PasoBasicosForm/PasoBasicosForm.tsx | 2 + .../PasoDetallesPanel/PasoDetallesPanel.tsx | 2 + src/types/supabase.ts | 3 + supabase/.temp/cli-latest | 2 +- 6 files changed, 64 insertions(+), 39 deletions(-) diff --git a/src/components/asignaturas/wizard/PasoBasicosForm.tsx b/src/components/asignaturas/wizard/PasoBasicosForm.tsx index dff2726..b92f5e8 100644 --- a/src/components/asignaturas/wizard/PasoBasicosForm.tsx +++ b/src/components/asignaturas/wizard/PasoBasicosForm.tsx @@ -27,14 +27,25 @@ export function PasoBasicosForm({ const [creditosInput, setCreditosInput] = useState(() => { const c = Number(wizard.datosBasicos.creditos ?? 0) - return c > 0 ? c.toFixed(2) : '' + let newC = c + console.log('antes', newC) + + if (Number.isFinite(c) && c > 999) { + newC = 999 + } + console.log('desp', newC) + return newC > 0 ? newC.toFixed(2) : '' }) const [creditosFocused, setCreditosFocused] = useState(false) useEffect(() => { if (creditosFocused) return const c = Number(wizard.datosBasicos.creditos ?? 0) - setCreditosInput(c > 0 ? c.toFixed(2) : '') + let newC = c + if (Number.isFinite(c) && c > 999) { + newC = 999 + } + setCreditosInput(newC > 0 ? newC.toFixed(2) : '') }, [wizard.datosBasicos.creditos, creditosFocused]) return ( @@ -44,6 +55,7 @@ export function PasoBasicosForm({ onChange( @@ -67,6 +79,7 @@ export function PasoBasicosForm({ onChange( @@ -123,6 +136,7 @@ export function PasoBasicosForm({ id="creditos" type="text" inputMode="decimal" + maxLength={6} pattern="^\\d*(?:[.,]\\d{0,2})?$" value={creditosInput} onKeyDown={(e) => { @@ -191,6 +205,42 @@ export function PasoBasicosForm({ /> +
+ + +

+ Define los campos requeridos (ej. Objetivos, Temario, Evaluación). +

+
+
- -
- - -

- Define los campos requeridos (ej. Objetivos, Temario, Evaluación). -

-
) } diff --git a/src/components/asignaturas/wizard/PasoDetallesPanel.tsx b/src/components/asignaturas/wizard/PasoDetallesPanel.tsx index 612d4fc..7b672f1 100644 --- a/src/components/asignaturas/wizard/PasoDetallesPanel.tsx +++ b/src/components/asignaturas/wizard/PasoDetallesPanel.tsx @@ -56,6 +56,7 @@ export function PasoDetallesPanel({