Architecture audit fixes: Fix broken APIs, remove duplicates, clean dead code

Critical Fixes:
- UnifiedGradingPanel: Fixed API calls from non-existent /api/v1/grades* to /api/assessments
  - Added data transformation from Assessment objects to Grade interface
  - Handle nested subject objects (subject.name instead of subject string)
  - Added empty state when no grades exist
- ProfessionalCalendar: Fixed API call from /api/v1/calendar/events to /api/calendar-events
  - Changed from startDate/endDate params to month param (YYYY-MM format)

Removed Duplicates:
- Removed 'tablet-grading' nav entry (was duplicate of 'grading', variant='tablet' was a no-op)
- Removed 'exam-calendar' nav entry (was duplicate of 'calendar', identical props)
- Removed 'school-events' nav entry (was duplicate of 'calendar', identical props)
- Removed corresponding renderView cases for all 3

Deleted Orphan Files:
- src/components/grading-panel.tsx (never imported, called non-existent /api/v1/assessments/*)
- src/components/notification-hub.tsx (never imported, called non-existent /api/v1/notifications/*)
- src/components/unified-nav-menu.tsx (never imported, depended on deleted navigation-config.ts)
- src/lib/navigation-config.ts (stale, unused - app uses inline arrays in app-layout.tsx)

Fixed Role Access:
- Added 'settings' to parentViews, studentViews, and teacherViews
- Added notebooks, homework, attendance, grading, flower, subjects, resources,
  competitions, portfolio to studentViews
- Added notebooks, drawing, portfolio, peer-assessment, subjects, competitions,
  parents, announcements, school-library, school-transport, counseling,
  student-wellness, student-career, ai-tests, ai-studio, data-import-export
  to teacherViews
- Removed 'tablet-grading' and 'exam-calendar' from teacherViews (nav entries removed)
This commit is contained in:
Z User committed 2026-08-10 17:46:37 +00:00
1 parent 411ff146a7
commit 1af01dd304
8 files changed
+39 -1008

No files matched your search

+2 -1
View File
@@ -99,8 +99,9 @@ export function ProfessionalCalendar({
const dateLocale = locale === 'de' ? deLocale : enLocale;
// Fetch events from backend
const monthParam = format(currentDate, 'yyyy-MM');
const { data: backendEvents, isLoading } = useApiGet(
`/api/v1/calendar/events?startDate=${format(startOfMonth(currentDate), 'yyyy-MM-dd')}&endDate=${format(endOfMonth(currentDate), 'yyyy-MM-dd')}`,
`/api/calendar-events?month=${monthParam}`,
{ revalidateOnFocus: true }
);