diff --git a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/datapanel.test.tsx b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/datapanel.test.tsx index da6d567d971d91..6e37f736d738de 100644 --- a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/datapanel.test.tsx +++ b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/datapanel.test.tsx @@ -35,7 +35,6 @@ const initialState: IndexPatternPrivateState = { type: 'alphabetical', }, }, - indexPatternId: '1', }, }, }, diff --git a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/dimension_panel/dimension_panel.test.tsx b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/dimension_panel/dimension_panel.test.tsx index aaa8a1668175f3..ee916e8f1a9c5d 100644 --- a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/dimension_panel/dimension_panel.test.tsx +++ b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/dimension_panel/dimension_panel.test.tsx @@ -96,7 +96,6 @@ describe('IndexPatternDimensionPanel', () => { interval: '1d', }, sourceField: 'timestamp', - indexPatternId: '1', }, }, }, @@ -207,7 +206,6 @@ describe('IndexPatternDimensionPanel', () => { // Private operationType: 'max', sourceField: 'bytes', - indexPatternId: '1', }, }, }, @@ -249,7 +247,6 @@ describe('IndexPatternDimensionPanel', () => { // Private operationType: 'max', sourceField: 'bytes', - indexPatternId: '1', }, }, }, @@ -288,7 +285,6 @@ describe('IndexPatternDimensionPanel', () => { // Private operationType: 'max', sourceField: 'bytes', - indexPatternId: '1', }, }, }, @@ -373,7 +369,6 @@ describe('IndexPatternDimensionPanel', () => { // Private operationType: 'max', sourceField: 'bytes', - indexPatternId: '1', }, }, }, @@ -713,7 +708,6 @@ describe('IndexPatternDimensionPanel', () => { // Private operationType: 'max', sourceField: 'bytes', - indexPatternId: '1', }, }, }, @@ -819,7 +813,6 @@ describe('IndexPatternDimensionPanel', () => { interval: '1d', }, sourceField: 'timestamp', - indexPatternId: 'foo', }, }, }, diff --git a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/indexpattern.test.tsx b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/indexpattern.test.tsx index 402c7cf3f5f123..ea1be14b39e06f 100644 --- a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/indexpattern.test.tsx +++ b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/indexpattern.test.tsx @@ -165,7 +165,6 @@ describe('IndexPattern Data Source', () => { orderBy: { type: 'alphabetical' }, orderDirection: 'asc', }, - indexPatternId: '1', }, }, }, @@ -221,7 +220,6 @@ describe('IndexPattern Data Source', () => { // Private operationType: 'count', - indexPatternId: '1', }, col2: { label: 'Date', @@ -234,7 +232,6 @@ describe('IndexPattern Data Source', () => { params: { interval: '1d', }, - indexPatternId: '1', }, }, }, @@ -610,7 +607,6 @@ describe('IndexPattern Data Source', () => { columns: { col1: { dataType: 'string', - indexPatternId: '1', isBucketed: true, sourceField: 'source', label: 'values of source', @@ -623,7 +619,6 @@ describe('IndexPattern Data Source', () => { }, col2: { dataType: 'number', - indexPatternId: '1', isBucketed: false, sourceField: 'bytes', label: 'Min of bytes', @@ -647,7 +642,6 @@ describe('IndexPattern Data Source', () => { columns: { col1: { dataType: 'date', - indexPatternId: '1', isBucketed: true, sourceField: 'timestamp', label: 'date histogram of timestamp', @@ -658,7 +652,6 @@ describe('IndexPattern Data Source', () => { }, col2: { dataType: 'number', - indexPatternId: '1', isBucketed: false, sourceField: 'bytes', label: 'Min of bytes', @@ -1101,7 +1094,6 @@ describe('IndexPattern Data Source', () => { operationType: 'max', sourceField: 'baz', suggestedPriority: 0, - indexPatternId: '1', }; const columns: Record = { a: { diff --git a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/indexpattern.tsx b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/indexpattern.tsx index 663e50891099a4..330c143abc87a7 100644 --- a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/indexpattern.tsx +++ b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/indexpattern.tsx @@ -50,7 +50,6 @@ export interface BaseIndexPatternColumn { // Private operationType: OperationType; suggestedPriority?: DimensionPriority; - indexPatternId: string; } type Omit = Pick>; diff --git a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operation_definitions/count.tsx b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operation_definitions/count.tsx index c9437d6427985e..8006af3ccc38d1 100644 --- a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operation_definitions/count.tsx +++ b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operation_definitions/count.tsx @@ -22,7 +22,7 @@ export const countOperation: OperationDefinition = { }, ]; }, - buildColumn({ suggestedPriority, indexPatternId }) { + buildColumn({ suggestedPriority }) { return { label: i18n.translate('xpack.lens.indexPattern.countOf', { defaultMessage: 'Count of documents', @@ -31,7 +31,6 @@ export const countOperation: OperationDefinition = { operationType: 'count', suggestedPriority, isBucketed: false, - indexPatternId, }; }, toEsAggsConfig: (column, columnId) => ({ diff --git a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operation_definitions/date_histogram.test.tsx b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operation_definitions/date_histogram.test.tsx index 1a214209c4c18c..f5fa7ff0a07323 100644 --- a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operation_definitions/date_histogram.test.tsx +++ b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operation_definitions/date_histogram.test.tsx @@ -62,7 +62,6 @@ describe('date_histogram', () => { interval: 'w', }, sourceField: 'timestamp', - indexPatternId: '1', }, }, }, @@ -81,7 +80,6 @@ describe('date_histogram', () => { interval: 'd', }, sourceField: 'other_timestamp', - indexPatternId: '2', }, }, }, @@ -95,7 +93,6 @@ describe('date_histogram', () => { columns: {}, suggestedPriority: 0, layerId: 'first', - indexPatternId: '1', field: { name: 'timestamp', type: 'date', @@ -112,7 +109,6 @@ describe('date_histogram', () => { columns: {}, suggestedPriority: 0, layerId: 'first', - indexPatternId: '1', field: { name: 'timestamp', type: 'date', diff --git a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operation_definitions/date_histogram.tsx b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operation_definitions/date_histogram.tsx index 0f3cf60fa2ca94..ed81f4656711ec 100644 --- a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operation_definitions/date_histogram.tsx +++ b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operation_definitions/date_histogram.tsx @@ -51,11 +51,9 @@ export const dateHistogramOperation: OperationDefinition { numerator: { query: '', language: 'kuery' }, denominator: { query: '', language: 'kuery' }, }, - indexPatternId: '1', }, }, }, @@ -70,7 +69,6 @@ describe('filter_ratio', () => { describe('buildColumn', () => { it('should create column object with default params', () => { const column = filterRatioOperation.buildColumn({ - indexPatternId: '1', layerId: 'first', columns: {}, suggestedPriority: undefined, diff --git a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operation_definitions/filter_ratio.tsx b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operation_definitions/filter_ratio.tsx index eb3bc28d35b7f5..3881adc302c867 100644 --- a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operation_definitions/filter_ratio.tsx +++ b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operation_definitions/filter_ratio.tsx @@ -27,7 +27,7 @@ export const filterRatioOperation: OperationDefinition( } return []; }, - buildColumn({ suggestedPriority, field, indexPatternId }): T { + buildColumn({ suggestedPriority, field }): T { if (!field) { throw new Error(`Invariant: A ${type} operation can only be built with a field`); } @@ -45,7 +45,6 @@ function buildMetricOperation( suggestedPriority, sourceField: field ? field.name : '', isBucketed: false, - indexPatternId, } as T; }, toEsAggsConfig: (column, columnId) => ({ 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 63209e8ad1a771..f6e54009adaaeb 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 @@ -37,7 +37,6 @@ describe('terms', () => { orderDirection: 'asc', }, sourceField: 'category', - indexPatternId: '1', }, col2: { label: 'Count', @@ -46,7 +45,6 @@ describe('terms', () => { // Private operationType: 'count', - indexPatternId: '1', }, }, }, @@ -76,7 +74,6 @@ describe('terms', () => { it('should use existing metric column as order column', () => { const termsColumn = termsOperation.buildColumn({ layerId: 'first', - indexPatternId: '1', suggestedPriority: undefined, columns: { col1: { @@ -86,7 +83,6 @@ describe('terms', () => { // Private operationType: 'count', - indexPatternId: '1', }, }, }); @@ -113,7 +109,6 @@ describe('terms', () => { orderDirection: 'asc', }, sourceField: 'category', - indexPatternId: '1', }; const updatedColumn = termsOperation.onOtherColumnChanged!(initialColumn, { col1: { @@ -123,7 +118,6 @@ describe('terms', () => { // Private operationType: 'count', - indexPatternId: '1', }, }); expect(updatedColumn).toBe(initialColumn); @@ -144,7 +138,6 @@ describe('terms', () => { orderDirection: 'asc', }, sourceField: 'category', - indexPatternId: '1', }, {} ); @@ -170,7 +163,6 @@ describe('terms', () => { orderDirection: 'asc', }, sourceField: 'category', - indexPatternId: '1', }, { col1: { @@ -184,7 +176,6 @@ describe('terms', () => { interval: 'w', }, sourceField: 'timestamp', - indexPatternId: '1', }, } ); @@ -241,7 +232,6 @@ describe('terms', () => { numerator: { query: '', language: 'kuery' }, denominator: { query: '', language: 'kuery' }, }, - indexPatternId: '1', }, }, }, 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 912a532621d439..2f9863547bf84a 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 @@ -53,7 +53,7 @@ export const termsOperation: OperationDefinition = { } return []; }, - buildColumn({ suggestedPriority, columns, field, indexPatternId }) { + buildColumn({ suggestedPriority, columns, field }) { const existingMetricColumn = Object.entries(columns) .filter(([_columnId, column]) => column && isSortableByColumn(column)) .map(([id]) => id)[0]; @@ -65,7 +65,6 @@ export const termsOperation: OperationDefinition = { suggestedPriority, sourceField: field ? field.name : '', isBucketed: true, - indexPatternId, params: { size: DEFAULT_SIZE, orderBy: existingMetricColumn diff --git a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operations.test.ts b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operations.test.ts index 9fff0e0fdb7e31..cdc3b040beb052 100644 --- a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operations.test.ts +++ b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operations.test.ts @@ -169,7 +169,6 @@ describe('getOperationTypesForField', () => { interval: '1d', }, sourceField: 'timestamp', - indexPatternId: '1', }, }, }, diff --git a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operations.ts b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operations.ts index 6e953692588dbc..e9045c3666ecbc 100644 --- a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operations.ts +++ b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operations.ts @@ -75,7 +75,6 @@ export interface OperationDefinition { buildColumn: (arg: { suggestedPriority: DimensionPriority | undefined; layerId: string; - indexPatternId: string; columns: Partial>; field?: IndexPatternField; }) => C; @@ -189,6 +188,5 @@ export function buildColumn({ suggestedPriority, field, layerId, - indexPatternId: indexPattern.id, }); } diff --git a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/state_helpers.test.ts b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/state_helpers.test.ts index 43b59298d0f86e..b90ba469518d4f 100644 --- a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/state_helpers.test.ts +++ b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/state_helpers.test.ts @@ -31,7 +31,6 @@ describe('state_helpers', () => { orderDirection: 'asc', size: 5, }, - indexPatternId: '', }; const state: IndexPatternPrivateState = { @@ -50,7 +49,6 @@ describe('state_helpers', () => { // Private operationType: 'count', - indexPatternId: '1', }, }, }, @@ -78,7 +76,6 @@ describe('state_helpers', () => { orderDirection: 'asc', size: 5, }, - indexPatternId: '', }; const state: IndexPatternPrivateState = { @@ -97,7 +94,6 @@ describe('state_helpers', () => { // Private operationType: 'count', - indexPatternId: '1', }, }, }, @@ -129,7 +125,6 @@ describe('state_helpers', () => { interval: '1d', }, sourceField: 'timestamp', - indexPatternId: '1', }; const state: IndexPatternPrivateState = { @@ -173,7 +168,6 @@ describe('state_helpers', () => { // Private operationType: 'avg', sourceField: 'bytes', - indexPatternId: '1', }, col2: { label: 'Max of bytes', @@ -183,7 +177,6 @@ describe('state_helpers', () => { // Private operationType: 'max', sourceField: 'bytes', - indexPatternId: '1', }, }, }, @@ -205,7 +198,6 @@ describe('state_helpers', () => { interval: '1d', }, sourceField: 'timestamp', - indexPatternId: '1', }, }) ).toEqual({ @@ -238,7 +230,6 @@ describe('state_helpers', () => { params: { interval: 'h', }, - indexPatternId: '1', }, }, }, @@ -260,7 +251,6 @@ describe('state_helpers', () => { params: { interval: 'w', }, - indexPatternId: '1', }, }).layers.first.columns.col1 ).toEqual( @@ -284,7 +274,6 @@ describe('state_helpers', () => { orderDirection: 'asc', size: 5, }, - indexPatternId: '1', }; const newColumn: AvgIndexPatternColumn = { @@ -295,7 +284,6 @@ describe('state_helpers', () => { // Private operationType: 'avg', sourceField: 'bytes', - indexPatternId: '1', }; const state: IndexPatternPrivateState = { @@ -314,7 +302,6 @@ describe('state_helpers', () => { // Private operationType: 'count', - indexPatternId: '1', }, }, }, @@ -354,7 +341,6 @@ describe('state_helpers', () => { params: { interval: 'h', }, - indexPatternId: '1', }, }) ).toEqual(['col1']); @@ -378,7 +364,6 @@ describe('state_helpers', () => { }, orderDirection: 'asc', }, - indexPatternId: '1', }, col2: { label: 'Average of bytes', @@ -388,7 +373,6 @@ describe('state_helpers', () => { // Private operationType: 'avg', sourceField: 'bytes', - indexPatternId: '1', }, col3: { label: 'Date Histogram of timestamp', @@ -401,7 +385,6 @@ describe('state_helpers', () => { params: { interval: '1d', }, - indexPatternId: '1', }, }) ).toEqual(['col1', 'col3', 'col2']); @@ -426,7 +409,6 @@ describe('state_helpers', () => { orderDirection: 'asc', }, suggestedPriority: 2, - indexPatternId: '1', }, col2: { label: 'Average of bytes', @@ -437,7 +419,6 @@ describe('state_helpers', () => { operationType: 'avg', sourceField: 'bytes', suggestedPriority: 0, - indexPatternId: '1', }, col3: { label: 'Date Histogram of timestamp', @@ -451,7 +432,6 @@ describe('state_helpers', () => { params: { interval: '1d', }, - indexPatternId: '1', }, }) ).toEqual(['col3', 'col1', 'col2']);