From 61bf4550af36ebbc2266f4d1ad035feab28ddcc8 Mon Sep 17 00:00:00 2001 From: Pankaj Koti Date: Sat, 12 Aug 2023 13:13:44 +0530 Subject: [PATCH] Enable test connection in UI if explicitly set to `Enabled` Following up PR https://github.com/apache/airflow/pull/32052/ the test connection is disabled in UI, API and CLI. The API and CLI strictly check for the config value to be set as `Enabled` for the functionality to be enabled, whereas the UI just checks that is it not set to `Disabled`. As a result setting values to the config param other than `Disabled`, enables the button in the UI. Even though the button gets enabled, the API forbids it as there is a strict check in the API that the value is set to `Enabled` and only then allows, however, it makes sense to also strictly check in the UI that value is set to `Enabled`. --- airflow/www/static/js/connection_form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airflow/www/static/js/connection_form.js b/airflow/www/static/js/connection_form.js index 453be58411a9b..2451da05a34eb 100644 --- a/airflow/www/static/js/connection_form.js +++ b/airflow/www/static/js/connection_form.js @@ -135,7 +135,7 @@ function handleTestConnection(connectionType, testableConnections) { $(testButton).hide(); return; } - if (configTestConnection === "disabled") { + if (configTestConnection !== "enabled") { // If test connection is not enabled in config, disable button and display toolip // alerting the user. $(testButton)