From 3f148e104ee548e03875798d1582fa16f351fe7a Mon Sep 17 00:00:00 2001 From: Chris Houseknecht Date: Wed, 13 Nov 2013 03:58:12 +0000 Subject: [PATCH] AC-625 while looking into issue surrounding non-running updates, discoverd that creating credentials from the Users and Teams tabs was not allowing the user to click Save. The Save button refused to become enabled. Turns out that when a user or team is preelected (using route params) form initialization routine needs to run and it was not. --- awx/ui/static/js/controllers/Credentials.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/awx/ui/static/js/controllers/Credentials.js b/awx/ui/static/js/controllers/Credentials.js index 87d9449899..f120a59cdc 100644 --- a/awx/ui/static/js/controllers/Credentials.js +++ b/awx/ui/static/js/controllers/Credentials.js @@ -115,7 +115,7 @@ CredentialsList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$route function CredentialsAdd ($scope, $rootScope, $compile, $location, $log, $routeParams, CredentialForm, GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, GenerateList, SearchInit, PaginateInit, LookUpInit, UserList, TeamList, GetBasePath, - GetChoices, Empty, KindChange, OwnerChange, FormSave) + GetChoices, Empty, KindChange, OwnerChange, FormSave, DebugForm) { ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior //scope. @@ -158,6 +158,7 @@ function CredentialsAdd ($scope, $rootScope, $compile, $location, $log, $routePa // Get the username based on incoming route scope['owner'] = 'user'; scope['user'] = $routeParams.user_id; + OwnerChange({ scope: scope }); var url = GetBasePath('users') + $routeParams.user_id + '/'; Rest.setUrl(url); Rest.get() @@ -173,6 +174,7 @@ function CredentialsAdd ($scope, $rootScope, $compile, $location, $log, $routePa // Get the username based on incoming route scope['owner'] = 'team'; scope['team'] = $routeParams.team_id; + OwnerChange({ scope: scope }); var url = GetBasePath('teams') + $routeParams.team_id + '/'; Rest.setUrl(url); Rest.get() @@ -238,7 +240,7 @@ function CredentialsAdd ($scope, $rootScope, $compile, $location, $log, $routePa CredentialsAdd.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'CredentialForm', 'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope', 'GenerateList', 'SearchInit', 'PaginateInit', 'LookUpInit', 'UserList', 'TeamList', 'GetBasePath', 'GetChoices', 'Empty', - 'KindChange', 'OwnerChange', 'FormSave']; + 'KindChange', 'OwnerChange', 'FormSave', 'DebugForm']; function CredentialsEdit ($scope, $rootScope, $compile, $location, $log, $routeParams, CredentialForm,