From cdb347cba526cd533cd92964cd8a3aad06c9ce28 Mon Sep 17 00:00:00 2001 From: mabashian Date: Fri, 10 Aug 2018 15:50:58 -0400 Subject: [PATCH 1/2] Properly show prompt button when re-selecting a node with promptable fields --- .../inventory/prompt-inventory.partial.html | 4 +-- .../workflow-maker.controller.js | 25 +++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/awx/ui/client/src/templates/prompt/steps/inventory/prompt-inventory.partial.html b/awx/ui/client/src/templates/prompt/steps/inventory/prompt-inventory.partial.html index 17dc1ce918..9caecf594c 100644 --- a/awx/ui/client/src/templates/prompt/steps/inventory/prompt-inventory.partial.html +++ b/awx/ui/client/src/templates/prompt/steps/inventory/prompt-inventory.partial.html @@ -6,8 +6,8 @@
{{:: vm.strings.get('prompt.NO_INVENTORY_SELECTED') }}
- - + +
{{:: vm.strings.get('prompt.REVERT') }} diff --git a/awx/ui/client/src/templates/workflows/workflow-maker/workflow-maker.controller.js b/awx/ui/client/src/templates/workflows/workflow-maker/workflow-maker.controller.js index c344c91615..eda3f6f3a2 100644 --- a/awx/ui/client/src/templates/workflows/workflow-maker/workflow-maker.controller.js +++ b/awx/ui/client/src/templates/workflows/workflow-maker/workflow-maker.controller.js @@ -641,6 +641,31 @@ export default ['$scope', 'WorkflowService', 'GetBasePath', 'TemplatesService', if (!_.isEmpty($scope.nodeBeingEdited.promptData)) { $scope.promptData = _.cloneDeep($scope.nodeBeingEdited.promptData); + const launchConf = $scope.promptData.launchConf; + + if (!launchConf.survey_enabled && + !launchConf.ask_inventory_on_launch && + !launchConf.ask_credential_on_launch && + !launchConf.ask_verbosity_on_launch && + !launchConf.ask_job_type_on_launch && + !launchConf.ask_limit_on_launch && + !launchConf.ask_tags_on_launch && + !launchConf.ask_skip_tags_on_launch && + !launchConf.ask_diff_mode_on_launch && + !launchConf.survey_enabled && + !launchConf.credential_needed_to_start && + launchConf.variables_needed_to_start.length === 0) { + $scope.showPromptButton = false; + $scope.promptModalMissingReqFields = false; + } else { + $scope.showPromptButton = true; + + if (launchConf.ask_inventory_on_launch && !_.has(launchConf, 'defaults.inventory') && !_.has($scope, 'nodeBeingEdited.originalNodeObj.summary_fields.inventory')) { + $scope.promptModalMissingReqFields = true; + } else { + $scope.promptModalMissingReqFields = false; + } + } } else if ( _.get($scope, 'nodeBeingEdited.unifiedJobTemplate.unified_job_type') === 'job_template' || _.get($scope, 'nodeBeingEdited.unifiedJobTemplate.type') === 'job_template' From d2aea30d3db6d78daeed48a1bde78607751c7aeb Mon Sep 17 00:00:00 2001 From: mabashian Date: Thu, 16 Aug 2018 15:40:40 -0400 Subject: [PATCH 2/2] Add check for ask_variables_on_launch when determining whether to show prompt button --- .../workflows/workflow-maker/workflow-maker.controller.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/awx/ui/client/src/templates/workflows/workflow-maker/workflow-maker.controller.js b/awx/ui/client/src/templates/workflows/workflow-maker/workflow-maker.controller.js index eda3f6f3a2..7090e0f870 100644 --- a/awx/ui/client/src/templates/workflows/workflow-maker/workflow-maker.controller.js +++ b/awx/ui/client/src/templates/workflows/workflow-maker/workflow-maker.controller.js @@ -652,8 +652,8 @@ export default ['$scope', 'WorkflowService', 'GetBasePath', 'TemplatesService', !launchConf.ask_tags_on_launch && !launchConf.ask_skip_tags_on_launch && !launchConf.ask_diff_mode_on_launch && - !launchConf.survey_enabled && !launchConf.credential_needed_to_start && + !launchConf.ask_variables_on_launch && launchConf.variables_needed_to_start.length === 0) { $scope.showPromptButton = false; $scope.promptModalMissingReqFields = false; @@ -752,7 +752,6 @@ export default ['$scope', 'WorkflowService', 'GetBasePath', 'TemplatesService', !launchConf.ask_tags_on_launch && !launchConf.ask_skip_tags_on_launch && !launchConf.ask_diff_mode_on_launch && - !launchConf.survey_enabled && !launchConf.credential_needed_to_start && !launchConf.ask_variables_on_launch && launchConf.variables_needed_to_start.length === 0) { @@ -1097,7 +1096,6 @@ export default ['$scope', 'WorkflowService', 'GetBasePath', 'TemplatesService', !launchConf.ask_tags_on_launch && !launchConf.ask_skip_tags_on_launch && !launchConf.ask_diff_mode_on_launch && - !launchConf.survey_enabled && !launchConf.credential_needed_to_start && !launchConf.ask_variables_on_launch && launchConf.variables_needed_to_start.length === 0) {