bbovenzi commented on code in PR #38021:
URL: https://github.com/apache/airflow/pull/38021#discussion_r1520143222


##########
airflow/www/static/js/dag/details/taskInstance/Logs/LogBlock.tsx:
##########
@@ -59,10 +67,43 @@ const LogBlock = ({ parsedLogs, wrap, tryNumber }: Props) 
=> {
     }
   };
 
+  const onClick = (e: React.MouseEvent<HTMLElement>) => {
+    const target = e.target as HTMLElement;
+    if (target.id && target.id.endsWith("_unfold")) {
+      const gId = target.id.substring(0, target.id.length - 7);
+      // remember the folding state if logs re-loaded
+      unfoldedGroups.push(gId);
+      setUnfoldedLogGroup(unfoldedGroups);
+      // now do the folding
+      target.style.display = "none";
+      if (target.nextElementSibling) {
+        (target.nextElementSibling as HTMLElement).style.display = "inline";
+      }
+    }
+    if (target.id && target.id.endsWith("_fold")) {
+      const gId = target.id.substring(0, target.id.length - 5);
+      // remember the folding state if logs re-loaded
+      if (unfoldedGroups.indexOf(gId) >= 0) {
+        unfoldedGroups.splice(unfoldedGroups.indexOf(gId), 1);
+      }
+      setUnfoldedLogGroup(unfoldedGroups);
+      // now do the folding
+      if (target.parentNode) {
+        (target.parentNode as HTMLElement).style.display = "none";
+        if (target.parentNode.previousSibling) {
+          (target.parentNode.previousSibling as HTMLElement).style.display =

Review Comment:
   ```suggestion
         if (target.parentElement) {
           target.parentElement.style.display = "none";
           if (target.parentElement.previousSibling) {
             (target.parentElement.previousSibling as 
HTMLElement).style.display =
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to