diff --git a/src/plugins/discover/public/application/main/components/chart/discover_chart.tsx b/src/plugins/discover/public/application/main/components/chart/discover_chart.tsx index bd0f637f14c71..8b6d1b5ce4f69 100644 --- a/src/plugins/discover/public/application/main/components/chart/discover_chart.tsx +++ b/src/plugins/discover/public/application/main/components/chart/discover_chart.tsx @@ -83,7 +83,7 @@ export function DiscoverChart({ if (!timeField) { return; } - triggerVisualizeActions(timeField, indexPattern.id, savedSearch.columns || []); + triggerVisualizeActions(timeField, indexPattern.id, savedSearch.columns || [], false); }, [indexPattern.id, savedSearch, timeField]); const onShowChartOptions = useCallback(() => { diff --git a/src/plugins/discover/public/application/main/components/sidebar/lib/visualize_trigger_utils.ts b/src/plugins/discover/public/application/main/components/sidebar/lib/visualize_trigger_utils.ts index 50ca2cae1bcc7..df035d5ac2903 100644 --- a/src/plugins/discover/public/application/main/components/sidebar/lib/visualize_trigger_utils.ts +++ b/src/plugins/discover/public/application/main/components/sidebar/lib/visualize_trigger_utils.ts @@ -46,7 +46,8 @@ async function getCompatibleActions( export function triggerVisualizeActions( field: DataViewField, indexPatternId: string | undefined, - contextualFields: string[] + contextualFields: string[], + shouldPassOriginatingApp: boolean = true ) { if (!indexPatternId) return; const trigger = getTriggerConstant(field.type); @@ -54,7 +55,11 @@ export function triggerVisualizeActions( indexPatternId, fieldName: field.name, contextualFields, - originatingApp: APP_ID, + ...(shouldPassOriginatingApp + ? { + originatingApp: APP_ID, + } + : {}), }; getUiActions().getTrigger(trigger).exec(triggerOptions); }