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 @@ -39,14 +39,12 @@ const LogBlock = ({
const [autoScroll, setAutoScroll] = useState(true);

const logBoxRef = useRef<HTMLPreElement>(null);
const codeBlockBottomDiv = useRef<HTMLDivElement>(null);
const offsetTop = useOffsetTop(logBoxRef);

const scrollToBottom = () => {
codeBlockBottomDiv.current?.scrollIntoView({
block: "nearest",
inline: "nearest",
});
if (logBoxRef.current) {
logBoxRef.current.scrollTop = logBoxRef.current.scrollHeight;
}
};

useEffect(() => {
Expand Down Expand Up @@ -122,7 +120,6 @@ const LogBlock = ({
>
{/* eslint-disable-next-line react/no-danger */}
<div dangerouslySetInnerHTML={{ __html: parsedLogs }} />
<div ref={codeBlockBottomDiv} />
</Code>
);
};
Expand Down
2 changes: 1 addition & 1 deletion airflow/www/static/js/utils/useOffsetTop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { debounce } from "lodash";
import React, { useEffect, useState } from "react";

// For an html element, keep it within view height by calculating the top offset and footer height
const useOffsetTop = (contentRef: React.RefObject<HTMLElement>) => {
const useOffsetTop = (contentRef: React.RefObject<HTMLElement | null>) => {
const [top, setTop] = useState(0);

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,9 @@ def test_cli_add_user_role(self, create_user_test4):
user_command.users_manage_role(args, remove=False)
assert 'User "test4" added to role "Op"' in stdout.getvalue()

assert _does_user_belong_to_role(appbuilder=self.appbuilder, email=TEST_USER1_EMAIL, rolename="Op"), (
"User should have been added to role 'Op'"
)
assert _does_user_belong_to_role(
appbuilder=self.appbuilder, email=TEST_USER1_EMAIL, rolename="Op"
), "User should have been added to role 'Op'"

def test_cli_remove_user_role(self, create_user_test4):
assert _does_user_belong_to_role(
Expand Down
Loading