From 52e226780a13cfc1f4d53f8d58b5363552ba97a7 Mon Sep 17 00:00:00 2001 From: mabashian Date: Thu, 12 Apr 2018 09:54:56 -0400 Subject: [PATCH] Disable prompt final action button after first click to prevent double clicking and launching multiple jobs --- awx/ui/client/src/templates/prompt/prompt.controller.js | 3 +++ awx/ui/client/src/templates/prompt/prompt.partial.html | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/awx/ui/client/src/templates/prompt/prompt.controller.js b/awx/ui/client/src/templates/prompt/prompt.controller.js index 79df58c51c..e390ba271a 100644 --- a/awx/ui/client/src/templates/prompt/prompt.controller.js +++ b/awx/ui/client/src/templates/prompt/prompt.controller.js @@ -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(); diff --git a/awx/ui/client/src/templates/prompt/prompt.partial.html b/awx/ui/client/src/templates/prompt/prompt.partial.html index 87e3f83a08..4f24b26e44 100644 --- a/awx/ui/client/src/templates/prompt/prompt.partial.html +++ b/awx/ui/client/src/templates/prompt/prompt.partial.html @@ -30,7 +30,7 @@ - +