AC-172 Fixed missing project path when viewing and existing project. Added a warning dialog for no available project paths condition.

This commit is contained in:
chouseknecht 2013-07-02 03:07:18 -04:00
parent 9a0f50f0fa
commit c4e4b7755a
2 changed files with 11 additions and 3 deletions

View File

@ -187,7 +187,7 @@ function ProjectsAdd ($scope, $rootScope, $compile, $location, $log, $routeParam
})
.error( function(data, status, headers, config) {
ProcessErrors(scope, data, status, ProjectsForm,
{ hdr: 'Error!', msg: 'Failed to create new project. Post returned status: ' + status });
{ hdr: 'Error!', msg: 'Failed to create new project. Post returned status: ' + status });
});
};

View File

@ -10,8 +10,8 @@
*/
angular.module('ProjectPathHelper', ['RestServices', 'Utilities'])
.factory('GetProjectPath', ['Alert', 'Rest', 'GetBasePath','ProcessErrors',
function(Alert, Rest, GetBasePath, ProcessErrors) {
.factory('GetProjectPath', ['Alert', 'Rest', 'GetBasePath','ProcessErrors', 'Alert',
function(Alert, Rest, GetBasePath, ProcessErrors, Alert) {
return function(params) {
var scope = params.scope;
@ -23,11 +23,19 @@ angular.module('ProjectPathHelper', ['RestServices', 'Utilities'])
var opts = [];
for (var i=0; i < data.project_local_paths.length; i++) {
opts.push(data.project_local_paths[i]);
}
if (scope.local_path) {
opts.push(scope.local_path);
}
scope.project_local_paths = opts;
scope.base_dir = data.project_base_dir;
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) {
Alert('Missing project path', 'All of the project paths have been assigned to existing projects, or ' +
'there are no directories found in the base path. You will need to add a project path before creating ' +
'a new project.', 'alert-info');
}
})
.error( function(data, status, headers, config) {
ProcessErrors(scope, data, status, null,