end
def html
- if filter.rows
+ # SONAR-3524
+ # If filter is empty, we return a empty result in order to be treated more easily
+ if filter.rows && !filter.rows.empty?
root = Treemap::Node.new(:id => -1, :label => '')
build_tree(root)
-
output = Sonar::HtmlOutput.new do |o|
# width in percents
o.width = 100
url: baseUrl + '/treemap/index?html_id=' + this.id + '&size_metric=' + this.sizeMetric + '&color_metric=' + this.colorMetric + '&resource=' + context.rid,
dataType: "html",
success: function (data) {
- self.rootNode().html(data);
- self.initNodes();
+ if (data.length > 1) {
+ self.rootNode().html(data);
+ self.initNodes();
+ } else {
+ // SONAR-3524
+ // When data is empty, do not display it and revert breadcrumb state
+ self.breadcrumb.pop();
+ }
$j("#tm-loading-" + self.id).hide();
}
});
self.breadcrumb.push(context);
self.load();
}
-
}
);
});