Loading portal-gui/src/app/config/navigation.ts +13 −0 Changes for portal-gui/src/app/config/navigation.ts: 13 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ import { Server, Rocket, UserIcon, Handshake, } from 'lucide-react'; import { ROUTES } from './route'; Loading Loading @@ -56,6 +57,14 @@ export const mainNavItems: NavItem[] = [ }, ], }, { title: 'Federation', to: ROUTES.FEDERATION, description: 'Federate with partner operator platforms.', icon: Handshake, showInSidebar: true, roles: ['operator'], }, { title: 'Profile', to: ROUTES.PROFILE, Loading @@ -64,6 +73,10 @@ export const mainNavItems: NavItem[] = [ }, ]; export function canSeeNavItem(item: NavItem, userRoles: readonly string[]) { return !item.roles || item.roles.some((role) => userRoles.includes(role)); } export function isActivePath(pathname: string, to: string) { if (to === '/') { return pathname === '/'; Loading portal-gui/src/app/config/route.ts +1 −0 Changes for portal-gui/src/app/config/route.ts: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ export const ROUTES = { APPLICATION_INSTANCES: '/applications/instances', APPLICATION_DEPLOYMENTS: '/applications/deployments', APPLICATION: '/applications/profiles/:appId', FEDERATION: '/federation', FORBIDDEN: '/403', NOT_FOUND: '/404', } as const; portal-gui/src/app/router.tsx +10 −0 Changes for portal-gui/src/app/router.tsx: 10 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ import { AuthLayout } from '@/layouts/auth-layout'; import { ProtectedRoute } from './guards/protected-route'; import { PublicRoute } from './guards/public-route'; import { RoleGuard } from './guards/role-guard'; // Pages import HomePage from '@/pages/home/index'; Loading @@ -17,6 +18,7 @@ import ApplicationsPage from '@/pages/applications/index'; import ApplicationProfilesPage from '@/pages/applications/app-profiles'; import ApplicationInstancesPage from '@/pages/applications/app-instances'; import DeploymentsPage from '@/pages/applications/app-deployments'; import FederationPage from '@/pages/federation/index'; import ForbiddenPage from '@/pages/errors/forbidden'; import NotFoundPage from '@/pages/errors/not-found'; Loading Loading @@ -81,6 +83,14 @@ export const router = createBrowserRouter([ path: ROUTES.APPLICATION_DEPLOYMENTS, element: <DeploymentsPage />, }, { path: ROUTES.FEDERATION, element: ( <RoleGuard allowedRoles={['operator']}> <FederationPage /> </RoleGuard> ), }, ], }, ], Loading portal-gui/src/features/federation/federation.tsx 0 → 100644 +17 −0 Changes for portal-gui/src/features/federation/federation.tsx: 17 added lines, 0 removed lines. Original line number Diff line number Diff line import { PageHeader } from '@/components/common/page-header'; import { PageContent } from '@/components/common/page-content'; import { EmptyState } from '@/components/common/empty-state'; export function FederationPage() { return ( <> <PageHeader /> <PageContent> <EmptyState title="No partners yet" description="Partner operator platforms you federate with will appear here." /> </PageContent> </> ); } portal-gui/src/layouts/app-sidebar.tsx +9 −2 Changes for portal-gui/src/layouts/app-sidebar.tsx: 9 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -9,11 +9,14 @@ import { SidebarFooter, SidebarHeader, } from '@/components/ui/sidebar'; import { mainNavItems } from '@/app/config/navigation'; import { canSeeNavItem, mainNavItems } from '@/app/config/navigation'; import { useAuth } from '@/features/auth/auth-context'; import { LogoIcon } from '@/lib/icons'; export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) { const { user } = useAuth(); const roles = user?.roles ?? []; return ( <Sidebar collapsible="offcanvas" {...props}> <SidebarHeader className="px-2 py-0"> Loading @@ -25,7 +28,11 @@ export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) { </Link> </SidebarHeader> <SidebarContent> <NavMain items={mainNavItems.filter((item) => item.showInSidebar)} /> <NavMain items={mainNavItems.filter( (item) => item.showInSidebar && canSeeNavItem(item, roles), )} /> </SidebarContent> <SidebarFooter> <NavUser /> Loading Loading
portal-gui/src/app/config/navigation.ts +13 −0 Changes for portal-gui/src/app/config/navigation.ts: 13 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ import { Server, Rocket, UserIcon, Handshake, } from 'lucide-react'; import { ROUTES } from './route'; Loading Loading @@ -56,6 +57,14 @@ export const mainNavItems: NavItem[] = [ }, ], }, { title: 'Federation', to: ROUTES.FEDERATION, description: 'Federate with partner operator platforms.', icon: Handshake, showInSidebar: true, roles: ['operator'], }, { title: 'Profile', to: ROUTES.PROFILE, Loading @@ -64,6 +73,10 @@ export const mainNavItems: NavItem[] = [ }, ]; export function canSeeNavItem(item: NavItem, userRoles: readonly string[]) { return !item.roles || item.roles.some((role) => userRoles.includes(role)); } export function isActivePath(pathname: string, to: string) { if (to === '/') { return pathname === '/'; Loading
portal-gui/src/app/config/route.ts +1 −0 Changes for portal-gui/src/app/config/route.ts: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ export const ROUTES = { APPLICATION_INSTANCES: '/applications/instances', APPLICATION_DEPLOYMENTS: '/applications/deployments', APPLICATION: '/applications/profiles/:appId', FEDERATION: '/federation', FORBIDDEN: '/403', NOT_FOUND: '/404', } as const;
portal-gui/src/app/router.tsx +10 −0 Changes for portal-gui/src/app/router.tsx: 10 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ import { AuthLayout } from '@/layouts/auth-layout'; import { ProtectedRoute } from './guards/protected-route'; import { PublicRoute } from './guards/public-route'; import { RoleGuard } from './guards/role-guard'; // Pages import HomePage from '@/pages/home/index'; Loading @@ -17,6 +18,7 @@ import ApplicationsPage from '@/pages/applications/index'; import ApplicationProfilesPage from '@/pages/applications/app-profiles'; import ApplicationInstancesPage from '@/pages/applications/app-instances'; import DeploymentsPage from '@/pages/applications/app-deployments'; import FederationPage from '@/pages/federation/index'; import ForbiddenPage from '@/pages/errors/forbidden'; import NotFoundPage from '@/pages/errors/not-found'; Loading Loading @@ -81,6 +83,14 @@ export const router = createBrowserRouter([ path: ROUTES.APPLICATION_DEPLOYMENTS, element: <DeploymentsPage />, }, { path: ROUTES.FEDERATION, element: ( <RoleGuard allowedRoles={['operator']}> <FederationPage /> </RoleGuard> ), }, ], }, ], Loading
portal-gui/src/features/federation/federation.tsx 0 → 100644 +17 −0 Changes for portal-gui/src/features/federation/federation.tsx: 17 added lines, 0 removed lines. Original line number Diff line number Diff line import { PageHeader } from '@/components/common/page-header'; import { PageContent } from '@/components/common/page-content'; import { EmptyState } from '@/components/common/empty-state'; export function FederationPage() { return ( <> <PageHeader /> <PageContent> <EmptyState title="No partners yet" description="Partner operator platforms you federate with will appear here." /> </PageContent> </> ); }
portal-gui/src/layouts/app-sidebar.tsx +9 −2 Changes for portal-gui/src/layouts/app-sidebar.tsx: 9 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -9,11 +9,14 @@ import { SidebarFooter, SidebarHeader, } from '@/components/ui/sidebar'; import { mainNavItems } from '@/app/config/navigation'; import { canSeeNavItem, mainNavItems } from '@/app/config/navigation'; import { useAuth } from '@/features/auth/auth-context'; import { LogoIcon } from '@/lib/icons'; export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) { const { user } = useAuth(); const roles = user?.roles ?? []; return ( <Sidebar collapsible="offcanvas" {...props}> <SidebarHeader className="px-2 py-0"> Loading @@ -25,7 +28,11 @@ export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) { </Link> </SidebarHeader> <SidebarContent> <NavMain items={mainNavItems.filter((item) => item.showInSidebar)} /> <NavMain items={mainNavItems.filter( (item) => item.showInSidebar && canSeeNavItem(item, roles), )} /> </SidebarContent> <SidebarFooter> <NavUser /> Loading