Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const ClearRunButton = ({ dagRun, isHotkeyEnabled = false }: Props) => {
>
<CgRedo />
</IconButton>
{open ? <ClearRunDialog dagRun={dagRun} onClose={onClose} open={open} /> : undefined}
<ClearRunDialog dagRun={dagRun} onClose={onClose} open={open} />
</>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ const ClearRunDialog = ({ dagRun, onClose, open }: Props) => {

const [note, setNote] = useState<string | null>(dagRun.note);
const [selectedOptions, setSelectedOptions] = useState<Array<string>>(["existingTasks"]);

const handleClose = () => {
setNote(dagRun.note);
setSelectedOptions(["existingTasks"]);
onClose();
};


const onlyFailed = selectedOptions.includes("onlyFailed");
const onlyNew = selectedOptions.includes("newTasks");

Expand All @@ -62,6 +70,7 @@ const ClearRunDialog = ({ dagRun, onClose, open }: Props) => {
dagId,
dagRunId,
options: {
enabled: open,
refetchInterval: (query) =>
query.state.data?.task_instances.some((ti) => "state" in ti && isStatePending(ti.state))
? refetchInterval
Expand All @@ -77,13 +86,13 @@ const ClearRunDialog = ({ dagRun, onClose, open }: Props) => {
const { isPending, mutate } = useClearDagRun({
dagId,
dagRunId,
onSuccessConfirm: onClose,
onSuccessConfirm: handleClose,
});

const { isPending: isPendingPatchDagRun, mutate: mutatePatchDagRun } = usePatchDagRun({
dagId,
dagRunId,
onSuccess: onClose,
onSuccess: handleClose,
});

// Check if DAG versions differ (works for both bundle-versioned and local bundles)
Expand All @@ -96,7 +105,7 @@ const ClearRunDialog = ({ dagRun, onClose, open }: Props) => {
const shouldShowBundleVersionOption = versionsDiffer && !onlyNew;

return (
<Dialog.Root lazyMount onOpenChange={onClose} open={open}>
<Dialog.Root lazyMount onOpenChange={handleClose} open={open}>
<Dialog.Content backdrop>
<Dialog.Header>
<VStack align="start" gap={4}>
Expand Down