diff --git a/src/app/dashboard/[...slug]/page.tsx b/src/app/dashboard/[...slug]/page.tsx index fb713a4..3b50ff1 100644 --- a/src/app/dashboard/[...slug]/page.tsx +++ b/src/app/dashboard/[...slug]/page.tsx @@ -2,15 +2,15 @@ import Link from 'next/link'; import { usePathname } from 'next/navigation'; -import { findNavItem } from '../../../lib/navigation'; +import { STAGE_LABEL, findNavItem } from '../../../lib/navigation'; export const dynamic = 'force-dynamic'; /** - * Ruta unica pentru sectiunile din arhitectura de informatie care nu sunt inca - * construite. Alternativa ar fi fost ~35 de fisiere-stub identice; asta tine - * lista intr-un singur loc (lib/navigation.ts) si spune exact ce lipseste, - * in loc sa arate un dashboard fals care pare functional. + * Ruta unica pentru elementele din Main Navigator care nu sunt inca construite. + * Alternativa ar fi fost ~120 de fisiere-stub identice; asta tine lista intr-un + * singur loc (registry-ul din lib/navigation.ts) si spune exact ce lipseste, + * in loc sa arate un ecran fals care pare functional. */ export default function PlannedSectionPage() { const pathname = usePathname(); @@ -35,10 +35,17 @@ export default function PlannedSectionPage() { return (
{section.label}
++ {section.order}. {section.label} +
+ + {STAGE_LABEL[item.releaseStage]} + +- Secțiunea face parte din structura platformei, dar nu e construită încă. + Face parte din structura platformei, dar nu e construită încă.
{item.missing && ( diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx index 86c0d0b..74cc72a 100644 --- a/src/app/dashboard/page.tsx +++ b/src/app/dashboard/page.tsx @@ -4,14 +4,15 @@ import Link from 'next/link'; import { useQuery } from '@tanstack/react-query'; import { apiFetch, type Briefing } from '../../lib/api'; import { useSession } from '../../components/session-provider'; -import { NAV_SECTIONS, countByStatus } from '../../lib/navigation'; +import { countByStatus, visibleSections, type Role } from '../../lib/navigation'; export const dynamic = 'force-dynamic'; export default function ExecutiveDashboardPage() { const { activeTenant } = useSession(); const tenantId = activeTenant?.tenantId ?? ''; - const progress = countByStatus(); + const role: Role = activeTenant?.role ?? 'member'; + const progress = countByStatus(role); const { data: briefing } = useQuery({ queryKey: ['briefing', tenantId], @@ -19,9 +20,9 @@ export default function ExecutiveDashboardPage() { enabled: Boolean(tenantId), }); - const readyItems = NAV_SECTIONS.flatMap((section) => - section.items - .filter((item) => item.status === 'ready' && item.href !== '/dashboard') + const readyItems = visibleSections(role).flatMap((section) => + section.children + .filter((item) => item.status === 'ready' && item.route !== '/dashboard') .map((item) => ({ ...item, section: section.label })), ); @@ -80,8 +81,8 @@ export default function ExecutiveDashboardPage() {{item.section}
@@ -90,8 +91,8 @@ export default function ExecutiveDashboardPage() { ))}- {progress.ready} din {progress.total} secțiuni sunt active. Restul apar în meniu cu un - punct și explică exact ce lipsește pentru fiecare. + {progress.ready} din {progress.total} pagini sunt active. Restul apar în meniu cu un cerc + gol și explică exact ce lipsește pentru fiecare.