Parcourir la source

Fix missing field in connection info modal

A field may be missing in providers without a connection info plugin if
the number of fields is not an odd number.
Sergiu Miclea il y a 7 ans
Parent
commit
12314be308
1 fichiers modifiés avec 6 ajouts et 3 suppressions
  1. 6 3
      src/plugins/endpoint/default/ContentPlugin.jsx

+ 6 - 3
src/plugins/endpoint/default/ContentPlugin.jsx

@@ -100,13 +100,16 @@ class ContentPlugin extends React.Component<Props> {
           </Row>
         ))
       }
-      if (field.useTextArea || schemaIndex === this.props.connectionInfoSchema.length - 1) {
+      if (field.useTextArea) {
+        pushRow(currentField)
+        i -= 1
+      } else if (i % 2 !== 0) {
+        pushRow(lastField, currentField)
+      } else if (schemaIndex === this.props.connectionInfoSchema.length - 1) {
         pushRow(currentField)
         if (field.useTextArea) {
           i -= 1
         }
-      } else if (i % 2 !== 0) {
-        pushRow(lastField, currentField)
       } else {
         lastField = currentField
       }