This is an automated email from the ASF dual-hosted git repository.

pierrejeambrun pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 4fd812a6def Undo changes to accordion done in #46348 (#47054)
4fd812a6def is described below

commit 4fd812a6def42c03a703aadd609b698ae3f08203
Author: Aritra Basu <[email protected]>
AuthorDate: Tue Feb 25 22:31:01 2025 +0530

    Undo changes to accordion done in #46348 (#47054)
---
 .../components/ActionAccordion/ActionAccordion.tsx | 73 ++++++++++------------
 1 file changed, 34 insertions(+), 39 deletions(-)

diff --git a/airflow/ui/src/components/ActionAccordion/ActionAccordion.tsx 
b/airflow/ui/src/components/ActionAccordion/ActionAccordion.tsx
index cc00a5495fc..3995b789308 100644
--- a/airflow/ui/src/components/ActionAccordion/ActionAccordion.tsx
+++ b/airflow/ui/src/components/ActionAccordion/ActionAccordion.tsx
@@ -29,14 +29,13 @@ import { columns } from "./columns";
 type Props = {
   readonly affectedTasks?: TaskInstanceCollectionResponse;
   readonly note: DAGRunResponse["note"];
-  readonly setNote: ((value: string) => void) | undefined;
+  readonly setNote: (value: string) => void;
 };
 
 // Table is in memory, pagination and sorting are disabled.
 // TODO: Make a front-end only unconnected table component with client side 
ordering and pagination
 const ActionAccordion = ({ affectedTasks, note, setNote }: Props) => {
   const showTaskSection = affectedTasks !== undefined;
-  const showNoteSection = note !== null;
 
   return (
     <Accordion.Root
@@ -63,44 +62,40 @@ const ActionAccordion = ({ affectedTasks, note, setNote }: 
Props) => {
           </Accordion.ItemContent>
         </Accordion.Item>
       ) : undefined}
-      {showNoteSection ? (
-        <Accordion.Item key="note" value="note">
-          <Accordion.ItemTrigger>
-            <Text fontWeight="bold">Note</Text>
-          </Accordion.ItemTrigger>
-          <Accordion.ItemContent>
-            <Editable.Root
-              onChange={(event: ChangeEvent<HTMLInputElement>) =>
-                setNote ? setNote(event.target.value) : undefined
-              }
-              value={note}
+      <Accordion.Item key="note" value="note">
+        <Accordion.ItemTrigger>
+          <Text fontWeight="bold">Note</Text>
+        </Accordion.ItemTrigger>
+        <Accordion.ItemContent>
+          <Editable.Root
+            onChange={(event: ChangeEvent<HTMLInputElement>) => 
setNote(event.target.value)}
+            value={note ?? ""}
+          >
+            <Editable.Preview
+              _hover={{ backgroundColor: "transparent" }}
+              alignItems="flex-start"
+              as={VStack}
+              gap="0"
+              height="200px"
+              overflowY="auto"
+              width="100%"
             >
-              <Editable.Preview
-                _hover={{ backgroundColor: "transparent" }}
-                alignItems="flex-start"
-                as={VStack}
-                gap="0"
-                height="200px"
-                overflowY="auto"
-                width="100%"
-              >
-                {Boolean(note) ? (
-                  <ReactMarkdown>{note}</ReactMarkdown>
-                ) : (
-                  <Text color="fg.subtle">Add a note...</Text>
-                )}
-              </Editable.Preview>
-              <Editable.Textarea
-                data-testid="notes-input"
-                height="200px"
-                overflowY="auto"
-                placeholder="Add a note..."
-                resize="none"
-              />
-            </Editable.Root>
-          </Accordion.ItemContent>
-        </Accordion.Item>
-      ) : undefined}
+              {Boolean(note) ? (
+                <ReactMarkdown>{note}</ReactMarkdown>
+              ) : (
+                <Text color="fg.subtle">Add a note...</Text>
+              )}
+            </Editable.Preview>
+            <Editable.Textarea
+              data-testid="notes-input"
+              height="200px"
+              overflowY="auto"
+              placeholder="Add a note..."
+              resize="none"
+            />
+          </Editable.Root>
+        </Accordion.ItemContent>
+      </Accordion.Item>
     </Accordion.Root>
   );
 };

Reply via email to