mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 03:40:42 -03:30
Always show search bar in smart inventory host filter modal
This commit is contained in:
parent
28cc08f215
commit
9c50609776
@ -390,6 +390,10 @@ table, tbody {
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
.modal-body > .List-emptyHostFilter {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.List-actionButton--selected,
|
||||
.List-editButton--selected {
|
||||
background-color: @list-actn-bg-hov !important;
|
||||
|
||||
@ -55,8 +55,10 @@ export default ['templateUrl', function(templateUrl) {
|
||||
delete hostList.fields.inventory.ngClick;
|
||||
hostList.fields.inventory.columnClass = 'col-sm-6';
|
||||
hostList.fields.inventory.ngBind = 'host.summary_fields.inventory.name';
|
||||
hostList.emptyListText = i18n._('You must have access to at least one host in order to create a smart inventory host filter');
|
||||
hostList.emptyListText = i18n._('Perform a search above to define a host filter');
|
||||
hostList.layoutClass = 'List-defaultLayout';
|
||||
hostList.alwaysShowSearch = true;
|
||||
hostList.emptyListClass = 'List-noItems List-emptyHostFilter'
|
||||
let html = GenerateList.build({
|
||||
list: hostList,
|
||||
input_type: 'host-filter-modal-body',
|
||||
|
||||
@ -200,7 +200,7 @@ export default ['$compile', 'Attr', 'Icon',
|
||||
if (options.showSearch === undefined || options.showSearch === true) {
|
||||
let singleSearchParam = list.singleSearchParam && list.singleSearchParam.param ? `single-search-param="${list.singleSearchParam.param}"` : '';
|
||||
html += `
|
||||
<div ng-hide="${list.name}.length === 0 && (searchTags | isEmpty)">
|
||||
<div ng-hide="!${list.alwaysShowSearch} && ${list.name}.length === 0 && (searchTags | isEmpty)">
|
||||
<smart-search
|
||||
django-model="${list.name}"
|
||||
${singleSearchParam}
|
||||
@ -244,7 +244,8 @@ export default ['$compile', 'Attr', 'Icon',
|
||||
|
||||
// Show the "no items" box when loading is done and the user isn't actively searching and there are no results
|
||||
if (options.showEmptyPanel === undefined || options.showEmptyPanel === true){
|
||||
html += `<div class="List-noItems" ng-show="${list.name}.length === 0 && (searchTags | isEmpty)">`;
|
||||
const emptyListClass = list.emptyListClass || "List-noItems";
|
||||
html += `<div class="${emptyListClass}" ng-show="${list.name}.length === 0 && (searchTags | isEmpty)">`;
|
||||
html += (list.emptyListText) ? list.emptyListText : i18n._("PLEASE ADD ITEMS TO THIS LIST");
|
||||
html += "</div>";
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user