diff --git a/CHANGELOG.md b/CHANGELOG.md index ad4b13c94b8b..8599b46b811f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -109,6 +109,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - [Region Maps] Add ui setting to configure custom vector map's size parameter([#3399](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3399)) - [Search Telemetry] Fixes search telemetry's observable object that won't be GC-ed([#3390](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3390)) - Clean up and rebuild `@osd/pm` ([#3570](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3570)) +- [Vega] Add Filter custom label for opensearchDashboardsAddFilter ([#3640](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3640)) ### 🚞 Infrastructure diff --git a/src/plugins/vis_type_vega/public/vega_view/vega_base_view.js b/src/plugins/vis_type_vega/public/vega_view/vega_base_view.js index 1286495af901..0f46e7bf9d8e 100644 --- a/src/plugins/vis_type_vega/public/vega_view/vega_base_view.js +++ b/src/plugins/vis_type_vega/public/vega_view/vega_base_view.js @@ -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] }); }