Skip to content

Commit

Permalink
switch back to "x to y" format for ranges
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Aug 12, 2015
1 parent cf45558 commit 0bbfc6c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/ui/public/agg_types/__tests__/buckets/_range.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ describe('Range Agg', function () {
var format = function (val) {
return agg.fieldFormatter()(agg.getKey(val));
};
expect(format(buckets[0])).to.be('[-∞, 1 KB)');
expect(format(buckets[1])).to.be('[1 KB, 2.5 KB)');
expect(format(buckets[2])).to.be('[2.5 KB, +∞)');
expect(format(buckets[0])).to.be('-∞ to 1 KB');
expect(format(buckets[1])).to.be('1 KB to 2.5 KB');
expect(format(buckets[2])).to.be('2.5 KB to +∞');

});
});
Expand Down
2 changes: 1 addition & 1 deletion src/ui/public/agg_types/buckets/range.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ define(function (require) {

var RangeFormat = FieldFormat.from(function (range) {
var format = agg.fieldOwnFormatter();
return `[${format(range.gte)}, ${format(range.lt)})`;
return `${format(range.gte)} to ${format(range.lt)}`;
});

return (this.$$rangeAggTypeFormat = new RangeFormat());
Expand Down
2 changes: 1 addition & 1 deletion src/ui/public/filter_bar/__tests__/mapAndFlattenFilters.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('Filter Bar Directive', function () {
expect(results[2].meta).to.have.property('key', 'query');
expect(results[2].meta).to.have.property('value', 'foo:bar');
expect(results[3].meta).to.have.property('key', 'bytes');
expect(results[3].meta).to.have.property('value', '[1,024, 2,048)');
expect(results[3].meta).to.have.property('value', '1,024 to 2,048');
expect(results[4].meta).to.have.property('key', '_type');
expect(results[4].meta).to.have.property('value', 'apache');
done();
Expand Down
4 changes: 2 additions & 2 deletions src/ui/public/filter_bar/__tests__/mapRange.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('Filter Bar Directive', function () {
var filter = { meta: { index: 'logstash-*' }, range: { bytes: { lt: 2048, gt: 1024 } } };
mapRange(filter).then(function (result) {
expect(result).to.have.property('key', 'bytes');
expect(result).to.have.property('value', '[1,024, 2,048)');
expect(result).to.have.property('value', '1,024 to 2,048');
done();
});
$rootScope.$apply();
Expand All @@ -34,7 +34,7 @@ describe('Filter Bar Directive', function () {
var filter = { meta: { index: 'logstash-*' }, range: { bytes: { lte: 2048, gte: 1024 } } };
mapRange(filter).then(function (result) {
expect(result).to.have.property('key', 'bytes');
expect(result).to.have.property('value', '[1,024, 2,048)');
expect(result).to.have.property('value', '1,024 to 2,048');
done();
});
$rootScope.$apply();
Expand Down
2 changes: 1 addition & 1 deletion src/ui/public/filter_bar/lib/mapRange.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ define(function (require) {

return {
key: key,
value: `[${convert(left)}, ${convert(right)})`
value: `${convert(left)} to ${convert(right)}`
};
});

Expand Down

0 comments on commit 0bbfc6c

Please sign in to comment.