From 74db3c5c5ede80cded1551f0a99670beb2754138 Mon Sep 17 00:00:00 2001 From: Emily Bonar Date: Fri, 18 Oct 2024 15:47:23 -0400 Subject: [PATCH] Fix flat run action button --- webui/react/src/pages/FlatRuns/FlatRunActionButton.test.tsx | 1 + webui/react/src/pages/FlatRuns/FlatRunActionButton.tsx | 4 +++- webui/react/src/pages/FlatRuns/FlatRuns.tsx | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/webui/react/src/pages/FlatRuns/FlatRunActionButton.test.tsx b/webui/react/src/pages/FlatRuns/FlatRunActionButton.test.tsx index d2e380fdaf4..bf4bdfe42e9 100644 --- a/webui/react/src/pages/FlatRuns/FlatRunActionButton.test.tsx +++ b/webui/react/src/pages/FlatRuns/FlatRunActionButton.test.tsx @@ -29,6 +29,7 @@ const setup = (selectedFlatRuns: ReadonlyArray>) => { projectId={1} selectedRuns={selectedFlatRuns} selection={{ selections: selectedFlatRuns.map((run) => run.id), type: 'ONLY_IN' }} + selectionSize={selectedFlatRuns.length} tableFilterString="" workspaceId={1} onActionComplete={onActionComplete} diff --git a/webui/react/src/pages/FlatRuns/FlatRunActionButton.tsx b/webui/react/src/pages/FlatRuns/FlatRunActionButton.tsx index 40f8ab8054d..e6ed8cdc3ae 100644 --- a/webui/react/src/pages/FlatRuns/FlatRunActionButton.tsx +++ b/webui/react/src/pages/FlatRuns/FlatRunActionButton.tsx @@ -61,6 +61,7 @@ interface Props { onActionSuccess?: (action: BatchAction, successfulIds: number[]) => void; onActionComplete?: () => void | Promise; selection: SelectionType; + selectionSize: number; } const FlatRunActionButton = ({ @@ -69,6 +70,7 @@ const FlatRunActionButton = ({ selectedRuns, projectId, selection, + selectionSize, workspaceId, onActionSuccess, onActionComplete, @@ -254,7 +256,7 @@ const FlatRunActionButton = ({ return ( <> - {selectedRuns.length > 0 && ( + {selectionSize > 0 && (