This is an automated email from the ASF dual-hosted git repository.
bbovenzi pushed a commit to branch v2-10-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v2-10-test by this push:
new 2a76973949 Fix require_confirmation_dag_change (#42063) (#42211)
2a76973949 is described below
commit 2a76973949bcb3a374449dfa693208b4d3195c39
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>