Overview
The User Management module provides comprehensive control over user accounts, roles, departments, and access permissions. Located at/configuracion/User, this feature enables administrators to maintain secure and organized access to the GIMA platform.
User CRUD Operations
Create, view, edit, and delete user accounts with intuitive modal-based workflows
Role-Based Access
Assign roles and permissions to control what users can access and modify
Department Organization
Organize users by department for streamlined management and reporting
Status Tracking
Monitor user availability and active status in real-time
User Interface
The user management interface is implemented insrc/app/configuracion/User/page.tsx and renders the UserTable component:
UserTable Component
The main component atsrc/components/user/UserTable.tsx provides a full-featured user management interface:
User Data Structure
Users are defined by theUser type in src/types/user.ts:
Example User Data
The system includes mock users fromsrc/utils/mockUsers.ts:
The example data shows diverse roles (Engineer, Doctor, Graduated) and departments (frontend, cardiology, Vet, pediatrics), demonstrating GIMA’s flexibility for different organizational structures.
Managing Users
Access User Management
Navigate to
/configuracion/User from the configuration menuThe page displays “Gestión de usuarios” with subtitle “Administración de permisos y personal”Search for Users
Use the search bar to filter users:Search matches against name, email, and department fields.
Table Structure
The user table displays key information with styled headers:Table Columns
- Usuario
- Rol/Cargo
- Departamento
- Estado
- Acción
User InformationDisplays:
- User initials in a circular avatar
- Full name
- Email address
iniciales field and displayed prominently for quick visual identification.User Modal Component
TheUserModal component (referenced at src/components/user/UserModal.tsx) handles user creation and editing:
Modal Functionality
Create Mode
Create Mode
When The modal presents empty fields for entering new user data.
user prop is null, the modal operates in creation mode:Edit Mode
Edit Mode
When Users can modify existing values and save changes.
user prop contains a User object, the modal pre-fills fields:Save Handler
Save Handler
The save function handles both creation and updates:
State Management
The UserTable component uses React hooks for comprehensive state management:Key State Variables
users
Array of User objects representing all users in the system
busqueda
Current search term for filtering users
modalAbierto
Boolean controlling modal visibility
usuarioEditando
User object being edited, or null for new user creation
Search Functionality
The search bar provides real-time filtering with a clean interface:User Roles & Permissions
While the current implementation shows flexible role assignment, typical GIMA roles include:- Administrator
- Manager
- Engineer/Technician
- Viewer
Full System AccessPermissions:
- Manage all users
- Configure system settings
- Access all reports
- Manage all assets and categories
- Override all restrictions
Best Practices
Unique Emails
Ensure each user has a unique email address for authentication and notifications
Meaningful Roles
Assign roles that accurately reflect user responsibilities and required permissions
Department Consistency
Use consistent department naming conventions across your organization
Regular Audits
Periodically review user accounts to remove inactive users and update roles
Status Updates
Keep user availability status current for accurate team visibility
Secure Deletions
Consider deactivating instead of deleting users to preserve historical data integrity
UserRow Component
Individual user rows are rendered by theUserRow component at src/components/user/UserRow.tsx:
- Displays user information in table cells
- Handles row hover effects
- Manages action button states
- Triggers edit and delete callbacks
Styling & Design
The user management interface uses a clean, professional design:Color Scheme
- Header Background:
#F0FDFA(light cyan) - Header Text:
#0B2545(navy blue) - Primary Blue:
#3B82F6(blue-600) - Background:
#F9FAFB(gray-50)
Interactive Elements
The design uses rounded corners (
rounded-lg) and subtle borders for a modern, approachable interface that matches GIMA’s overall aesthetic.Integration Points
- Dashboard: User status affects team availability metrics
- Maintenance: User roles determine maintenance task assignments
- Reports: User departments filter report access and visibility
- AI Diagnostics: User roles control AI feature access
- Asset Management: User permissions control asset modification rights
Future Enhancements
Potential improvements to user management:- Multi-factor Authentication: Enhanced security for sensitive accounts
- Password Management: Self-service password reset and policies
- User Groups: Organize users into custom groups beyond departments
- Activity Logs: Track user actions for audit and compliance
- Bulk Operations: Import/export users and perform batch updates
- Advanced Permissions: Granular permission control per feature
Related Features
- Dashboard - Role-based dashboard views
- Reports - User activity and access reports
- Asset Management - Permission-controlled asset operations
- Maintenance - Role-based maintenance assignments