Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added spinner activity while the logs load #31165

Merged
merged 4 commits into from
May 10, 2023
Merged
Changes from 2 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 @@ -26,6 +26,7 @@ import {
Button,
Checkbox,
Icon,
Spinner,
} from "@chakra-ui/react";
import { MdWarning } from "react-icons/md";

Expand Down Expand Up @@ -266,12 +267,14 @@ const Logs = ({
<Text fontSize="sm">{warning}</Text>
</Flex>
)}
{!!parsedLogs && (
{parsedLogs ? (
<LogBlock
parsedLogs={parsedLogs}
wrap={wrap}
tryNumber={taskTryNumber}
/>
) : (
<Spinner />
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's get the loading state from the query to determine when to show the spinner.
const { data, isLoading } = useTaskLog()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changes done. Since isLoading is always false in the above case because of the placeholder in the query. Hence, using isFetching for the spinner.

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, we can get rid of that placeholderData and use isLoading normally. isFetching can be true when there is still data to show.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

)}
</>
)}
Expand Down