From 0b94ad875c33293d7ca594fdda1eef900379989c Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Fri, 4 Feb 2022 13:06:40 +0200 Subject: [PATCH 1/2] [Table] Not send hidden columns to the inspector --- src/plugins/vis_types/table/public/table_vis_fn.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/vis_types/table/public/table_vis_fn.ts b/src/plugins/vis_types/table/public/table_vis_fn.ts index 861923ef5086e..852107240ced8 100644 --- a/src/plugins/vis_types/table/public/table_vis_fn.ts +++ b/src/plugins/vis_types/table/public/table_vis_fn.ts @@ -126,6 +126,11 @@ export const createTableVisFn = (): TableExpressionFunctionDefinition => ({ }, fn(input, args, handlers) { const convertedData = tableVisResponseHandler(input, args); + const inspectorData = { + rows: convertedData?.table?.rows, + columns: convertedData?.table?.columns, + type: 'datatable', + } as Datatable; if (handlers?.inspectorAdapters?.tables) { const argsTable: Dimension[] = [ @@ -158,7 +163,7 @@ export const createTableVisFn = (): TableExpressionFunctionDefinition => ({ }), ]); } - const logTable = prepareLogTable(input, argsTable); + const logTable = prepareLogTable(inspectorData, argsTable); handlers.inspectorAdapters.tables.logDatatable('default', logTable); } return { From 9826ff5c368990d06605319c9fdb46739913dca7 Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Fri, 4 Feb 2022 14:17:54 +0200 Subject: [PATCH 2/2] Fix tests --- src/plugins/vis_types/table/public/table_vis_fn.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/vis_types/table/public/table_vis_fn.ts b/src/plugins/vis_types/table/public/table_vis_fn.ts index 852107240ced8..99c8992ff5984 100644 --- a/src/plugins/vis_types/table/public/table_vis_fn.ts +++ b/src/plugins/vis_types/table/public/table_vis_fn.ts @@ -127,8 +127,8 @@ export const createTableVisFn = (): TableExpressionFunctionDefinition => ({ fn(input, args, handlers) { const convertedData = tableVisResponseHandler(input, args); const inspectorData = { - rows: convertedData?.table?.rows, - columns: convertedData?.table?.columns, + rows: convertedData?.table?.rows ?? input.rows, + columns: convertedData?.table?.columns ?? input.columns, type: 'datatable', } as Datatable;