From e65d827cf9eca51f742200e76172b62224003871 Mon Sep 17 00:00:00 2001 From: ZverGuy Date: Thu, 5 Nov 2026 00:16:49 +0700 Subject: [PATCH] fix(dashboard): move the tenant logs page under observability/ The fixed /console/logs route came before the generic :plural route, so an application kind with the plural "logs" would have its list page replaced by the logs page. A two-segment path cannot shadow an application list, the same way the backups and migration pages avoid it. Assisted-by: LLM Signed-off-by: ZverGuy --- .../src/routes/ConsolePage.routing.test.tsx | 24 +++++++++++++++++++ .../apps/console/src/routes/ConsolePage.tsx | 2 +- .../src/routes/sidebar-sections.test.tsx | 2 +- .../console/src/routes/sidebar-sections.tsx | 2 +- 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/packages/system/dashboard/images/console/apps/console/src/routes/ConsolePage.routing.test.tsx b/packages/system/dashboard/images/console/apps/console/src/routes/ConsolePage.routing.test.tsx index 7c6d1209c..cf6982823 100644 --- a/packages/system/dashboard/images/console/apps/console/src/routes/ConsolePage.routing.test.tsx +++ b/packages/system/dashboard/images/console/apps/console/src/routes/ConsolePage.routing.test.tsx @@ -70,4 +70,28 @@ describe("ConsolePage routing", () => { await waitFor(() => expect(client.list).toHaveBeenCalled()) expect(screen.queryByText(/Cluster-scoped capacity/i)).toBeNull() }) + + it("serves the tenant logs page under observability/", async () => { + renderWithK8sProvider( + + + , + { client: makeClient(), initialRoute: "/observability/logs" }, + ) + + expect(await screen.findByText(/^Every application in/)).toBeInTheDocument() + }) + + it("leaves /logs to an application kind whose plural is logs", async () => { + const client = makeClient() + renderWithK8sProvider( + + + , + { client, initialRoute: "/logs" }, + ) + + await waitFor(() => expect(client.list).toHaveBeenCalled()) + expect(screen.queryByText(/^Every application in/)).toBeNull() + }) }) diff --git a/packages/system/dashboard/images/console/apps/console/src/routes/ConsolePage.tsx b/packages/system/dashboard/images/console/apps/console/src/routes/ConsolePage.tsx index 5e204e84f..2b2aed3e4 100644 --- a/packages/system/dashboard/images/console/apps/console/src/routes/ConsolePage.tsx +++ b/packages/system/dashboard/images/console/apps/console/src/routes/ConsolePage.tsx @@ -97,7 +97,7 @@ export function ConsolePage() { path="migration/vmimporttasks/:name" element={} /> - } /> + } /> } /> } /> } /> diff --git a/packages/system/dashboard/images/console/apps/console/src/routes/sidebar-sections.test.tsx b/packages/system/dashboard/images/console/apps/console/src/routes/sidebar-sections.test.tsx index da40081bc..1fcc3cde4 100644 --- a/packages/system/dashboard/images/console/apps/console/src/routes/sidebar-sections.test.tsx +++ b/packages/system/dashboard/images/console/apps/console/src/routes/sidebar-sections.test.tsx @@ -117,7 +117,7 @@ describe("useConsoleSidebarSections — admin areas moved out", () => { wrapper: makeWrapper(client), }) await waitFor(() => expect(result.current.length).toBeGreaterThan(0)) - expect(findItem(result.current, "Logs")?.to).toBe("/console/logs") + expect(findItem(result.current, "Logs")?.to).toBe("/console/observability/logs") expect(result.current.find((s) => s.title === "Observability")?.items).toHaveLength(1) }) }) diff --git a/packages/system/dashboard/images/console/apps/console/src/routes/sidebar-sections.tsx b/packages/system/dashboard/images/console/apps/console/src/routes/sidebar-sections.tsx index 4cec3a94c..0cf1ce089 100644 --- a/packages/system/dashboard/images/console/apps/console/src/routes/sidebar-sections.tsx +++ b/packages/system/dashboard/images/console/apps/console/src/routes/sidebar-sections.tsx @@ -121,7 +121,7 @@ export function useConsoleSidebarSections(): SidebarSection[] { const observabilitySection: SidebarSection = { title: "Observability", - items: [{ label: "Logs", to: "/console/logs", icon: ScrollText }], + items: [{ label: "Logs", to: "/console/observability/logs", icon: ScrollText }], } return [...categorySections, backupsSection, migrationSection, observabilitySection]