mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 19:30:39 -03:30
Merge pull request #1347 from mabashian/1188-launch-double-submit
Prevent double click on launch which spawns multiple jobs
This commit is contained in:
commit
2dad8cc980
@ -16,6 +16,7 @@ export default [ 'Rest', 'GetBasePath', 'ProcessErrors', 'CredentialTypeModel',
|
||||
({ modal } = scope[scope.ns]);
|
||||
|
||||
scope.$watch('vm.promptData.triggerModalOpen', () => {
|
||||
vm.actionButtonClicked = false;
|
||||
if(vm.promptData && vm.promptData.triggerModalOpen) {
|
||||
|
||||
vm.steps = {
|
||||
@ -160,6 +161,8 @@ export default [ 'Rest', 'GetBasePath', 'ProcessErrors', 'CredentialTypeModel',
|
||||
};
|
||||
|
||||
vm.finish = () => {
|
||||
// Disable the action button to prevent double clicking
|
||||
vm.actionButtonClicked = true;
|
||||
vm.promptData.triggerModalOpen = false;
|
||||
if(vm.onFinish) {
|
||||
vm.onFinish();
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
<button class="Prompt-actionButton" ng-show="vm.steps.credential.tab._active" ng-click="vm.next(vm.steps.credential.tab)" ng-disabled="!vm.forms.credentialPasswords.$valid || (vm.promptData.credentialTypeMissing && vm.promptData.credentialTypeMissing.length > 0)">{{:: vm.strings.get('NEXT') }}</button>
|
||||
<button class="Prompt-actionButton" ng-show="vm.steps.other_prompts.tab._active" ng-click="vm.next(vm.steps.other_prompts.tab)" ng-disabled="!vm.forms.otherPrompts.$valid">{{:: vm.strings.get('NEXT') }}</button>
|
||||
<button class="Prompt-actionButton" ng-show="vm.steps.survey.tab._active" ng-click="vm.next(vm.steps.survey.tab)" ng-disabled="!vm.forms.survey.$valid">{{:: vm.strings.get('NEXT') }}</button>
|
||||
<button class="Prompt-actionButton" ng-show="vm.steps.preview.tab._active" ng-click="vm.finish()" ng-bind="vm.actionText"></button>
|
||||
<button class="Prompt-actionButton" ng-show="vm.steps.preview.tab._active" ng-click="vm.finish()" ng-bind="vm.actionText" ng-disabled="vm.actionButtonClicked"></button>
|
||||
</div>
|
||||
</at-modal>
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user