diff --git a/__test__/__snapshots__/Manage.test.tsx.snap b/__test__/__snapshots__/Manage.test.tsx.snap index 3818cdce..a09f56e0 100644 --- a/__test__/__snapshots__/Manage.test.tsx.snap +++ b/__test__/__snapshots__/Manage.test.tsx.snap @@ -50,6 +50,7 @@ exports[`login page renders a manage page 1`] = ` @@ -46,6 +47,7 @@ export default function ManagePage() { value={value} onChange={(e) => setValue(e.target.value)} data-testid="agent-search-input" + disabled={disableSearch} /> @@ -59,6 +61,7 @@ export default function ManagePage() { }) } searchString={value} + onEmptyAgents={() => setDisableSearch(true)} /> diff --git a/src/components/ListAgents/ListAgents.tsx b/src/components/ListAgents/ListAgents.tsx index 85a0d659..62eaf28a 100644 --- a/src/components/ListAgents/ListAgents.tsx +++ b/src/components/ListAgents/ListAgents.tsx @@ -126,12 +126,17 @@ export default function ListAgents({ agents, onDetails, searchString, + onEmptyAgents, }: { agents: string[]; searchString?: string; onDetails: (_agent: string) => void; + onEmptyAgents?: () => void; }) { if (agents.length === 0) { + if (onEmptyAgents) { + onEmptyAgents(); + } return ; } return ( diff --git a/src/components/ListAgents/ListAgentsWithVCs.tsx b/src/components/ListAgents/ListAgentsWithVCs.tsx index f0b31091..a0b64ee1 100644 --- a/src/components/ListAgents/ListAgentsWithVCs.tsx +++ b/src/components/ListAgents/ListAgentsWithVCs.tsx @@ -63,10 +63,12 @@ function SuspendedList({ onDetails, searchString, agents, + onEmptyAgents }: { onDetails: (_agent: string) => void; searchString: string; agents?: string[]; + onEmptyAgents?: () => void; }) { if (agents === undefined) { return ; @@ -76,6 +78,7 @@ function SuspendedList({ agents={agents} onDetails={onDetails} searchString={searchString} + onEmptyAgents={onEmptyAgents} /> ); } @@ -83,9 +86,11 @@ function SuspendedList({ export default function ListAgentsWithVCs({ onDetails, searchString, + onEmptyAgents, }: { onDetails: (_agent: string) => void; searchString: string; + onEmptyAgents?: () => void; }) { const { session, accessEndpoint, endpointConfiguration } = useContext(SessionContext); @@ -115,6 +120,7 @@ export default function ListAgentsWithVCs({ agents={agents} onDetails={onDetails} searchString={searchString} + onEmptyAgents={onEmptyAgents} /> ); }