From 449c231af0648e26b0b15e49bbc336175c154687 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 7 Nov 2025 21:44:24 +0000 Subject: [PATCH] fix: Update dashboard to match backend structure and support dark mode Frontend changes: - Updated API endpoints to call /tenants/{id}/dashboard/* (removed /orchestrator/ prefix to match backend router) - Updated DashboardPage to use CSS theme variables instead of hardcoded colors - Replaced bg-white, text-gray-*, bg-blue-* with var(--bg-primary), var(--text-primary), etc. - Quick action buttons now use color accents with left border for visual distinction This ensures: 1. Frontend calls the correct backend endpoints (fixes 404 errors) 2. Dashboard respects theme (light/dark mode) 3. Consistent styling with rest of application --- frontend/src/api/hooks/newDashboard.ts | 10 ++--- frontend/src/pages/app/DashboardPage.tsx | 48 ++++++++++++++---------- 2 files changed, 34 insertions(+), 24 deletions(-) diff --git a/frontend/src/api/hooks/newDashboard.ts b/frontend/src/api/hooks/newDashboard.ts index 71bfc112..31018a46 100644 --- a/frontend/src/api/hooks/newDashboard.ts +++ b/frontend/src/api/hooks/newDashboard.ts @@ -153,7 +153,7 @@ export function useBakeryHealthStatus(tenantId: string) { queryKey: ['bakery-health-status', tenantId], queryFn: async () => { const response = await apiClient.get( - `/orchestrator/tenants/${tenantId}/dashboard/health-status` + `/tenants/${tenantId}/dashboard/health-status` ); return response.data; }, @@ -174,7 +174,7 @@ export function useOrchestrationSummary(tenantId: string, runId?: string) { queryFn: async () => { const params = runId ? { run_id: runId } : {}; const response = await apiClient.get( - `/orchestrator/tenants/${tenantId}/dashboard/orchestration-summary`, + `/tenants/${tenantId}/dashboard/orchestration-summary`, { params } ); return response.data; @@ -195,7 +195,7 @@ export function useActionQueue(tenantId: string) { queryKey: ['action-queue', tenantId], queryFn: async () => { const response = await apiClient.get( - `/orchestrator/tenants/${tenantId}/dashboard/action-queue` + `/tenants/${tenantId}/dashboard/action-queue` ); return response.data; }, @@ -215,7 +215,7 @@ export function useProductionTimeline(tenantId: string) { queryKey: ['production-timeline', tenantId], queryFn: async () => { const response = await apiClient.get( - `/orchestrator/tenants/${tenantId}/dashboard/production-timeline` + `/tenants/${tenantId}/dashboard/production-timeline` ); return response.data; }, @@ -235,7 +235,7 @@ export function useInsights(tenantId: string) { queryKey: ['dashboard-insights', tenantId], queryFn: async () => { const response = await apiClient.get( - `/orchestrator/tenants/${tenantId}/dashboard/insights` + `/tenants/${tenantId}/dashboard/insights` ); return response.data; }, diff --git a/frontend/src/pages/app/DashboardPage.tsx b/frontend/src/pages/app/DashboardPage.tsx index e322a546..ecb186b4 100644 --- a/frontend/src/pages/app/DashboardPage.tsx +++ b/frontend/src/pages/app/DashboardPage.tsx @@ -126,18 +126,24 @@ export function NewDashboardPage() { }; return ( -
+
{/* Mobile-optimized container */}
{/* Header */}
-

Panel de Control

-

Your bakery at a glance

+

Panel de Control

+

Your bakery at a glance