This commit is contained in:
Maurus Decimus
2026-07-31 15:52:36 +02:00
parent 189e270785
commit 8cab61a9c5
13 changed files with 156 additions and 72 deletions
+3 -10
View File
@@ -16,13 +16,8 @@ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/comp
import { useUIStore } from '@/stores/uiStore';
import { useAccountStore } from '@/stores/accountStore';
import { useSchemaStore } from '@/stores/schemaStore';
import {
visibleLayouts,
findFirstVisibleLinkInLayout,
findFirstAccessibleLinkInLayout,
isLinkEnterprise,
isLinkVisible,
} from '@/lib/layout';
import { visibleLayouts, isLinkEnterprise, isLinkVisible } from '@/lib/layout';
import { sectionLandingLink } from '@/lib/lastVisited';
import type { Layout, LayoutItem, LayoutSubItem } from '@/types/schema';
function LucideIcon({ name, className }: { name: string; className?: string }) {
@@ -341,9 +336,7 @@ export function Sidebar() {
const handleSectionClick = (target: Layout) => {
setActiveSection(target.name);
const canGet = (prefix: string) => permissions.includes(`${prefix}Get`);
const first =
findFirstAccessibleLinkInLayout(schema, target, edition, canGet, hasPermission) ??
findFirstVisibleLinkInLayout(schema, target, edition, canGet, hasPermission);
const first = sectionLandingLink(schema, target, edition, canGet, hasPermission);
if (first) navigate(`/${target.name}/${first}`);
};