From 3a02ecb757e8062c3602c06fa4e1a2ad40bf31ef Mon Sep 17 00:00:00 2001 From: Nurfog Date: Mon, 29 Dec 2025 01:33:53 -0300 Subject: [PATCH] refactor: Clean up unused imports, improve type safety, and fix UI text and navigation links. --- README.md | 17 ++ roadmap.md | 3 +- .../src/app/admin/organizations/page.tsx | 6 +- .../courses/[id]/lessons/[lessonId]/page.tsx | 246 +++++++++--------- 4 files changed, 145 insertions(+), 127 deletions(-) diff --git a/README.md b/README.md index dde5923..e4d1061 100644 --- a/README.md +++ b/README.md @@ -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**: diff --git a/roadmap.md b/roadmap.md index 298dbb9..73b3847 100644 --- a/roadmap.md +++ b/roadmap.md @@ -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). diff --git a/web/studio/src/app/admin/organizations/page.tsx b/web/studio/src/app/admin/organizations/page.tsx index be410a6..67115c5 100644 --- a/web/studio/src/app/admin/organizations/page.tsx +++ b/web/studio/src/app/admin/organizations/page.tsx @@ -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([]); @@ -322,7 +322,7 @@ export default function OrganizationsPage() {
{selectedOrg.logo_url ? ( - + Logo ) :
}
@@ -350,7 +350,7 @@ export default function OrganizationsPage() {

- 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's learning experience.

diff --git a/web/studio/src/app/courses/[id]/lessons/[lessonId]/page.tsx b/web/studio/src/app/courses/[id]/lessons/[lessonId]/page.tsx index 1628f7e..bded7f6 100644 --- a/web/studio/src/app/courses/[id]/lessons/[lessonId]/page.tsx +++ b/web/studio/src/app/courses/[id]/lessons/[lessonId]/page.tsx @@ -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); @@ -199,7 +193,7 @@ export default function LessonEditor({ params }: { params: { id: string; lessonI
- Outline + Outline / Activity
@@ -274,8 +268,8 @@ export default function LessonEditor({ params }: { params: { id: string; lessonI
{gradingCategories.length === 0 ? (
- No grading categories defined. Go to Grading Policy -
+ No grading categories defined. Go to Grading Policy +
) : ( gradingCategories.map((cat) => (
+
@@ -328,127 +322,133 @@ export default function LessonEditor({ params }: { params: { id: string; lessonI
)} -
+
)} - {editMode && ( -
-
-

- 📅 Scheduling & Deadlines -

-

Set deadlines and mark important dates for this activity

-
- -
-
- -
- -
- -
-
-
- )} - - {/* AI Magic Section */} - {editMode && ( -
-
- 🪄 + { + editMode && ( +
-

AI Content Assistant

-

Automate your content creation

+

+ 📅 Scheduling & Deadlines +

+

Set deadlines and mark important dates for this activity

-
-
- {(lesson.content_type === 'video' || lesson.content_type === 'audio') && ( - - )} +
+
+ +
- - - -
-
- )} - - {/* AI Summary Visualization */} - {(summary || editMode) && ( -
-
-
- -
-

AI Lesson Summary

-

Key insights generated by intelligence

+
+
+ ) + } - {editMode ? ( -