mirror of
https://github.com/ansible/awx.git
synced 2026-02-20 12:40:06 -03:30
Fixed a few search related bugs based on PR review feedback
This commit is contained in:
@@ -1830,7 +1830,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
|
|||||||
// smart-search directive
|
// smart-search directive
|
||||||
html += `
|
html += `
|
||||||
<div
|
<div
|
||||||
ng-hide="${itm}.length === 0 && (${collection.iterator}_searchTags | isEmpty)">
|
ng-hide="${itm}.length === 0 && (searchTags | isEmpty)">
|
||||||
<smart-search
|
<smart-search
|
||||||
django-model="${itm}"
|
django-model="${itm}"
|
||||||
search-size="${width}"
|
search-size="${width}"
|
||||||
@@ -1855,7 +1855,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
|
|||||||
html += `
|
html += `
|
||||||
<div
|
<div
|
||||||
class="row"
|
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">
|
<div class="col-lg-12 List-searchNoResults">
|
||||||
No records matched your search.
|
No records matched your search.
|
||||||
</div>
|
</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
|
// 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");
|
var emptyListText = (collection.emptyListText) ? collection.emptyListText : i18n._("PLEASE ADD ITEMS TO THIS LIST");
|
||||||
html += `<div ng-hide="is_superuser">`;
|
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 += '</div>';
|
||||||
|
|
||||||
html += `
|
html += `
|
||||||
|
|||||||
@@ -85,12 +85,19 @@ export default ['$stateParams', '$scope', '$state', 'QuerySet', 'GetBasePath', '
|
|||||||
else {
|
else {
|
||||||
encodeParams.searchTerm = true;
|
encodeParams.searchTerm = true;
|
||||||
}
|
}
|
||||||
|
removed = qs.encodeParam(encodeParams);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
removed = setDefaults(tagToRemove);
|
||||||
}
|
}
|
||||||
removed = qs.encodeParam(encodeParams);
|
|
||||||
}
|
}
|
||||||
_.each(removed, (value, key) => {
|
_.each(removed, (value, key) => {
|
||||||
if (Array.isArray(queryset[key])){
|
if (Array.isArray(queryset[key])){
|
||||||
_.remove(queryset[key], (item) => item === value);
|
_.remove(queryset[key], (item) => item === value);
|
||||||
|
// If the array is now empty, remove that key
|
||||||
|
if(queryset[key].length === 0) {
|
||||||
|
delete queryset[key];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
delete queryset[key];
|
delete queryset[key];
|
||||||
|
|||||||
Reference in New Issue
Block a user