mirror of
https://github.com/ansible/awx.git
synced 2026-01-20 06:01:25 -03:30
Project SCM type drop down fix
The SCM type for the projects page was broken when we sorted the drop down options by value. There was no value for 'manual' projects. I had to insert the word 'manual' where it was expecting a blank sting and then remove the word manual before saving the job template to the API
This commit is contained in:
parent
12f07e454f
commit
b4be8f7d49
@ -417,7 +417,8 @@ function ProjectsAdd($scope, $rootScope, $compile, $location, $log, $routeParams
|
||||
var i;
|
||||
for (i = 0; i < $scope.scm_type_options.length; i++) {
|
||||
if ($scope.scm_type_options[i].value === '') {
|
||||
$scope.scm_type = $scope.scm_type_options[i];
|
||||
$scope.scm_type_options[i].value="manual";
|
||||
//$scope.scm_type = $scope.scm_type_options[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -467,7 +468,9 @@ function ProjectsAdd($scope, $rootScope, $compile, $location, $log, $routeParams
|
||||
}
|
||||
}
|
||||
}
|
||||
data.scm_type = $scope.scm_type.value;
|
||||
if(data.scm_type.value==="manual" ){
|
||||
data.scm_type = "";
|
||||
} else data.scm_type = $scope.scm_type.value;
|
||||
if ($scope.scm_type.value !== '') {
|
||||
delete data.local_path;
|
||||
} else {
|
||||
@ -509,8 +512,8 @@ function ProjectsAdd($scope, $rootScope, $compile, $location, $log, $routeParams
|
||||
$scope.scmChange = function () {
|
||||
// When an scm_type is set, path is not required
|
||||
if ($scope.scm_type) {
|
||||
$scope.pathRequired = ($scope.scm_type.value === '') ? true : false;
|
||||
$scope.scmRequired = ($scope.scm_type.value !== '') ? true : false;
|
||||
$scope.pathRequired = ($scope.scm_type.value === 'manual') ? true : false;
|
||||
$scope.scmRequired = ($scope.scm_type.value !== 'manual') ? true : false;
|
||||
$scope.scmBranchLabel = ($scope.scm_type.value === 'svn') ? 'Revision #' : 'SCM Branch';
|
||||
}
|
||||
};
|
||||
|
||||
@ -105,7 +105,7 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
||||
type: 'textarea',
|
||||
//"class": 'col-lg-6',
|
||||
showonly: true,
|
||||
ngShow: "scm_type.value == ''",
|
||||
ngShow: "scm_type.value == 'manual' " ,
|
||||
awPopOver: '<p>Base path used for locating playbooks. Directories found inside this path will be listed in the playbook directory drop-down. ' +
|
||||
'Together the base path and selected playbook directory provide the full path used to locate playbooks.</p>' +
|
||||
'<p>Use PROJECTS_ROOT in your environment settings file to determine the base path value.</p>',
|
||||
@ -122,7 +122,7 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
||||
variable: "pathRequired",
|
||||
init: false
|
||||
},
|
||||
ngShow: "scm_type.value == '' && !showMissingPlaybooksAlert",
|
||||
ngShow: "scm_type.value == 'manual' && !showMissingPlaybooksAlert",
|
||||
awPopOver: '<p>Select from the list of directories found in the base path.' +
|
||||
'Together the base path and the playbook directory provide the full path used to locate playbooks.</p>' +
|
||||
'<p>Use PROJECTS_ROOT in your environment settings file to determine the base path value.</p>',
|
||||
@ -133,7 +133,7 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
||||
scm_url: {
|
||||
label: 'SCM URL',
|
||||
type: 'text',
|
||||
ngShow: "scm_type && scm_type.value !== ''",
|
||||
ngShow: "scm_type && scm_type.value !== 'manual'",
|
||||
awRequiredWhen: {
|
||||
variable: "scmRequired",
|
||||
init: false
|
||||
@ -166,14 +166,14 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
||||
scm_branch: {
|
||||
labelBind: "scmBranchLabel",
|
||||
type: 'text',
|
||||
ngShow: "scm_type && scm_type.value !== ''",
|
||||
ngShow: "scm_type && scm_type.value !== 'manual'",
|
||||
addRequired: false,
|
||||
editRequired: false
|
||||
},
|
||||
credential: {
|
||||
label: 'SCM Credential',
|
||||
type: 'lookup',
|
||||
ngShow: "scm_type && scm_type.value !== ''",
|
||||
ngShow: "scm_type && scm_type.value !== 'manual'",
|
||||
sourceModel: 'credential',
|
||||
sourceField: 'name',
|
||||
ngClick: 'lookUpCredential()',
|
||||
@ -183,7 +183,7 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
||||
checkbox_group: {
|
||||
label: 'SCM Update Options',
|
||||
type: 'checkbox_group',
|
||||
ngShow: "scm_type && scm_type.value !== ''",
|
||||
ngShow: "scm_type && scm_type.value !== 'manual'",
|
||||
fields: [{
|
||||
name: 'scm_clean',
|
||||
label: 'Clean',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user