potiuk commented on issue #13985: URL: https://github.com/apache/airflow/issues/13985#issuecomment-770435358
> If I understand the way it currently works, the entire set of fields, regardless of the selected connection, is POSTed to the controller. Yep. My understanding as well. > Haven't read in detail yet, but if the controller can handle fields that are omitted in the POST request without negative side effects, `connection_form.js` could be modified to save the DOM nodes on initial load, then dynamically add/remove them when different connection types are selected. Yep. my understing that this would work the way. Currently this code is rather simple (simply changing attributes of the fields to be visible/hidden). Another option would be to remove/restore `required` property of the "required" fields. Not sure how the controller would behave in this case, but likely this has even more chances of not having side effects and might be a bit simpler (no need to add the fields on submit() likely). > Also worth noting that this is also an issue not just for required fields, but also where someone tries to return an `IntegerField` instead of a `StringField`. Indeed. Those could be prefilled with 0s I guess (not perfect and I can imagine scenarios where such fields are visible, change, hidden and THEN submitted. Not sure how the controller would behave. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
