mirror of
https://github.com/ansible/awx.git
synced 2026-05-11 03:17:38 -02:30
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:
committed by
Chris Church
parent
a5c44a391c
commit
8a3a0d219c
@@ -305,9 +305,12 @@ function ProjectsAdd ($scope, $rootScope, $compile, $location, $log, $routeParam
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
data.scm_type = scope.scm_type.value;
|
data.scm_type = scope.scm_type.value;
|
||||||
if (data.scm_type.value !== '') {
|
if (scope.scm_type.value !== '') {
|
||||||
delete data.local_path;
|
delete data.local_path;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
data.local_path = scope.local_path.value;
|
||||||
|
}
|
||||||
|
|
||||||
var url = (base == 'teams') ? GetBasePath('teams') + $routeParams.team_id + '/projects/' : defaultUrl;
|
var url = (base == 'teams') ? GetBasePath('teams') + $routeParams.team_id + '/projects/' : defaultUrl;
|
||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
@@ -515,6 +518,9 @@ function ProjectsEdit ($scope, $rootScope, $compile, $location, $log, $routePara
|
|||||||
if (scope.scm_type.value !== '') {
|
if (scope.scm_type.value !== '') {
|
||||||
delete params.local_path;
|
delete params.local_path;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
params.local_path = scope.local_path.value;
|
||||||
|
}
|
||||||
|
|
||||||
Rest.setUrl(defaultUrl);
|
Rest.setUrl(defaultUrl);
|
||||||
Rest.put(params)
|
Rest.put(params)
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ angular.module('ProjectPathHelper', ['RestServices', 'Utilities'])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
scope.base_dir = data.project_base_dir;
|
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
|
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) {
|
if (opts.length == 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user