Skip to content

Commit

Permalink
[RunsFeed] Add terminate all runs button (#26945)
Browse files Browse the repository at this point in the history
## Summary & Motivation
As titled


## How I Tested These Changes
<img width="1728" alt="Screenshot 2025-01-08 at 12 43 44 PM"
src="https://github.com/user-attachments/assets/55fda5fb-3272-4e6c-b5e8-0f1f0d8f454f"
/>
<img width="1728" alt="Screenshot 2025-01-08 at 12 43 40 PM"
src="https://github.com/user-attachments/assets/8c9bd558-544e-465f-adf8-dd27cd2957ec"
/>
  • Loading branch information
salazarm authored Jan 8, 2025
1 parent 8740bf3 commit 2ee1d34
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
25 changes: 25 additions & 0 deletions js_modules/dagster-ui/packages/ui-core/src/runs/RunsFeedRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {Box, Checkbox, Colors, tokenToString} from '@dagster-io/ui-components';
import partition from 'lodash/partition';
import {useCallback, useMemo} from 'react';

import {inProgressStatuses, queuedStatuses} from './RunStatuses';
import {RunsQueryRefetchContext} from './RunUtils';
import {RunsFeedError} from './RunsFeedError';
import {RunsFeedTable} from './RunsFeedTable';
Expand All @@ -14,6 +15,7 @@ import {
useRunsFilterInput,
} from './RunsFilterInput';
import {ScheduledRunList} from './ScheduledRunListRoot';
import {TerminateAllRunsButton} from './TerminateAllRunsButton';
import {useRunsFeedEntries} from './useRunsFeedEntries';
import {
FIFTEEN_SECONDS,
Expand Down Expand Up @@ -158,6 +160,29 @@ export const RunsFeedRoot = () => {
belowActionBarComponents={belowActionBarComponents}
paginationProps={paginationProps}
filter={filter}
terminateAllRunsButton={
currentTab === 'queued' ? (
<TerminateAllRunsButton
refetch={combinedRefreshState.refetch}
filter={{...filter, statuses: Array.from(queuedStatuses)}}
disabled={
runQueryResult.data?.queuedCount.__typename === 'RunsFeedCount'
? runQueryResult.data?.queuedCount.count === 0
: true
}
/>
) : currentTab === 'in-progress' ? (
<TerminateAllRunsButton
refetch={combinedRefreshState.refetch}
filter={{...filter, statuses: Array.from(inProgressStatuses)}}
disabled={
runQueryResult.data?.inProgressCount.__typename === 'RunsFeedCount'
? runQueryResult.data?.inProgressCount.count === 0
: true
}
/>
) : undefined
}
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ interface RunsFeedTableProps {
refetch: () => void;
actionBarComponents?: React.ReactNode;
belowActionBarComponents?: React.ReactNode;
terminateAllRunsButton?: React.ReactNode;
paginationProps: CursorPaginationProps;
filter?: RunsFilter;
emptyState?: () => React.ReactNode;
Expand All @@ -52,6 +53,7 @@ export const RunsFeedTable = ({
refetch,
actionBarComponents,
belowActionBarComponents,
terminateAllRunsButton,
paginationProps,
filter,
emptyState,
Expand Down Expand Up @@ -121,6 +123,7 @@ export const RunsFeedTable = ({
paginationProps.reset();
}}
/>
{terminateAllRunsButton}
<RunBulkActionsMenu
clearSelection={() => onToggleAll(false)}
selected={selectedRuns}
Expand Down

1 comment on commit 2ee1d34

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for dagit-core-storybook ready!

✅ Preview
https://dagit-core-storybook-9inxp1u13-elementl.vercel.app

Built with commit 2ee1d34.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.