Skip to content

Commit

Permalink
Added spinner activity while the logs load (#31165)
Browse files Browse the repository at this point in the history
* spinner added

* fixed static checks

* isFetching

* isFetching replaced with isLoading
  • Loading branch information
Adaverse authored May 10, 2023
1 parent 420a9b1 commit 584a9f5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
1 change: 0 additions & 1 deletion airflow/www/static/js/api/useTaskLog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ const useTaskLog = ({
});
},
{
placeholderData: "",
refetchInterval:
expectingLogs && isRefreshOn && (autoRefreshInterval || 1) * 1000,
}
Expand Down
19 changes: 12 additions & 7 deletions airflow/www/static/js/dag/details/taskInstance/Logs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
Button,
Checkbox,
Icon,
Spinner,
} from "@chakra-ui/react";
import { MdWarning } from "react-icons/md";

Expand Down Expand Up @@ -119,7 +120,7 @@ const Logs = ({
const { timezone } = useTimezone();

const taskTryNumber = selectedTryNumber || tryNumber || 1;
const { data } = useTaskLog({
const { data, isLoading } = useTaskLog({
dagId,
dagRunId,
taskId,
Expand Down Expand Up @@ -266,12 +267,16 @@ const Logs = ({
<Text fontSize="sm">{warning}</Text>
</Flex>
)}
{!!parsedLogs && (
<LogBlock
parsedLogs={parsedLogs}
wrap={wrap}
tryNumber={taskTryNumber}
/>
{isLoading ? (
<Spinner />
) : (
!!parsedLogs && (
<LogBlock
parsedLogs={parsedLogs}
wrap={wrap}
tryNumber={taskTryNumber}
/>
)
)}
</>
)}
Expand Down

0 comments on commit 584a9f5

Please sign in to comment.