From 0b4aec8d8a43086a3073d3fb282c8841b2d944c9 Mon Sep 17 00:00:00 2001 From: Uladzislau Lasitsa Date: Wed, 26 Jan 2022 15:49:01 +0300 Subject: [PATCH] Don't log table from heatmap if we in lens --- .../common/expression_functions/heatmap_function.ts | 3 ++- .../editor_frame/workspace_panel/workspace_panel.tsx | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_function.ts b/src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_function.ts index 8a4d16ae3bfbd..5068782ede44e 100644 --- a/src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_function.ts +++ b/src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_function.ts @@ -143,7 +143,8 @@ export const heatmapFunction = (): HeatmapExpressionFunctionDefinition => ({ }, }, fn(data, args, handlers) { - if (handlers?.inspectorAdapters?.tables) { + // as in lens we've already calling logDatatable for heatmap we shouldn't do it here + if (handlers?.inspectorAdapters?.tables && handlers?.getExecutionContext?.()?.type !== 'lens') { const argsTable: Dimension[] = []; if (args.valueAccessor) { prepareHeatmapLogTable( diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx index 6752c0ae03cea..2d82ef50d5371 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx @@ -630,6 +630,12 @@ export const VisualizationWrapper = ({ onData$={onData$} inspectorAdapters={lensInspector.adapters} renderMode="edit" + executionContext={{ + type: 'lens', + name: '', + id: '', + description: '', + }} renderError={(errorMessage?: string | null, error?: ExpressionRenderError | null) => { const errorsFromRequest = getOriginalRequestErrorMessages(error); const visibleErrorMessages = errorsFromRequest.length