mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 01:17:37 -02:30
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:
@@ -187,7 +187,7 @@ function ProjectsAdd ($scope, $rootScope, $compile, $location, $log, $routeParam
|
|||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
ProcessErrors(scope, data, status, ProjectsForm,
|
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 });
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -10,8 +10,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
angular.module('ProjectPathHelper', ['RestServices', 'Utilities'])
|
angular.module('ProjectPathHelper', ['RestServices', 'Utilities'])
|
||||||
.factory('GetProjectPath', ['Alert', 'Rest', 'GetBasePath','ProcessErrors',
|
.factory('GetProjectPath', ['Alert', 'Rest', 'GetBasePath','ProcessErrors', 'Alert',
|
||||||
function(Alert, Rest, GetBasePath, ProcessErrors) {
|
function(Alert, Rest, GetBasePath, ProcessErrors, Alert) {
|
||||||
return function(params) {
|
return function(params) {
|
||||||
|
|
||||||
var scope = params.scope;
|
var scope = params.scope;
|
||||||
@@ -23,11 +23,19 @@ angular.module('ProjectPathHelper', ['RestServices', 'Utilities'])
|
|||||||
var opts = [];
|
var opts = [];
|
||||||
for (var i=0; i < data.project_local_paths.length; i++) {
|
for (var i=0; i < data.project_local_paths.length; i++) {
|
||||||
opts.push(data.project_local_paths[i]);
|
opts.push(data.project_local_paths[i]);
|
||||||
|
}
|
||||||
|
if (scope.local_path) {
|
||||||
|
opts.push(scope.local_path);
|
||||||
}
|
}
|
||||||
scope.project_local_paths = opts;
|
scope.project_local_paths = opts;
|
||||||
scope.base_dir = data.project_base_dir;
|
scope.base_dir = data.project_base_dir;
|
||||||
master.base_dir = scope.base_dir; // Keep in master object so that it doesn't get
|
master.base_dir = scope.base_dir; // Keep in master object so that it doesn't get
|
||||||
// wiped out on form reset.
|
// 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) {
|
.error( function(data, status, headers, config) {
|
||||||
ProcessErrors(scope, data, status, null,
|
ProcessErrors(scope, data, status, null,
|
||||||
|
|||||||
Reference in New Issue
Block a user