From d1dc6007fdef9870603bcfabe8a222e9a6be7512 Mon Sep 17 00:00:00 2001 From: Jake McDermott Date: Tue, 30 Apr 2019 12:25:43 -0400 Subject: [PATCH] use test callback from test form save hooks Enter key and other form submits are handled generically from the built-in save hooks on the form controller. This adds implementations for those hooks on the plugin test forms to make sure the expected handlers are always called. --- .../features/credentials/external-test-modal.component.js | 4 ++++ .../features/credentials/input-source-lookup.component.js | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/awx/ui/client/features/credentials/external-test-modal.component.js b/awx/ui/client/features/credentials/external-test-modal.component.js index 8600cc45f1..7b8ac82685 100644 --- a/awx/ui/client/features/credentials/external-test-modal.component.js +++ b/awx/ui/client/features/credentials/external-test-modal.component.js @@ -5,6 +5,10 @@ function ExternalTestModalController (strings) { vm.strings = strings; vm.title = strings.get('externalTest.TITLE'); + + vm.$onInit = () => { + vm.form.save = () => vm.onSubmit(); + }; } ExternalTestModalController.$inject = [ diff --git a/awx/ui/client/features/credentials/input-source-lookup.component.js b/awx/ui/client/features/credentials/input-source-lookup.component.js index 6d6d8841de..b76baf043b 100644 --- a/awx/ui/client/features/credentials/input-source-lookup.component.js +++ b/awx/ui/client/features/credentials/input-source-lookup.component.js @@ -6,7 +6,10 @@ function InputSourceLookupController (strings, wait) { vm.strings = strings; vm.title = strings.get('inputSources.TITLE'); - vm.$onInit = () => wait('start'); + vm.$onInit = () => { + wait('start'); + vm.form.save = () => vm.onTest(); + }; vm.onReady = () => { vm.isReady = true;