This is an automated email from the ASF dual-hosted git repository.
bbovenzi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 8745fb9 Fix: Add taskgroup tooltip to graph view (#19083)
8745fb9 is described below
commit 8745fb903069ac6174134d52513584538a2b8657
Author: Brent Bovenzi <[email protected]>
AuthorDate: Tue Oct 19 13:08:27 2021 -0500
Fix: Add taskgroup tooltip to graph view (#19083)
---
airflow/www/static/js/graph.js | 6 +++++-
airflow/www/views.py | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/airflow/www/static/js/graph.js b/airflow/www/static/js/graph.js
index 6671eae..2790e10 100644
--- a/airflow/www/static/js/graph.js
+++ b/airflow/www/static/js/graph.js
@@ -451,8 +451,12 @@ function groupTooltip(node, tis) {
});
const groupDuration =
convertSecsToHumanReadable(moment(maxEnd).diff(minStart, 'second'));
+ const tooltipText = node.tooltip ? `<p>${node.tooltip}</p>` : '';
- let tt = `<strong>Duration:</strong> ${groupDuration} <br><br>`;
+ let tt = `
+ ${tooltipText}
+ <strong>Duration:</strong> ${groupDuration} <br><br>
+ `;
numMap.forEach((key, val) => {
if (key > 0) {
tt += `<strong>${escapeHtml(val)}:</strong> ${key} <br>`;
diff --git a/airflow/www/views.py b/airflow/www/views.py
index 009846f..72e2929 100644
--- a/airflow/www/views.py
+++ b/airflow/www/views.py
@@ -276,8 +276,8 @@ def task_group_to_dict(task_group):
'rx': 5,
'ry': 5,
'clusterLabelPos': 'top',
+ 'tooltip': task_group.tooltip,
},
- 'tooltip': task_group.tooltip,
'children': children,
}