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_r277597088
########## File path: airflow/www/templates/airflow/dags.html ########## @@ -207,14 +214,21 @@ <h2>DAGs</h2> {% block tail %} {{ super() }} + <script src="{{ url_for_asset('utils.js') }}"></script> <script src="{{ url_for_asset('d3.min.js') }}"></script> <script src="{{ url_for_asset('jquery.dataTables.min.js') }}"></script> <script src="{{ url_for_asset('dataTables.bootstrap.min.js') }}"></script> <script src="{{ url_for_asset('bootstrap-toggle.min.js') }}"></script> <script src="{{ url_for_asset('bootstrap3-typeahead.min.js') }}"></script> <script> - const DAGS_INDEX = "{{ url_for('Airflow.index') }}"; + const DAGS_INDEX = getMetaValue('base-url-index'); + const BASE_URL_BLOCKED = getMetaValue('base-url-blocked'); + const BASE_URL_DAG_STATS = getMetaValue("base-url-dag-stats"); Review comment: In addition, your suggestion is not compatible with the code rules adopted in the project. This project follow the Airbnb recommendation https://github.com/apache/airflow/blob/master/CONTRIBUTING.md#javascript-style-guide > 2.1 Use const for all of your references; avoid using var. eslint: prefer-const, no-const-assign https://github.com/airbnb/javascript#references ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services