From 324dbc2600323002fbde899c47310b871d7e14fc Mon Sep 17 00:00:00 2001 From: shilpa Date: Sun, 19 Aug 2018 22:48:00 -0700 Subject: [PATCH] option to remove filter with custom value --- dist/datasource.js | 9 +++++++++ src/datasource.js | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/dist/datasource.js b/dist/datasource.js index 391064e6..faa519fe 100644 --- a/dist/datasource.js +++ b/dist/datasource.js @@ -322,6 +322,15 @@ function (angular, _, dateMath, moment) { var replacedFilters = filters.map(function (filter) { return filterTemplateExpanders[filter.type](filter); }) + .filter(function(filter) { + if(filter.pattern) + return filter.pattern!="_REMOVE_FILTER_" + else if(filter.value) + return filter.value!="_REMOVE_FILTER_" + else + return true + } + ) .map(function (filter) { var finalFilter = _.omit(filter, 'negate'); if (filter.negate) { diff --git a/src/datasource.js b/src/datasource.js index 47f6ec01..b5477bbe 100644 --- a/src/datasource.js +++ b/src/datasource.js @@ -322,6 +322,15 @@ function (angular, _, dateMath, moment) { var replacedFilters = filters.map(function (filter) { return filterTemplateExpanders[filter.type](filter); }) + .filter(function(filter) { + if(filter.pattern) + return filter.pattern!="_REMOVE_FILTER_" + else if(filter.value) + return filter.value!="_REMOVE_FILTER_" + else + return true + } + ) .map(function (filter) { var finalFilter = _.omit(filter, 'negate'); if (filter.negate) {