Fixed create operation on Credentials. Credential lookups on Groups and Projects now working.

This commit is contained in:
Chris Houseknecht
2013-11-02 08:49:49 +00:00
committed by Chris Church
parent 41b5d8b9ad
commit 72aacfd972
7 changed files with 41 additions and 25 deletions

View File

@@ -131,7 +131,7 @@ function CredentialsAdd ($scope, $rootScope, $compile, $location, $log, $routePa
if (!Empty($routeParams.user_id)) {
// Get the username based on incoming route
scope['owner'] == 'user';
scope['owner'] = 'user';
scope['user'] = $routeParams.user_id;
var url = GetBasePath('users') + $routeParams.user_id + '/';
Rest.setUrl(url);
@@ -146,7 +146,7 @@ function CredentialsAdd ($scope, $rootScope, $compile, $location, $log, $routePa
}
else if (!Empty($routeParams.team_id)) {
// Get the username based on incoming route
scope['owner'] == 'team';
scope['owner'] = 'team';
scope['team'] = $routeParams.team_id;
var url = GetBasePath('teams') + $routeParams.team_id + '/';
Rest.setUrl(url);
@@ -157,12 +157,9 @@ function CredentialsAdd ($scope, $rootScope, $compile, $location, $log, $routePa
.error( function(data, status, headers, config) {
ProcessErrors(scope, data, status, null,
{ hdr: 'Error!', msg: 'Failed to retrieve team. GET status: ' + status });
});
});
}
else {
scope['owner'] = 'team';
}
// Handle Kind change
scope.kindChange = function () {
KindChange({ scope: scope, form: form, reset: true });

View File

@@ -279,6 +279,7 @@ function ProjectsAdd ($scope, $rootScope, $compile, $location, $log, $routeParam
LookUpInit({
scope: scope,
url: GetBasePath('credentials') + '?kind=scm',
form: form,
list: CredentialList,
field: 'credential'
@@ -498,8 +499,8 @@ function ProjectsEdit ($scope, $rootScope, $compile, $location, $log, $routePara
// Load the list of options for Kind
GetChoices({
url: GetBasePath('credentials') + '?kind=scm',
scope: scope,
url: defaultUrl,
field: 'scm_type',
variable: 'scm_type_options',
callback: 'choicesReady'