1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-02 09:51:09 +03:00

Merge pull request #1356 from mabashian/947-allow-simultaneous

Add checkbox for allow_simultaneous on the workflow job template forms
This commit is contained in:
Michael Abashian 2018-04-19 09:58:39 -04:00 committed by GitHub
commit d3a3694a49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 37 additions and 2 deletions

View File

@ -82,6 +82,22 @@ export default ['NotificationsList', 'i18n', function(NotificationsList, i18n) {
dataPlacement: 'right', dataPlacement: 'right',
dataContainer: "body", dataContainer: "body",
ngDisabled: '!(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddWorkflowJobTemplate)' // TODO: get working ngDisabled: '!(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddWorkflowJobTemplate)' // TODO: get working
},
checkbox_group: {
label: i18n._('Options'),
type: 'checkbox_group',
fields: [{
name: 'allow_simultaneous',
label: i18n._('Enable Concurrent Jobs'),
type: 'checkbox',
column: 2,
awPopOver: "<p>" + i18n._("If enabled, simultaneous runs of this workflow job template will be allowed.") + "</p>",
dataPlacement: 'right',
dataTitle: i18n._('Enable Concurrent Jobs'),
dataContainer: "body",
labelClass: 'stack-inline',
ngDisabled: '!(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddWorkflowJobTemplate)'
}]
} }
}, },

View File

@ -59,8 +59,15 @@ export default [
try { try {
for (fld in form.fields) { for (fld in form.fields) {
if(form.fields[fld].type === 'checkbox_group') {
// Loop across the checkboxes
for(var i=0; i<form.fields[fld].fields.length; i++) {
data[form.fields[fld].fields[i].name] = $scope[form.fields[fld].fields[i].name];
}
} else {
data[fld] = $scope[fld]; data[fld] = $scope[fld];
} }
}
data.extra_vars = ToJSON($scope.parseType, data.extra_vars = ToJSON($scope.parseType,
$scope.variables, true); $scope.variables, true);

View File

@ -96,6 +96,11 @@ export default [
$scope[form.fields[fld].sourceModel + '_' + form.fields[fld].sourceField] = $scope[form.fields[fld].sourceModel + '_' + form.fields[fld].sourceField] =
workflowJobTemplateData.summary_fields[form.fields[fld].sourceModel][form.fields[fld].sourceField]; workflowJobTemplateData.summary_fields[form.fields[fld].sourceModel][form.fields[fld].sourceField];
} }
if (form.fields[fld].type === 'checkbox_group') {
for(var j=0; j<form.fields[fld].fields.length; j++) {
$scope[form.fields[fld].fields[j].name] = workflowJobTemplateData[form.fields[fld].fields[j].name];
}
}
} }
if(workflowJobTemplateData.organization) { if(workflowJobTemplateData.organization) {
@ -139,8 +144,15 @@ export default [
try { try {
for (fld in form.fields) { for (fld in form.fields) {
if(form.fields[fld].type === 'checkbox_group') {
// Loop across the checkboxes
for(var i=0; i<form.fields[fld].fields.length; i++) {
data[form.fields[fld].fields[i].name] = $scope[form.fields[fld].fields[i].name];
}
} else {
data[fld] = $scope[fld]; data[fld] = $scope[fld];
} }
}
data.extra_vars = ToJSON($scope.parseType, data.extra_vars = ToJSON($scope.parseType,
$scope.variables, true); $scope.variables, true);