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

Add checkbox for allow_simultaneous on the workflow job template forms

This commit is contained in:
mabashian 2018-04-12 15:34:36 -04:00
parent 35a75196a9
commit 93dc27f0e7
3 changed files with 37 additions and 2 deletions

View File

@ -82,6 +82,22 @@ export default ['NotificationsList', 'i18n', function(NotificationsList, i18n) {
dataPlacement: 'right',
dataContainer: "body",
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 {
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.extra_vars = ToJSON($scope.parseType,
$scope.variables, true);

View File

@ -96,6 +96,11 @@ export default [
$scope[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) {
@ -139,8 +144,15 @@ export default [
try {
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.extra_vars = ToJSON($scope.parseType,
$scope.variables, true);