From 025b932f70e977031ccbbea09e75e0f036ca13cd Mon Sep 17 00:00:00 2001 From: Hardik Date: Sun, 31 May 2026 08:46:19 +0530 Subject: [PATCH] feat(sidebar): no Purchasing section for admin; Cost Centres in Administration PURCHASING_MGMT roles narrowed to MANAGER only, so the entire Purchasing section disappears for ADMIN (they never needed the /inventory/ browse links). Cost Centres (/admin/vessels) added to the top of ADMIN_ITEMS. Co-Authored-By: Claude Sonnet 4.6 --- App/components/layout/sidebar.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/App/components/layout/sidebar.tsx b/App/components/layout/sidebar.tsx index 28c7b68..ee85010 100644 --- a/App/components/layout/sidebar.tsx +++ b/App/components/layout/sidebar.tsx @@ -54,13 +54,14 @@ const PURCHASING_STAFF: NavItem[] = [ { href: "/inventory/cart", label: "Cart", icon: ShoppingCart, roles: ["TECHNICAL", "MANNING", "SUPERUSER", "MANAGER"] }, ]; -// Manager / Admin catalogue management — Sites conditionally shown +// Manager catalogue management — Sites conditionally shown +// Admin does not use Purchasing; their links live under Administration const PURCHASING_MGMT: NavItem[] = [ - { href: "/inventory/vendors", label: "Vendors", icon: Store, roles: ["MANAGER", "ADMIN"] }, - { href: "/inventory/items", label: "Items", icon: Package, roles: ["MANAGER", "ADMIN"] }, - { href: "/admin/vessels", label: "Cost Centres", icon: Ship, roles: ["MANAGER", "ADMIN"] }, + { href: "/inventory/vendors", label: "Vendors", icon: Store, roles: ["MANAGER"] }, + { href: "/inventory/items", label: "Items", icon: Package, roles: ["MANAGER"] }, + { href: "/admin/vessels", label: "Cost Centres", icon: Ship, roles: ["MANAGER"] }, ...(INVENTORY_ENABLED - ? [{ href: "/admin/sites", label: "Sites", icon: MapPin, roles: ["MANAGER", "ADMIN"] as Role[] }] + ? [{ href: "/admin/sites", label: "Sites", icon: MapPin, roles: ["MANAGER"] as Role[] }] : []), ]; @@ -75,6 +76,7 @@ const MANAGER_ADMIN_ITEMS: NavItem[] = [ // Full Administration section (ADMIN only) const ADMIN_ITEMS: NavItem[] = [ + { href: "/admin/vessels", label: "Cost Centres", icon: Ship }, { href: "/admin/users", label: "Users", icon: Users }, { href: "/admin/superuser-requests", label: "SuperUser Requests",icon: ShieldCheck }, { href: "/admin/accounts", label: "Accounting Codes", icon: Building2 },