Skip to content
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

Allow pre-population of trigger form values via URL parameters #37497

Conversation

jscheffl
Copy link
Contributor

@jscheffl jscheffl commented Feb 16, 2024

This PR adds the (missing) option reported as Bug a while ago that the DAG trigger form can be called with default values populated.

How to test:

  • Run the web UI on this branch, see that forms are displayed
  • Call the UI, e.g. DAG example_params_ui_tutorial and add URL parameters and see fields are pre-populated, e.g. /dags/example_params_ui_tutorial/trigger?required_field=some text
  • Check that boolean, objects and lists are also working e.g. via
    • flag=true or flag=false
    • array_of_numbers=[17,18,19]
    • object={"x":789}
    • run_id=manual__12345 (and expand the lower section seeing run_id being pre-populated)
    • text=<script>alert(1)</script> (and see that it is not possible to XSS a value in)

closes: #32859

FYI @AutomationDev85

@jscheffl jscheffl added type:bug-fix Changelog: Bug Fixes area:UI Related to UI/UX. For Frontend Developers. labels Feb 16, 2024
@jscheffl jscheffl added this to the Airflow 2.8.2 milestone Feb 16, 2024
@boring-cyborg boring-cyborg bot added area:webserver Webserver related Issues kind:documentation labels Feb 16, 2024
Copy link
Contributor

@dirrao dirrao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Static checks are failing.

@jscheffl jscheffl force-pushed the bugfix/32859-allow-pre-populate-form-fields-in-trigger-form branch from 82c6f20 to ce46d8c Compare February 17, 2024 14:42
@jscheffl jscheffl requested a review from dirrao February 17, 2024 16:52
@jscheffl jscheffl force-pushed the bugfix/32859-allow-pre-populate-form-fields-in-trigger-form branch from ce46d8c to be98590 Compare February 20, 2024 19:48
Copy link
Contributor

@bbovenzi bbovenzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UI part makes sense to me. I'd appreciate someone to check the python code a bit more

@potiuk potiuk merged commit 099925b into apache:main Feb 20, 2024
57 checks passed
ephraimbuddy pushed a commit that referenced this pull request Feb 22, 2024
* Allow pre-population of trigger form values via URL parameters

* Fix docs reference

(cherry picked from commit 099925b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues kind:documentation type:bug-fix Changelog: Bug Fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DAG triggering page does not reflect conf parameter in the URL query string
4 participants