From 6a3e477c9a308b961b05b2eb49545852fa3d4b67 Mon Sep 17 00:00:00 2001 From: Chris Houseknecht Date: Thu, 13 Feb 2014 19:52:37 +0000 Subject: [PATCH] Fixed a bug in Groups.js helper that blocked GroupsEdit, so you couldn't edit an existing group. Issue was Angular depenedency ineject was misaligned with function parameters. --- awx/ui/static/js/helpers/Groups.js | 12 ++++-------- awx/ui/static/lib/ansible/InventoryTree.js | 1 + 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/awx/ui/static/js/helpers/Groups.js b/awx/ui/static/js/helpers/Groups.js index 12496535a9..b0cf82a2c3 100644 --- a/awx/ui/static/js/helpers/Groups.js +++ b/awx/ui/static/js/helpers/Groups.js @@ -331,8 +331,6 @@ angular.module('GroupsHelper', ['RestServices', 'Utilities', 'ListGenerator', 'G scope = generator.inject(form, { mode: 'add', modal: true, related: false, show_modal: false }), choicesReady; - $('#form-modal .btn-none').removeClass('btn-none').addClass('btn-success'); - scope.formModalActionLabel = 'Save'; scope.formModalCancelShow = true; scope.parseType = 'yaml'; @@ -564,8 +562,8 @@ angular.module('GroupsHelper', ['RestServices', 'Utilities', 'ListGenerator', 'G 'Prompt', 'ProcessErrors', 'GetBasePath', 'SetNodeName', 'ParseTypeChange', 'GetSourceTypeOptions', 'InventoryUpdate', 'LookUpInit', 'Empty', 'Wait', 'GetChoices', 'UpdateGroup', 'SourceChange', 'Find','WatchInventoryWindowResize', function ($rootScope, $location, $log, $routeParams, Rest, Alert, GroupForm, GenerateForm, Prompt, ProcessErrors, - GetBasePath, SetNodeName, ParseTypeChange, GetSourceTypeOptions, InventoryUpdate, GetUpdateIntervalOptions, - LookUpInit, Empty, Wait, GetChoices, UpdateGroup, SourceChange, Find, WatchInventoryWindowResize) { + GetBasePath, SetNodeName, ParseTypeChange, GetSourceTypeOptions, InventoryUpdate, LookUpInit, Empty, Wait, + GetChoices, UpdateGroup, SourceChange, Find, WatchInventoryWindowResize) { return function (params) { var parent_scope = params.scope, @@ -747,10 +745,8 @@ angular.module('GroupsHelper', ['RestServices', 'Utilities', 'ListGenerator', 'G scope.$emit('groupLoaded'); }) .error(function (data, status) { - ProcessErrors(scope, data, status, form, { - hdr: 'Error!', - msg: 'Failed to retrieve group: ' + defaultUrl + '. GET status: ' + status - }); + ProcessErrors(scope, data, status, form, { hdr: 'Error!', + msg: 'Failed to retrieve group: ' + defaultUrl + '. GET status: ' + status }); }); }); diff --git a/awx/ui/static/lib/ansible/InventoryTree.js b/awx/ui/static/lib/ansible/InventoryTree.js index 1e2c377c2f..471cba8d78 100644 --- a/awx/ui/static/lib/ansible/InventoryTree.js +++ b/awx/ui/static/lib/ansible/InventoryTree.js @@ -202,6 +202,7 @@ angular.module('InventoryTree', ['Utilities', 'RestServices', 'GroupsHelper', 'P group_id = params.group_id, properties = params.properties, i, p, grp, old_name, stat; + for (i = 0; i < scope.groups.length; i++) { if (scope.groups[i].group_id === group_id) { grp = scope.groups[i];