mirror of
https://github.com/ansible/awx.git
synced 2026-02-24 22:46:01 -03:30
make workflow prompt inventory step optional
This commit is contained in:
@@ -15,11 +15,17 @@ export default [ 'Rest', 'GetBasePath', 'ProcessErrors', 'CredentialTypeModel',
|
|||||||
scope = _scope_;
|
scope = _scope_;
|
||||||
({ modal } = scope[scope.ns]);
|
({ modal } = scope[scope.ns]);
|
||||||
|
|
||||||
|
vm.isInventoryOptional = false;
|
||||||
|
|
||||||
scope.$watch('vm.promptData.triggerModalOpen', () => {
|
scope.$watch('vm.promptData.triggerModalOpen', () => {
|
||||||
|
|
||||||
vm.actionButtonClicked = false;
|
vm.actionButtonClicked = false;
|
||||||
if(vm.promptData && vm.promptData.triggerModalOpen) {
|
if(vm.promptData && vm.promptData.triggerModalOpen) {
|
||||||
|
|
||||||
|
if (vm.promptData.templateType === "workflow_job_template") {
|
||||||
|
vm.isInventoryOptional = true;
|
||||||
|
}
|
||||||
|
|
||||||
scope.$emit('launchModalOpen', true);
|
scope.$emit('launchModalOpen', true);
|
||||||
vm.promptDataClone = _.cloneDeep(vm.promptData);
|
vm.promptDataClone = _.cloneDeep(vm.promptData);
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
<div class="Prompt-footer">
|
<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_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_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"
|
<button id="prompt_credential_next" class="Prompt-actionButton"
|
||||||
ng-show="vm.steps.credential.tab._active"
|
ng-show="vm.steps.credential.tab._active"
|
||||||
ng-click="vm.next(vm.steps.credential.tab)"
|
ng-click="vm.next(vm.steps.credential.tab)"
|
||||||
|
|||||||
@@ -748,6 +748,7 @@ export default ['$scope', 'WorkflowService', 'TemplatesService',
|
|||||||
launchOptions: launchOptions,
|
launchOptions: launchOptions,
|
||||||
prompts: prompts,
|
prompts: prompts,
|
||||||
surveyQuestions: surveyQuestionRes.data.spec,
|
surveyQuestions: surveyQuestionRes.data.spec,
|
||||||
|
templateType: $scope.nodeBeingEdited.unifiedJobTemplate.type,
|
||||||
template: $scope.nodeBeingEdited.unifiedJobTemplate.id
|
template: $scope.nodeBeingEdited.unifiedJobTemplate.id
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -770,6 +771,7 @@ export default ['$scope', 'WorkflowService', 'TemplatesService',
|
|||||||
launchConf: launchConf,
|
launchConf: launchConf,
|
||||||
launchOptions: launchOptions,
|
launchOptions: launchOptions,
|
||||||
prompts: prompts,
|
prompts: prompts,
|
||||||
|
templateType: $scope.nodeBeingEdited.unifiedJobTemplate.type,
|
||||||
template: $scope.nodeBeingEdited.unifiedJobTemplate.id
|
template: $scope.nodeBeingEdited.unifiedJobTemplate.id
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1053,6 +1055,7 @@ export default ['$scope', 'WorkflowService', 'TemplatesService',
|
|||||||
launchOptions: responses[0].data,
|
launchOptions: responses[0].data,
|
||||||
surveyQuestions: processed.surveyQuestions,
|
surveyQuestions: processed.surveyQuestions,
|
||||||
template: selectedTemplate.id,
|
template: selectedTemplate.id,
|
||||||
|
templateType: selectedTemplate.type,
|
||||||
prompts: PromptService.processPromptValues({
|
prompts: PromptService.processPromptValues({
|
||||||
launchConf: responses[1].data,
|
launchConf: responses[1].data,
|
||||||
launchOptions: responses[0].data
|
launchOptions: responses[0].data
|
||||||
@@ -1077,6 +1080,7 @@ export default ['$scope', 'WorkflowService', 'TemplatesService',
|
|||||||
launchConf,
|
launchConf,
|
||||||
launchOptions: responses[0].data,
|
launchOptions: responses[0].data,
|
||||||
template: selectedTemplate.id,
|
template: selectedTemplate.id,
|
||||||
|
templateType: selectedTemplate.type,
|
||||||
prompts: PromptService.processPromptValues({
|
prompts: PromptService.processPromptValues({
|
||||||
launchConf: responses[1].data,
|
launchConf: responses[1].data,
|
||||||
launchOptions: responses[0].data
|
launchOptions: responses[0].data
|
||||||
|
|||||||
Reference in New Issue
Block a user