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 9a1f9e90a5 Fix require_confirmation_dag_change (#42063)
9a1f9e90a5 is described below

commit 9a1f9e90a5fd8fc1a0736d9d23dccefeb8614f39
Author: Nikita <[email protected]>
AuthorDate: Thu Sep 12 17:56:02 2024 +0300

    Fix require_confirmation_dag_change (#42063)
    
    * Add 'lower' to require_confirmation_dag_change
    
    * Set input attribute only if require-confirmation is true
---
 airflow/www/static/js/dag.js           | 2 +-
 airflow/www/templates/airflow/dag.html | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/airflow/www/static/js/dag.js b/airflow/www/static/js/dag.js
index 3893063739..f178ac0a5b 100644
--- a/airflow/www/static/js/dag.js
+++ b/airflow/www/static/js/dag.js
@@ -55,7 +55,7 @@ $("#pause_resume").on("change", function onChange() {
   const $input = $(this);
   const id = $input.data("dag-id");
   const isPaused = $input.is(":checked");
-  const requireConfirmation = $input.data("require-confirmation");
+  const requireConfirmation = $input.is("[data-require-confirmation]");
   if (requireConfirmation) {
     const confirmation = window.confirm(
       `Are you sure you want to ${isPaused ? "resume" : "pause"} this DAG?`
diff --git a/airflow/www/templates/airflow/dag.html 
b/airflow/www/templates/airflow/dag.html
index 1fc711d993..b0c00bcd5c 100644
--- a/airflow/www/templates/airflow/dag.html
+++ b/airflow/www/templates/airflow/dag.html
@@ -120,7 +120,7 @@
         {% endif %}
         <label class="switch-label{{' disabled' if not can_edit_dag else ''  
}} js-tooltip" title="{{ switch_tooltip }}">
           <input class="switch-input" id="pause_resume" data-dag-id="{{ 
dag.dag_id }}"
-                  data-require-confirmation="{{ 
appbuilder.require_confirmation_dag_change }}"
+                  {{ "data-require-confirmation" if 
appbuilder.require_confirmation_dag_change else "" }}
                   type="checkbox"{{ " checked" if not dag_is_paused else "" }}
                   {{ " disabled" if not can_edit_dag else "" }}>
           <span class="switch" aria-hidden="true"></span>

Reply via email to