diff --git a/awx/ui/client/lib/models/WorkflowJobTemplate.js b/awx/ui/client/lib/models/WorkflowJobTemplate.js index 79198bbe82..406aba3350 100644 --- a/awx/ui/client/lib/models/WorkflowJobTemplate.js +++ b/awx/ui/client/lib/models/WorkflowJobTemplate.js @@ -50,8 +50,10 @@ function canLaunchWithoutPrompt () { const launchData = this.model.launch.GET; return ( - launchData.can_start_without_user_input && - !launchData.survey_enabled + // TODO: may need api update + // launchData.can_start_without_user_input && + !launchData.survey_enabled && + !this.model.GET.ask_inventory_on_launch ); } diff --git a/awx/ui/client/src/templates/workflows.form.js b/awx/ui/client/src/templates/workflows.form.js index 017fcb06ba..fe3f8c24e7 100644 --- a/awx/ui/client/src/templates/workflows.form.js +++ b/awx/ui/client/src/templates/workflows.form.js @@ -81,6 +81,11 @@ export default ['NotificationsList', 'i18n', function(NotificationsList, i18n) { dataTitle: i18n._('Inventory'), dataPlacement: 'right', dataContainer: "body", + subCheckbox: { + variable: 'ask_inventory_on_launch', + ngChange: 'workflow_job_template_form.inventory_name.$validate()', + text: i18n._('Prompt on launch') + }, ngDisabled: '!(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddWorkflowJobTemplate) || !canEditInventory', }, labels: { diff --git a/awx/ui/client/src/templates/workflows/add-workflow/workflow-add.controller.js b/awx/ui/client/src/templates/workflows/add-workflow/workflow-add.controller.js index e99a89a048..45bbc4e78c 100644 --- a/awx/ui/client/src/templates/workflows/add-workflow/workflow-add.controller.js +++ b/awx/ui/client/src/templates/workflows/add-workflow/workflow-add.controller.js @@ -75,6 +75,7 @@ export default [ data[fld] = $scope[fld]; } } + data.ask_inventory_on_launch = Boolean($scope.ask_inventory_on_launch); data.extra_vars = ToJSON($scope.parseType, $scope.variables, true); diff --git a/awx/ui/client/src/templates/workflows/edit-workflow/workflow-edit.controller.js b/awx/ui/client/src/templates/workflows/edit-workflow/workflow-edit.controller.js index 9d6db73ac0..be7b125261 100644 --- a/awx/ui/client/src/templates/workflows/edit-workflow/workflow-edit.controller.js +++ b/awx/ui/client/src/templates/workflows/edit-workflow/workflow-edit.controller.js @@ -88,6 +88,8 @@ export default [ } } + data.ask_inventory_on_launch = Boolean($scope.ask_inventory_on_launch); + data.extra_vars = ToJSON($scope.parseType, $scope.variables, true);