make workflow prompt inventory step optional

This commit is contained in:
Jake McDermott 2018-11-11 02:06:01 -05:00
parent a8d22b9459
commit 4ea7511ae8
No known key found for this signature in database
GPG Key ID: 9A6F084352C3A0B7
3 changed files with 11 additions and 1 deletions

View File

@ -15,11 +15,17 @@ export default [ 'Rest', 'GetBasePath', 'ProcessErrors', 'CredentialTypeModel',
scope = _scope_;
({ modal } = scope[scope.ns]);
vm.isInventoryOptional = false;
scope.$watch('vm.promptData.triggerModalOpen', () => {
vm.actionButtonClicked = false;
if(vm.promptData && vm.promptData.triggerModalOpen) {
if (vm.promptData.templateType === "workflow_job_template") {
vm.isInventoryOptional = true;
}
scope.$emit('launchModalOpen', true);
vm.promptDataClone = _.cloneDeep(vm.promptData);

View File

@ -45,7 +45,7 @@
<div class="Prompt-footer">
<button id="prompt_cancel" class="Prompt-defaultButton" ng-click="vm.cancel()" ng-show="!vm.readOnlyPrompts">{{:: vm.strings.get('CANCEL') }}</button>
<button id="prompt_close" class="Prompt-defaultButton" ng-click="vm.cancel()" ng-show="vm.readOnlyPrompts">{{:: vm.strings.get('CLOSE') }}</button>
<button id="prompt_inventory_next" class="Prompt-actionButton" ng-show="vm.steps.inventory.tab._active" ng-click="vm.next(vm.steps.inventory.tab)" ng-disabled="!vm.promptDataClone.prompts.inventory.value.id && !vm.readOnlyPrompts">{{:: vm.strings.get('NEXT') }}</button>
<button id="prompt_inventory_next" class="Prompt-actionButton" ng-show="vm.steps.inventory.tab._active" ng-click="vm.next(vm.steps.inventory.tab)" ng-disabled="!vm.isInventoryOptional && !vm.promptDataClone.prompts.inventory.value.id && !vm.readOnlyPrompts">{{:: vm.strings.get('NEXT') }}</button>
<button id="prompt_credential_next" class="Prompt-actionButton"
ng-show="vm.steps.credential.tab._active"
ng-click="vm.next(vm.steps.credential.tab)"

View File

@ -748,6 +748,7 @@ export default ['$scope', 'WorkflowService', 'TemplatesService',
launchOptions: launchOptions,
prompts: prompts,
surveyQuestions: surveyQuestionRes.data.spec,
templateType: $scope.nodeBeingEdited.unifiedJobTemplate.type,
template: $scope.nodeBeingEdited.unifiedJobTemplate.id
};
@ -770,6 +771,7 @@ export default ['$scope', 'WorkflowService', 'TemplatesService',
launchConf: launchConf,
launchOptions: launchOptions,
prompts: prompts,
templateType: $scope.nodeBeingEdited.unifiedJobTemplate.type,
template: $scope.nodeBeingEdited.unifiedJobTemplate.id
};
@ -1053,6 +1055,7 @@ export default ['$scope', 'WorkflowService', 'TemplatesService',
launchOptions: responses[0].data,
surveyQuestions: processed.surveyQuestions,
template: selectedTemplate.id,
templateType: selectedTemplate.type,
prompts: PromptService.processPromptValues({
launchConf: responses[1].data,
launchOptions: responses[0].data
@ -1077,6 +1080,7 @@ export default ['$scope', 'WorkflowService', 'TemplatesService',
launchConf,
launchOptions: responses[0].data,
template: selectedTemplate.id,
templateType: selectedTemplate.type,
prompts: PromptService.processPromptValues({
launchConf: responses[1].data,
launchOptions: responses[0].data