fix: remove "Open Server Dashboard" link from tenant sidebar
The server dashboard link in the sidebar footer is premature — tenant servers may not be provisioned yet and the link target depends on org context that isn't always available. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -4,7 +4,7 @@ import {
|
||||
Sidebar,
|
||||
TopBar,
|
||||
} from '@cameleer/design-system';
|
||||
import { LayoutDashboard, ShieldCheck, Server, Users, Settings, Shield, Building, ScrollText } from 'lucide-react';
|
||||
import { LayoutDashboard, ShieldCheck, Users, Settings, Shield, Building, ScrollText } from 'lucide-react';
|
||||
import { useAuth } from '../auth/useAuth';
|
||||
import { useScopes } from '../auth/useScopes';
|
||||
import { useOrgStore } from '../auth/useOrganization';
|
||||
@@ -31,7 +31,7 @@ export function Layout() {
|
||||
const location = useLocation();
|
||||
const { logout } = useAuth();
|
||||
const scopes = useScopes();
|
||||
const { username, organizations, currentOrgId } = useOrgStore();
|
||||
const { username } = useOrgStore();
|
||||
|
||||
const isVendor = scopes.has('platform:admin');
|
||||
const isTenantAdmin = scopes.has('tenant:manage');
|
||||
@@ -39,10 +39,6 @@ export function Layout() {
|
||||
// Vendor on vendor routes: show only TENANTS. On tenant routes: show tenant portal too (for debugging).
|
||||
const showTenantPortal = isTenantAdmin && (!isVendor || !onVendorRoute);
|
||||
|
||||
// Determine current org slug for server dashboard link
|
||||
const currentOrg = organizations.find((o) => o.id === currentOrgId);
|
||||
const serverDashboardHref = currentOrg?.slug ? `/t/${currentOrg.slug}/` : '#';
|
||||
|
||||
// Build breadcrumbs from path
|
||||
const segments = location.pathname.replace(/^\//, '').split('/').filter(Boolean);
|
||||
const breadcrumb = segments.map((seg) => {
|
||||
@@ -173,15 +169,6 @@ export function Layout() {
|
||||
</>
|
||||
)}
|
||||
|
||||
{showTenantPortal && (
|
||||
<Sidebar.Footer>
|
||||
<Sidebar.FooterLink
|
||||
icon={<Server size={16} />}
|
||||
label="Open Server Dashboard"
|
||||
onClick={() => window.open(serverDashboardHref, '_blank', 'noopener')}
|
||||
/>
|
||||
</Sidebar.Footer>
|
||||
)}
|
||||
</Sidebar>
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user