Improve the frontend and fix TODOs

This commit is contained in:
Urtzi Alfaro
2025-10-24 13:05:04 +02:00
parent 07c33fa578
commit 61376b7a9f
100 changed files with 8284 additions and 3419 deletions

View File

@@ -42,13 +42,10 @@ const AIInsightsPage = React.lazy(() => import('../pages/app/analytics/ai-insigh
const PerformanceAnalyticsPage = React.lazy(() => import('../pages/app/analytics/performance/PerformanceAnalyticsPage'));
// Settings pages
const PersonalInfoPage = React.lazy(() => import('../pages/app/settings/personal-info/PersonalInfoPage'));
const CommunicationPreferencesPage = React.lazy(() => import('../pages/app/settings/communication-preferences/CommunicationPreferencesPage'));
// Settings pages - Unified
const BakerySettingsPage = React.lazy(() => import('../pages/app/settings/bakery/BakerySettingsPage'));
const NewProfileSettingsPage = React.lazy(() => import('../pages/app/settings/profile/NewProfileSettingsPage'));
const SubscriptionPage = React.lazy(() => import('../pages/app/settings/subscription/SubscriptionPage'));
const PrivacySettingsPage = React.lazy(() => import('../pages/app/settings/privacy/PrivacySettingsPage'));
const InformationPage = React.lazy(() => import('../pages/app/database/information/InformationPage'));
const AjustesPage = React.lazy(() => import('../pages/app/database/ajustes/AjustesPage'));
const TeamPage = React.lazy(() => import('../pages/app/settings/team/TeamPage'));
const OrganizationsPage = React.lazy(() => import('../pages/app/settings/organizations/OrganizationsPage'));
@@ -197,26 +194,20 @@ export const AppRouter: React.FC = () => {
</ProtectedRoute>
}
/>
{/* NEW: Unified Bakery Settings Route */}
<Route
path="/app/database/information"
path="/app/settings/bakery"
element={
<ProtectedRoute>
<AppShell>
<InformationPage />
</AppShell>
</ProtectedRoute>
}
/>
<Route
path="/app/database/ajustes"
element={
<ProtectedRoute>
<AppShell>
<AjustesPage />
<BakerySettingsPage />
</AppShell>
</ProtectedRoute>
}
/>
{/* Legacy routes redirect to new unified page */}
<Route path="/app/database/information" element={<Navigate to="/app/settings/bakery" replace />} />
<Route path="/app/database/ajustes" element={<Navigate to="/app/settings/bakery" replace />} />
<Route
path="/app/database/team"
element={
@@ -330,28 +321,23 @@ export const AppRouter: React.FC = () => {
}
/>
{/* Settings Routes */}
{/* NEW: Unified Profile Settings Route */}
<Route
path="/app/settings/personal-info"
path="/app/settings/profile"
element={
<ProtectedRoute>
<AppShell>
<PersonalInfoPage />
</AppShell>
</ProtectedRoute>
}
/>
<Route
path="/app/settings/communication-preferences"
element={
<ProtectedRoute>
<AppShell>
<CommunicationPreferencesPage />
<NewProfileSettingsPage />
</AppShell>
</ProtectedRoute>
}
/>
{/* Legacy routes redirect to new unified profile page */}
<Route path="/app/settings/personal-info" element={<Navigate to="/app/settings/profile" replace />} />
<Route path="/app/settings/communication-preferences" element={<Navigate to="/app/settings/profile" replace />} />
<Route path="/app/settings/privacy" element={<Navigate to="/app/settings/profile" replace />} />
<Route
path="/app/settings/subscription"
element={
@@ -372,16 +358,6 @@ export const AppRouter: React.FC = () => {
</ProtectedRoute>
}
/>
<Route
path="/app/settings/privacy"
element={
<ProtectedRoute>
<AppShell>
<PrivacySettingsPage />
</AppShell>
</ProtectedRoute>
}
/>
{/* Data Routes */}
<Route

View File

@@ -129,18 +129,21 @@ export const ROUTES = {
// Settings
SETTINGS: '/settings',
SETTINGS_PROFILE: '/app/settings/personal-info',
SETTINGS_COMMUNICATION: '/app/settings/communication-preferences',
SETTINGS_PROFILE: '/app/settings/profile',
SETTINGS_BAKERY: '/app/settings/bakery',
SETTINGS_SUBSCRIPTION: '/app/settings/subscription',
SETTINGS_ORGANIZATIONS: '/app/settings/organizations',
SETTINGS_PRIVACY: '/app/settings/privacy',
// Legacy routes (will redirect)
SETTINGS_PERSONAL_INFO_OLD: '/app/settings/personal-info',
SETTINGS_COMMUNICATION_OLD: '/app/settings/communication-preferences',
SETTINGS_PRIVACY_OLD: '/app/settings/privacy',
SETTINGS_BAKERY_INFO_OLD: '/app/database/information',
SETTINGS_BAKERY_AJUSTES_OLD: '/app/database/ajustes',
SETTINGS_TENANT: '/settings/tenant',
SETTINGS_USERS: '/settings/users',
SETTINGS_PERMISSIONS: '/settings/permissions',
SETTINGS_INTEGRATIONS: '/settings/integrations',
SETTINGS_BILLING: '/settings/billing',
SETTINGS_BAKERY_CONFIG: '/app/database/information',
SETTINGS_BAKERY_AJUSTES: '/app/database/ajustes',
SETTINGS_TEAM: '/app/database/team',
QUALITY_TEMPLATES: '/app/database/quality-templates',
@@ -382,21 +385,10 @@ export const routesConfig: RouteConfig[] = [
requiresAuth: true,
showInNavigation: true,
children: [
{
path: '/app/database/information',
name: 'Information',
component: 'InformationPage',
title: 'Información',
icon: 'settings',
requiresAuth: true,
requiredRoles: ROLE_COMBINATIONS.ADMIN_ACCESS,
showInNavigation: true,
showInBreadcrumbs: true,
},
{
path: '/app/database/ajustes',
name: 'Ajustes',
component: 'AjustesPage',
path: '/app/settings/bakery',
name: 'BakerySettings',
component: 'BakerySettingsPage',
title: 'Ajustes',
icon: 'settings',
requiresAuth: true,
@@ -500,25 +492,15 @@ export const routesConfig: RouteConfig[] = [
showInNavigation: true,
children: [
{
path: '/app/settings/personal-info',
name: 'PersonalInfo',
component: 'PersonalInfoPage',
title: 'Información',
path: '/app/settings/profile',
name: 'Profile',
component: 'NewProfileSettingsPage',
title: 'Ajustes',
icon: 'user',
requiresAuth: true,
showInNavigation: true,
showInBreadcrumbs: true,
},
{
path: '/app/settings/communication-preferences',
name: 'CommunicationPreferences',
component: 'CommunicationPreferencesPage',
title: 'Notificaciones',
icon: 'bell',
requiresAuth: true,
showInNavigation: true,
showInBreadcrumbs: true,
},
{
path: '/app/settings/subscription',
name: 'Subscription',
@@ -539,16 +521,6 @@ export const routesConfig: RouteConfig[] = [
showInNavigation: true,
showInBreadcrumbs: true,
},
{
path: '/app/settings/privacy',
name: 'Privacy',
component: 'PrivacySettingsPage',
title: 'Privacidad',
icon: 'settings',
requiresAuth: true,
showInNavigation: true,
showInBreadcrumbs: true,
},
],
},