diff --git a/ui/src/App.test.tsx b/ui/src/App.test.tsx index 851b5593c11..9009f97aa29 100644 --- a/ui/src/App.test.tsx +++ b/ui/src/App.test.tsx @@ -254,6 +254,11 @@ describe("Apps routes", () => { expect(appSource).toContain('} />'); expect(appSource).toContain('} />'); }); + + it("redirects legacy Rules and Health links to the remaining developer surfaces", () => { + expect(appSource).toContain('if (tab === "runtime") return "/apps/connections";'); + expect(appSource).toContain('if (tab === "policies") return "/apps/advanced/profiles";'); + }); }); describe("Decisions routes", () => { diff --git a/ui/src/App.tsx b/ui/src/App.tsx index 4e134d9244e..12d53ebfa7a 100644 --- a/ui/src/App.tsx +++ b/ui/src/App.tsx @@ -404,6 +404,8 @@ function LegacyToolsRedirect() { function legacyToolsRedirectTarget(tab?: string) { if (!tab) return "/apps/advanced/profiles"; if (tab === "applications" || tab === "connections" || tab === "overview" || tab === "examples") return "/apps/connections"; + if (tab === "runtime") return "/apps/connections"; + if (tab === "policies") return "/apps/advanced/profiles"; return `/apps/advanced/${tab}`; } diff --git a/ui/src/components/AppsSidebar.test.tsx b/ui/src/components/AppsSidebar.test.tsx index ff0c9e403b4..3e9c1a44fe2 100644 --- a/ui/src/components/AppsSidebar.test.tsx +++ b/ui/src/components/AppsSidebar.test.tsx @@ -8,7 +8,6 @@ import { AppsSidebar } from "./AppsSidebar"; const sidebarNavItemMock = vi.hoisted(() => vi.fn()); const mockToolsApi = vi.hoisted(() => ({ - listRuntimeSlots: vi.fn(), listActionRequests: vi.fn(), })); @@ -89,12 +88,6 @@ describe("AppsSidebar", () => { beforeEach(() => { container = document.createElement("div"); document.body.appendChild(container); - mockToolsApi.listRuntimeSlots.mockResolvedValue({ - runtimeSlots: [ - { id: "slot-1", status: "running" }, - { id: "slot-2", status: "stopped" }, - ], - }); mockToolsApi.listActionRequests.mockResolvedValue({ actionRequests: [] }); }); @@ -154,9 +147,8 @@ describe("AppsSidebar", () => { expect(sidebarNavItemMock).toHaveBeenCalledWith( expect.objectContaining({ to: "/apps/advanced/profiles", label: "Profiles", end: true }), ); - expect(sidebarNavItemMock).toHaveBeenCalledWith( - expect.objectContaining({ to: "/apps/advanced/runtime", label: "Health", end: true, liveCount: 1 }), - ); + expect(sidebarNavItemMock).not.toHaveBeenCalledWith(expect.objectContaining({ label: "Rules" })); + expect(sidebarNavItemMock).not.toHaveBeenCalledWith(expect.objectContaining({ label: "Health" })); expect(sidebarNavItemMock).toHaveBeenCalledWith( expect.objectContaining({ to: "/apps/advanced/audit", label: "Activity", end: true }), ); diff --git a/ui/src/components/AppsSidebar.tsx b/ui/src/components/AppsSidebar.tsx index f339f8e9bc6..4d941e9b06c 100644 --- a/ui/src/components/AppsSidebar.tsx +++ b/ui/src/components/AppsSidebar.tsx @@ -1,10 +1,7 @@ import { ChevronLeft, AppWindow, Store, ShieldQuestion } from "lucide-react"; -import { useQuery } from "@tanstack/react-query"; import { Link } from "@/lib/router"; import { useCompany } from "@/context/CompanyContext"; import { useSidebar } from "@/context/SidebarContext"; -import { queryKeys } from "@/lib/queryKeys"; -import { toolsApi } from "@/api/tools"; import { DEVELOPER_TABS, advancedTabHref, isExperimentalToolTab } from "@/pages/tools/tool-tabs"; import { useSmokeLabEnabled } from "@/hooks/useSmokeLabEnabled"; import { useReviewCount } from "@/pages/apps/useReviewCount"; @@ -15,7 +12,7 @@ import { SidebarNavItem } from "./SidebarNavItem"; * PAP-13254 / U3). * * ← Back · APPS: Browse / Review (n) - * DEVELOPER: Connections / Gateways / Profiles / Rules / Health / Activity + * DEVELOPER: Connections / Gateways / Profiles / Activity * * "Browse" is the store and "Review" holds decisions waiting on the user's * OK. Connection management lives with the Developer tools. @@ -28,7 +25,7 @@ import { SidebarNavItem } from "./SidebarNavItem"; * (PAP-10922). */ export function AppsSidebar() { - const { selectedCompany, selectedCompanyId } = useCompany(); + const { selectedCompany } = useCompany(); const { isMobile, setSidebarOpen } = useSidebar(); const reviewCount = useReviewCount(); @@ -37,15 +34,6 @@ export function AppsSidebar() { (tab) => !isExperimentalToolTab(tab.key) || smokeLabEnabled, ); - const runtimeSlots = useQuery({ - queryKey: queryKeys.tools.runtimeSlots(selectedCompanyId ?? "__none__"), - queryFn: () => toolsApi.listRuntimeSlots(selectedCompanyId!), - enabled: !!selectedCompanyId, - refetchInterval: 15_000, - }); - const runtimeActiveCount = (runtimeSlots.data?.runtimeSlots ?? []) - .filter((slot) => slot.status === "running").length; - return (