From 175778f9c10b13e2f4264cf37202954391e76468 Mon Sep 17 00:00:00 2001 From: Alexey Antonov Date: Tue, 12 May 2020 11:24:03 +0300 Subject: [PATCH] Inspect action shows on dashboard for every chart (#65998) Closes: #60372 --- .../public/embeddable/visualize_embeddable.ts | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts b/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts index 10704514ab8d5..f5a840c480aa1 100644 --- a/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts +++ b/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts @@ -71,6 +71,8 @@ export interface VisualizeOutput extends EmbeddableOutput { type ExpressionLoader = InstanceType; +const visTypesWithoutInspector = ['markdown', 'input_control_vis', 'metrics', 'vega', 'timelion']; + export class VisualizeEmbeddable extends Embeddable { private handler?: ExpressionLoader; private timefilter: TimefilterContract; @@ -126,7 +128,7 @@ export class VisualizeEmbeddable extends Embeddable { - if (!this.handler) { + if (!this.handler || visTypesWithoutInspector.includes(this.vis.type.name)) { return undefined; } return this.handler.inspect(); @@ -215,19 +217,7 @@ export class VisualizeEmbeddable extends Embeddable { - const visTypesWithoutInspector = [ - 'markdown', - 'input_control_vis', - 'metrics', - 'vega', - 'timelion', - ]; - if (visTypesWithoutInspector.includes(this.vis.type.name)) { - return false; - } - return this.getInspectorAdapters(); - }; + hasInspector = () => Boolean(this.getInspectorAdapters()); /** *