From 66e5cf88ade3b8fca8b441bc22c47d878ee12743 Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Fri, 13 Jan 2017 18:49:42 -0500 Subject: [PATCH] Fixed basePath at the root level of the inventory manage (thanks @jared) --- .../src/inventories/manage/inventory-manage.route.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/awx/ui/client/src/inventories/manage/inventory-manage.route.js b/awx/ui/client/src/inventories/manage/inventory-manage.route.js index 87d2daacb4..ca7589a3e1 100644 --- a/awx/ui/client/src/inventories/manage/inventory-manage.route.js +++ b/awx/ui/client/src/inventories/manage/inventory-manage.route.js @@ -101,7 +101,11 @@ export default { templateProvider: function(InventoryGroups, generateList, $templateRequest, $stateParams, GetBasePath) { let list = _.cloneDeep(InventoryGroups); if($stateParams && $stateParams.group) { - list.basePath = GetBasePath('groups') + $stateParams.group[$stateParams.group.length-1] + '/children'; + list.basePath = GetBasePath('groups') + _.last($stateParams.group) + '/children'; + } + else { + //reaches here if the user is on the root level group + list.basePath = GetBasePath('inventory') + $stateParams.inventory_id + '/root_groups'; } let html = generateList.build({ list: list, @@ -119,7 +123,11 @@ export default { templateProvider: function(InventoryHosts, generateList, $stateParams, GetBasePath) { let list = _.cloneDeep(InventoryHosts); if($stateParams && $stateParams.group) { - list.basePath = GetBasePath('groups') + $stateParams.group[$stateParams.group.length-1] + '/all_hosts'; + list.basePath = GetBasePath('groups') + _.last($stateParams.group) + '/all_hosts'; + } + else { + //reaches here if the user is on the root level group + list.basePath = GetBasePath('inventory') + $stateParams.inventory_id + '/hosts'; } let html = generateList.build({ list: list,