From 4382682ae837a25825b8400fd374ad81e5a238c9 Mon Sep 17 00:00:00 2001 From: "Luis Gustavo S. Barreto" Date: Thu, 28 May 2026 11:30:06 -0300 Subject: [PATCH] chore(ui): remove custom fields column from device list --- .../pages/devices/__tests__/Devices.test.tsx | 54 ------------------- .../apps/console/src/pages/devices/index.tsx | 28 ---------- 2 files changed, 82 deletions(-) diff --git a/ui-react/apps/console/src/pages/devices/__tests__/Devices.test.tsx b/ui-react/apps/console/src/pages/devices/__tests__/Devices.test.tsx index 82bce96f364..65bc22b2d9b 100644 --- a/ui-react/apps/console/src/pages/devices/__tests__/Devices.test.tsx +++ b/ui-react/apps/console/src/pages/devices/__tests__/Devices.test.tsx @@ -224,18 +224,6 @@ describe("Devices list", () => { screen.getByPlaceholderText("Search by hostname..."), ).toBeInTheDocument(); }); - - it('renders the "Custom Fields" column header', () => { - vi.mocked(useDevices).mockReturnValue({ - ...defaultHookState, - devices: [makeDevice()], - totalCount: 1, - }); - renderPage(); - expect( - screen.getByRole("columnheader", { name: "Custom Fields" }), - ).toBeInTheDocument(); - }); }); describe("loading state", () => { @@ -284,48 +272,6 @@ describe("Devices list", () => { }); }); - describe("custom fields column", () => { - it("renders '—' when device has no custom fields", () => { - vi.mocked(useDevices).mockReturnValue({ - ...defaultHookState, - devices: [makeDevice({ custom_fields: {} })], - totalCount: 1, - }); - renderPage(); - expect(screen.getByText("—")).toBeInTheDocument(); - }); - - it("renders key and value badges for each custom field", () => { - vi.mocked(useDevices).mockReturnValue({ - ...defaultHookState, - devices: [ - makeDevice({ custom_fields: { env: "production", owner: "team-a" } }), - ], - totalCount: 1, - }); - renderPage(); - expect(screen.getByText("env")).toBeInTheDocument(); - expect(screen.getByText("production")).toBeInTheDocument(); - expect(screen.getByText("owner")).toBeInTheDocument(); - expect(screen.getByText("team-a")).toBeInTheDocument(); - }); - - it("renders multiple custom field badges for multiple fields", () => { - vi.mocked(useDevices).mockReturnValue({ - ...defaultHookState, - devices: [makeDevice({ custom_fields: { a: "1", b: "2", c: "3" } })], - totalCount: 1, - }); - renderPage(); - expect(screen.getByText("a")).toBeInTheDocument(); - expect(screen.getByText("1")).toBeInTheDocument(); - expect(screen.getByText("b")).toBeInTheDocument(); - expect(screen.getByText("2")).toBeInTheDocument(); - expect(screen.getByText("c")).toBeInTheDocument(); - expect(screen.getByText("3")).toBeInTheDocument(); - }); - }); - describe("error state", () => { it("renders an error message when hook returns an error", () => { vi.mocked(useDevices).mockReturnValue({ diff --git a/ui-react/apps/console/src/pages/devices/index.tsx b/ui-react/apps/console/src/pages/devices/index.tsx index 03dc4e73bc7..2db2ccbc456 100644 --- a/ui-react/apps/console/src/pages/devices/index.tsx +++ b/ui-react/apps/console/src/pages/devices/index.tsx @@ -136,34 +136,6 @@ export default function Devices() { ), }, - { - key: "custom_fields", - header: "Custom Fields", - render: (device) => { - const entries = Object.entries(device.custom_fields ?? {}); - if (entries.length === 0) - return ( - - ); - return ( -
- {entries.map(([k, v]) => ( - - - {k} - - - {v} - - - ))} -
- ); - }, - }, { key: "last_seen", header: "Last Seen",