From 07ab1e77870bf6feea97e0e25b0991dc0ba978b6 Mon Sep 17 00:00:00 2001 From: Ken Hoes Date: Tue, 5 Apr 2016 09:12:52 -0400 Subject: [PATCH] PR feedback implemented. --- awx/ui/client/src/helpers/Hosts.js | 4 +-- .../copy-hosts.directive.controller.js | 9 +++--- .../manage/inventory-manage.controller.js | 28 ++++++------------- .../manage-hosts.directive.controller.js | 1 - 4 files changed, 16 insertions(+), 26 deletions(-) diff --git a/awx/ui/client/src/helpers/Hosts.js b/awx/ui/client/src/helpers/Hosts.js index 6a7b864e02..efc3cad8bf 100644 --- a/awx/ui/client/src/helpers/Hosts.js +++ b/awx/ui/client/src/helpers/Hosts.js @@ -437,10 +437,10 @@ 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', 'ParamPass', + 'ToJSON', 'ParseVariableString', 'CreateDialog', 'TextareaResize', function($rootScope, $location, $log, $stateParams, Rest, Alert, HostForm, GenerateForm, Prompt, ProcessErrors, GetBasePath, HostsReload, ParseTypeChange, Wait, Find, SetStatus, ApplyEllipsis, ToJSON, - ParseVariableString, CreateDialog, TextareaResize, ParamPass) { + ParseVariableString, CreateDialog, TextareaResize) { return function(params) { var parent_scope = params.host_scope, diff --git a/awx/ui/client/src/inventories/manage/copy/copy-hosts-directive/copy-hosts.directive.controller.js b/awx/ui/client/src/inventories/manage/copy/copy-hosts-directive/copy-hosts.directive.controller.js index bf596c5cef..1da180f880 100644 --- a/awx/ui/client/src/inventories/manage/copy/copy-hosts-directive/copy-hosts.directive.controller.js +++ b/awx/ui/client/src/inventories/manage/copy/copy-hosts-directive/copy-hosts.directive.controller.js @@ -142,7 +142,7 @@ function copyHostsDirectiveController($compile, $state, $scope, Rest, ProcessErr setWidgets: false }); $scope.refreshHostsOnGroupRefresh = true; - } + }; var performCopy = function() { var list = GroupList, @@ -229,9 +229,10 @@ function copyHostsDirectiveController($compile, $state, $scope, Rest, ProcessErr copy_choice: copy_choice, name: name, cancel: cancel, - allowSave: allowSave - }) -}; + allowSave: allowSave, + performCopy: performCopy + }); +} export default ['$compile', '$state', '$scope', 'Rest', 'ProcessErrors', 'CreateDialog', 'GetBasePath', 'Wait', 'generateList', 'GroupList', 'SearchInit', 'PaginateInit', 'ParamPass', 'Store', copyHostsDirectiveController 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 e8b8040245..c7d12bbcf6 100644 --- a/awx/ui/client/src/inventories/manage/inventory-manage.controller.js +++ b/awx/ui/client/src/inventories/manage/inventory-manage.controller.js @@ -400,16 +400,12 @@ function InventoriesManage($log, $scope, $rootScope, $location, $scope.copyGroup = function(id) { PreviousSearchParams = Store('group_current_search_params'); - // GroupsCopy({ - // scope: $scope, - // group_id: id - // }); - var params = { - scope: $scope - } - ParamPass.set(params); - $location.search('groups', null); - $state.go('inventoryManage.copy.group', {group_id: id}); + var params = { + scope: $scope + }; + ParamPass.set(params); + $location.search('groups', null); + $state.go('inventoryManage.copy.group', {group_id: id}); }; $scope.deleteGroup = function (id) { @@ -433,7 +429,7 @@ function InventoriesManage($log, $scope, $rootScope, $location, host_id: null, selected_group_id: $scope.selected_group_id, inventory_id: $scope.inventory.id - } + }; ParamPass.set(params); $state.go('inventoryManage.addHost'); }; @@ -445,7 +441,7 @@ function InventoriesManage($log, $scope, $rootScope, $location, mode: 'edit', host_id: host_id, inventory_id: $scope.inventory.id - } + }; ParamPass.set(params); $state.go('inventoryManage.editHost', {host_id: host_id}); }; @@ -461,17 +457,11 @@ function InventoriesManage($log, $scope, $rootScope, $location, hostScope.copyHost = function(id) { PreviousSearchParams = Store('group_current_search_params'); - // HostsCopy({ - // group_scope: $scope, - // host_scope: hostScope, - // host_id: id - // }); - var params = { group_scope: $scope, host_scope: hostScope, host_id: id - } + }; ParamPass.set(params); diff --git a/awx/ui/client/src/inventories/manage/manage-hosts/directive/manage-hosts.directive.controller.js b/awx/ui/client/src/inventories/manage/manage-hosts/directive/manage-hosts.directive.controller.js index c44ee6cdea..87b706a48b 100644 --- a/awx/ui/client/src/inventories/manage/manage-hosts/directive/manage-hosts.directive.controller.js +++ b/awx/ui/client/src/inventories/manage/manage-hosts/directive/manage-hosts.directive.controller.js @@ -99,7 +99,6 @@ function manageHostsDirectiveController($rootScope, $location, $log, $stateParam scope: scope, field_id: 'host_variables', }); - //scope.$emit('hostVariablesLoaded'); scope.parseType = 'yaml'; ParseTypeChange({ scope: scope,