From fcc5549ec999b1f718abe507df34e6c8f518de37 Mon Sep 17 00:00:00 2001 From: mabashian Date: Mon, 30 Apr 2018 11:41:26 -0400 Subject: [PATCH] Reload state after copying inventory to update list --- .../inventories/list/inventory-list.controller.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/awx/ui/client/src/inventories-hosts/inventories/list/inventory-list.controller.js b/awx/ui/client/src/inventories-hosts/inventories/list/inventory-list.controller.js index 9f3ba01557..9fc16afdd0 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/list/inventory-list.controller.js +++ b/awx/ui/client/src/inventories-hosts/inventories/list/inventory-list.controller.js @@ -77,7 +77,7 @@ function InventoriesList($scope, Wait('start'); new Inventory('get', inventory.id) .then(model => model.copy()) - .then(copy => $scope.editInventory(copy)) + .then(copy => $scope.editInventory(copy, true)) .catch(({ data, status }) => { const params = { hdr: 'Error!', msg: `Call to copy failed. Return status: ${status}` }; ProcessErrors($scope, data, status, null, params); @@ -89,12 +89,13 @@ function InventoriesList($scope, $state.go('inventories.edit.networking', {inventory_id: inventory.id, inventory_name: inventory.name}); }; - $scope.editInventory = function (inventory) { + $scope.editInventory = function (inventory, reload) { + const goOptions = reload ? { reload: true } : null; if(inventory.kind && inventory.kind === 'smart') { - $state.go('inventories.editSmartInventory', {smartinventory_id: inventory.id}); + $state.go('inventories.editSmartInventory', {smartinventory_id: inventory.id}, goOptions); } else { - $state.go('inventories.edit', {inventory_id: inventory.id}); + $state.go('inventories.edit', {inventory_id: inventory.id}, goOptions); } };