mirror of
https://github.com/ansible/awx.git
synced 2026-03-11 14:39:30 -02:30
Merge pull request #1624 from mabashian/1493-copy-inv-list
Reload state after copying inventory to update list
This commit is contained in:
@@ -77,7 +77,7 @@ function InventoriesList($scope,
|
|||||||
Wait('start');
|
Wait('start');
|
||||||
new Inventory('get', inventory.id)
|
new Inventory('get', inventory.id)
|
||||||
.then(model => model.copy())
|
.then(model => model.copy())
|
||||||
.then(copy => $scope.editInventory(copy))
|
.then(copy => $scope.editInventory(copy, true))
|
||||||
.catch(({ data, status }) => {
|
.catch(({ data, status }) => {
|
||||||
const params = { hdr: 'Error!', msg: `Call to copy failed. Return status: ${status}` };
|
const params = { hdr: 'Error!', msg: `Call to copy failed. Return status: ${status}` };
|
||||||
ProcessErrors($scope, data, status, null, params);
|
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});
|
$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') {
|
if(inventory.kind && inventory.kind === 'smart') {
|
||||||
$state.go('inventories.editSmartInventory', {smartinventory_id: inventory.id});
|
$state.go('inventories.editSmartInventory', {smartinventory_id: inventory.id}, goOptions);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$state.go('inventories.edit', {inventory_id: inventory.id});
|
$state.go('inventories.edit', {inventory_id: inventory.id}, goOptions);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user