Improve the frontend 5

This commit is contained in:
Urtzi Alfaro
2025-11-02 20:24:44 +01:00
parent 0220da1725
commit 5adb0e39c0
90 changed files with 10658 additions and 2548 deletions

View File

@@ -40,6 +40,7 @@ const SalesAnalyticsPage = React.lazy(() => import('../pages/app/analytics/sales
const ScenarioSimulationPage = React.lazy(() => import('../pages/app/analytics/scenario-simulation/ScenarioSimulationPage'));
const AIInsightsPage = React.lazy(() => import('../pages/app/analytics/ai-insights/AIInsightsPage'));
const PerformanceAnalyticsPage = React.lazy(() => import('../pages/app/analytics/performance/PerformanceAnalyticsPage'));
const EventRegistryPage = React.lazy(() => import('../pages/app/analytics/events/EventRegistryPage'));
// Settings pages - Unified
@@ -55,11 +56,6 @@ const ModelsConfigPage = React.lazy(() => import('../pages/app/database/models/M
const QualityTemplatesPage = React.lazy(() => import('../pages/app/database/quality-templates/QualityTemplatesPage'));
const SustainabilityPage = React.lazy(() => import('../pages/app/database/sustainability/SustainabilityPage'));
// Data pages
const WeatherPage = React.lazy(() => import('../pages/app/data/weather/WeatherPage'));
const TrafficPage = React.lazy(() => import('../pages/app/data/traffic/TrafficPage'));
const EventsPage = React.lazy(() => import('../pages/app/data/events/EventsPage'));
// Onboarding pages
const OnboardingPage = React.lazy(() => import('../pages/onboarding/OnboardingPage'));
@@ -331,6 +327,16 @@ export const AppRouter: React.FC = () => {
</ProtectedRoute>
}
/>
<Route
path="/app/analytics/events"
element={
<ProtectedRoute requiredRoles={['admin', 'owner']}>
<AppShell>
<EventRegistryPage />
</AppShell>
</ProtectedRoute>
}
/>
{/* Settings Routes */}
@@ -370,38 +376,6 @@ export const AppRouter: React.FC = () => {
}
/>
{/* Data Routes */}
<Route
path="/app/data/weather"
element={
<ProtectedRoute>
<AppShell>
<WeatherPage />
</AppShell>
</ProtectedRoute>
}
/>
<Route
path="/app/data/traffic"
element={
<ProtectedRoute>
<AppShell>
<TrafficPage />
</AppShell>
</ProtectedRoute>
}
/>
<Route
path="/app/data/events"
element={
<ProtectedRoute>
<AppShell>
<EventsPage />
</AppShell>
</ProtectedRoute>
}
/>
{/* Onboarding Route - Protected but without AppShell */}
<Route
path="/app/onboarding"

View File

@@ -106,16 +106,10 @@ export const ROUTES = {
POS_TRANSACTIONS: '/pos/transactions',
POS_WEBHOOKS: '/pos/webhooks',
POS_SETTINGS: '/pos/settings',
// Data Management
DATA: '/app/data',
DATA_IMPORT: '/data/import',
DATA_EXPORT: '/data/export',
DATA_EXTERNAL: '/data/external',
DATA_WEATHER: '/app/data/weather',
DATA_EVENTS: '/app/data/events',
DATA_TRAFFIC: '/app/data/traffic',
// Analytics
ANALYTICS_EVENTS: '/app/analytics/events',
// Training & ML
TRAINING: '/training',
TRAINING_MODELS: '/training/models',
@@ -374,6 +368,17 @@ export const routesConfig: RouteConfig[] = [
showInNavigation: true,
showInBreadcrumbs: true,
},
{
path: '/app/analytics/events',
name: 'EventRegistry',
component: 'EventRegistryPage',
title: 'Registro de Eventos',
icon: 'fileText',
requiresAuth: true,
requiredRoles: ['admin', 'owner'],
showInNavigation: true,
showInBreadcrumbs: true,
},
],
},
@@ -536,50 +541,6 @@ export const routesConfig: RouteConfig[] = [
],
},
// Data Management Section
{
path: '/app/data',
name: 'Data',
component: 'DataPage',
title: 'Gestión de Datos',
icon: 'data',
requiresAuth: true,
showInNavigation: true,
children: [
{
path: '/app/data/weather',
name: 'Weather',
component: 'WeatherPage',
title: 'Datos Meteorológicos',
icon: 'data',
requiresAuth: true,
showInNavigation: true,
showInBreadcrumbs: true,
},
{
path: '/app/data/traffic',
name: 'Traffic',
component: 'TrafficPage',
title: 'Datos de Tráfico',
icon: 'data',
requiresAuth: true,
showInNavigation: true,
showInBreadcrumbs: true,
},
{
path: '/app/data/events',
name: 'Events',
component: 'EventsPage',
title: 'Eventos y Festivales',
icon: 'data',
requiresAuth: true,
showInNavigation: true,
showInBreadcrumbs: true,
},
],
},
// Onboarding Section - Complete 9-step flow
{
path: '/app/onboarding',