feat: add Usuarios route and user management functionality

- Introduced a new route for user management under /usuarios.
- Implemented user listing with search and edit capabilities.
- Added role management with visual indicators for user roles.
- Created a modal for editing user details, including role and permissions.
- Integrated Supabase for user data retrieval and updates.
- Enhanced UI components for better user experience.
- Removed unused planes route and related components.
- Added a new plan detail modal for displaying plan information.
- Updated navigation to include new Usuarios link.
This commit is contained in:
2025-08-21 15:30:50 -06:00
parent fe471bcfc2
commit 02ad043ed6
16 changed files with 1542 additions and 97 deletions

View File

@@ -12,13 +12,14 @@ import { Route as rootRouteImport } from './routes/__root'
import { Route as LoginRouteImport } from './routes/login'
import { Route as AuthenticatedRouteImport } from './routes/_authenticated'
import { Route as IndexRouteImport } from './routes/index'
import { Route as AuthenticatedUsuariosRouteImport } from './routes/_authenticated/usuarios'
import { Route as AuthenticatedPlanesRouteImport } from './routes/_authenticated/planes'
import { Route as AuthenticatedFacultadesRouteImport } from './routes/_authenticated/facultades'
import { Route as AuthenticatedDashboardRouteImport } from './routes/_authenticated/dashboard'
import { Route as AuthenticatedAsignaturasRouteImport } from './routes/_authenticated/asignaturas'
import { Route as AuthenticatedPlanesPlanIdRouteImport } from './routes/_authenticated/planes/$planId'
import { Route as AuthenticatedPlanPlanIdRouteImport } from './routes/_authenticated/plan/$planId'
import { Route as AuthenticatedFacultadFacultadIdRouteImport } from './routes/_authenticated/facultad/$facultadId'
import { Route as AuthenticatedPlanesPlanIdModalRouteImport } from './routes/_authenticated/planes/$planId/modal'
import { Route as AuthenticatedPlanPlanIdModalRouteImport } from './routes/_authenticated/plan/$planId/modal'
const LoginRoute = LoginRouteImport.update({
id: '/login',
@@ -34,6 +35,11 @@ const IndexRoute = IndexRouteImport.update({
path: '/',
getParentRoute: () => rootRouteImport,
} as any)
const AuthenticatedUsuariosRoute = AuthenticatedUsuariosRouteImport.update({
id: '/usuarios',
path: '/usuarios',
getParentRoute: () => AuthenticatedRoute,
} as any)
const AuthenticatedPlanesRoute = AuthenticatedPlanesRouteImport.update({
id: '/planes',
path: '/planes',
@@ -55,23 +61,22 @@ const AuthenticatedAsignaturasRoute =
path: '/asignaturas',
getParentRoute: () => AuthenticatedRoute,
} as any)
const AuthenticatedPlanesPlanIdRoute =
AuthenticatedPlanesPlanIdRouteImport.update({
id: '/$planId',
path: '/$planId',
getParentRoute: () => AuthenticatedPlanesRoute,
} as any)
const AuthenticatedPlanPlanIdRoute = AuthenticatedPlanPlanIdRouteImport.update({
id: '/plan/$planId',
path: '/plan/$planId',
getParentRoute: () => AuthenticatedRoute,
} as any)
const AuthenticatedFacultadFacultadIdRoute =
AuthenticatedFacultadFacultadIdRouteImport.update({
id: '/facultad/$facultadId',
path: '/facultad/$facultadId',
getParentRoute: () => AuthenticatedRoute,
} as any)
const AuthenticatedPlanesPlanIdModalRoute =
AuthenticatedPlanesPlanIdModalRouteImport.update({
const AuthenticatedPlanPlanIdModalRoute =
AuthenticatedPlanPlanIdModalRouteImport.update({
id: '/modal',
path: '/modal',
getParentRoute: () => AuthenticatedPlanesPlanIdRoute,
getParentRoute: () => AuthenticatedPlanPlanIdRoute,
} as any)
export interface FileRoutesByFullPath {
@@ -80,10 +85,11 @@ export interface FileRoutesByFullPath {
'/asignaturas': typeof AuthenticatedAsignaturasRoute
'/dashboard': typeof AuthenticatedDashboardRoute
'/facultades': typeof AuthenticatedFacultadesRoute
'/planes': typeof AuthenticatedPlanesRouteWithChildren
'/planes': typeof AuthenticatedPlanesRoute
'/usuarios': typeof AuthenticatedUsuariosRoute
'/facultad/$facultadId': typeof AuthenticatedFacultadFacultadIdRoute
'/planes/$planId': typeof AuthenticatedPlanesPlanIdRouteWithChildren
'/planes/$planId/modal': typeof AuthenticatedPlanesPlanIdModalRoute
'/plan/$planId': typeof AuthenticatedPlanPlanIdRouteWithChildren
'/plan/$planId/modal': typeof AuthenticatedPlanPlanIdModalRoute
}
export interface FileRoutesByTo {
'/': typeof IndexRoute
@@ -91,10 +97,11 @@ export interface FileRoutesByTo {
'/asignaturas': typeof AuthenticatedAsignaturasRoute
'/dashboard': typeof AuthenticatedDashboardRoute
'/facultades': typeof AuthenticatedFacultadesRoute
'/planes': typeof AuthenticatedPlanesRouteWithChildren
'/planes': typeof AuthenticatedPlanesRoute
'/usuarios': typeof AuthenticatedUsuariosRoute
'/facultad/$facultadId': typeof AuthenticatedFacultadFacultadIdRoute
'/planes/$planId': typeof AuthenticatedPlanesPlanIdRouteWithChildren
'/planes/$planId/modal': typeof AuthenticatedPlanesPlanIdModalRoute
'/plan/$planId': typeof AuthenticatedPlanPlanIdRouteWithChildren
'/plan/$planId/modal': typeof AuthenticatedPlanPlanIdModalRoute
}
export interface FileRoutesById {
__root__: typeof rootRouteImport
@@ -104,10 +111,11 @@ export interface FileRoutesById {
'/_authenticated/asignaturas': typeof AuthenticatedAsignaturasRoute
'/_authenticated/dashboard': typeof AuthenticatedDashboardRoute
'/_authenticated/facultades': typeof AuthenticatedFacultadesRoute
'/_authenticated/planes': typeof AuthenticatedPlanesRouteWithChildren
'/_authenticated/planes': typeof AuthenticatedPlanesRoute
'/_authenticated/usuarios': typeof AuthenticatedUsuariosRoute
'/_authenticated/facultad/$facultadId': typeof AuthenticatedFacultadFacultadIdRoute
'/_authenticated/planes/$planId': typeof AuthenticatedPlanesPlanIdRouteWithChildren
'/_authenticated/planes/$planId/modal': typeof AuthenticatedPlanesPlanIdModalRoute
'/_authenticated/plan/$planId': typeof AuthenticatedPlanPlanIdRouteWithChildren
'/_authenticated/plan/$planId/modal': typeof AuthenticatedPlanPlanIdModalRoute
}
export interface FileRouteTypes {
fileRoutesByFullPath: FileRoutesByFullPath
@@ -118,9 +126,10 @@ export interface FileRouteTypes {
| '/dashboard'
| '/facultades'
| '/planes'
| '/usuarios'
| '/facultad/$facultadId'
| '/planes/$planId'
| '/planes/$planId/modal'
| '/plan/$planId'
| '/plan/$planId/modal'
fileRoutesByTo: FileRoutesByTo
to:
| '/'
@@ -129,9 +138,10 @@ export interface FileRouteTypes {
| '/dashboard'
| '/facultades'
| '/planes'
| '/usuarios'
| '/facultad/$facultadId'
| '/planes/$planId'
| '/planes/$planId/modal'
| '/plan/$planId'
| '/plan/$planId/modal'
id:
| '__root__'
| '/'
@@ -141,9 +151,10 @@ export interface FileRouteTypes {
| '/_authenticated/dashboard'
| '/_authenticated/facultades'
| '/_authenticated/planes'
| '/_authenticated/usuarios'
| '/_authenticated/facultad/$facultadId'
| '/_authenticated/planes/$planId'
| '/_authenticated/planes/$planId/modal'
| '/_authenticated/plan/$planId'
| '/_authenticated/plan/$planId/modal'
fileRoutesById: FileRoutesById
}
export interface RootRouteChildren {
@@ -175,6 +186,13 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof IndexRouteImport
parentRoute: typeof rootRouteImport
}
'/_authenticated/usuarios': {
id: '/_authenticated/usuarios'
path: '/usuarios'
fullPath: '/usuarios'
preLoaderRoute: typeof AuthenticatedUsuariosRouteImport
parentRoute: typeof AuthenticatedRoute
}
'/_authenticated/planes': {
id: '/_authenticated/planes'
path: '/planes'
@@ -203,12 +221,12 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof AuthenticatedAsignaturasRouteImport
parentRoute: typeof AuthenticatedRoute
}
'/_authenticated/planes/$planId': {
id: '/_authenticated/planes/$planId'
path: '/$planId'
fullPath: '/planes/$planId'
preLoaderRoute: typeof AuthenticatedPlanesPlanIdRouteImport
parentRoute: typeof AuthenticatedPlanesRoute
'/_authenticated/plan/$planId': {
id: '/_authenticated/plan/$planId'
path: '/plan/$planId'
fullPath: '/plan/$planId'
preLoaderRoute: typeof AuthenticatedPlanPlanIdRouteImport
parentRoute: typeof AuthenticatedRoute
}
'/_authenticated/facultad/$facultadId': {
id: '/_authenticated/facultad/$facultadId'
@@ -217,55 +235,48 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof AuthenticatedFacultadFacultadIdRouteImport
parentRoute: typeof AuthenticatedRoute
}
'/_authenticated/planes/$planId/modal': {
id: '/_authenticated/planes/$planId/modal'
'/_authenticated/plan/$planId/modal': {
id: '/_authenticated/plan/$planId/modal'
path: '/modal'
fullPath: '/planes/$planId/modal'
preLoaderRoute: typeof AuthenticatedPlanesPlanIdModalRouteImport
parentRoute: typeof AuthenticatedPlanesPlanIdRoute
fullPath: '/plan/$planId/modal'
preLoaderRoute: typeof AuthenticatedPlanPlanIdModalRouteImport
parentRoute: typeof AuthenticatedPlanPlanIdRoute
}
}
}
interface AuthenticatedPlanesPlanIdRouteChildren {
AuthenticatedPlanesPlanIdModalRoute: typeof AuthenticatedPlanesPlanIdModalRoute
interface AuthenticatedPlanPlanIdRouteChildren {
AuthenticatedPlanPlanIdModalRoute: typeof AuthenticatedPlanPlanIdModalRoute
}
const AuthenticatedPlanesPlanIdRouteChildren: AuthenticatedPlanesPlanIdRouteChildren =
const AuthenticatedPlanPlanIdRouteChildren: AuthenticatedPlanPlanIdRouteChildren =
{
AuthenticatedPlanesPlanIdModalRoute: AuthenticatedPlanesPlanIdModalRoute,
AuthenticatedPlanPlanIdModalRoute: AuthenticatedPlanPlanIdModalRoute,
}
const AuthenticatedPlanesPlanIdRouteWithChildren =
AuthenticatedPlanesPlanIdRoute._addFileChildren(
AuthenticatedPlanesPlanIdRouteChildren,
const AuthenticatedPlanPlanIdRouteWithChildren =
AuthenticatedPlanPlanIdRoute._addFileChildren(
AuthenticatedPlanPlanIdRouteChildren,
)
interface AuthenticatedPlanesRouteChildren {
AuthenticatedPlanesPlanIdRoute: typeof AuthenticatedPlanesPlanIdRouteWithChildren
}
const AuthenticatedPlanesRouteChildren: AuthenticatedPlanesRouteChildren = {
AuthenticatedPlanesPlanIdRoute: AuthenticatedPlanesPlanIdRouteWithChildren,
}
const AuthenticatedPlanesRouteWithChildren =
AuthenticatedPlanesRoute._addFileChildren(AuthenticatedPlanesRouteChildren)
interface AuthenticatedRouteChildren {
AuthenticatedAsignaturasRoute: typeof AuthenticatedAsignaturasRoute
AuthenticatedDashboardRoute: typeof AuthenticatedDashboardRoute
AuthenticatedFacultadesRoute: typeof AuthenticatedFacultadesRoute
AuthenticatedPlanesRoute: typeof AuthenticatedPlanesRouteWithChildren
AuthenticatedPlanesRoute: typeof AuthenticatedPlanesRoute
AuthenticatedUsuariosRoute: typeof AuthenticatedUsuariosRoute
AuthenticatedFacultadFacultadIdRoute: typeof AuthenticatedFacultadFacultadIdRoute
AuthenticatedPlanPlanIdRoute: typeof AuthenticatedPlanPlanIdRouteWithChildren
}
const AuthenticatedRouteChildren: AuthenticatedRouteChildren = {
AuthenticatedAsignaturasRoute: AuthenticatedAsignaturasRoute,
AuthenticatedDashboardRoute: AuthenticatedDashboardRoute,
AuthenticatedFacultadesRoute: AuthenticatedFacultadesRoute,
AuthenticatedPlanesRoute: AuthenticatedPlanesRouteWithChildren,
AuthenticatedPlanesRoute: AuthenticatedPlanesRoute,
AuthenticatedUsuariosRoute: AuthenticatedUsuariosRoute,
AuthenticatedFacultadFacultadIdRoute: AuthenticatedFacultadFacultadIdRoute,
AuthenticatedPlanPlanIdRoute: AuthenticatedPlanPlanIdRouteWithChildren,
}
const AuthenticatedRouteWithChildren = AuthenticatedRoute._addFileChildren(