From 47f743e623bff25bfe51c374ac354445b1d24d23 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Tue, 17 Oct 2017 17:40:28 -0700 Subject: [PATCH] fixing removeTerm for smart search to work --- .../src/shared/smart-search/smart-search.controller.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/awx/ui/client/src/shared/smart-search/smart-search.controller.js b/awx/ui/client/src/shared/smart-search/smart-search.controller.js index dc06e56207..d77d8d90cc 100644 --- a/awx/ui/client/src/shared/smart-search/smart-search.controller.js +++ b/awx/ui/client/src/shared/smart-search/smart-search.controller.js @@ -375,10 +375,11 @@ export default ['$stateParams', '$scope', '$state', 'GetBasePath', 'QuerySet', ' removed = searchWithoutKey(termParts[termParts.length-1]); } } - removeFromQuerySet(queryset); + let cleared = _.cloneDeep(queryset); + removeFromQuerySet(cleared); if(!$scope.querySet) { $state.go('.', { - [$scope.iterator + '_search']: queryset }).then(function(){ + [$scope.iterator + '_search']: cleared }).then(function(){ // ISSUE: for some reason deleting a tag from a list in a modal does not // remove the param from $stateParams. Here we'll manually check to make sure // that that happened and remove it if it didn't.