diff --git a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operation_definitions/terms.test.tsx b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operation_definitions/terms.test.tsx index 057fc25f84b3b..94411e13fb63c 100644 --- a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operation_definitions/terms.test.tsx +++ b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operation_definitions/terms.test.tsx @@ -32,7 +32,7 @@ describe('terms', () => { operationType: 'terms', params: { orderBy: { type: 'alphabetical' }, - size: 5, + size: 3, orderDirection: 'asc', }, sourceField: 'category', @@ -64,7 +64,7 @@ describe('terms', () => { params: expect.objectContaining({ orderBy: '_key', field: 'category', - size: 5, + size: 3, }), }) ); @@ -108,7 +108,7 @@ describe('terms', () => { operationType: 'terms', params: { orderBy: { type: 'column', columnId: 'col1' }, - size: 5, + size: 3, orderDirection: 'asc', }, sourceField: 'category', @@ -139,7 +139,7 @@ describe('terms', () => { operationType: 'terms', params: { orderBy: { type: 'column', columnId: 'col1' }, - size: 5, + size: 3, orderDirection: 'asc', }, sourceField: 'category', @@ -165,7 +165,7 @@ describe('terms', () => { operationType: 'terms', params: { orderBy: { type: 'column', columnId: 'col1' }, - size: 5, + size: 3, orderDirection: 'asc', }, sourceField: 'category', @@ -344,7 +344,7 @@ describe('terms', () => { ); - expect(instance.find(EuiRange).prop('value')).toEqual(5); + expect(instance.find(EuiRange).prop('value')).toEqual(3); }); it('should update state with the size value', () => { diff --git a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operation_definitions/terms.tsx b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operation_definitions/terms.tsx index bbab3efdb6b30..912a532621d43 100644 --- a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operation_definitions/terms.tsx +++ b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operation_definitions/terms.tsx @@ -34,6 +34,8 @@ function isSortableByColumn(column: IndexPatternColumn) { return !column.isBucketed && column.operationType !== 'filter_ratio'; } +const DEFAULT_SIZE = 3; + export const termsOperation: OperationDefinition = { type: 'terms', displayName: i18n.translate('xpack.lens.indexPattern.terms', { @@ -65,7 +67,7 @@ export const termsOperation: OperationDefinition = { isBucketed: true, indexPatternId, params: { - size: 5, + size: DEFAULT_SIZE, orderBy: existingMetricColumn ? { type: 'column', columnId: existingMetricColumn } : { type: 'alphabetical' },