pankajkoti commented on code in PR #32052:
URL: https://github.com/apache/airflow/pull/32052#discussion_r1240799495


##########
airflow/www/static/js/connection_form.js:
##########
@@ -123,6 +125,16 @@ function applyFieldBehaviours(connection) {
  */
 function handleTestConnection(connectionType, testableConnections) {
   const testButton = document.getElementById("test-connection");
+
+  if (!configTestConnectionEnabled) {
+    // If test connection is not enabled in config, disable button and display 
toolip
+    // alerting the user.
+    $(testButton)
+      .prop("disabled", true)
+      .attr("title", "Test connection is not enabled in config.");

Review Comment:
   A bit confused about what could be the best approach here. But observed that 
the UI treats the values as a string anyway to do a comparison of the value. 
   
   So, based on the conversation above and considering @jedcunningham's and 
@potiuk's suggestions, I thought to provide a single config param 
`test_connection` in the `core` section of Airflow configuration as this param 
needs to be used across Airflow UI, API and CLI. The supported values I have 
implemented are `Disabled`, `Enabled` and `Hidden` with `Disabled` being the 
default. @o-nikolas hope you are okay with this approach 🤔 



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