From 04b8c459878897cdd9c97a57236003252dc17a30 Mon Sep 17 00:00:00 2001 From: Guillermo Arrieta Medina Date: Mon, 5 Jan 2026 14:22:39 -0600 Subject: [PATCH] =?UTF-8?q?Separaci=C3=B3n=20vista/l=C3=B3gica=20de=20wiza?= =?UTF-8?q?rd=20de=20creaci=C3=B3n=20de=20asignatura?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../asignaturas/wizard/PasoBasicosForm.tsx | 155 +++ .../wizard/PasoConfiguracionPanel.tsx | 286 +++++ .../wizard/PasoMetodoCardGroup.tsx | 135 ++ .../asignaturas/wizard/PasoResumenCard.tsx | 75 ++ .../asignaturas/wizard/StepWithTooltip.tsx | 40 + .../asignaturas/wizard/VistaSinPermisos.tsx | 39 + .../asignaturas/wizard/WizardControls.tsx | 66 + .../asignaturas/wizard/WizardHeader.tsx | 80 ++ .../planes/wizard/PasoDetallesPanel.tsx | 9 +- .../planes/wizard/PasoResumenCard.tsx | 3 +- .../new/NuevaAsignaturaModalContainer.tsx | 127 ++ src/features/asignaturas/new/catalogs.ts | 56 + .../new/hooks/useNuevaAsignaturaWizard.ts | 90 ++ src/features/asignaturas/new/types.ts | 45 + .../planes/new/hooks/useNuevoPlanWizard.ts | 6 +- src/features/planes/new/types.ts | 4 +- .../$planId/asignaturas/_lista/nueva.tsx | 1081 +---------------- 17 files changed, 1211 insertions(+), 1086 deletions(-) create mode 100644 src/components/asignaturas/wizard/PasoBasicosForm.tsx create mode 100644 src/components/asignaturas/wizard/PasoConfiguracionPanel.tsx create mode 100644 src/components/asignaturas/wizard/PasoMetodoCardGroup.tsx create mode 100644 src/components/asignaturas/wizard/PasoResumenCard.tsx create mode 100644 src/components/asignaturas/wizard/StepWithTooltip.tsx create mode 100644 src/components/asignaturas/wizard/VistaSinPermisos.tsx create mode 100644 src/components/asignaturas/wizard/WizardControls.tsx create mode 100644 src/components/asignaturas/wizard/WizardHeader.tsx create mode 100644 src/features/asignaturas/new/NuevaAsignaturaModalContainer.tsx create mode 100644 src/features/asignaturas/new/catalogs.ts create mode 100644 src/features/asignaturas/new/hooks/useNuevaAsignaturaWizard.ts create mode 100644 src/features/asignaturas/new/types.ts diff --git a/src/components/asignaturas/wizard/PasoBasicosForm.tsx b/src/components/asignaturas/wizard/PasoBasicosForm.tsx new file mode 100644 index 0000000..4fdeacf --- /dev/null +++ b/src/components/asignaturas/wizard/PasoBasicosForm.tsx @@ -0,0 +1,155 @@ +import type { + NewSubjectWizardState, + TipoAsignatura, +} from '@/features/asignaturas/new/types' + +import { Input } from '@/components/ui/input' +import { Label } from '@/components/ui/label' +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from '@/components/ui/select' +import { + ESTRUCTURAS_SEP, + TIPOS_MATERIA, +} from '@/features/asignaturas/new/catalogs' + +export function PasoBasicosForm({ + wizard, + onChange, +}: { + wizard: NewSubjectWizardState + onChange: React.Dispatch> +}) { + return ( +
+
+ + + onChange((w) => ({ + ...w, + datosBasicos: { ...w.datosBasicos, nombre: e.target.value }, + })) + } + /> +
+ +
+ + + onChange((w) => ({ + ...w, + datosBasicos: { ...w.datosBasicos, clave: e.target.value }, + })) + } + /> +
+ +
+ + +
+ +
+ + + onChange((w) => ({ + ...w, + datosBasicos: { + ...w.datosBasicos, + creditos: Number(e.target.value || 0), + }, + })) + } + /> +
+ +
+ + + onChange((w) => ({ + ...w, + datosBasicos: { + ...w.datosBasicos, + horasSemana: Number(e.target.value || 0), + }, + })) + } + /> +
+ +
+ + +

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

+
+
+ ) +} diff --git a/src/components/asignaturas/wizard/PasoConfiguracionPanel.tsx b/src/components/asignaturas/wizard/PasoConfiguracionPanel.tsx new file mode 100644 index 0000000..947869d --- /dev/null +++ b/src/components/asignaturas/wizard/PasoConfiguracionPanel.tsx @@ -0,0 +1,286 @@ +import * as Icons from 'lucide-react' + +import type { NewSubjectWizardState } from '@/features/asignaturas/new/types' + +import { Button } from '@/components/ui/button' +import { + Card, + CardContent, + CardDescription, + CardHeader, + CardTitle, +} from '@/components/ui/card' +import { Input } from '@/components/ui/input' +import { Label } from '@/components/ui/label' +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from '@/components/ui/select' +import { Textarea } from '@/components/ui/textarea' +import { + ARCHIVOS_SISTEMA_MOCK, + FACULTADES, + MATERIAS_MOCK, + PLANES_MOCK, +} from '@/features/asignaturas/new/catalogs' + +export function PasoConfiguracionPanel({ + wizard, + onChange, + onGenerarIA, +}: { + wizard: NewSubjectWizardState + onChange: React.Dispatch> + onGenerarIA: () => void +}) { + if (wizard.modoCreacion === 'MANUAL') { + return ( + + + Configuración Manual + + La asignatura se creará vacía. Podrás editar el contenido detallado + en la siguiente pantalla. + + + + ) + } + + if (wizard.modoCreacion === 'IA') { + return ( +
+
+ +