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

Fix dropdown default and adjust tutorial to use 42 as default for proof #31400

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions airflow/example_dags/example_params_ui_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@
),
# If you want to have a selection list box then you can use the enum feature of JSON schema
"pick_one": Param(
"value 1",
"value 42",
type="string",
title="Select one Value",
description="You can use JSON schema enum's to generate drop down selection boxes.",
enum=[f"value {i}" for i in range(1, 42)],
enum=[f"value {i}" for i in range(16, 64)],
),
# Boolean as proper parameter with description
"bool": Param(
Expand Down
4 changes: 2 additions & 2 deletions airflow/www/templates/airflow/trigger.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@
</div>
{% elif "enum" in form_details.schema and form_details.schema.enum %}
<select class="my_select2 form-control" name="element_{{ form_key }}" id="element_{{ form_key }}" data-placeholder="Select Value"
value="{% if form_details.value %}{{ form_details.value }}{% endif %}" onchange="updateJSONconf();"
onchange="updateJSONconf();"
{%- if not "null" in form_details.schema.type %} required=""{% endif %}>
{% for option in form_details.schema.enum -%}
<option>{{ option }}</option>
<option{% if form_details.value == option %} selected="true"{% endif %}>{{ option }}</option>
{% endfor -%}
</select>
{% elif form_details.schema and "array" in form_details.schema.type %}
Expand Down