Disable prompt final action button after first click to prevent double clicking and launching multiple jobs

This commit is contained in:
mabashian 2018-04-12 09:54:56 -04:00
parent a2cc357f21
commit 52e226780a
2 changed files with 4 additions and 1 deletions

View File

@ -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();

View File

@ -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>