Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions airflow/www/static/js/graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,19 @@ let innerSvg = d3.select('#graph-svg g');
const updateNodeLabels = (node, instances) => {
let haveLabelsChanged = false;
let { label } = node.value;
// Check if there is a count of mapped instances
if ((tasks[node.id] && tasks[node.id].is_mapped) || node.value.isMapped) {
const id = !!node.children && node.children.length ? node.children[0].id : node.value.id;

let count = ' ';
const isGroupMapped = node.value.isMapped;
const isTaskMapped = tasks[node.id] && tasks[node.id].is_mapped;

if (isTaskMapped || isGroupMapped) {
// get count from mapped_states or the first child's mapped_states
const id = isGroupMapped ? node.children[0].id : node.id;
const instance = instances[id];
let count = ' ';

// TODO: update this count for when we can nest mapped tasks inside of mapped task groups
if (instances[node.id] && instances[node.id].mapped_states) {
count = instances[node.id].mapped_states.length;
} else if (id && instances[id]) {
count = instances[id].mapped_states.length;
if (instance && instance.mapped_states) {
count = instance.mapped_states.length;
}

if (!label.includes(`[${count}]`)) {
Expand Down