bbovenzi commented on a change in pull request #16931:
URL: https://github.com/apache/airflow/pull/16931#discussion_r729075558
##########
File path: airflow/www/templates/airflow/dag.html
##########
@@ -91,11 +91,15 @@ <h4 class="pull-right" style="user-select:
none;-moz-user-select: auto;">
<a class="label label-default" href="{{ url_for('DagRunModelView.list')
}}?_flt_3_dag_id={{ dag.dag_id }}">
Schedule: {{ dag.schedule_interval }}
</a>
+ {% if dag.timetable.interval_description is not none %}
+ <span id="schedule-description-{{ dag.safe_dag_id }}"
class="material-icons text-muted js-tooltip" aria-hidden="true"
data-original-title="Runs: {{ dag.timetable.interval_description|string
}}">info</span>
+ {% endif %}
Review comment:
There are a few parts in views.py that you can see we sometimes need to
access both a DAG and DagModel.
https://github.com/apache/airflow/blob/main/airflow/www/views.py#L2409
##########
File path: airflow/www/templates/airflow/dag.html
##########
@@ -91,11 +91,15 @@ <h4 class="pull-right" style="user-select:
none;-moz-user-select: auto;">
<a class="label label-default" href="{{ url_for('DagRunModelView.list')
}}?_flt_3_dag_id={{ dag.dag_id }}">
Schedule: {{ dag.schedule_interval }}
</a>
+ {% if dag.timetable.interval_description is not none %}
+ <span id="schedule-description-{{ dag.safe_dag_id }}"
class="material-icons text-muted js-tooltip" aria-hidden="true"
data-original-title="Runs: {{ dag.timetable.interval_description|string
}}">info</span>
+ {% endif %}
Review comment:
There are a few parts in views.py that you can see we sometimes need to
access both a DAG and DagModel.
https://github.com/apache/airflow/blob/main/airflow/www/views.py#L2357
##########
File path: airflow/www/templates/airflow/dag.html
##########
@@ -91,11 +91,15 @@ <h4 class="pull-right" style="user-select:
none;-moz-user-select: auto;">
<a class="label label-default" href="{{ url_for('DagRunModelView.list')
}}?_flt_3_dag_id={{ dag.dag_id }}">
Schedule: {{ dag.schedule_interval }}
</a>
+ {% if dag.timetable.interval_description is not none %}
+ <span id="schedule-description-{{ dag.safe_dag_id }}"
class="material-icons text-muted js-tooltip" aria-hidden="true"
data-original-title="Runs: {{ dag.timetable.interval_description|string
}}">info</span>
+ {% endif %}
Review comment:
Oh nooo. Link is correct now
##########
File path: airflow/www/templates/airflow/dags.html
##########
@@ -190,6 +190,11 @@ <h2>{{ page_title }}</h2>
<a class="label label-default schedule" href="{{
url_for('DagRunModelView.list') }}?_flt_3_dag_id={{ dag.dag_id }}"
data-dag-id="{{ dag.dag_id }}">
{{ dag.schedule_interval }}
</a>
+
+ {% if dag.timetable_description is not none %}
+ <span id="schedule-description-{{ dag.safe_dag_id }}"
class="material-icons text-muted js-tooltip" aria-hidden="true"
data-original-title="Schedule: {{ dag.timetable_description|string
}}">info</span>
+ {% endif %}
+
Review comment:
Nitpick: Let's remove the empty lines but indent the content inside of
the `if` statement
##########
File path: airflow/www/templates/airflow/dags.html
##########
@@ -190,6 +190,11 @@ <h2>{{ page_title }}</h2>
<a class="label label-default schedule" href="{{
url_for('DagRunModelView.list') }}?_flt_3_dag_id={{ dag.dag_id }}"
data-dag-id="{{ dag.dag_id }}">
{{ dag.schedule_interval }}
</a>
+
+ {% if dag.timetable_description is not none %}
+ <span id="schedule-description-{{ dag.safe_dag_id }}"
class="material-icons text-muted js-tooltip" aria-hidden="true"
data-original-title="Schedule: {{ dag.timetable_description|string
}}">info</span>
+ {% endif %}
+
Review comment:
Also, what are we using the `id` for?
##########
File path: airflow/www/templates/airflow/dag.html
##########
@@ -91,11 +91,15 @@ <h4 class="pull-right" style="user-select:
none;-moz-user-select: auto;">
<a class="label label-default" href="{{ url_for('DagRunModelView.list')
}}?_flt_3_dag_id={{ dag.dag_id }}">
Schedule: {{ dag.schedule_interval }}
</a>
+ {% if dag_model is defined and dag_model.timetable_description is not
none %}
+ <span class="material-icons text-muted js-tooltip"
aria-hidden="true" data-original-title="Schedule: {{
dag_model.timetable_description|string }}">info</span>
+ {% endif %}
{% if dag_model is defined and dag_model.next_dagrun is defined %}
<p class="label label-default js-tooltip" style="margin-left: 5px"
id="next-run" data-html="true" data-placement="bottom">
Next Run: <time datetime="{{ dag_model.next_dagrun }}">{{
dag_model.next_dagrun }}</time>
</p>
{% endif %}
+
Review comment:
Let's remove this new line too.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]