Skip to content

Commit

Permalink
Fix flat run action button
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilyBonar committed Oct 21, 2024
1 parent 389a5c7 commit 74db3c5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const setup = (selectedFlatRuns: ReadonlyArray<Readonly<FlatRun>>) => {
projectId={1}
selectedRuns={selectedFlatRuns}
selection={{ selections: selectedFlatRuns.map((run) => run.id), type: 'ONLY_IN' }}
selectionSize={selectedFlatRuns.length}
tableFilterString=""
workspaceId={1}
onActionComplete={onActionComplete}
Expand Down
4 changes: 3 additions & 1 deletion webui/react/src/pages/FlatRuns/FlatRunActionButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ interface Props {
onActionSuccess?: (action: BatchAction, successfulIds: number[]) => void;
onActionComplete?: () => void | Promise<void>;
selection: SelectionType;
selectionSize: number;
}

const FlatRunActionButton = ({
Expand All @@ -69,6 +70,7 @@ const FlatRunActionButton = ({
selectedRuns,
projectId,
selection,
selectionSize,
workspaceId,
onActionSuccess,
onActionComplete,
Expand Down Expand Up @@ -254,7 +256,7 @@ const FlatRunActionButton = ({

return (
<>
{selectedRuns.length > 0 && (
{selectionSize > 0 && (
<Dropdown menu={editMenuItems} onClick={handleBatchAction}>
<Button hideChildren={isMobile} icon={<Icon decorative name="pencil" />}>
Actions
Expand Down
1 change: 1 addition & 0 deletions webui/react/src/pages/FlatRuns/FlatRuns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,7 @@ const FlatRuns: React.FC<Props> = ({ projectId, workspaceId, searchId }) => {
projectId={projectId}
selectedRuns={loadedSelectedRuns}
selection={settings.selection}
selectionSize={selectionSize}
tableFilterString={filtersString}
workspaceId={workspaceId}
onActionComplete={onActionComplete}
Expand Down

0 comments on commit 74db3c5

Please sign in to comment.