-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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 Mark Instance state buttons stay disabled if user lacks permission (#37451) #38732
Fix Mark Instance state buttons stay disabled if user lacks permission (#37451) #38732
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)
|
airflow/www/static/js/dag/details/taskInstance/taskActions/ClearInstance.tsx
Outdated
Show resolved
Hide resolved
9ab50c6
to
4d04624
Compare
Hey, the code is now ready, since the fix is pretty simple I removed the test case which was not needed. I'm sorry for the latest commit, It's my first time contributing and I messed up the rebase. I have already fixed it having now only one commit. |
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
closes: #37451
This bug adresses a visual issue occuring when attempting to mark task states as Failed or Sucess, or when using clear button without the 'can edit on Task Instances' role. This resulted in a not expected partially empty screen in the dag menu.
The fix resolves the issue by disabling both the "Clear Task" and "Mark state as…" buttons when the user lacks permission, same as the behavior when the user can't edit on DAGs.
Now, in 'views.py', an additional meta named 'can_edit_taskintances' is passed to 'grid.html' based on the user's task instance edit permission, same as the meta 'can_edit' from user's dag edit permission defined in 'dag.html'.
Both 'canEdit' and 'canEditTaskInstances' definitions were moved inside the React components. This was necessary just for the variables to be mockable during testing, as these variables were defined before the component was loaded.