techolga commented on code in PR #39993:
URL: https://github.com/apache/airflow/pull/39993#discussion_r1623654379


##########
airflow/www/templates/airflow/trigger.html:
##########
@@ -86,8 +86,9 @@
         {% endfor -%}
       </select>
     {% elif form_details.schema and "array" in form_details.schema.type %}
-      {% if "items" in form_details.schema and form_details.schema.items %}
-      <textarea class="form-control" name="element_{{ form_key }}" 
id="element_{{ form_key }}" valuetype="advancedarray" rows="6"
+      {% if "items" in form_details.schema and form_details.schema["items"] %}
+      <textarea class="form-control" name="element_{{ form_key }}" 
id="element_{{ form_key }}" rows="6"
+        {%- if "string" in form_details.schema["items"]["type"] %} 
valuetype="array"{% else %} valuetype="advancedarray"{% endif -%}

Review Comment:
   You are right, we have some redundancy here. Once the formatting is solved 
in JS and once in the template, what is the preferred way here?
   
   Yes the `advancedarray` is rendered for all other types. You can have for 
example an array of objects with format validation in it. The default element 
of an array type array is the textarea, when any different type than string is 
specified the CodeMirror element is rendered.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to