Implement WFJT prompting for limit & scm_branch

add feature to UI and awxkit

restructure some details of create_unified_job
  for workflows to allow use of char_prompts
  hidden field
avoid conflict with sliced jobs in char_prompts copy logic

update developer docs

update migration reference

bump migration
This commit is contained in:
AlanCoding
2019-07-23 16:01:42 -04:00
parent d3b413c125
commit e8581f6892
19 changed files with 390 additions and 85 deletions

View File

@@ -89,6 +89,34 @@ export default ['NotificationsList', 'i18n', function(NotificationsList, i18n) {
},
ngDisabled: '!(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddOrEdit) || !canEditInventory',
},
limit: {
label: i18n._('Limit'),
type: 'text',
column: 1,
awPopOver: "<p>" + i18n._("Select a limit for the workflow. This limit is applied to all job template nodes that prompt for a limit.") + "</p>",
dataTitle: i18n._('Limit'),
dataPlacement: 'right',
dataContainer: "body",
subCheckbox: {
variable: 'ask_limit_on_launch',
text: i18n._('Prompt on launch')
},
ngDisabled: '!(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddOrEdit) || !canEditInventory',
},
scm_branch: {
label: i18n._('SCM Branch'),
type: 'text',
column: 1,
awPopOver: "<p>" + i18n._("Select a branch for the workflow. This branch is applied to all job template nodes that prompt for a branch.") + "</p>",
dataTitle: i18n._('SCM Branch'),
dataPlacement: 'right',
dataContainer: "body",
subCheckbox: {
variable: 'ask_scm_branch_on_launch',
text: i18n._('Prompt on launch')
},
ngDisabled: '!(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddOrEdit)',
},
labels: {
label: i18n._('Labels'),
type: 'select',

View File

@@ -54,6 +54,8 @@ export default [
$scope.parseType = 'yaml';
$scope.includeWorkflowMaker = false;
$scope.ask_inventory_on_launch = workflowJobTemplateData.ask_inventory_on_launch;
$scope.ask_limit_on_launch = workflowJobTemplateData.ask_limit_on_launch;
$scope.ask_scm_branch_on_launch = workflowJobTemplateData.ask_scm_branch_on_launch;
$scope.ask_variables_on_launch = (workflowJobTemplateData.ask_variables_on_launch) ? true : false;
if (Inventory){
@@ -91,6 +93,8 @@ export default [
}
data.ask_inventory_on_launch = Boolean($scope.ask_inventory_on_launch);
data.ask_limit_on_launch = Boolean($scope.ask_limit_on_launch);
data.ask_scm_branch_on_launch = Boolean($scope.ask_scm_branch_on_launch);
data.ask_variables_on_launch = Boolean($scope.ask_variables_on_launch);
data.extra_vars = ToJSON($scope.parseType,

View File

@@ -69,7 +69,9 @@ export default ['workflowData', 'workflowResultsService', 'workflowDataOptions',
SLICE_TEMPLATE: i18n._('Slice Job Template'),
JOB_EXPLANATION: i18n._('Explanation'),
SOURCE_WORKFLOW_JOB: i18n._('Source Workflow'),
INVENTORY: i18n._('Inventory')
INVENTORY: i18n._('Inventory'),
LIMIT: i18n._('Inventory Limit'),
SCM_BRANCH: i18n._('SCM Branch')
},
details: {
HEADER: i18n._('DETAILS'),

View File

@@ -140,6 +140,26 @@
</div>
</div>
<!-- LIMIT -->
<div class="WorkflowResults-resultRow" ng-show="workflow.limit">
<label class="WorkflowResults-resultRowLabel">
{{ strings.labels.LIMIT }}
</label>
<div class="WorkflowResults-resultRowText">
{{ workflow.limit }}
</div>
</div>
<!-- BRANCH -->
<div class="WorkflowResults-resultRow" ng-show="workflow.scm_branch">
<label class="WorkflowResults-resultRowLabel">
{{ strings.labels.SCM_BRANCH }}
</label>
<div class="WorkflowResults-resultRowText">
{{ workflow.scm_branch }}
</div>
</div>
<!-- TEMPLATE DETAIL -->
<div class="WorkflowResults-resultRow"
ng-show="workflow.summary_fields.workflow_job_template.name">