diff --git a/awx/ui/client/src/helpers/Hosts.js b/awx/ui/client/src/helpers/Hosts.js index 1e4e22bec7..6a7b864e02 100644 --- a/awx/ui/client/src/helpers/Hosts.js +++ b/awx/ui/client/src/helpers/Hosts.js @@ -437,14 +437,12 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', listGenerator.name, .factory('HostsEdit', ['$rootScope', '$location', '$log', '$stateParams', 'Rest', 'Alert', 'HostForm', 'GenerateForm', 'Prompt', 'ProcessErrors', 'GetBasePath', 'HostsReload', 'ParseTypeChange', 'Wait', 'Find', 'SetStatus', 'ApplyEllipsis', - 'ToJSON', 'ParseVariableString', 'CreateDialog', 'TextareaResize', 'ScopePass', + 'ToJSON', 'ParseVariableString', 'CreateDialog', 'TextareaResize', 'ParamPass', function($rootScope, $location, $log, $stateParams, Rest, Alert, HostForm, GenerateForm, Prompt, ProcessErrors, GetBasePath, HostsReload, ParseTypeChange, Wait, Find, SetStatus, ApplyEllipsis, ToJSON, - ParseVariableString, CreateDialog, TextareaResize, ScopePass) { + ParseVariableString, CreateDialog, TextareaResize, ParamPass) { return function(params) { - ScopePass.set(params); - var passing = ScopePass.get(); - console.info(passing); + var parent_scope = params.host_scope, group_scope = params.group_scope, host_id = params.host_id, diff --git a/awx/ui/client/src/inventories/manage/inventory-manage.controller.js b/awx/ui/client/src/inventories/manage/inventory-manage.controller.js index 58c50dfbe2..a5c215bb0a 100644 --- a/awx/ui/client/src/inventories/manage/inventory-manage.controller.js +++ b/awx/ui/client/src/inventories/manage/inventory-manage.controller.js @@ -18,7 +18,7 @@ function InventoriesManage($log, $scope, $rootScope, $location, ViewUpdateStatus, GroupsDelete, Store, HostsEdit, HostsDelete, EditInventoryProperties, ToggleHostEnabled, ShowJobSummary, InventoryGroupsHelp, HelpDialog, - GroupsCopy, HostsCopy, $stateParams) { + GroupsCopy, HostsCopy, $stateParams, ParamPass) { var PreviousSearchParams, url, @@ -335,22 +335,38 @@ function InventoriesManage($log, $scope, $rootScope, $location, $scope.createGroup = function () { PreviousSearchParams = Store('group_current_search_params'); - GroupsEdit({ + // GroupsEdit({ + // scope: $scope, + // inventory_id: $scope.inventory.id, + // group_id: $scope.selected_group_id, + // mode: 'add' + // }); + var params = { scope: $scope, inventory_id: $scope.inventory.id, group_id: $scope.selected_group_id, mode: 'add' - }); + } + ParamPass.set(params); + $state.go('inventoryManage.addGroup'); }; $scope.editGroup = function (id) { PreviousSearchParams = Store('group_current_search_params'); - GroupsEdit({ + // GroupsEdit({ + // scope: $scope, + // inventory_id: $scope.inventory.id, + // group_id: id, + // mode: 'edit' + // }); + var params = { scope: $scope, inventory_id: $scope.inventory.id, group_id: id, mode: 'edit' - }); + } + ParamPass.set(params); + $state.go('inventoryManage.editGroup', {group_id: id}); }; // Launch inventory sync @@ -416,24 +432,44 @@ function InventoriesManage($log, $scope, $rootScope, $location, }; hostScope.createHost = function () { - HostsEdit({ + // HostsEdit({ + // host_scope: hostScope, + // group_scope: $scope, + // mode: 'add', + // host_id: null, + // selected_group_id: $scope.selected_group_id, + // inventory_id: $scope.inventory.id + // }); + + var params = { host_scope: hostScope, group_scope: $scope, mode: 'add', host_id: null, selected_group_id: $scope.selected_group_id, inventory_id: $scope.inventory.id - }); + } + ParamPass.set(params); + $state.go('inventoryManage.addHost'); }; hostScope.editHost = function (host_id) { - HostsEdit({ + // HostsEdit({ + // host_scope: hostScope, + // group_scope: $scope, + // mode: 'edit', + // host_id: host_id, + // inventory_id: $scope.inventory.id + // }); + var params = { host_scope: hostScope, group_scope: $scope, mode: 'edit', host_id: host_id, inventory_id: $scope.inventory.id - }); + } + ParamPass.set(params); + $state.go('inventoryManage.editHost', {host_id: host_id}); }; hostScope.deleteHost = function (host_id, host_name) { @@ -526,5 +562,5 @@ export default [ 'GroupsDelete', 'Store', 'HostsEdit', 'HostsDelete', 'EditInventoryProperties', 'ToggleHostEnabled', 'ShowJobSummary', 'InventoryGroupsHelp', 'HelpDialog', 'GroupsCopy', - 'HostsCopy', '$stateParams', InventoriesManage, + 'HostsCopy', '$stateParams', 'ParamPass', InventoriesManage, ]; diff --git a/awx/ui/client/src/inventories/manage/inventory-manage.partial.html b/awx/ui/client/src/inventories/manage/inventory-manage.partial.html index c04eb31552..f465ef47c0 100644 --- a/awx/ui/client/src/inventories/manage/inventory-manage.partial.html +++ b/awx/ui/client/src/inventories/manage/inventory-manage.partial.html @@ -1,7 +1,5 @@
-
- -
+
@@ -12,9 +10,6 @@
- -
- \n"; //end of Form-header - html += "
"; - html += "
\n"; - html += "
\n"; //end of Form-header if (this.form.tabs) { var collection;