diff --git a/x-pack/legacy/plugins/lens/public/editor_frame_plugin/mocks.tsx b/x-pack/legacy/plugins/lens/public/editor_frame_plugin/mocks.tsx index 79dff5bddb882..456951e7d2d26 100644 --- a/x-pack/legacy/plugins/lens/public/editor_frame_plugin/mocks.tsx +++ b/x-pack/legacy/plugins/lens/public/editor_frame_plugin/mocks.tsx @@ -48,9 +48,6 @@ export function createMockDatasource(): DatasourceMock { getOperationForColumnId: jest.fn(), renderDimensionPanel: jest.fn(), renderLayerPanel: jest.fn(), - removeColumnInTableSpec: jest.fn(), - moveColumnTo: jest.fn(), - duplicateColumn: jest.fn(), }; return { diff --git a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/indexpattern.test.ts b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/indexpattern.test.ts index d998437f3e492..e7def3b9dbf2c 100644 --- a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/indexpattern.test.ts +++ b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/indexpattern.test.ts @@ -433,61 +433,6 @@ describe('IndexPattern Data Source', () => { }); }); - describe('removeColumnInTableSpec', () => { - it('should remove the specified column', async () => { - const initialState = await indexPatternDatasource.initialize(persistedState); - const setState = jest.fn(); - const sampleColumn: IndexPatternColumn = { - dataType: 'number', - isBucketed: false, - label: 'foo', - operationType: 'max', - sourceField: 'baz', - suggestedPriority: 0, - }; - const columns: Record = { - a: { - ...sampleColumn, - suggestedPriority: 0, - }, - b: { - ...sampleColumn, - suggestedPriority: 1, - }, - c: { - ...sampleColumn, - suggestedPriority: 2, - }, - }; - const api = indexPatternDatasource.getPublicAPI({ - state: { - ...initialState, - layers: { - first: { - ...initialState.layers.first, - columns, - columnOrder: ['a', 'b', 'c'], - }, - }, - }, - setState, - layerId: 'first', - dateRange: { - fromDate: 'now-1y', - toDate: 'now', - }, - }); - - api.removeColumnInTableSpec('b'); - - expect(setState.mock.calls[0][0].layers.first.columnOrder).toEqual(['a', 'c']); - expect(setState.mock.calls[0][0].layers.first.columns).toEqual({ - a: columns.a, - c: columns.c, - }); - }); - }); - describe('getOperationForColumnId', () => { it('should get an operation for col1', () => { expect(publicAPI.getOperationForColumnId('col1')).toEqual({ 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 443667ab64476..7a413f24f243a 100644 --- a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/indexpattern.tsx +++ b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/indexpattern.tsx @@ -89,12 +89,6 @@ export function uniqueLabels(layers: Record) { return columnLabelMap; } -function removeProperty(prop: string, object: Record): Record { - const result = { ...object }; - delete result[prop]; - return result; -} - export function getIndexPatternDatasource({ chrome, core, @@ -268,22 +262,6 @@ export function getIndexPatternDatasource({ domElement ); }, - - removeColumnInTableSpec: (columnId: string) => { - setState({ - ...state, - layers: { - ...state.layers, - [layerId]: { - ...state.layers[layerId], - columnOrder: state.layers[layerId].columnOrder.filter(id => id !== columnId), - columns: removeProperty(columnId, state.layers[layerId].columns), - }, - }, - }); - }, - moveColumnTo: () => {}, - duplicateColumn: () => [], }; }, getDatasourceSuggestionsForField(state, draggedField) { diff --git a/x-pack/legacy/plugins/lens/public/types.ts b/x-pack/legacy/plugins/lens/public/types.ts index 36d30fa1a6d48..8c1e90643ca7a 100644 --- a/x-pack/legacy/plugins/lens/public/types.ts +++ b/x-pack/legacy/plugins/lens/public/types.ts @@ -157,10 +157,6 @@ export interface DatasourcePublicAPI { // Render can be called many times renderDimensionPanel: (domElement: Element, props: DatasourceDimensionPanelProps) => void; renderLayerPanel: (domElement: Element, props: DatasourceLayerPanelProps) => void; - - removeColumnInTableSpec: (columnId: string) => void; - moveColumnTo: (columnId: string, targetIndex: number) => void; - duplicateColumn: (columnId: string) => TableSpec; } export interface TableSpecColumn {