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

kaxilnaik pushed a commit to branch v3-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit c116d44c16d9ad48511baaf927929791ef3ad79b
Author: yangyulely <[email protected]>
AuthorDate: Wed Sep 17 23:05:14 2025 +0800

    Correctly enable Connection "Save" button when editing 'Extra Fields' 
(#55558)
    
    * fix(ui): 'Extra Fields' of connection can not be edit
    
    * Fix ci issue
    
    * Removed the unnecessary useState hooks
    
    (cherry picked from commit b9e6ecb4cab0f34c6a3b868f865ee43f71a877b6)
---
 .../airflow/ui/src/pages/Connections/ConnectionForm.tsx | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git 
a/airflow-core/src/airflow/ui/src/pages/Connections/ConnectionForm.tsx 
b/airflow-core/src/airflow/ui/src/pages/Connections/ConnectionForm.tsx
index b4595490801..dbecdf2ecf7 100644
--- a/airflow-core/src/airflow/ui/src/pages/Connections/ConnectionForm.tsx
+++ b/airflow-core/src/airflow/ui/src/pages/Connections/ConnectionForm.tsx
@@ -96,6 +96,19 @@ const ConnectionForm = ({
     mutateConnection(data);
   };
 
+  // Check if extra fields have changed by comparing with initial connection
+  const isExtraFieldsDirty = (() => {
+    try {
+      const initialParsed = JSON.parse(initialConnection.extra) as 
Record<string, unknown>;
+      const currentParsed = JSON.parse(extra) as Record<string, unknown>;
+
+      return JSON.stringify(initialParsed) !== JSON.stringify(currentParsed);
+    } catch {
+      // If parsing fails, fall back to string comparison
+      return extra !== initialConnection.extra;
+    }
+  })();
+
   const validateAndPrettifyJson = (value: string) => {
     try {
       if (value.trim() === "") {
@@ -251,7 +264,9 @@ const ConnectionForm = ({
           <Spacer />
           <Button
             colorPalette="brand"
-            disabled={Boolean(errors.conf) || formErrors || isPending || 
!isValid || !isDirty}
+            disabled={
+              Boolean(errors.conf) || formErrors || isPending || !isValid || 
(!isDirty && !isExtraFieldsDirty)
+            }
             onClick={() => void handleSubmit(onSubmit)()}
           >
             <FiSave /> {translate("formActions.save")}

Reply via email to