This is an automated email from the ASF dual-hosted git repository.

jedcunningham pushed a commit to branch v2-2-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 4d0a03d37ec0581e8f2082aacf2ace8810e48d16
Author: Brent Bovenzi <[email protected]>
AuthorDate: Wed Oct 20 15:38:49 2021 -0500

    Hide tooltip when next run is none (#19112)
    
    * Hide Next Run when it is None
    
    Check for `is not none` instead of `is defined` when showing the next run 
tooltip
    
    * check next_dagrun is defined and not none
    
    (cherry picked from commit e6fcf7776a298cff741d8a55f0990ea796fd0540)
---
 airflow/www/static/js/dag.js           | 10 ++++++----
 airflow/www/templates/airflow/dag.html |  3 ++-
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/airflow/www/static/js/dag.js b/airflow/www/static/js/dag.js
index d0b329a..6fb7176 100644
--- a/airflow/www/static/js/dag.js
+++ b/airflow/www/static/js/dag.js
@@ -279,10 +279,12 @@ $('#pause_resume').on('change', function onChange() {
 $('#next-run').on('mouseover', () => {
   $('#next-run').attr('data-original-title', () => {
     let newTitle = '';
-    newTitle += `<strong>Run After:</strong> 
${formatDateTime(nextRun.createAfter)}<br><br>`;
-    newTitle += '<strong>Data Interval</strong><br>';
-    newTitle += `Start: ${formatDateTime(nextRun.intervalStart)}<br>`;
-    newTitle += `End: ${formatDateTime(nextRun.intervalEnd)}`;
+    if (nextRun.createAfter) newTitle += `<strong>Run After:</strong> 
${formatDateTime(nextRun.createAfter)}<br><br>`;
+    if (nextRun.intervalStart && nextRun.intervalEnd) {
+      newTitle += '<strong>Data Interval</strong><br>';
+      newTitle += `Start: ${formatDateTime(nextRun.intervalStart)}<br>`;
+      newTitle += `End: ${formatDateTime(nextRun.intervalEnd)}`;
+    }
     return newTitle;
   });
 });
diff --git a/airflow/www/templates/airflow/dag.html 
b/airflow/www/templates/airflow/dag.html
index 6d4aaee..a88e3d4 100644
--- a/airflow/www/templates/airflow/dag.html
+++ b/airflow/www/templates/airflow/dag.html
@@ -36,7 +36,8 @@
   <meta name="extra_links_url" content="{{ url_for('Airflow.extra_links') }}">
   <meta name="paused_url" content="{{ url_for('Airflow.paused') }}">
   <meta name="tree_data" content="{{ url_for('Airflow.tree_data') }}">
-  {% if dag_model is defined and dag_model.next_dagrun_create_after is defined 
%}
+  {%
+    if dag_model is defined and dag_model.next_dagrun_create_after is defined 
and dag_model.next_dagrun_create_after is not none %}
     <meta name="next_dagrun_create_after" content="{{ 
dag_model.next_dagrun_create_after }}">
     <meta name="next_dagrun_data_interval_start" content="{{ 
dag_model.next_dagrun_data_interval_start }}">
     <meta name="next_dagrun_data_interval_end" content="{{ 
dag_model.next_dagrun_data_interval_end }}">

Reply via email to