Merge pull request #4060 from mabashian/3830-host-filter-search

Always show search bar in smart inventory host filter modal

Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
softwarefactory-project-zuul[bot]
2019-06-13 21:44:02 +00:00
committed by GitHub
3 changed files with 9 additions and 3 deletions

View File

@@ -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;

View File

@@ -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',

View File

@@ -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,7 @@ 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)">`;
html += `<div class="${list.emptyListClass || "List-noItems"}" ng-show="${list.name}.length === 0 && (searchTags | isEmpty)">`;
html += (list.emptyListText) ? list.emptyListText : i18n._("PLEASE ADD ITEMS TO THIS LIST");
html += "</div>";
}