From 6de87b910ba011368b655ba4282693f5b57ffb02 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Mon, 1 May 2017 16:14:08 -0400 Subject: [PATCH] adding host resolve for nested groups route --- .../nested-groups/nested-groups-list-state.factory.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/awx/ui/client/src/inventories/groups/nested-groups/nested-groups-list-state.factory.js b/awx/ui/client/src/inventories/groups/nested-groups/nested-groups-list-state.factory.js index 7efd37c391..26763ee007 100644 --- a/awx/ui/client/src/inventories/groups/nested-groups/nested-groups-list-state.factory.js +++ b/awx/ui/client/src/inventories/groups/nested-groups/nested-groups-list-state.factory.js @@ -66,8 +66,15 @@ export default ['$stateExtender', 'templateUrl', '$injector', return qs.search(path, $stateParams[`${list.iterator}_search`]); } ], + host: ['$stateParams', 'HostManageService', function($stateParams, HostManageService) { + if($stateParams.host_id){ + return HostManageService.get({ id: $stateParams.host_id }).then(function(res) { + return res.data.results[0]; + }); + } + }], inventoryData: ['InventoryManageService', '$stateParams', 'host', function(InventoryManageService, $stateParams, host) { - var id = ($stateParams.inventory_id) ? $stateParams.inventory_id : host.data.summary_fields.inventory.id; + var id = ($stateParams.inventory_id) ? $stateParams.inventory_id : host.summary_fields.inventory.id; return InventoryManageService.getInventory(id).then(res => res.data); }] }