-
Notifications
You must be signed in to change notification settings - Fork 16.4k
AIP-50 Trigger UI based on FAB #27063
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
AIP-50 Trigger UI based on FAB #27063
Conversation
|
Note that Pytests are not adjusted and are even failing for the WIP PR at the moment, will be fixed before the PR leaves the WIP phase. Still the function is working and can be inspected. |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions. |
|
@jens-scheffler-bosch |
Great, looing forward to complete the missing pieces if the direction/proposal is accepted! |
|
@jens-scheffler-bosch Tested that locally and looks very cool. I think it is worth pushing that further with the addition you mentioned. (Doc, tests, cleaning the code etc.) I would mention that it would be great if this could integrate with the newly added |
|
To address your questions, (imho):
|
…fab-dag-trigger-ui
…fab-dag-trigger-ui
|
Hi @pierrejeambrun - thanks again for the review! I now closed the gaps and made the pipeline green - functional-wise the AIP-50 implementation is completed now. Now time for a final review, then (in my view) ready to be merged. Recent commits changed:
|
| (Default) value that should be displayed when showing/loading the form.</li> | ||
| <li>Note: If you have elements changing a value, call <code>updateJSONconf()</code>.</li> | ||
| </ul> | ||
| Example: <code><input name='{name}' value='{value}' onchange='updateJSONconf()' /></code> |
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.
Rather than needing custom form's to use onchange='updateJSONconf()' can we change the even to pick up all inputs under the form automatically?
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.
I tried to apply this comment but when looking to my own example I realized that a "generic" solution might be hard. I fear this generates more problems than it helps users, because adding the event listeners globally might generate side effects when a custom form has other event listeners and the order is not right.
ashb
left a comment
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.
Python side looks okay to me now (though lets separate out trigger_dag_url change so we can continue discussing that without blocking this.)
I'd like @bbovenzi To take a look at the JS side of things before merging.
jscheffl
left a comment
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.
Adedd screen shot snippets for Trigger form
| <td class="col-lg-2"> | ||
| <label for="element_{{ form_key }}" control-label=""> | ||
| {%- if "title" in form_details.schema and form_details.schema.title -%} | ||
| {{ form_details.schema.title }} | ||
| {%- else -%} | ||
| {{ form_key }} | ||
| {%- endif -%} | ||
| {%- if form_details.schema and form_details.schema.type and not "null" in form_details.schema.type and not "boolean" in form_details.schema.type -%} | ||
| <strong style="color: red"> *</strong> | ||
| {%- endif -%} | ||
| : </label> | ||
| </td> |
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.
| <label for="element_{{ form_key }}" control-label=""> | ||
| <input class="switch-input" name="element_{{ form_key }}" id="element_{{ form_key }}" type="checkbox" | ||
| {%- if form_details.value %} checked="checked"{%- endif -%}/> | ||
| <span class="switch" aria-hidden="true"></span> | ||
| </label> |
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.
| <div class="input-group datetime datetimepicker"> | ||
| <span class="input-group-addon"><span class="material-icons cursor-hand">calendar_today</span></span> | ||
| <input class="form-control" name="element_{{ form_key }}" id="element_{{ form_key }}" type="text" valuetype="date" | ||
| {%- if not "null" in form_details.schema.type %} required=""{%- endif %} value="{% if form_details.value %}{{ form_details.value }}{% endif %}" /> | ||
| </div> |
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.
| <div class="input-group datetime datepicker"> | ||
| <span class="input-group-addon"><span class="material-icons cursor-hand">calendar_today</span></span> | ||
| <input class="form-control" name="element_{{ form_key }}" id="element_{{ form_key }}" type="text" valuetype="date" | ||
| {%- if not "null" in form_details.schema.type %} required=""{%- endif %} value="{% if form_details.value %}{{ form_details.value }}{% endif %}" /> | ||
| </div> |
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.
| <div class="input-group datetime timepicker"> | ||
| <span class="input-group-addon"><span class="material-icons cursor-hand">calendar_today</span></span> | ||
| <input class="form-control" name="element_{{ form_key }}" id="element_{{ form_key }}" type="text" valuetype="date" | ||
| {%- if not "null" in form_details.schema.type %} required=""{%- endif %} | ||
| value="{% if form_details.value %}{{ form_details.value[0:2] }}00-01-01 {{ form_details.value }}{% endif %}" /> | ||
| </div> |
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.
| <input class="form-control" name="element_{{ form_key }}" id="element_{{ form_key }}" placeholder="" type="text" | ||
| value="{% if form_details.value %}{{ form_details.value }}{% endif %}" | ||
| {%- if form_details.schema and form_details.schema.minLength %} minlength="{{ form_details.schema.minLength }}"{% endif %} | ||
| {%- if form_details.schema and form_details.schema.maxLength %} maxlength="{{ form_details.schema.maxLength }}"{% endif %} | ||
| {%- if form_details.schema and form_details.schema.type and not "null" in form_details.schema.type %} required=""{% endif %} /> |
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.
| {%- if form_details.schema and form_details.schema.type and not "null" in form_details.schema.type %} required=""{% endif %} /> | ||
| {% endif %} | ||
| {% if form_details.description -%} | ||
| <span class="help-block">{{ form_details.description }}</span> |
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.
| <div class="col-md-2"> | ||
| <label for="recent_configs">Recent Configurations</label> | ||
| <label for="recent_configs">Select Recent Configurations</label> | ||
| <select class="form-control" name="recent_configs" id="recent_configs"> | ||
| <option value="">empty config</option> | ||
| {% for conf in recent_confs %} | ||
| <option value="{{ conf }}">{{ conf }}</option> | ||
| <option value="{{ conf }}">Default parameters</option> | ||
| {% for run_id, recent_conf in recent_confs.items() %} | ||
| <option value="{{ recent_conf }}">{{ run_id }}: {{ recent_conf }}</option> | ||
| {% endfor %} |
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.
| <div class="panel-heading"> | ||
| <h4 class="panel-title"> | ||
| <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion_section_{{ form_section | lower() | replace(' ', '_') }}" href="#accordion_section_{{ form_section | lower() | replace(' ', '_') }}_href" | ||
| data-original-title="" title="" id="{{ form_section | lower() | replace(' ', '_') }}_toggle">{{ form_section }}<span class="caret"></span></a> | ||
| </h4> | ||
| </div> |
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.
| <div class="panel-group" id="accordion_json_conf"> | ||
| <div class="panel panel-default"> | ||
| <div class="panel-heading"> | ||
| <h4 class="panel-title"> | ||
| <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion_json_conf" href="#accordion_json_conf_href" data-original-title="" title="" id="generated_json_toggle">Generated Configuration JSON<span class="caret"></span></a> | ||
| </h4> | ||
| </div> | ||
| <div id="accordion_json_conf_href" class="panel-collapse collapse"> | ||
| <div class="panel-body"> | ||
| <textarea name="conf" id="json">{{ conf }}</textarea> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> |
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.
bbovenzi
left a comment
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.
Great work! I played around with the example dags too. They were really helpful.
|
Thank you for this!! Or the only reasonable way would be waiting until it goes into a stable release? I'm running Airflow 2.5.1 with Docker Compose in dev mode, following: Thank you. |
|
Hello @mayeulk,
I would say that you could cherry pick only the changes related to AIP-50 and apply that to your own version (if you really can't wait). This is a new feature, so it will be part of the next minor release. I would recommend to wait just a little bit longer. 😄 |
|
Hello @pierrejeambrun, |










This PR adds a trigger UI based on ideas and discussion from AIP-50 Trigger DAG UI Extension with Flexible User Form Concept based on current FAB UI infrastructure. (Note: Initially it was a PoC PR, now functionally complete).
Due to the feedback received on AIP-50 the PR is based on the
Paramstoolings already available and leverages with minimal changes 80% of desired scope. Also the parallel implementation of #27805 was integrated.Coverage/Scope of this PR:
paramsor usage of existingparamsdict a form as UI is generated dynamicallyparamsare defined on a DAG a form is generatedparamsare defined the previous JSON based entry is presentedhiddenwas implemented by using the JSON schema attributeconstantwhich assumes that only one constant value is permitted, no additional flag needed.related: #26215 #27805
closes: #11054
FYI @clellmann @wolfdn @AutomationDev85