diff --git a/awx/ui/client/src/shared/form-generator.js b/awx/ui/client/src/shared/form-generator.js index 63146ce890..e9d6597001 100644 --- a/awx/ui/client/src/shared/form-generator.js +++ b/awx/ui/client/src/shared/form-generator.js @@ -1830,7 +1830,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat // smart-search directive html += `
+ ng-hide="${itm}.length === 0 && (searchTags | isEmpty)"> + ng-show="${itm}.length === 0 && !(searchTags | isEmpty)">
No records matched your search.
@@ -1865,7 +1865,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat // Show the "no items" box when loading is done and the user isn't actively searching and there are no results var emptyListText = (collection.emptyListText) ? collection.emptyListText : i18n._("PLEASE ADD ITEMS TO THIS LIST"); html += `
`; - html += `
${emptyListText}
`; + html += `
${emptyListText}
`; html += '
'; html += ` 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 1ec198c18d..b601813a72 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 @@ -85,12 +85,19 @@ export default ['$stateParams', '$scope', '$state', 'QuerySet', 'GetBasePath', ' else { encodeParams.searchTerm = true; } + removed = qs.encodeParam(encodeParams); + } + else { + removed = setDefaults(tagToRemove); } - removed = qs.encodeParam(encodeParams); } _.each(removed, (value, key) => { if (Array.isArray(queryset[key])){ _.remove(queryset[key], (item) => item === value); + // If the array is now empty, remove that key + if(queryset[key].length === 0) { + delete queryset[key]; + } } else { delete queryset[key];