-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
Support multiline input for Params of type string in trigger UI form #40414
Support multiline input for Params of type string in trigger UI form #40414
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)
|
e11430d
to
dfecf1d
Compare
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'd propose to make the feature explicit and not based on newline in examples.
Is any of the JSON schema attributes matching as an option? Else you are free to "invent" or deine a new and specific attribute as marker.
Can you also please adjust the docs such that users are able to know about the feature w/o the need to read source code?
Thanks for the feedback ! I'll try to check whether the |
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. |
dfecf1d
to
3596f03
Compare
Some static checks fail. Though I like the implementation a lot more than before... actually as project team we have decided (1) that Airflow 2.10 will only get new features in exceptional cases and (2) the UI will be completely re-written - So an upcoming Airflow 3 will have a 100% new codebase for UI... this change probably will never to live in any future release. @bbovenzi WDYT how should we treat this PR? Make it to main to have a reminder to migrate it/the feature to the new UI? I think it is useful but code needs to be re-written anyway in 100% React. |
I think this is a small enough of a surface area where adding it now doesn't significantly change how we rebuild this view. But having it in the code reminds us to make this feature work in 2.10. |
@sc-anssi So then I would say... if you fix the static checks then we could merge it and back-port to a 2.10.2 release... |
…t area in the trigger UI form
ab0d291
to
8bfc7b3
Compare
8bfc7b3
to
ae64532
Compare
Spelling is fixed, please let me know if anything else needs to be done 👍 |
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
…pache#40414) * Add multiline input (textarea) support for Params of type string in trigger UI form * Use the 'format' attribute in the Param for rendering a multiline text area in the trigger UI form * Update example DAG and documentation to illustrate the use of a multiline text Param
…40414) (#42139) * Add multiline input (textarea) support for Params of type string in trigger UI form * Use the 'format' attribute in the Param for rendering a multiline text area in the trigger UI form * Update example DAG and documentation to illustrate the use of a multiline text Param Co-authored-by: sc-anssi <[email protected]>
…40414) (#42139) * Add multiline input (textarea) support for Params of type string in trigger UI form * Use the 'format' attribute in the Param for rendering a multiline text area in the trigger UI form * Update example DAG and documentation to illustrate the use of a multiline text Param Co-authored-by: sc-anssi <[email protected]>
…pache#40414) * Add multiline input (textarea) support for Params of type string in trigger UI form * Use the 'format' attribute in the Param for rendering a multiline text area in the trigger UI form * Update example DAG and documentation to illustrate the use of a multiline text Param
This patch adds the possibility to have a multiline input (textarea) for Params of type "string" in the trigger UI form. The choice between rendering a text input (single line) or a textarea (multiline) is based on the presence of a new line character in any of the examples of the Param.
For instance, the following code generates a multiline input:
I know Params of type "array" are rendered as textareas but forcing our end-users to format their multiline text into an array of strings would not be very friendly :). So it seems more practical to leave the Param as a "string" type and work on the rendering options instead.
The patch is merely a PoC to showcase what the feature would look like and by no means a definitive solution. I think that relying on the
examples
attribute is more a hack than a solution, but adding a new explicit attribute to the Param object is beyond my understanding of Airflow. So feel free to rewrite it completely if you think the feature is worth it.