[TSVB] Support triggers only for timeseries chart (#100323)
* [TSVB] Support triggers only for timeseries chart * fix the type * Fix type falure Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
11b3ab167d
commit
7cfa0d2b06
|
@ -74,8 +74,11 @@ export const metricsVisDefinition = {
|
|||
showIndexSelection: false,
|
||||
},
|
||||
toExpressionAst,
|
||||
getSupportedTriggers: () => {
|
||||
return [VIS_EVENT_TO_TRIGGER.filter, VIS_EVENT_TO_TRIGGER.brush];
|
||||
getSupportedTriggers: (params?: VisParams) => {
|
||||
if (params?.type === PANEL_TYPES.TIMESERIES) {
|
||||
return [VIS_EVENT_TO_TRIGGER.filter, VIS_EVENT_TO_TRIGGER.brush];
|
||||
}
|
||||
return [];
|
||||
},
|
||||
inspectorAdapters: {},
|
||||
getUsedIndexPattern: async (params: VisParams) => {
|
||||
|
|
|
@ -420,7 +420,7 @@ export class VisualizeEmbeddable
|
|||
};
|
||||
|
||||
public supportedTriggers(): string[] {
|
||||
return this.vis.type.getSupportedTriggers?.() ?? [];
|
||||
return this.vis.type.getSupportedTriggers?.(this.vis.params) ?? [];
|
||||
}
|
||||
|
||||
inputIsRefType = (input: VisualizeInput): input is VisualizeByReferenceInput => {
|
||||
|
|
|
@ -91,7 +91,7 @@ export interface VisTypeDefinition<TVisParams> {
|
|||
/**
|
||||
* If given, it will return the supported triggers for this vis.
|
||||
*/
|
||||
readonly getSupportedTriggers?: () => string[];
|
||||
readonly getSupportedTriggers?: (params?: VisParams) => string[];
|
||||
|
||||
/**
|
||||
* Some visualizations are created without SearchSource and may change the used indexes during the visualization configuration.
|
||||
|
|
Loading…
Reference in a new issue