Skip to content

Commit

Permalink
Inspect action shows on dashboard for every chart (elastic#65998)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexwizp committed May 12, 2020
1 parent b96e57d commit 175778f
Showing 1 changed file with 4 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ export interface VisualizeOutput extends EmbeddableOutput {

type ExpressionLoader = InstanceType<ExpressionsStart['ExpressionLoader']>;

const visTypesWithoutInspector = ['markdown', 'input_control_vis', 'metrics', 'vega', 'timelion'];

export class VisualizeEmbeddable extends Embeddable<VisualizeInput, VisualizeOutput> {
private handler?: ExpressionLoader;
private timefilter: TimefilterContract;
Expand Down Expand Up @@ -126,7 +128,7 @@ export class VisualizeEmbeddable extends Embeddable<VisualizeInput, VisualizeOut
}

public getInspectorAdapters = () => {
if (!this.handler) {
if (!this.handler || visTypesWithoutInspector.includes(this.vis.type.name)) {
return undefined;
}
return this.handler.inspect();
Expand Down Expand Up @@ -215,19 +217,7 @@ export class VisualizeEmbeddable extends Embeddable<VisualizeInput, VisualizeOut

// this is a hack to make editor still work, will be removed once we clean up editor
// @ts-ignore
hasInspector = () => {
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());

/**
*
Expand Down

0 comments on commit 175778f

Please sign in to comment.