From 9f36ad8fb47087a5b39d5ce49d5999d93d1f51b0 Mon Sep 17 00:00:00 2001 From: Wylie Conlon Date: Wed, 26 Feb 2020 15:10:05 -0500 Subject: [PATCH 1/3] Fix formatter on range aggregation --- src/plugins/data/public/field_formats/utils/deserialize.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/data/public/field_formats/utils/deserialize.ts b/src/plugins/data/public/field_formats/utils/deserialize.ts index c10ebfbe3eb1e..4af108799467b 100644 --- a/src/plugins/data/public/field_formats/utils/deserialize.ts +++ b/src/plugins/data/public/field_formats/utils/deserialize.ts @@ -76,7 +76,8 @@ export const deserializeFieldFormat: FormatFactory = function( const { id } = mapping; if (id === 'range') { const RangeFormat = FieldFormat.from((range: any) => { - const format = getFieldFormat(this, id, mapping.params); + const nestedFormatter = mapping.params as SerializedFieldFormat; + const format = getFieldFormat(this, nestedFormatter.id, nestedFormatter.params); const gte = '\u2265'; const lt = '\u003c'; return i18n.translate('data.aggTypes.buckets.ranges.rangesFormatMessage', { From 07507e4a57032b64c015ef5409e62afb918382d3 Mon Sep 17 00:00:00 2001 From: Wylie Conlon Date: Wed, 26 Feb 2020 17:11:10 -0500 Subject: [PATCH 2/3] Fix test that was using unformatted byte ranges --- test/functional/apps/visualize/_data_table.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/functional/apps/visualize/_data_table.js b/test/functional/apps/visualize/_data_table.js index 0a9ff1e77a2ef..450b895bb839c 100644 --- a/test/functional/apps/visualize/_data_table.js +++ b/test/functional/apps/visualize/_data_table.js @@ -99,9 +99,9 @@ export default function({ getService, getPageObjects }) { async function expectValidTableData() { const data = await PageObjects.visChart.getTableVisData(); expect(data.trim().split('\n')).to.be.eql([ - '≥ 0 and < 1000', + '≥ 0B and < 1,000B', '1,351 64.7%', - '≥ 1000 and < 2000', + '≥ 1,000B and < 1.953KB', '737 35.3%', ]); } @@ -144,9 +144,9 @@ export default function({ getService, getPageObjects }) { const data = await PageObjects.visChart.getTableVisData(); expect(data.trim().split('\n')).to.be.eql([ - '≥ 0 and < 1000', + '≥ 0B and < 1,000B', '344.094B', - '≥ 1000 and < 2000', + '≥ 1,000B and < 1.953KB', '1.697KB', ]); }); From 56d658299848603c72b9246a74fb0d70d32128bb Mon Sep 17 00:00:00 2001 From: Wylie Conlon Date: Fri, 20 Mar 2020 12:31:41 -0400 Subject: [PATCH 3/3] Fix test --- test/functional/apps/visualize/_data_table.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/functional/apps/visualize/_data_table.js b/test/functional/apps/visualize/_data_table.js index 450b895bb839c..a6305e158007d 100644 --- a/test/functional/apps/visualize/_data_table.js +++ b/test/functional/apps/visualize/_data_table.js @@ -248,9 +248,9 @@ export default function({ getService, getPageObjects }) { await PageObjects.visEditor.clickGo(); const data = await PageObjects.visChart.getTableVisData(); expect(data.trim().split('\n')).to.be.eql([ - '≥ 0 and < 1000', + '≥ 0B and < 1,000B', '1,351', - '≥ 1000 and < 2000', + '≥ 1,000B and < 1.953KB', '737', ]); });