Skip to content

Commit

Permalink
fix: disable dryrun autofetch (#36941)
Browse files Browse the repository at this point in the history
set useQuery to be enabled after action button is clicked instead of automatically

closes issue #36119
  • Loading branch information
im-perativa committed Jan 22, 2024
1 parent 10c04a4 commit e0f8c6e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion airflow/www/static/js/api/useClearTaskDryRun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const useClearTaskDryRun = ({
recursive,
failed,
mapIndexes = [],
enabled = false,
}: {
dagId: string;
runId: string;
Expand All @@ -52,6 +53,7 @@ const useClearTaskDryRun = ({
recursive: boolean;
failed: boolean;
mapIndexes?: number[];
enabled?: boolean;
}) =>
useQuery(
[
Expand Down Expand Up @@ -101,7 +103,8 @@ const useClearTaskDryRun = ({
},
}
);
}
},
{ enabled }
);

export default useClearTaskDryRun;
5 changes: 4 additions & 1 deletion airflow/www/static/js/api/useMarkTaskDryRun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const useMarkTaskDryRun = ({
upstream,
downstream,
mapIndexes = [],
enabled = false,
}: {
dagId: string;
runId: string;
Expand All @@ -47,6 +48,7 @@ const useMarkTaskDryRun = ({
upstream: boolean;
downstream: boolean;
mapIndexes?: number[];
enabled?: boolean;
}) =>
useQuery(
[
Expand Down Expand Up @@ -84,7 +86,8 @@ const useMarkTaskDryRun = ({
return axios.get<AxiosResponse, MinimalTaskInstance[]>(confirmUrl, {
params,
});
}
},
{ enabled }
);

export default useMarkTaskDryRun;
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ const ClearModal = ({
recursive,
failed,
mapIndexes,
enabled: isOpen,
});

const { mutateAsync: clearTask, isLoading } = useClearTask({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ const MarkAsModal = ({
upstream,
downstream,
mapIndexes,
enabled: isOpen,
}
);

Expand Down

0 comments on commit e0f8c6e

Please sign in to comment.