-
Notifications
You must be signed in to change notification settings - Fork 14.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix require_confirmation_dag_change #42063
Fix require_confirmation_dag_change #42063
Conversation
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
|
Thank you for the pull request. That seems a little odd that the normal string "Something" is considered a string (most things are then truthy), but casting it to lower somehow convert that to a boolean, I would think that this would remain a string
|
Ok, as I recall html attribute values are string, therefore, we end up with Which does not work indeed, both are truthy. Jquery The problem is that this is too implicit. People reading that code will not understand why it's here in a couple of weeks and will have to get back here. I would prefer something more explicit like we do with I would only set the attribute if True like this:
Then adapt the jquery query to check if the attribute is set or not, something like:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good.
Working as expected ty.
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
We'll need to cherry pick this for |
Yes! I’ll open the PR tomorrow edit: #42211 |
* Add 'lower' to require_confirmation_dag_change * Set input attribute only if require-confirmation is true (cherry picked from commit 9a1f9e9)
* Add 'lower' to require_confirmation_dag_change * Set input attribute only if require-confirmation is true
Currently
require_confirmation_dag_change
seems to have no effect on pause/resume switch, triggering the switch will cause confirmation window to show up regardless.This is caused by JS type conversions. In current version with
data-require-confirmation="{{ appbuilder.require_confirmation_dag_change }}"
resulting value on JS side in onChange function hasString
type and does not automatically converts to boolean, which causes incorrect check:Adding
lower
on jinja side does the trick and seems like simplest fix, resulting string successfully converts to boolean. After that confirmation window shows up only when passingTrue
torequire_confirmation_dag_change
.^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rst
or{issue_number}.significant.rst
, in newsfragments.