-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
Operator's extra link button is disabled #43252
Comments
I'm happy to investigate this - will take a look now |
If I understand you correctly, seems like this can be solved with:
i.e, if the URL is '' or null, set isSanitised to false so that the button ends up having the isDisabled prop set to true |
candidate PR here: #43844 |
* Disable button if link is null or empty * Fix space --------- Co-authored-by: Enis Nazif <[email protected]>
…che#43844) * Disable button if link is null or empty * Fix space --------- Co-authored-by: Enis Nazif <[email protected]> (cherry picked from commit de88182)
…43851) * Disable button if link is null or empty * Fix space --------- Co-authored-by: Enis Nazif <[email protected]> (cherry picked from commit de88182) Co-authored-by: enisnazif <[email protected]>
isSanitised should return |
Fixed in #43844 |
…che#43844) * Disable button if link is null or empty * Fix space --------- Co-authored-by: Enis Nazif <[email protected]>
Hi, Your fix isn't complete, as I mentioned in my previous command isSanitised should returns
|
Can you propose a better fix ? |
Yeah, first of all, following code to check that a url is external is buggy:
This regex will accept a url starting with "//" so first let's fix this (removing
And for the isSantised method let's reuse this isExternal
I cannot test it, I don't have a ready airflow dev environment on my work laptop, otherwise I would be appreciated to contribute. |
You can use codespaces - which is entirely from the browser, supported by Airflow and free up to 80 hours a month for everyone in GitHub. Super easy to use - you click a button and you have working development environment with airflow in a matter of minutes. Quick start here: https://github.com/apache/airflow/blob/main/contributing-docs/quick-start-ide/contributors_quick_start_codespaces.rst If you can create and coment on issues in GitHub, you can also run this development environment -as it is purely in-browser and runs Airflow's CI image remotely on GitHub's workers. |
…43851) * Disable button if link is null or empty * Fix space --------- Co-authored-by: Enis Nazif <[email protected]> (cherry picked from commit de88182) Co-authored-by: enisnazif <[email protected]>
…43851) * Disable button if link is null or empty * Fix space --------- Co-authored-by: Enis Nazif <[email protected]> (cherry picked from commit de88182) Co-authored-by: enisnazif <[email protected]>
Apache Airflow version
2.10.2
What happened?
When in get_link method I provide
None
, the button is enabled and when I provide link (internal link) it is disabledWhat you think should happen instead?
In the following code, if url is empty or None, the result of isSanitised is True !
also if the url is internal then isSanitised is False (so internal url is not supported)
As a workaround for now I am providing a random non-rul string instead of None, and I replaced my internal url with absolute one (but I missed rendering my page in same window now)
https://github.com/apache/airflow/blob/2.10.2/airflow/www/static/js/dag/details/taskInstance/ExtraLinks.tsx
How to reproduce
Operating System
Debian GNU/Linux 12 (bookworm)
Versions of Apache Airflow Providers
non related
Deployment
Docker-Compose
Deployment details
We are deploying on docker swarm
Anything else?
It works in 2.8.1
And It seems that internal url issue is fixed in main branch but None handling is not fixed.
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: