Skip to content

Commit

Permalink
Return back savedSearchId into vis object
Browse files Browse the repository at this point in the history
  • Loading branch information
sulemanof committed Mar 11, 2020
1 parent 85e40c0 commit b45bd07
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,11 @@ function VisualizeAppController(
const handleLinkedSearch = linked => {
if (linked && !savedVis.savedSearchId && savedSearch) {
savedVis.savedSearchId = savedSearch.id;
vis.savedSearchId = savedSearch.id;
searchSource.setParent(savedSearch.searchSource);
} else if (!linked && savedVis.savedSearchId) {
delete savedVis.savedSearchId;
delete vis.savedSearchId;
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ export interface Vis {
aggs: Array<{ [key: string]: any }>;
};

/**
* If a visualization based on the saved search,
* the id is necessary for building an expression function in src/plugins/expressions/common/expression_functions/specs/kibana_context.ts
*/
savedSearchId?: string;

// Since we haven't typed everything here yet, we basically "any" the rest
// of that interface. This should be removed as soon as this type definition
// has been completed. But that way we at least have typing for a couple of
Expand Down

0 comments on commit b45bd07

Please sign in to comment.