refactor: Clean up unused imports, improve type safety, and fix UI text and navigation links.

This commit is contained in:
2025-12-29 01:33:53 -03:00
parent 158aa5b315
commit 3a02ecb757
4 changed files with 145 additions and 127 deletions
+17
View File
@@ -162,6 +162,23 @@ El servicio CMS expone una API RESTful en el puerto `3001`. A continuación se d
- **URL**: `GET /organizations/{id}/branding`
- **Descripción**: Recupera la identidad visual (logo y colores) de una organización.
### 👥 Gestión de Usuarios (Admin)
#### Listar Usuarios
- **URL**: `GET /users`
- **Descripción**: Obtiene todos los usuarios registrados en el sistema.
#### Actualizar Usuario
- **URL**: `PUT /users/{id}`
- **Descripción**: Permite cambiar el rol o la organización de un usuario.
- **Body (JSON)**:
```json
{
"role": "string",
"organization_id": "uuid"
}
```
## 📦 Configuración y Ejecución
1. **Variables de Entorno**:
+2 -1
View File
@@ -95,7 +95,8 @@
- [ ] XP and leveling system
- [x] **Course Management Enhancements**:
- [x] Manual naming for modules, lessons, and activities during creation.
- [x] Drag-and-drop reordering for modules, lessons, and activities.
- [x] Reordering for modules, lessons, and activities (Level up/down).
- [x] Deletion of modules and lessons with confirmation.
- [x] **Pacing Control**:
- [x] Self-paced mode (Evergreen).
- [x] Instructor-led mode (Cohort-based with start/end dates).
@@ -3,7 +3,7 @@
import { useState, useEffect } from 'react';
import { cmsApi, Organization } from '@/lib/api';
import { useAuth } from '@/context/AuthContext';
import { Plus, Building2, Globe, Calendar, ExternalLink, ShieldCheck, Palette, Upload, Save, X, Check } from 'lucide-react';
import { Plus, Building2, Globe, Calendar, ExternalLink, ShieldCheck, Palette, Upload, Save, X } from 'lucide-react';
export default function OrganizationsPage() {
const [organizations, setOrganizations] = useState<Organization[]>([]);
@@ -322,7 +322,7 @@ export default function OrganizationsPage() {
<div className="flex items-center gap-2">
<div className="w-5 h-5 bg-white/20 rounded flex items-center justify-center overflow-hidden">
{selectedOrg.logo_url ? (
<img src={selectedOrg.logo_url} className="w-full h-full object-contain" />
<img src={selectedOrg.logo_url} alt="Logo" className="w-full h-full object-contain" />
) : <div className="w-3 h-3 bg-white" />}
</div>
<div className="w-16 h-2 bg-white/30 rounded" />
@@ -350,7 +350,7 @@ export default function OrganizationsPage() {
</div>
<div className="p-3 rounded-lg bg-blue-500/10 border border-blue-500/20">
<p className="text-[10px] text-blue-400 leading-relaxed">
This is a real-time preview of how the brand identity will apply to the student's learning experience.
This is a real-time preview of how the brand identity will apply to the student&apos;s learning experience.
</p>
</div>
</div>
@@ -16,13 +16,7 @@ import {
Pencil,
ChevronUp,
ChevronDown,
Trash2,
PlayCircle,
FileText,
Calendar,
Settings,
Layout,
CheckCircle2
Trash2
} from "lucide-react";
export default function LessonEditor({ params }: { params: { id: string; lessonId: string } }) {
@@ -109,7 +103,7 @@ export default function LessonEditor({ params }: { params: { id: string; lessonI
max_attempts: maxAttempts,
allow_retry: allowRetry,
due_date: dueDate ? new Date(dueDate).toISOString() : undefined,
important_date_type: (importantDateType || undefined) as any
important_date_type: (importantDateType || undefined) as 'exam' | 'assignment' | 'milestone' | 'live-session' | undefined
});
setLesson(updated);
setEditMode(false);
@@ -331,7 +325,8 @@ export default function LessonEditor({ params }: { params: { id: string; lessonI
</div >
)}
{editMode && (
{
editMode && (
<div className="bg-white/5 border border-white/10 rounded-3xl p-8 space-y-6 animate-in fade-in slide-in-from-top-4 duration-500">
<div>
<h3 className="text-xl font-bold flex items-center gap-2">
@@ -371,10 +366,12 @@ export default function LessonEditor({ params }: { params: { id: string; lessonI
</div>
</div>
</div>
)}
)
}
{/* AI Magic Section */}
{editMode && (
{
editMode && (
<div className="bg-white/5 border border-white/10 rounded-3xl p-8 space-y-6 animate-in fade-in slide-in-from-top-4 duration-500">
<div className="flex items-center gap-3">
<span className="text-2xl">🪄</span>
@@ -420,10 +417,12 @@ export default function LessonEditor({ params }: { params: { id: string; lessonI
</button>
</div>
</div>
)}
)
}
{/* AI Summary Visualization */}
{(summary || editMode) && (
{
(summary || editMode) && (
<div className="bg-gradient-to-br from-indigo-500/10 to-blue-500/10 border border-indigo-500/20 rounded-3xl p-8 space-y-6 animate-in fade-in duration-700">
<div className="flex items-center justify-between">
<div className="flex items-center gap-3">
@@ -448,7 +447,8 @@ export default function LessonEditor({ params }: { params: { id: string; lessonI
</div>
)}
</div>
)}
)
}
<div className="space-y-16">
{blocks.map((block, index) => (