bbovenzi commented on a change in pull request #15795:
URL: https://github.com/apache/airflow/pull/15795#discussion_r637915420



##########
File path: airflow/www/static/js/connection_form.js
##########
@@ -140,6 +153,67 @@ $(document).ready(function () {
     }
   }
 
+  /**
+   * Produces JSON stringified data from a html form data
+   *
+   * @param {string} selector Jquery from selector string.
+   * @returns {string} Form data as a JSON string
+   */
+  function getSerializedFormData(selector) {
+    const outObj = {};
+    const inArray = $(selector).serializeArray();
+
+    $.each(inArray, function () {
+      if (this.name === 'conn_id') {
+        outObj.connection_id = this.value;
+      } else if (this.value !== '' && this.name !== 'csrf_token') {
+        outObj[this.name] = this.value;
+      }
+    });
+
+    return JSON.stringify(outObj);
+  }
+
+  /**
+   * Displays the Flask style alert on UI via JS
+   *
+   * @param {boolean} status - true for success, false for error
+   * @param {strinf} message - The text message to show in alert box

Review comment:
       ```suggestion
      * @param {string} message - The text message to show in alert box
   ```
   Just a typo




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


Reply via email to