Refactor: unifica wizards con WizardLayout/WizardResponsiveHeader y convierte asignaturas en layout con Outlet

- Se introdujo un layout genérico de wizard (WizardLayout) con headerSlot/footerSlot y se migraron los modales de Nuevo Plan y Nueva Asignatura a esta estructura usando defineStepper.
- Se creó y reutilizó WizardResponsiveHeader para un encabezado responsivo consistente (progreso en móvil y navegación en escritorio) en ambos wizards.
- Se homologó WizardControls del wizard de asignaturas para alinearlo al patrón del wizard de planes (props onPrev/onNext, flags de disable, manejo de error/loading y creación).
- Se mejoró la captura de datos en el wizard de asignatura: créditos como flotante con 2 decimales, placeholders/estilos en inputs/selects y uso de catálogo real de estructuras vía useSubjectEstructuras con qk.estructurasAsignatura.
- Se reorganizó la sección de asignaturas del detalle del plan: el contenido del antiguo index se movió a asignaturas.tsx como layout y se agregó <Outlet />; navegación a “nueva asignatura” ajustada al path correcto.
This commit is contained in:
2026-02-04 13:36:46 -06:00
parent fafe90e5e8
commit c82fac52f7
17 changed files with 824 additions and 433 deletions

View File

@@ -246,9 +246,9 @@ export function PasoBasicosForm({
// Keep undefined when the input is empty so the field stays optional
numCiclos: (() => {
const raw = e.target.value
if (raw === '') return undefined
if (raw === '') return null
const asNumber = Number(raw)
if (Number.isNaN(asNumber)) return undefined
if (Number.isNaN(asNumber)) return null
// Coerce to positive integer (natural numbers without zero)
const n = Math.floor(Math.abs(asNumber))
return n >= 1 ? n : 1

View File

@@ -90,7 +90,7 @@ export function PasoDetallesPanel({
selectedRepositorioIds={wizard.iaConfig?.repositoriosReferencia || []}
uploadedFiles={wizard.iaConfig?.archivosAdjuntos || []}
onToggleArchivo={(id, checked) =>
onChange((w) => {
onChange((w): NewPlanWizardState => {
const prev = w.iaConfig?.archivosReferencia || []
const next = checked
? [...prev, id]
@@ -105,7 +105,7 @@ export function PasoDetallesPanel({
})
}
onToggleRepositorio={(id, checked) =>
onChange((w) => {
onChange((w): NewPlanWizardState => {
const prev = w.iaConfig?.repositoriosReferencia || []
const next = checked
? [...prev, id]