From 3b4c17d19e4c0b7a6f3c739c282fbff85eab0dd6 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Thu, 8 Aug 2019 13:11:40 -0600 Subject: [PATCH] [Maps] fix bug with draw filters in maps application (#42956) (#42968) --- x-pack/legacy/plugins/maps/public/angular/map_controller.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/x-pack/legacy/plugins/maps/public/angular/map_controller.js b/x-pack/legacy/plugins/maps/public/angular/map_controller.js index eac8912522529..829af62f45604 100644 --- a/x-pack/legacy/plugins/maps/public/angular/map_controller.js +++ b/x-pack/legacy/plugins/maps/public/angular/map_controller.js @@ -52,7 +52,7 @@ import { MAP_SAVED_OBJECT_TYPE, MAP_APP_PATH } from '../../common/constants'; - +import { FilterStateStore } from '@kbn/es-query'; import { setup as data } from '../../../../../../src/legacy/core_plugins/data/public/legacy'; const REACT_ANCHOR_DOM_ELEMENT_ID = 'react-maps-root'; @@ -170,6 +170,9 @@ app.controller('GisMapController', ($scope, $route, kbnUrl, localStorage, AppSta }; function addFilters(newFilters) { + newFilters.forEach(filter => { + filter.$state = FilterStateStore.APP_STATE; + }); $scope.updateFiltersAndDispatch([...$scope.filters, ...newFilters]); }