pierrejeambrun commented on code in PR #55558:
URL: https://github.com/apache/airflow/pull/55558#discussion_r2355833309


##########
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;
+    }
+  })();

Review Comment:
   I think it's because of the front-end json formatting. 'content' is actually 
the same, but UI will show extra '\n' and indent to have a nice display, those 
wouldn't match with plain string comparison.



-- 
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