Skip to content

Commit

Permalink
Fix require_confirmation_dag_change (#42063) (#42211)
Browse files Browse the repository at this point in the history
* Add 'lower' to require_confirmation_dag_change

* Set input attribute only if require-confirmation is true

(cherry picked from commit 9a1f9e9)

Co-authored-by: Nikita <sowow359@ya.ru>
  • Loading branch information
pierrejeambrun and sowow359 authored Sep 13, 2024
1 parent 0b4bd74 commit 2a76973
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion airflow/www/static/js/dag.js
Original file line number Diff line number Diff line change
Expand Up @@ -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?`
Expand Down
2 changes: 1 addition & 1 deletion airflow/www/templates/airflow/dag.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ <h3>
{% 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>
Expand Down

0 comments on commit 2a76973

Please sign in to comment.