AC-985 edit now edit's inventory properties via dialog- using the same edit code already written for the wrench button on inventory->groups/hosts page.

This commit is contained in:
Chris Houseknecht
2014-01-28 15:57:00 -05:00
parent 77b285f632
commit 7434bb8a9e
6 changed files with 80 additions and 22 deletions

View File

@@ -12,7 +12,7 @@
function InventoriesList ($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, InventoryList,
GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller,
ClearScope, ProcessErrors, GetBasePath, Wait, Stream)
ClearScope, ProcessErrors, GetBasePath, Wait, Stream, EditInventoryProperties)
{
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
//scope.
@@ -128,9 +128,21 @@ function InventoriesList ($scope, $rootScope, $location, $log, $routeParams, Res
}
});
if (scope.removeRefreshInventories) {
scope.removeRefreshInventories();
}
scope.removeRefreshInventories = scope.$on('RefreshInventories', function() {
// Reflect changes after inventory properties edit completes
scope.search(list.iterator);
});
scope.showActivity = function() { Stream({ scope: scope }); }
scope.editInventoryProperties = function(inventory_id) {
EditInventoryProperties({ scope: scope, inventory_id: inventory_id });
}
scope.addInventory = function() {
$location.path($location.path() + '/add');
}
@@ -186,7 +198,7 @@ function InventoriesList ($scope, $rootScope, $location, $log, $routeParams, Res
InventoriesList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'InventoryList', 'GenerateList',
'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors',
'GetBasePath', 'Wait', 'Stream' ];
'GetBasePath', 'Wait', 'Stream', 'EditInventoryProperties'];
function InventoriesAdd ($scope, $rootScope, $compile, $location, $log, $routeParams, InventoryForm,