Skip to content

Commit

Permalink
Replace "Save and return" button with "Save" for Lens visualization c…
Browse files Browse the repository at this point in the history
…reated from Discover histogram to avoid confusion
  • Loading branch information
DianaDerevyankina committed Mar 31, 2022
1 parent cef1d43 commit 05064c6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,20 @@ 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);
const triggerOptions = {
indexPatternId,
fieldName: field.name,
contextualFields,
originatingApp: APP_ID,
...(shouldPassOriginatingApp
? {
originatingApp: APP_ID,
}
: {}),
};
getUiActions().getTrigger(trigger).exec(triggerOptions);
}
Expand Down

0 comments on commit 05064c6

Please sign in to comment.