You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2019/01/04 13:55:57 UTC

[GitHub] kaxil closed pull request #4185: [AIRFLOW-3340] Placeholder support in connections form

kaxil closed pull request #4185: [AIRFLOW-3340] Placeholder support in connections form
URL: https://github.com/apache/incubator-airflow/pull/4185
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/airflow/www/static/connection_form.js b/airflow/www/static/connection_form.js
index 8ed42c2dbe..8517ad2582 100644
--- a/airflow/www/static/connection_form.js
+++ b/airflow/www/static/connection_form.js
@@ -59,6 +59,9 @@
           relabeling: {
             'host': 'API Endpoint',
             'password': 'Auth Token',
+          },
+          placeholders: {
+            'host': 'https://<env>.qubole.com/api'
           }
         },
         ssh: {
@@ -81,6 +84,8 @@
         $("label[orig_text]").each(function(){
             $(this).text($(this).attr("orig_text"));
         });
+        $(".form-control").each(function(){$(this).attr('placeholder', '')});
+
         if (config[connectionType] != undefined){
           $.each(config[connectionType].hidden_fields, function(i, field){
             $("#" + field).parent().parent().addClass('hide')
@@ -90,6 +95,9 @@
             lbl.attr("orig_text", lbl.text());
             $("label[for='" + k + "']").text(v);
           });
+          $.each(config[connectionType].placeholders, function(k, v){
+            $("#" + k).attr('placeholder', v);
+          });
         }
       }
       var connectionType=$("#conn_type").val();
diff --git a/airflow/www_rbac/static/js/connection_form.js b/airflow/www_rbac/static/js/connection_form.js
index 09034f8785..17ca29066a 100644
--- a/airflow/www_rbac/static/js/connection_form.js
+++ b/airflow/www_rbac/static/js/connection_form.js
@@ -51,6 +51,9 @@ $(document).ready(function () {
       relabeling: {
         'host': 'API Endpoint',
         'password': 'Auth Token',
+      },
+      placeholders: {
+        'host': 'https://<env>.qubole.com/api'
       }
     },
     ssh: {
@@ -72,6 +75,8 @@ $(document).ready(function () {
     $("label[orig_text]").each(function () {
       $(this).text($(this).attr("orig_text"));
     });
+    $(".form-control").each(function(){$(this).attr('placeholder', '')});
+
     if (config[connectionType] != undefined) {
       $.each(config[connectionType].hidden_fields, function (i, field) {
         $("#" + field).parent().parent().addClass('hide')
@@ -81,6 +86,9 @@ $(document).ready(function () {
         lbl.attr("orig_text", lbl.text());
         $("label[for='" + k + "']").text(v);
       });
+      $.each(config[connectionType].placeholders, function(k, v){
+        $("#" + k).attr('placeholder', v);
+      });
     }
   }
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services