@@ -33,7 +114,7 @@ export function WizardControls({
Anterior
{isLastStep ? (
-
diff --git a/src/features/planes/nuevo/hooks/useNuevoPlanWizard.ts b/src/features/planes/nuevo/hooks/useNuevoPlanWizard.ts
index 6455b32..8d82865 100644
--- a/src/features/planes/nuevo/hooks/useNuevoPlanWizard.ts
+++ b/src/features/planes/nuevo/hooks/useNuevoPlanWizard.ts
@@ -1,17 +1,17 @@
-import { useState } from "react";
+import { useState } from 'react'
-import type { NewPlanWizardState } from "../types";
+import type { NewPlanWizardState } from '../types'
export function useNuevoPlanWizard() {
const [wizard, setWizard] = useState
({
step: 1,
tipoOrigen: null,
datosBasicos: {
- nombrePlan: "",
- carreraId: "",
- facultadId: "",
- nivel: "",
- tipoCiclo: "",
+ nombrePlan: '',
+ carreraId: '',
+ facultadId: '',
+ nivel: '',
+ tipoCiclo: '',
numCiclos: undefined,
estructuraPlanId: null,
},
@@ -34,8 +34,8 @@ export function useNuevoPlanWizard() {
archivoAsignaturasExcelId: null,
},
iaConfig: {
- descripcionEnfoque: "",
- notasAdicionales: "",
+ descripcionEnfoque: '',
+ notasAdicionales: '',
archivosReferencia: [],
repositoriosReferencia: [],
archivosAdjuntos: [],
@@ -43,42 +43,43 @@ export function useNuevoPlanWizard() {
resumen: {},
isLoading: false,
errorMessage: null,
- });
+ })
- const canContinueDesdeModo = wizard.tipoOrigen === "MANUAL" ||
- wizard.tipoOrigen === "IA" ||
- (wizard.tipoOrigen === "CLONADO_INTERNO" ||
- wizard.tipoOrigen === "CLONADO_TRADICIONAL");
+ const canContinueDesdeModo =
+ wizard.tipoOrigen === 'MANUAL' ||
+ wizard.tipoOrigen === 'IA' ||
+ wizard.tipoOrigen === 'CLONADO_INTERNO' ||
+ wizard.tipoOrigen === 'CLONADO_TRADICIONAL'
- const canContinueDesdeBasicos = !!wizard.datosBasicos.nombrePlan &&
+ const canContinueDesdeBasicos =
+ !!wizard.datosBasicos.nombrePlan &&
!!wizard.datosBasicos.carreraId &&
!!wizard.datosBasicos.facultadId &&
!!wizard.datosBasicos.nivel &&
- (wizard.datosBasicos.numCiclos !== undefined &&
- wizard.datosBasicos.numCiclos > 0) &&
+ wizard.datosBasicos.numCiclos !== undefined &&
+ wizard.datosBasicos.numCiclos > 0 &&
// Requerir ambas plantillas (plan y mapa) con versión
- !!wizard.datosBasicos.estructuraPlanId;
+ !!wizard.datosBasicos.estructuraPlanId
const canContinueDesdeDetalles = (() => {
- if (wizard.tipoOrigen === "MANUAL") return true;
- if (wizard.tipoOrigen === "IA") {
+ if (wizard.tipoOrigen === 'MANUAL') return true
+ if (wizard.tipoOrigen === 'IA') {
// Requerimos descripción del enfoque y notas adicionales
- return !!wizard.iaConfig?.descripcionEnfoque &&
- !!wizard.iaConfig.notasAdicionales;
+ return !!wizard.iaConfig?.descripcionEnfoque
}
- if (wizard.tipoOrigen === "CLONADO_INTERNO") {
- return !!wizard.clonInterno?.planOrigenId;
+ if (wizard.tipoOrigen === 'CLONADO_INTERNO') {
+ return !!wizard.clonInterno?.planOrigenId
}
- if (wizard.tipoOrigen === "CLONADO_TRADICIONAL") {
- const t = wizard.clonTradicional;
- if (!t) return false;
- const tieneWord = !!t.archivoWordPlanId;
- const tieneAlMenosUnExcel = !!t.archivoMapaExcelId ||
- !!t.archivoAsignaturasExcelId;
- return tieneWord && tieneAlMenosUnExcel;
+ if (wizard.tipoOrigen === 'CLONADO_TRADICIONAL') {
+ const t = wizard.clonTradicional
+ if (!t) return false
+ const tieneWord = !!t.archivoWordPlanId
+ const tieneAlMenosUnExcel =
+ !!t.archivoMapaExcelId || !!t.archivoAsignaturasExcelId
+ return tieneWord && tieneAlMenosUnExcel
}
- return false;
- })();
+ return false
+ })()
return {
wizard,
@@ -86,5 +87,5 @@ export function useNuevoPlanWizard() {
canContinueDesdeModo,
canContinueDesdeBasicos,
canContinueDesdeDetalles,
- };
+ }
}
diff --git a/src/features/planes/nuevo/types.ts b/src/features/planes/nuevo/types.ts
index 61dab10..1902732 100644
--- a/src/features/planes/nuevo/types.ts
+++ b/src/features/planes/nuevo/types.ts
@@ -1,65 +1,61 @@
-import type { UploadedFile } from "@/components/planes/wizard/PasoDetallesPanel/FileDropZone";
+import type { UploadedFile } from '@/components/planes/wizard/PasoDetallesPanel/FileDropZone'
import type {
NivelPlanEstudio,
TipoCiclo,
TipoOrigen,
-} from "@/data/types/domain";
+} from '@/data/types/domain'
export type PlanPreview = {
- nombrePlan: string;
- nivel: NivelPlanEstudio;
- tipoCiclo: TipoCiclo;
- numCiclos: number;
- numAsignaturasAprox?: number;
- secciones?: Array<{ id: string; titulo: string; resumen: string }>;
-};
+ nombrePlan: string
+ nivel: NivelPlanEstudio
+ tipoCiclo: TipoCiclo
+ numCiclos: number
+ numAsignaturasAprox?: number
+ secciones?: Array<{ id: string; titulo: string; resumen: string }>
+}
export type NewPlanWizardState = {
- step: 1 | 2 | 3 | 4;
- tipoOrigen: TipoOrigen | null;
+ step: 1 | 2 | 3 | 4
+ tipoOrigen: TipoOrigen | null
datosBasicos: {
- nombrePlan: string;
- carreraId: string;
- facultadId: string;
- nivel: NivelPlanEstudio | "";
- tipoCiclo: TipoCiclo | "";
- numCiclos: number | undefined;
+ nombrePlan: string
+ carreraId: string
+ facultadId: string
+ nivel: NivelPlanEstudio | ''
+ tipoCiclo: TipoCiclo | ''
+ numCiclos: number | undefined
// Selección de plantillas (obligatorias)
- estructuraPlanId: string | null;
- };
- clonInterno?: { planOrigenId: string | null };
+ estructuraPlanId: string | null
+ }
+ clonInterno?: { planOrigenId: string | null }
clonTradicional?: {
- archivoWordPlanId:
- | {
- id: string;
- name: string;
- size: string;
- type: string;
- }
- | null;
+ archivoWordPlanId: {
+ id: string
+ name: string
+ size: string
+ type: string
+ } | null
archivoMapaExcelId: {
- id: string;
- name: string;
- size: string;
- type: string;
- } | null;
+ id: string
+ name: string
+ size: string
+ type: string
+ } | null
archivoAsignaturasExcelId: {
- id: string;
- name: string;
- size: string;
- type: string;
- } | null;
- };
+ id: string
+ name: string
+ size: string
+ type: string
+ } | null
+ }
iaConfig?: {
- descripcionEnfoque: string;
- notasAdicionales: string;
- archivosReferencia: Array;
- repositoriosReferencia?: Array;
- archivosAdjuntos?: Array<
- UploadedFile
- >;
- };
- resumen: { previewPlan?: PlanPreview };
- isLoading: boolean;
- errorMessage: string | null;
-};
+ descripcionEnfoque: string
+ notasAdicionales?: string
+ archivosReferencia: Array
+ repositoriosReferencia?: Array
+ archivosAdjuntos?: Array
+ }
+ resumen: { previewPlan?: PlanPreview }
+ isLoading: boolean
+ errorMessage: string | null
+}
diff --git a/src/routeTree.gen.ts b/src/routeTree.gen.ts
index 37b426a..b54e156 100644
--- a/src/routeTree.gen.ts
+++ b/src/routeTree.gen.ts
@@ -12,7 +12,6 @@ import { Route as rootRouteImport } from './routes/__root'
import { Route as LoginRouteImport } from './routes/login'
import { Route as DashboardRouteImport } from './routes/dashboard'
import { Route as IndexRouteImport } from './routes/index'
-import { Route as PlanesPlanesListRouteRouteImport } from './routes/planes/PlanesListRoute'
import { Route as DemoTanstackQueryRouteImport } from './routes/demo/tanstack-query'
import { Route as PlanesListaRouteRouteImport } from './routes/planes/_lista/route'
import { Route as PlanesPlanIdIndexRouteImport } from './routes/planes/$planId/index'
@@ -46,11 +45,6 @@ const IndexRoute = IndexRouteImport.update({
path: '/',
getParentRoute: () => rootRouteImport,
} as any)
-const PlanesPlanesListRouteRoute = PlanesPlanesListRouteRouteImport.update({
- id: '/planes/PlanesListRoute',
- path: '/planes/PlanesListRoute',
- getParentRoute: () => rootRouteImport,
-} as any)
const DemoTanstackQueryRoute = DemoTanstackQueryRouteImport.update({
id: '/demo/tanstack-query',
path: '/demo/tanstack-query',
@@ -154,8 +148,7 @@ export interface FileRoutesByFullPath {
'/login': typeof LoginRoute
'/planes': typeof PlanesListaRouteRouteWithChildren
'/demo/tanstack-query': typeof DemoTanstackQueryRoute
- '/planes/PlanesListRoute': typeof PlanesPlanesListRouteRoute
- '/planes/$planId': typeof PlanesPlanIdDetalleRouteRouteWithChildren
+ '/planes/$planId': typeof PlanesPlanIdIndexRoute
'/planes/$planId/asignaturas': typeof PlanesPlanIdAsignaturasListaRouteRouteWithChildren
'/planes/nuevo': typeof PlanesListaNuevoRoute
'/planes/$planId/': typeof PlanesPlanIdIndexRoute
@@ -176,7 +169,10 @@ export interface FileRoutesByTo {
'/login': typeof LoginRoute
'/planes': typeof PlanesListaRouteRouteWithChildren
'/demo/tanstack-query': typeof DemoTanstackQueryRoute
+<<<<<<< HEAD
'/planes/PlanesListRoute': typeof PlanesPlanesListRouteRoute
+=======
+>>>>>>> 4950f7efbf664bbd31ac8a673fe594af5baf07f6
'/planes/$planId': typeof PlanesPlanIdIndexRoute
'/planes/nuevo': typeof PlanesListaNuevoRoute
'/planes/$planId/asignaturas/$asignaturaId': typeof PlanesPlanIdAsignaturasAsignaturaIdRouteRoute
@@ -197,7 +193,6 @@ export interface FileRoutesById {
'/login': typeof LoginRoute
'/planes/_lista': typeof PlanesListaRouteRouteWithChildren
'/demo/tanstack-query': typeof DemoTanstackQueryRoute
- '/planes/PlanesListRoute': typeof PlanesPlanesListRouteRoute
'/planes/$planId/_detalle': typeof PlanesPlanIdDetalleRouteRouteWithChildren
'/planes/$planId/asignaturas': typeof PlanesPlanIdAsignaturasRouteRouteWithChildren
'/planes/_lista/nuevo': typeof PlanesListaNuevoRoute
@@ -222,7 +217,6 @@ export interface FileRouteTypes {
| '/login'
| '/planes'
| '/demo/tanstack-query'
- | '/planes/PlanesListRoute'
| '/planes/$planId'
| '/planes/$planId/asignaturas'
| '/planes/nuevo'
@@ -244,7 +238,6 @@ export interface FileRouteTypes {
| '/login'
| '/planes'
| '/demo/tanstack-query'
- | '/planes/PlanesListRoute'
| '/planes/$planId'
| '/planes/nuevo'
| '/planes/$planId/asignaturas/$asignaturaId'
@@ -264,7 +257,6 @@ export interface FileRouteTypes {
| '/login'
| '/planes/_lista'
| '/demo/tanstack-query'
- | '/planes/PlanesListRoute'
| '/planes/$planId/_detalle'
| '/planes/$planId/asignaturas'
| '/planes/_lista/nuevo'
@@ -288,7 +280,6 @@ export interface RootRouteChildren {
LoginRoute: typeof LoginRoute
PlanesListaRouteRoute: typeof PlanesListaRouteRouteWithChildren
DemoTanstackQueryRoute: typeof DemoTanstackQueryRoute
- PlanesPlanesListRouteRoute: typeof PlanesPlanesListRouteRoute
PlanesPlanIdDetalleRouteRoute: typeof PlanesPlanIdDetalleRouteRouteWithChildren
PlanesPlanIdAsignaturasRouteRoute: typeof PlanesPlanIdAsignaturasRouteRouteWithChildren
PlanesPlanIdIndexRoute: typeof PlanesPlanIdIndexRoute
@@ -317,13 +308,6 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof IndexRouteImport
parentRoute: typeof rootRouteImport
}
- '/planes/PlanesListRoute': {
- id: '/planes/PlanesListRoute'
- path: '/planes/PlanesListRoute'
- fullPath: '/planes/PlanesListRoute'
- preLoaderRoute: typeof PlanesPlanesListRouteRouteImport
- parentRoute: typeof rootRouteImport
- }
'/demo/tanstack-query': {
id: '/demo/tanstack-query'
path: '/demo/tanstack-query'
@@ -341,7 +325,11 @@ declare module '@tanstack/react-router' {
'/planes/$planId/': {
id: '/planes/$planId/'
path: '/planes/$planId'
+<<<<<<< HEAD
fullPath: '/planes/$planId/'
+=======
+ fullPath: '/planes/$planId'
+>>>>>>> 4950f7efbf664bbd31ac8a673fe594af5baf07f6
preLoaderRoute: typeof PlanesPlanIdIndexRouteImport
parentRoute: typeof rootRouteImport
}
@@ -524,7 +512,6 @@ const rootRouteChildren: RootRouteChildren = {
LoginRoute: LoginRoute,
PlanesListaRouteRoute: PlanesListaRouteRouteWithChildren,
DemoTanstackQueryRoute: DemoTanstackQueryRoute,
- PlanesPlanesListRouteRoute: PlanesPlanesListRouteRoute,
PlanesPlanIdDetalleRouteRoute: PlanesPlanIdDetalleRouteRouteWithChildren,
PlanesPlanIdAsignaturasRouteRoute:
PlanesPlanIdAsignaturasRouteRouteWithChildren,
diff --git a/src/routes/planes/PlanesListRoute.tsx b/src/routes/planes/PlanesListRoute.tsx
deleted file mode 100644
index ed63c2b..0000000
--- a/src/routes/planes/PlanesListRoute.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-import { createFileRoute } from '@tanstack/react-router'
-import { useMemo, useState } from 'react'
-
-import { usePlanes } from '@/data'
-
-export const Route = createFileRoute('/planes/PlanesListRoute')({
- component: RouteComponent,
-})
-
-function RouteComponent() {
- const [search, setSearch] = useState('')
-
- const filters = useMemo(
- () => ({ search, limit: 20, offset: 0, activo: true }),
- [search],
- )
-
- const { data, isLoading, isError, error } = usePlanes(filters)
-
- return (
-
-
Planes
-
-
setSearch(e.target.value)}
- placeholder="Buscar…"
- />
-
- {isLoading &&
Cargando…
}
- {isError &&
Error: {(error as any).message}
}
-
-
-
- )
-}