mirror of
https://github.com/ansible/awx.git
synced 2024-11-02 01:21:21 +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:
commit
d3a3694a49
@ -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)'
|
||||
}]
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -59,7 +59,14 @@ export default [
|
||||
|
||||
try {
|
||||
for (fld in form.fields) {
|
||||
data[fld] = $scope[fld];
|
||||
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,
|
||||
|
@ -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,7 +144,14 @@ export default [
|
||||
|
||||
try {
|
||||
for (fld in form.fields) {
|
||||
data[fld] = $scope[fld];
|
||||
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,
|
||||
|
Loading…
Reference in New Issue
Block a user