Fixed form validation issues on Projects detail for manual projects. When editing an existing project, local_path value was not being set, even though it diplayed properly. Changed local_path from array of strings to array of objects. Now local_path values are sorted and the correct object in the list is selected.

This commit is contained in:
Chris Houseknecht 2013-11-04 07:20:46 +00:00 committed by Chris Church
parent a5c44a391c
commit 8a3a0d219c
2 changed files with 8 additions and 1 deletions

View File

@ -305,9 +305,12 @@ function ProjectsAdd ($scope, $rootScope, $compile, $location, $log, $routeParam
}
}
data.scm_type = scope.scm_type.value;
if (data.scm_type.value !== '') {
if (scope.scm_type.value !== '') {
delete data.local_path;
}
else {
data.local_path = scope.local_path.value;
}
var url = (base == 'teams') ? GetBasePath('teams') + $routeParams.team_id + '/projects/' : defaultUrl;
Rest.setUrl(url);
@ -515,6 +518,9 @@ function ProjectsEdit ($scope, $rootScope, $compile, $location, $log, $routePara
if (scope.scm_type.value !== '') {
delete params.local_path;
}
else {
params.local_path = scope.local_path.value;
}
Rest.setUrl(defaultUrl);
Rest.put(params)

View File

@ -59,6 +59,7 @@ angular.module('ProjectPathHelper', ['RestServices', 'Utilities'])
}
}
scope.base_dir = data.project_base_dir;
master.local_path = scope.local_path;
master.base_dir = scope.base_dir; // Keep in master object so that it doesn't get
// wiped out on form reset.
if (opts.length == 0) {