From 347d1ef402da0d820c558b4afc124927b346e0c7 Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Wed, 19 Jul 2017 15:10:58 -0400 Subject: [PATCH] Use the related host list definition instead of the all host list definition for the associate host modal list. --- .../associate-hosts/associate-hosts.controller.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/awx/ui/client/src/inventories-hosts/shared/associate-hosts/associate-hosts.controller.js b/awx/ui/client/src/inventories-hosts/shared/associate-hosts/associate-hosts.controller.js index 41f7901707..a5e5f4967a 100644 --- a/awx/ui/client/src/inventories-hosts/shared/associate-hosts/associate-hosts.controller.js +++ b/awx/ui/client/src/inventories-hosts/shared/associate-hosts/associate-hosts.controller.js @@ -5,9 +5,9 @@ *************************************************/ export default ['$scope', '$rootScope', 'ProcessErrors', 'GetBasePath', 'generateList', - '$state', 'Rest', '$q', 'Wait', '$window', 'QuerySet', 'HostsList', + '$state', 'Rest', '$q', 'Wait', '$window', 'QuerySet', 'RelatedHostsListDefinition', function($scope, $rootScope, ProcessErrors, GetBasePath, generateList, - $state, Rest, $q, Wait, $window, qs, HostsList) { + $state, Rest, $q, Wait, $window, qs, RelatedHostsListDefinition) { $scope.$on("linkLists", function() { init(); @@ -23,12 +23,14 @@ page_size: 5 }; - let list = _.cloneDeep(HostsList); + let list = _.cloneDeep(RelatedHostsListDefinition); list.basePath = GetBasePath('inventory') + $state.params.inventory_id + '/hosts'; list.iterator = 'associate_host'; list.name = 'associate_hosts'; list.multiSelect = true; list.fields.name.ngClick = 'linkoutHost(associate_host)'; + list.fields.name.ngClass = "{ 'host-disabled-label': !associate_host.enabled }"; + list.fields.name.dataHostId = "{{ associate_host.id }}"; list.trackBy = 'associate_host.id'; list.multiSelectPreview = { selectedRows: 'selectedItems', @@ -36,7 +38,7 @@ }; delete list.fields.toggleHost; delete list.fields.active_failures; - delete list.fields.inventory; + delete list.fields.groups; delete list.actions; delete list.fieldActions; list.well = false;