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/02/28 18:51:59 UTC
[GitHub] mik-laj commented on a change in pull request #4787: [AIRFLOW-3967]
Extract Jinja directive from Javascript
mik-laj commented on a change in pull request #4787: [AIRFLOW-3967] Extract Jinja directive from Javascript
URL: https://github.com/apache/airflow/pull/4787#discussion_r261334485
##########
File path: airflow/www/templates/airflow/graph.html
##########
@@ -103,15 +113,16 @@
var initialStrokeWidth = '3px';
var highlightStrokeWidth = '5px';
- var nodes = {{ nodes|safe }};
- var edges = {{ edges|safe }};
- var execution_date = "{{ execution_date }}";
- var arrange = "{{ arrange }}";
+ var nodes = JSON.parse(getMetaValue('nodes'));
+ var edges = JSON.parse(getMetaValue('edges'));
+ var execution_date = getMetaValue('execution-date');
+ var arrange = getMetaValue('arrange');
+ var tasks = JSON.parse(getMetaValue('tasks'));
+ var task_instances = JSON.parse(getMetaValue('task-instances'));
Review comment:
I would like to introduce it in a separate PR. I have a PR in queue, which introduce linting for all JS (*.js, *.html). This allows me to deal with the problem globally instead of making changes only locally. Solving the problem locally will not be permanent, so it should only be used when there is no other possibility.
----------------------------------------------------------------
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