Skip to content

Commit

Permalink
refactor: 💡 remove expressions plugin dependency on inspector
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Apr 17, 2020
1 parent 38a5498 commit 8dd2b67
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 18 deletions.
3 changes: 1 addition & 2 deletions src/plugins/expressions/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"server": true,
"ui": true,
"requiredPlugins": [
"bfetch",
"inspector"
"bfetch"
]
}
13 changes: 2 additions & 11 deletions src/plugins/expressions/public/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@

import { BehaviorSubject, Observable, Subject } from 'rxjs';
import { filter, map } from 'rxjs/operators';
import { Adapters, InspectorSession } from '../../inspector/public';
import { Adapters } from '../../inspector/public';
import { IExpressionLoaderParams } from './types';
import { ExpressionAstExpression } from '../common';
import { ExecutionContract } from '../common/execution/execution_contract';

import { ExpressionRenderHandler } from './render';
import { getInspector, getExpressionsService } from './services';
import { getExpressionsService } from './services';

type Data = any;

Expand Down Expand Up @@ -121,15 +121,6 @@ export class ExpressionLoader {
return this.renderHandler.getElement();
}

openInspector(title: string): InspectorSession | undefined {
const inspector = this.inspect();
if (inspector) {
return getInspector().open(inspector, {
title,
});
}
}

inspect(): Adapters | undefined {
return this.execution ? (this.execution.inspect() as Adapters) : undefined;
}
Expand Down
2 changes: 0 additions & 2 deletions src/plugins/expressions/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import { Setup as InspectorSetup, Start as InspectorStart } from '../../inspecto
import { BfetchPublicSetup, BfetchPublicStart } from '../../bfetch/public';
import {
setCoreStart,
setInspector,
setInterpreter,
setRenderersRegistry,
setNotifications,
Expand Down Expand Up @@ -182,7 +181,6 @@ export class ExpressionsPublicPlugin

public start(core: CoreStart, { inspector, bfetch }: ExpressionsStartDeps): ExpressionsStart {
setCoreStart(core);
setInspector(inspector);
setNotifications(core.notifications);

const { expressions } = this;
Expand Down
3 changes: 0 additions & 3 deletions src/plugins/expressions/public/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,11 @@
import { NotificationsStart } from 'kibana/public';
import { createKibanaUtilsCore, createGetterSetter } from '../../kibana_utils/public';
import { ExpressionInterpreter } from './types';
import { Start as IInspector } from '../../inspector/public';
import { ExpressionsSetup } from './plugin';
import { ExpressionsService } from '../common';

export const { getCoreStart, setCoreStart } = createKibanaUtilsCore();

export const [getInspector, setInspector] = createGetterSetter<IInspector>('Inspector');

export const [getInterpreter, setInterpreter] = createGetterSetter<ExpressionInterpreter>(
'Interpreter'
);
Expand Down

0 comments on commit 8dd2b67

Please sign in to comment.