1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-02 09:51:09 +03:00

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.

This commit is contained in:
Chris Houseknecht 2014-02-13 19:52:37 +00:00
parent c77db691eb
commit 6a3e477c9a
2 changed files with 5 additions and 8 deletions

View File

@ -331,8 +331,6 @@ angular.module('GroupsHelper', ['RestServices', 'Utilities', 'ListGenerator', 'G
scope = generator.inject(form, { mode: 'add', modal: true, related: false, show_modal: false }), scope = generator.inject(form, { mode: 'add', modal: true, related: false, show_modal: false }),
choicesReady; choicesReady;
$('#form-modal .btn-none').removeClass('btn-none').addClass('btn-success');
scope.formModalActionLabel = 'Save'; scope.formModalActionLabel = 'Save';
scope.formModalCancelShow = true; scope.formModalCancelShow = true;
scope.parseType = 'yaml'; scope.parseType = 'yaml';
@ -564,8 +562,8 @@ angular.module('GroupsHelper', ['RestServices', 'Utilities', 'ListGenerator', 'G
'Prompt', 'ProcessErrors', 'GetBasePath', 'SetNodeName', 'ParseTypeChange', 'GetSourceTypeOptions', 'InventoryUpdate', 'Prompt', 'ProcessErrors', 'GetBasePath', 'SetNodeName', 'ParseTypeChange', 'GetSourceTypeOptions', 'InventoryUpdate',
'LookUpInit', 'Empty', 'Wait', 'GetChoices', 'UpdateGroup', 'SourceChange', 'Find','WatchInventoryWindowResize', 'LookUpInit', 'Empty', 'Wait', 'GetChoices', 'UpdateGroup', 'SourceChange', 'Find','WatchInventoryWindowResize',
function ($rootScope, $location, $log, $routeParams, Rest, Alert, GroupForm, GenerateForm, Prompt, ProcessErrors, function ($rootScope, $location, $log, $routeParams, Rest, Alert, GroupForm, GenerateForm, Prompt, ProcessErrors,
GetBasePath, SetNodeName, ParseTypeChange, GetSourceTypeOptions, InventoryUpdate, GetUpdateIntervalOptions, GetBasePath, SetNodeName, ParseTypeChange, GetSourceTypeOptions, InventoryUpdate, LookUpInit, Empty, Wait,
LookUpInit, Empty, Wait, GetChoices, UpdateGroup, SourceChange, Find, WatchInventoryWindowResize) { GetChoices, UpdateGroup, SourceChange, Find, WatchInventoryWindowResize) {
return function (params) { return function (params) {
var parent_scope = params.scope, var parent_scope = params.scope,
@ -747,10 +745,8 @@ angular.module('GroupsHelper', ['RestServices', 'Utilities', 'ListGenerator', 'G
scope.$emit('groupLoaded'); scope.$emit('groupLoaded');
}) })
.error(function (data, status) { .error(function (data, status) {
ProcessErrors(scope, data, status, form, { ProcessErrors(scope, data, status, form, { hdr: 'Error!',
hdr: 'Error!', msg: 'Failed to retrieve group: ' + defaultUrl + '. GET status: ' + status });
msg: 'Failed to retrieve group: ' + defaultUrl + '. GET status: ' + status
});
}); });
}); });

View File

@ -202,6 +202,7 @@ angular.module('InventoryTree', ['Utilities', 'RestServices', 'GroupsHelper', 'P
group_id = params.group_id, group_id = params.group_id,
properties = params.properties, properties = params.properties,
i, p, grp, old_name, stat; i, p, grp, old_name, stat;
for (i = 0; i < scope.groups.length; i++) { for (i = 0; i < scope.groups.length; i++) {
if (scope.groups[i].group_id === group_id) { if (scope.groups[i].group_id === group_id) {
grp = scope.groups[i]; grp = scope.groups[i];