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/17 16:49:04 UTC

[GitHub] verdan commented on a change in pull request #4548: [AIRFLOW-3724] Fix the broken refresh button on Graph View in RBAC UI

verdan commented on a change in pull request #4548: [AIRFLOW-3724] Fix the broken refresh button on Graph View in RBAC UI
URL: https://github.com/apache/airflow/pull/4548#discussion_r248752708
 
 

 ##########
 File path: airflow/www/templates/airflow/graph.html
 ##########
 @@ -112,8 +112,8 @@
     // Below variables are being used in dag.js
     var tasks = {{ tasks|safe }};
     var task_instances = {{ task_instances|safe }};
-    var getTaskInstanceURL = '{{ url_for("Airflow.task_instances", dag_id='+
-      dag.dag_id + ', execution_date=' + execution_date + ') }}';
+    var getTaskInstanceURL = "{{ url_for('Airflow.task_instances',
+      execution_date=execution_date)}}&dag_id={{dag.dag_id}}";
 
 Review comment:
   the way we are not using the `dag_id` as a parameter in url_for function and only using execution date is kinda confusing. Either we should use both as parameters or skip both. JS does not provide a proper way to use jinja template variables, so I'd suggest to use both variables outside the `url_for` function. 
   Something like:
   
   ```
       var getTaskInstanceURL = "{{ url_for('Airflow.task_instances') }}" +
                               "?dag_id=" + encodeURIComponent(dag_id) +
                               "&execution_date=" + encodeURIComponent(execution_date);
   ```

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