You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2020/06/29 13:21:41 UTC

[airflow] 35/37: Ensure "started"/"ended" in tooltips are not shown if job not started (#8667)

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

potiuk pushed a commit to branch v1-10-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 99c1f71f1d70d974f984c6d19eed6f9a83c20a07
Author: Xiaodong DENG <xd...@hotmail.com>
AuthorDate: Sat May 2 21:12:06 2020 +0200

    Ensure "started"/"ended" in tooltips are not shown if job not started (#8667)
    
    (cherry-picked from 0954140)
---
 airflow/www_rbac/static/js/task-instances.js | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/airflow/www_rbac/static/js/task-instances.js b/airflow/www_rbac/static/js/task-instances.js
index 8b49700..8b25c4f 100644
--- a/airflow/www_rbac/static/js/task-instances.js
+++ b/airflow/www_rbac/static/js/task-instances.js
@@ -30,6 +30,10 @@ function makeDateTimeHTML(start, end) {
 }
 
 function generateTooltipDateTimes(startDate, endDate, dagTZ) {
+  if (!startDate) {
+    return '<br><em>Not yet started</em>';
+  }
+
   const tzFormat = 'z (Z)';
   const localTZ = moment.defaultZone.name;
   startDate = moment.utc(startDate);
@@ -37,11 +41,6 @@ function generateTooltipDateTimes(startDate, endDate, dagTZ) {
   dagTZ = dagTZ.toUpperCase();
 
   // Generate UTC Start and End Date
-  if (!startDate) {
-    return '<br><em>Not yet started</em>';
-  }
-
-  // Generate UTC Start and End Date
   let tooltipHTML = `<br><strong>UTC:</strong><br>`;
   tooltipHTML += makeDateTimeHTML(startDate, endDate);