mirror of
https://github.com/ansible/awx.git
synced 2026-03-01 16:58:46 -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:
@@ -16,6 +16,7 @@ export default [ 'Rest', 'GetBasePath', 'ProcessErrors', 'CredentialTypeModel',
|
|||||||
({ modal } = scope[scope.ns]);
|
({ modal } = scope[scope.ns]);
|
||||||
|
|
||||||
scope.$watch('vm.promptData.triggerModalOpen', () => {
|
scope.$watch('vm.promptData.triggerModalOpen', () => {
|
||||||
|
vm.actionButtonClicked = false;
|
||||||
if(vm.promptData && vm.promptData.triggerModalOpen) {
|
if(vm.promptData && vm.promptData.triggerModalOpen) {
|
||||||
|
|
||||||
vm.steps = {
|
vm.steps = {
|
||||||
@@ -160,6 +161,8 @@ export default [ 'Rest', 'GetBasePath', 'ProcessErrors', 'CredentialTypeModel',
|
|||||||
};
|
};
|
||||||
|
|
||||||
vm.finish = () => {
|
vm.finish = () => {
|
||||||
|
// Disable the action button to prevent double clicking
|
||||||
|
vm.actionButtonClicked = true;
|
||||||
vm.promptData.triggerModalOpen = false;
|
vm.promptData.triggerModalOpen = false;
|
||||||
if(vm.onFinish) {
|
if(vm.onFinish) {
|
||||||
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.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.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.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>
|
</div>
|
||||||
</at-modal>
|
</at-modal>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user