Skip to content

Commit

Permalink
removes extraHandlers (#58336)
Browse files Browse the repository at this point in the history
  • Loading branch information
ppisljar authored Feb 24, 2020
1 parent 12f35d5 commit 63d5e38
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,7 @@ export class VisualizeEmbeddable extends Embeddable<VisualizeInput, VisualizeOut
query: this.input.query,
filters: this.input.filters,
},
extraHandlers: {
uiState: this.uiState,
},
uiState: this.uiState,
};
this.expression = await buildPipeline(this.vis, {
searchSource: this.savedVisualization.searchSource,
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/expressions/public/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export class ExpressionLoader {
};

private render(data: Data): void {
this.renderHandler.render(data, this.params.extraHandlers);
this.renderHandler.render(data, this.params.uiState);
}

private setParams(params?: IExpressionLoaderParams) {
Expand All @@ -182,8 +182,8 @@ export class ExpressionLoader {
this.params.searchContext || {}
) as any;
}
if (params.extraHandlers && this.params) {
this.params.extraHandlers = params.extraHandlers;
if (params.uiState && this.params) {
this.params.uiState = params.uiState;
}
if (params.variables && this.params) {
this.params.variables = params.variables;
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/expressions/public/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export class ExpressionRenderHandler {
};
}

render = async (data: any, extraHandlers: IExpressionRendererExtraHandlers = {}) => {
render = async (data: any, uiState: any = {}) => {
if (!data || typeof data !== 'object') {
return this.handleRenderError(new Error('invalid data provided to the expression renderer'));
}
Expand All @@ -119,7 +119,7 @@ export class ExpressionRenderHandler {
.get(data.as)!
.render(this.element, data.value, {
...this.handlers,
...extraHandlers,
uiState,
} as any);
} catch (e) {
return this.handleRenderError(e);
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/expressions/public/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export interface IExpressionLoaderParams {
disableCaching?: boolean;
customFunctions?: [];
customRenderers?: [];
extraHandlers?: Record<string, any>;
uiState?: unknown;
inspectorAdapters?: Adapters;
onRenderError?: RenderErrorHandlerFnType;
}
Expand Down

0 comments on commit 63d5e38

Please sign in to comment.