diff --git a/frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx b/frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx index 7e765699e..08d2e4c04 100644 --- a/frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx +++ b/frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx @@ -1,23 +1,16 @@ import { Component, Show, createEffect, createMemo, createSignal } from 'solid-js'; import { useLocation, useNavigate } from '@solidjs/router'; -import { Dialog } from '@/components/shared/Dialog'; import { presentationPolicyIsReadOnly } from '@/stores/sessionPresentationPolicy'; import { AgentProfilesPanel } from './AgentProfilesPanel'; import { ConnectionDetailDrawer } from './ConnectionDetailDrawer'; import { ConnectionsTable, type ConnectionsTableHeaderAction } from './ConnectionsTable'; -import { - buildInfrastructureSystemRows, - type InfrastructureSystemRow, - type SystemManageAction, -} from './connectionsTableModel'; +import type { InfrastructureSystemRow, SystemManageAction } from './connectionsTableModel'; import { ConnectionEditor } from './ConnectionEditor/ConnectionEditor'; import { NodeCredentialSlot } from './ConnectionEditor/CredentialSlots/NodeCredentialSlot'; import { TrueNASCredentialSlot } from './ConnectionEditor/CredentialSlots/TrueNASCredentialSlot'; import { VMwareCredentialSlot } from './ConnectionEditor/CredentialSlots/VMwareCredentialSlot'; import type { ConnectionType } from '@/api/connections'; import { InfrastructureInstallerSection } from './InfrastructureInstallerSection'; -import { InfrastructureIgnoredRowDetails } from './InfrastructureIgnoredRowDetails'; -import { InfrastructureStopMonitoringDialog } from './InfrastructureStopMonitoringDialog'; import { buildInfrastructureWorkspacePath, deriveAddStepFromLocation, @@ -25,10 +18,7 @@ import { } from './infrastructureWorkspaceModel'; import type { InfrastructurePlatformSettingsProps } from './proxmoxSettingsModel'; import { useConnectionsLedger } from './useConnectionsLedger'; -import { - InfrastructureOperationsStateProvider, - useInfrastructureOperationsContext, -} from './useInfrastructureOperationsState'; +import { InfrastructureOperationsStateProvider } from './useInfrastructureOperationsState'; export type InfrastructureWorkspaceProps = InfrastructurePlatformSettingsProps; @@ -44,7 +34,6 @@ const ADD_STEP_TO_TYPE: Record = { const InfrastructureWorkspaceContent: Component = (props) => { const navigate = useNavigate(); const location = useLocation(); - const state = useInfrastructureOperationsContext(); const ledger = useConnectionsLedger(); const [addMode, setAddMode] = createSignal(false); @@ -79,14 +68,6 @@ const InfrastructureWorkspaceContent: Component = setShowAgentProfiles(false); }); - // Auto-open the agent installer when a setup handoff is waiting. - createEffect(() => { - if (state.setupHandoff?.() && !addMode() && !readOnly()) { - setAddMode(true); - setInitialAddType('agent'); - } - }); - // Drop add mode in read-only sessions. createEffect(() => { if (readOnly() && addMode()) { @@ -94,13 +75,7 @@ const InfrastructureWorkspaceContent: Component = } }); - const rows = createMemo(() => [ - ...ledger.rows(), - ...buildInfrastructureSystemRows({ - activeRows: [], - monitoringStoppedRows: state.monitoringStoppedRows(), - }), - ]); + const rows = createMemo(() => ledger.rows()); const headerActions = createMemo(() => readOnly() @@ -119,20 +94,8 @@ const InfrastructureWorkspaceContent: Component = ); const handleManageAction = (action: SystemManageAction) => { - switch (action.kind) { - case 'connection': - state.setSelectedIgnoredRowKey(null); - setSelectedConnectionId(action.connectionId); - return; - case 'inventory-ignored': - setSelectedConnectionId(null); - state.setSelectedIgnoredRowKey(action.rowKey); - return; - case 'inventory-active': - // Legacy active-row path retired; unified rows use the connection drawer. - return; - default: - return; + if (action.kind === 'connection') { + setSelectedConnectionId(action.connectionId); } }; @@ -254,21 +217,6 @@ const InfrastructureWorkspaceContent: Component = connection={selectedConnection} onClose={() => setSelectedConnectionId(null)} /> - - {/* Ignored system detail drawer (retires with phase 9). */} - state.setSelectedIgnoredRowKey(null)} - layout="drawer-right" - panelClass="max-w-[760px]" - ariaLabel="Ignored item details" - > - - {(rowAccessor) => } - - - - ); }; diff --git a/frontend-modern/src/components/Settings/__tests__/InfrastructureWorkspace.test.tsx b/frontend-modern/src/components/Settings/__tests__/InfrastructureWorkspace.test.tsx index e1c7f357f..46e92af3a 100644 --- a/frontend-modern/src/components/Settings/__tests__/InfrastructureWorkspace.test.tsx +++ b/frontend-modern/src/components/Settings/__tests__/InfrastructureWorkspace.test.tsx @@ -1,22 +1,14 @@ import { cleanup, fireEvent, render, screen, waitFor } from '@solidjs/testing-library'; -import { createSignal } from 'solid-js'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import type { Connection } from '@/api/connections'; -import type { UnifiedAgentRow } from '../infrastructureOperationsModel'; import { InfrastructureWorkspace } from '../InfrastructureWorkspace'; let mockPathname = '/settings/infrastructure'; let mockSearch = ''; const navigateSpy = vi.hoisted(() => vi.fn()); const presentationPolicyIsReadOnlyMock = vi.hoisted(() => vi.fn(() => false)); -const setExpandedRowKeySpy = vi.hoisted(() => vi.fn()); -const setSelectedIgnoredRowKeySpy = vi.hoisted(() => vi.fn()); -let mockActiveRows: UnifiedAgentRow[] = []; -let mockIgnoredRows: UnifiedAgentRow[] = []; let mockConnections: Connection[] = []; -const [selectedActiveRowKey, setSelectedActiveRowKey] = createSignal(null); -const [selectedIgnoredRowKey, setSelectedIgnoredRowKey] = createSignal(null); vi.mock('@solidjs/router', async () => { const actual = await vi.importActual('@solidjs/router'); @@ -33,23 +25,6 @@ vi.mock('@/stores/sessionPresentationPolicy', () => ({ vi.mock('../useInfrastructureOperationsState', () => ({ InfrastructureOperationsStateProvider: (props: { children: unknown }) => <>{props.children}, - useInfrastructureOperationsContext: () => ({ - activeRows: () => mockActiveRows, - monitoringStoppedRows: () => mockIgnoredRows, - selectedActiveRow: () => - mockActiveRows.find((row) => row.rowKey === selectedActiveRowKey()) ?? null, - selectedIgnoredRow: () => - mockIgnoredRows.find((row) => row.rowKey === selectedIgnoredRowKey()) ?? null, - setExpandedRowKey: (value: string | null) => { - setExpandedRowKeySpy(value); - setSelectedActiveRowKey(value); - }, - setSelectedIgnoredRowKey: (value: string | null) => { - setSelectedIgnoredRowKeySpy(value); - setSelectedIgnoredRowKey(value); - }, - setupHandoff: () => null, - }), })); vi.mock('../InfrastructureInstallerSection', () => ({ @@ -72,14 +47,6 @@ vi.mock('../ConnectionEditor/CredentialSlots/VMwareCredentialSlot', () => ({ VMwareCredentialSlot: () =>
vmware
, })); -vi.mock('../InfrastructureIgnoredRowDetails', () => ({ - InfrastructureIgnoredRowDetails: () =>
ignored details
, -})); - -vi.mock('../InfrastructureStopMonitoringDialog', () => ({ - InfrastructureStopMonitoringDialog: () =>
, -})); - vi.mock('../AgentProfilesPanel', () => ({ AgentProfilesPanel: () =>
profiles
, })); @@ -112,33 +79,6 @@ const connectionFixture = (overrides: Partial = {}): Connection => ( ...overrides, }); -const reportingRow = (overrides: Partial = {}): UnifiedAgentRow => - ({ - rowKey: 'agent:tower', - id: 'tower', - name: 'tower', - hostname: 'tower.local', - capabilities: ['agent'], - status: 'active', - healthStatus: 'online', - lastSeen: Date.now(), - upgradePlatform: 'linux', - scope: { label: 'Default', category: 'default' }, - installFlags: [], - searchText: 'tower', - surfaces: [ - { - key: 'agent', - kind: 'agent', - label: 'Host telemetry', - detail: 'Host telemetry', - action: 'stop-monitoring', - controlId: 'tower', - }, - ], - ...overrides, - }) as UnifiedAgentRow; - const setShowNodeModalSpy = vi.fn(); const setEditingNodeSpy = vi.fn(); const setCurrentNodeTypeSpy = vi.fn(); @@ -177,19 +117,13 @@ describe('InfrastructureWorkspace', () => { navigateSpy.mockReset(); presentationPolicyIsReadOnlyMock.mockReset(); presentationPolicyIsReadOnlyMock.mockReturnValue(false); - setExpandedRowKeySpy.mockReset(); - setSelectedIgnoredRowKeySpy.mockReset(); setShowNodeModalSpy.mockReset(); setEditingNodeSpy.mockReset(); setCurrentNodeTypeSpy.mockReset(); setModalResetKeySpy.mockReset(); mockPathname = '/settings/infrastructure'; mockSearch = ''; - mockActiveRows = [reportingRow()]; - mockIgnoredRows = []; mockConnections = [connectionFixture()]; - setSelectedActiveRowKey(null); - setSelectedIgnoredRowKey(null); }); afterEach(() => { @@ -322,7 +256,6 @@ describe('InfrastructureWorkspace', () => { fireEvent.click(screen.getByRole('button', { name: 'View details' })); expect(screen.getByRole('dialog', { name: 'Connection details' })).toBeInTheDocument(); - expect(setExpandedRowKeySpy).not.toHaveBeenCalled(); }); it('redirects legacy install deep link and pre-selects the agent credential slot', async () => {