diff --git a/backend/routes/courses.js b/backend/routes/courses.js index 7bc2463..8a506e4 100644 --- a/backend/routes/courses.js +++ b/backend/routes/courses.js @@ -437,8 +437,6 @@ router.put('/:id/assign-trainer', [ // @access Private (Super Admin) router.get('/trainers/available', auth, requireSuperAdmin, async (req, res) => { try { - console.log('Get available trainers request from user:', req.user.id, 'role:', req.user.role); - const trainers = await User.findAll({ where: { role: 'trainer', @@ -448,7 +446,6 @@ router.get('/trainers/available', auth, requireSuperAdmin, async (req, res) => { order: [['firstName', 'ASC'], ['lastName', 'ASC']] }); - console.log('Found trainers:', trainers.length); res.json({ trainers }); } catch (error) { console.error('Get available trainers error:', error); diff --git a/frontend/src/components/TrainerAssignmentModal.js b/frontend/src/components/TrainerAssignmentModal.js index ef56a32..66e80d3 100644 --- a/frontend/src/components/TrainerAssignmentModal.js +++ b/frontend/src/components/TrainerAssignmentModal.js @@ -4,7 +4,6 @@ import { coursesAPI } from '../services/api'; import { useAuth } from '../contexts/AuthContext'; import { XMarkIcon, - UserIcon, AcademicCapIcon, } from '@heroicons/react/24/outline'; import LoadingSpinner from './LoadingSpinner'; @@ -18,18 +17,12 @@ const TrainerAssignmentModal = ({ isOpen, onClose, courseId, currentTrainer }) = // Get available trainers const { data: trainersData, isLoading: trainersLoading, error: trainersError } = useQuery( ['available-trainers'], - () => { - console.log('Fetching available trainers...'); - return coursesAPI.getAvailableTrainers(); - }, + () => coursesAPI.getAvailableTrainers(), { enabled: isOpen, onError: (error) => { console.error('Trainer loading error:', error); toast.error('Failed to load trainers'); - }, - onSuccess: (data) => { - console.log('Trainers loaded successfully:', data); } } ); @@ -149,16 +142,7 @@ const TrainerAssignmentModal = ({ isOpen, onClose, courseId, currentTrainer }) = )} - {/* Debug info - remove in production */} - {process.env.NODE_ENV === 'development' && ( -
-

Debug: trainersData = {JSON.stringify(trainersData, null, 2)}

-

Debug: trainersLoading = {trainersLoading}

-

Debug: trainersError = {trainersError?.message}

-

Debug: Current user role = {user?.role}

-

Debug: Current user ID = {user?.id}

-
- )} +
{error && ( -
+
+
+ + + +

Login Error diff --git a/version.txt b/version.txt index 71ea98c..4346c6a 100644 --- a/version.txt +++ b/version.txt @@ -1,4 +1,4 @@ -CourseWorx v1.1.2 - Trainer Assignment System & Navigation Improvements +CourseWorx v1.1.3 - Enhanced Login Experience & Dashboard Improvements ========================================================== This version adds comprehensive course content management and enrollment/subscriber functionality to the existing Course Management System. @@ -111,6 +111,55 @@ MAJOR FEATURES IMPLEMENTED: - Assignment management - Database migrations and seeding +NEW FEATURES IN v1.1.3: +======================== + +1. ENHANCED LOGIN EXPERIENCE +----------------------------- +- Fixed page reload issue that was hiding error messages +- Improved error message visibility with better styling +- Added delays to prevent immediate redirects after login +- Enhanced error handling with clear visual feedback +- Better user experience with proper error persistence +- Added error icons and improved error message styling + +2. TRAINER PROFILE SYSTEM +-------------------------- +- New trainer profile page with comprehensive information +- Clickable instructor sections in course details +- Trainer qualifications and experience display +- Course listings by trainer +- Professional trainer profile layout +- Direct navigation from course pages to trainer profiles + +3. MODERN COURSE DETAIL PAGE +----------------------------- +- Redesigned course detail page with Udemy-like layout +- Left column with course information and content +- Right sidebar with pricing and enrollment options +- Professional course preview with play button +- Enhanced "What you'll learn" section with checkmarks +- Course content structure with expandable sections +- Requirements and description sections +- Course includes section with feature icons + +4. DASHBOARD IMPROVEMENTS +-------------------------- +- Made all dashboard cards clickable with proper navigation +- Added hover effects and arrow icons for better UX +- Fixed hardcoded values and improved data display +- Enhanced Quick Actions with proper links +- Course and enrollment items are now clickable +- Better visual feedback with transitions and hover effects + +5. ESLINT & CODE QUALITY +------------------------- +- Fixed all ESLint warnings across components +- Removed unused imports and variables +- Improved code organization and structure +- Enhanced code maintainability +- Cleaned up debugging code and console logs + NEW FEATURES IN v1.1.2: ======================== @@ -386,5 +435,5 @@ DEPLOYMENT READINESS: This version (1.1.0) adds comprehensive course content management and enrollment/subscriber functionality to the existing Course Management System, providing a complete foundation for creating rich educational content and managing student enrollments. Release Date: [Current Date] -Version: 1.1.2 +Version: 1.1.3 Status: Production Ready \ No newline at end of file