Skip to content

Commit

Permalink
Using custom label to replace field name
Browse files Browse the repository at this point in the history
  • Loading branch information
ycombinator committed Apr 22, 2016
1 parent 4680853 commit b0e8d7c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ui/public/agg_types/__tests__/metrics/percentiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('AggTypeMetricPercentilesProvider class', function () {
let responseAggs = aggTypeMetricPercentiles.getResponseAggs(aggConfig);
let ninetyFifthPercentileLabel = responseAggs[0].makeLabel();

expect(ninetyFifthPercentileLabel).to.be('95th prince of bytes');
expect(ninetyFifthPercentileLabel).to.be('95th percentile of prince');
});

});
4 changes: 2 additions & 2 deletions src/ui/public/agg_types/metrics/percentiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export default function AggTypeMetricPercentilesProvider(Private) {

let valueProps = {
makeLabel: function () {
let label = this.params.customLabel || 'percentile';
return ordinalSuffix(this.key) + ' ' + label + ' of ' + this.fieldDisplayName();
const label = this.params.customLabel || this.fieldDisplayName();
return ordinalSuffix(this.key) + ' percentile of ' + label;
}
};

Expand Down

0 comments on commit b0e8d7c

Please sign in to comment.