mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 18:09:57 -03:30
Fixed a few search related bugs based on PR review feedback
This commit is contained in:
parent
46491a59e6
commit
18fcfee96d
@ -1830,7 +1830,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
|
||||
// smart-search directive
|
||||
html += `
|
||||
<div
|
||||
ng-hide="${itm}.length === 0 && (${collection.iterator}_searchTags | isEmpty)">
|
||||
ng-hide="${itm}.length === 0 && (searchTags | isEmpty)">
|
||||
<smart-search
|
||||
django-model="${itm}"
|
||||
search-size="${width}"
|
||||
@ -1855,7 +1855,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
|
||||
html += `
|
||||
<div
|
||||
class="row"
|
||||
ng-show="${itm}.length === 0 && !(${collection.iterator}_searchTags | isEmpty)">
|
||||
ng-show="${itm}.length === 0 && !(searchTags | isEmpty)">
|
||||
<div class="col-lg-12 List-searchNoResults">
|
||||
No records matched your search.
|
||||
</div>
|
||||
@ -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 += `<div ng-hide="is_superuser">`;
|
||||
html += `<div class="List-noItems" ng-show="${itm}.length === 0 && (${collection.iterator}_searchTags | isEmpty)"> ${emptyListText} </div>`;
|
||||
html += `<div class="List-noItems" ng-show="${itm}.length === 0 && (searchTags | isEmpty)"> ${emptyListText} </div>`;
|
||||
html += '</div>';
|
||||
|
||||
html += `
|
||||
|
||||
@ -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];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user