Skip to content

Commit

Permalink
[Vega] Add Filter custom label for opensearchDashboardsAddFilter (#3640)
Browse files Browse the repository at this point in the history
* [Vega] Add Filter custom label for opensearchDashboardsAddFilter

Signed-off-by: Aswath <it.aswath@gmail.com>

Co-authored-by: Josh Romero <rmerqg@amazon.com>

---------

Signed-off-by: Aswath <it.aswath@gmail.com>
Co-authored-by: Josh Romero <rmerqg@amazon.com>
(cherry picked from commit 276fae9)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and joshuarrrr committed Mar 24, 2023
1 parent 9ef6622 commit 584d840
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/plugins/vis_type_vega/public/vega_view/vega_base_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,15 @@ export class VegaBaseView {
/**
* @param {object} query Query DSL snippet, as used in the query DSL editor
* @param {string} [index] as defined in OpenSearch Dashboards, or default if missing
* @param {string} alias OpenSearch Query DSL's custom label for `opensearchDashboardsAddFilter`, as used in '+ Add Filter'
*/
async addFilterHandler(query, index) {
async addFilterHandler(query, index, alias) {
const indexId = await this.findIndex(Utils.handleNonStringIndex(index));
const filter = opensearchFilters.buildQueryFilter(Utils.handleInvalidQuery(query), indexId);
const filter = opensearchFilters.buildQueryFilter(
Utils.handleInvalidQuery(query),
indexId,
alias
);
this._applyFilter({ filters: [filter] });
}

Expand Down

0 comments on commit 584d840

Please sign in to comment.