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

ephraimanierobi pushed a commit to branch sync_v2_10_test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 871c52983030949130d0af5c5946f185e20f075d
Author: Pierre Jeambrun <[email protected]>
AuthorDate: Sat Sep 14 00:04:54 2024 +0800

    Fix require_confirmation_dag_change (#42063) (#42211)
    
    * Add 'lower' to require_confirmation_dag_change
    
    * Set input attribute only if require-confirmation is true
    
    (cherry picked from commit 9a1f9e90a5fd8fc1a0736d9d23dccefeb8614f39)
    
    Co-authored-by: Nikita <[email protected]>
---
 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 d3a7995440..69151dd093 100644
--- a/airflow/www/templates/airflow/dag.html
+++ b/airflow/www/templates/airflow/dag.html
@@ -129,7 +129,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