-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ui] Include a Backfills tab on the new runs feed
- Loading branch information
bengotow
committed
Dec 11, 2024
1 parent
5b628db
commit dcbdd35
Showing
18 changed files
with
264 additions
and
218 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 8 additions & 2 deletions
10
js_modules/dagster-ui/packages/ui-core/src/graphql/schema.graphql
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
10 changes: 8 additions & 2 deletions
10
js_modules/dagster-ui/packages/ui-core/src/graphql/types.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
js_modules/dagster-ui/packages/ui-core/src/instance/useBulkActionStatusFilter.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import {BulkActionStatus} from '../graphql/types'; | ||
import {useStaticSetFilter} from '../ui/BaseFilters/useStaticSetFilter'; | ||
|
||
const labelForBackfillStatus = (key: BulkActionStatus) => { | ||
switch (key) { | ||
case BulkActionStatus.CANCELED: | ||
return 'Canceled'; | ||
case BulkActionStatus.CANCELING: | ||
return 'Canceling'; | ||
case BulkActionStatus.COMPLETED: | ||
return 'Completed'; | ||
case BulkActionStatus.FAILED: | ||
return 'Failed'; | ||
case BulkActionStatus.REQUESTED: | ||
return 'In progress'; | ||
case BulkActionStatus.COMPLETED_SUCCESS: | ||
return 'Success'; | ||
case BulkActionStatus.COMPLETED_FAILED: | ||
return 'Failed'; | ||
} | ||
}; | ||
|
||
export function useBulkActionStatusFilter( | ||
state: Set<BulkActionStatus> | BulkActionStatus[], | ||
onStateChanged: (state: Set<BulkActionStatus>) => void, | ||
) { | ||
const backfillStatusValues = Object.keys(BulkActionStatus).map((key) => { | ||
const status = key as BulkActionStatus; | ||
const label = labelForBackfillStatus(status); | ||
return { | ||
label, | ||
value: status, | ||
match: [status, label], | ||
}; | ||
}); | ||
|
||
const statusFilter = useStaticSetFilter<BulkActionStatus>({ | ||
name: 'Status', | ||
icon: 'status', | ||
allValues: backfillStatusValues, | ||
allowMultipleSelections: false, | ||
closeOnSelect: true, | ||
renderLabel: ({value}) => <div>{labelForBackfillStatus(value)}</div>, | ||
getStringValue: (status) => labelForBackfillStatus(status), | ||
state, | ||
onStateChanged, | ||
}); | ||
|
||
return statusFilter; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.