Skip to content

Commit ec5e928

Browse files
Fix for heat map tooltips with angular ui bootstrap upgrade
1 parent 32b831e commit ec5e928

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/charts/heatmap/heatmap.directive.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,11 +313,11 @@ angular.module('patternfly.charts').directive('pfHeatmap', function ($compile, $
313313
return i % numberOfRows * blockSize;
314314
}).attr('width', fillSize).attr('height', fillSize).style('fill', function (d) {
315315
return color(d.value);
316-
}).attr('tooltip-html-unsafe', function (d, i) { //tooltip-html is throwing an exception
316+
}).attr('uib-tooltip-html', function (d, i) { //tooltip-html is throwing an exception
317317
if (scope.rangeOnHover && fillSize <= scope.rangeHoverSize) {
318-
return rangeTooltip(d.value);
318+
return '"' + rangeTooltip(d.value) + '"';
319319
}
320-
return d.tooltip;
320+
return "'" + d.tooltip + "'";
321321
}).attr('tooltip-append-to-body', function (d, i) {
322322
return true;
323323
}).attr('tooltip-animation', function (d, i) {

test/charts/heatmap/heatmap.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ describe('Directive: pfHeatmap', function() {
4949
element = compileChart('<div pf-heatmap chart-title="title" data="data"></div>',$scope);
5050

5151
block = angular.element(element).find('.heatmap-pf-svg').children().first();
52-
tooltip = block.attr('tooltip-html-unsafe');
52+
tooltip = block.attr('uib-tooltip-html');
5353

54-
expect(tooltip).toBe('Node 8 : My OpenShift Provider<br>96% : 96 Used of 100 Total<br>4 Available');
54+
expect(tooltip).toBe("'Node 8 : My OpenShift Provider<br>96% : 96 Used of 100 Total<br>4 Available'");
5555

5656
color = block.attr('style');
5757
var result = color.trim() == 'fill: #ce0000;' || color.trim() == 'fill: rgb(206, 0, 0);';

0 commit comments

Comments
 (0)