Skip to content

Commit

Permalink
change all the interface imports again as usual
Browse files Browse the repository at this point in the history
  • Loading branch information
oatkiller committed Dec 19, 2019
1 parent 61d8ec2 commit 85d987c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,13 @@ import {
IContainer,
Embeddable,
} from '../../../../../../src/plugins/embeddable/public';
import { HttpServiceBase } from '../../../../../../src/core/public';
import { HttpSetup } from '../../../../../../src/core/public';

export class ResolverEmbeddable extends Embeddable {
public readonly type = 'resolver';
private httpServiceBase: HttpServiceBase;
private httpService: HttpSetup;
private lastRenderTarget?: Element;
constructor(
initialInput: EmbeddableInput,
httpServiceBase: HttpServiceBase,
parent?: IContainer
) {
constructor(initialInput: EmbeddableInput, httpService: HttpSetup, parent?: IContainer) {
super(
// Input state is irrelevant to this embeddable, just pass it along.
initialInput,
Expand All @@ -33,7 +29,7 @@ export class ResolverEmbeddable extends Embeddable {
// Optional parent component, this embeddable can optionally be rendered inside a container.
parent
);
this.httpServiceBase = httpServiceBase;
this.httpService = httpService;
}

public render(node: HTMLElement) {
Expand All @@ -42,7 +38,7 @@ export class ResolverEmbeddable extends Embeddable {
}
this.lastRenderTarget = node;
// TODO, figure out how to destroy middleware
const { store } = storeFactory({ httpServiceBase: this.httpServiceBase });
const { store } = storeFactory({ httpServiceBase: this.httpService });
ReactDOM.render(<AppRoot store={store} />, node);
}

Expand Down
16 changes: 6 additions & 10 deletions x-pack/plugins/endpoint/public/embeddables/resolver/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,25 @@
*/

import { i18n } from '@kbn/i18n';
import { HttpServiceBase } from 'kibana/public';
import {
EmbeddableFactory,
EmbeddableInput,
IContainer,
} from '../../../../../../src/plugins/embeddable/public';
import { EmbeddableFactory, EmbeddableInput, IContainer } from 'src/plugins/embeddable/public';
import { HttpSetup } from 'kibana/public';
import { ResolverEmbeddable } from './';

export class ResolverEmbeddableFactory extends EmbeddableFactory {
public readonly type = 'resolver';
private httpServiceBase: HttpServiceBase;
private httpService: HttpSetup;

constructor(httpServiceBase: HttpServiceBase) {
constructor(httpService: HttpSetup) {
super();
this.httpServiceBase = httpServiceBase;
this.httpService = httpService;
}

public isEditable() {
return true;
}

public async create(initialInput: EmbeddableInput, parent?: IContainer) {
return new ResolverEmbeddable(initialInput, this.httpServiceBase, parent);
return new ResolverEmbeddable(initialInput, this.httpService, parent);
}

public getDisplayName() {
Expand Down

0 comments on commit 85d987c

Please sign in to comment.