diff --git a/packages/kbn-discover-utils/src/utils/build_data_record.test.ts b/packages/kbn-discover-utils/src/utils/build_data_record.test.ts index 275261a8a10ce..93b5b623ac13d 100644 --- a/packages/kbn-discover-utils/src/utils/build_data_record.test.ts +++ b/packages/kbn-discover-utils/src/utils/build_data_record.test.ts @@ -23,7 +23,7 @@ describe('Data table record utils', () => { describe('buildDataTableRecordList', () => { test('should return a list of DataTableRecord', () => { const result = buildDataTableRecordList({ - docs: esHitsMock, + records: esHitsMock, dataView: dataViewMock, }); result.forEach((doc) => { @@ -36,7 +36,7 @@ describe('Data table record utils', () => { test('should support processing each record', () => { const result = buildDataTableRecordList({ - docs: esHitsMock, + records: esHitsMock, dataView: dataViewMock, processRecord: (record) => ({ ...record, id: 'custom-id' }), }); diff --git a/packages/kbn-discover-utils/src/utils/build_data_record.ts b/packages/kbn-discover-utils/src/utils/build_data_record.ts index 18019bdf924b5..7c64b71cf5138 100644 --- a/packages/kbn-discover-utils/src/utils/build_data_record.ts +++ b/packages/kbn-discover-utils/src/utils/build_data_record.ts @@ -32,19 +32,19 @@ export function buildDataTableRecord( /** * Helper to build multiple DataTableRecords at once, saved a bit of testing code lines - * @param docs Array of documents returned from Elasticsearch + * @param records Array of documents returned from Elasticsearch * @param dataView this current data view */ export function buildDataTableRecordList({ - docs, + records, dataView, processRecord, }: { - docs: EsHitRecord[]; + records: EsHitRecord[]; dataView?: DataView; processRecord?: (record: DataTableRecord) => T; }): DataTableRecord[] { - return docs.map((doc) => { + return records.map((doc) => { const record = buildDataTableRecord(doc, dataView); return processRecord ? processRecord(record) : record; }); diff --git a/src/plugins/discover/public/application/context/services/context.predecessors.test.ts b/src/plugins/discover/public/application/context/services/context.predecessors.test.ts index 5d403e7971dfa..fe562b33e5770 100644 --- a/src/plugins/discover/public/application/context/services/context.predecessors.test.ts +++ b/src/plugins/discover/public/application/context/services/context.predecessors.test.ts @@ -104,7 +104,7 @@ describe('context predecessors', function () { expect(mockSearchSource.fetch$.calledOnce).toBe(true); expect(rows).toEqual( buildDataTableRecordList({ - docs: mockSearchSource._stubHits.slice(0, 3), + records: mockSearchSource._stubHits.slice(0, 3), dataView, }) ); @@ -139,7 +139,7 @@ describe('context predecessors', function () { expect(intervals.length).toBeGreaterThan(1); expect(rows).toEqual( buildDataTableRecordList({ - docs: mockSearchSource._stubHits.slice(0, 3), + records: mockSearchSource._stubHits.slice(0, 3), dataView, }) ); @@ -178,7 +178,7 @@ describe('context predecessors', function () { expect(rows).toEqual( buildDataTableRecordList({ - docs: mockSearchSource._stubHits.slice(-3), + records: mockSearchSource._stubHits.slice(-3), dataView, }) ); @@ -271,7 +271,7 @@ describe('context predecessors', function () { expect(setFieldsSpy.calledOnce).toBe(true); expect(rows).toEqual( buildDataTableRecordList({ - docs: mockSearchSource._stubHits.slice(0, 3), + records: mockSearchSource._stubHits.slice(0, 3), dataView, }) ); diff --git a/src/plugins/discover/public/application/context/services/context.successors.test.ts b/src/plugins/discover/public/application/context/services/context.successors.test.ts index f05dfc4c7493a..39cc05bd76571 100644 --- a/src/plugins/discover/public/application/context/services/context.successors.test.ts +++ b/src/plugins/discover/public/application/context/services/context.successors.test.ts @@ -105,7 +105,7 @@ describe('context successors', function () { expect(mockSearchSource.fetch$.calledOnce).toBe(true); expect(rows).toEqual( buildDataTableRecordList({ - docs: mockSearchSource._stubHits.slice(-3), + records: mockSearchSource._stubHits.slice(-3), dataView, }) ); @@ -140,7 +140,7 @@ describe('context successors', function () { expect(intervals.length).toBeGreaterThan(1); expect(rows).toEqual( buildDataTableRecordList({ - docs: mockSearchSource._stubHits.slice(-3), + records: mockSearchSource._stubHits.slice(-3), dataView, }) ); @@ -173,7 +173,7 @@ describe('context successors', function () { expect(intervals.length).toBeGreaterThan(1); expect(rows).toEqual( buildDataTableRecordList({ - docs: mockSearchSource._stubHits.slice(0, 4), + records: mockSearchSource._stubHits.slice(0, 4), dataView, }) ); @@ -262,7 +262,7 @@ describe('context successors', function () { expect(mockSearchSource.fetch$.calledOnce).toBe(true); expect(rows).toEqual( buildDataTableRecordList({ - docs: mockSearchSource._stubHits.slice(-3), + records: mockSearchSource._stubHits.slice(-3), dataView, }) ); @@ -337,7 +337,7 @@ describe('context successors', function () { expect(mockSearchSource.fetch$.calledOnce).toBe(true); expect(rows).toEqual( buildDataTableRecordList({ - docs: mockSearchSource._stubHits.slice(-3), + records: mockSearchSource._stubHits.slice(-3), dataView, }) ); diff --git a/src/plugins/discover/public/application/main/data_fetching/fetch_documents.ts b/src/plugins/discover/public/application/main/data_fetching/fetch_documents.ts index 3e75be23ec667..bcacf1aef8a87 100644 --- a/src/plugins/discover/public/application/main/data_fetching/fetch_documents.ts +++ b/src/plugins/discover/public/application/main/data_fetching/fetch_documents.ts @@ -67,7 +67,7 @@ export const fetchDocuments = ( filter((res) => !isRunningResponse(res)), map((res) => { return buildDataTableRecordList({ - docs: res.rawResponse.hits.hits, + records: res.rawResponse.hits.hits, dataView, processRecord: (record) => services.profilesManager.resolveDocumentProfile({ record }), }); diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/documents_table.tsx b/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/documents_table.tsx index 20cd3f9a6171f..6d21c3331ed3e 100644 --- a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/documents_table.tsx +++ b/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/documents_table.tsx @@ -98,7 +98,7 @@ export function DocumentsTable({ {loading && }