From f7f92c961df4131b92f1bd7cfc6bea770eddf30c Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Thu, 26 Jan 2017 17:36:51 -0500 Subject: [PATCH] Adding tags was creating this nested array structure which was causing buggy behavior. This should fix that. --- .../src/shared/smart-search/smart-search.controller.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 f3d2602a26..3f1c848628 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 @@ -212,7 +212,15 @@ export default ['$stateParams', '$scope', '$state', 'QuerySet', 'GetBasePath', ' params.page = '1'; queryset = _.merge(queryset, params, (objectValue, sourceValue, key, object) => { if (object[key] && object[key] !== sourceValue){ - return [object[key], sourceValue]; + if(_.isArray(object[key])) { + // Add the new value to the array and return + object[key].push(sourceValue); + return object[key]; + } + else { + // Start the array of keys + return [object[key], sourceValue]; + } } else { // // https://lodash.com/docs/3.10.1#merge