diff --git a/awx/ui/client/legacy/styles/lists.less b/awx/ui/client/legacy/styles/lists.less index 562b1d79d1..3e004461af 100644 --- a/awx/ui/client/legacy/styles/lists.less +++ b/awx/ui/client/legacy/styles/lists.less @@ -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; diff --git a/awx/ui/client/src/inventories-hosts/inventories/smart-inventory/smart-inventory-host-filter/host-filter-modal/host-filter-modal.directive.js b/awx/ui/client/src/inventories-hosts/inventories/smart-inventory/smart-inventory-host-filter/host-filter-modal/host-filter-modal.directive.js index ef77fcc0fe..0fb6d5b556 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/smart-inventory/smart-inventory-host-filter/host-filter-modal/host-filter-modal.directive.js +++ b/awx/ui/client/src/inventories-hosts/inventories/smart-inventory/smart-inventory-host-filter/host-filter-modal/host-filter-modal.directive.js @@ -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', diff --git a/awx/ui/client/src/shared/list-generator/list-generator.factory.js b/awx/ui/client/src/shared/list-generator/list-generator.factory.js index 51f4eae891..1523895dff 100644 --- a/awx/ui/client/src/shared/list-generator/list-generator.factory.js +++ b/awx/ui/client/src/shared/list-generator/list-generator.factory.js @@ -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 += ` -
+
`; + const emptyListClass = list.emptyListClass || "List-noItems"; + html += `
`; html += (list.emptyListText) ? list.emptyListText : i18n._("PLEASE ADD ITEMS TO THIS LIST"); html += "
"; }