From edb4dac6529bbec3dbdfb52a2b51f1a2defcaae8 Mon Sep 17 00:00:00 2001 From: mabashian Date: Wed, 8 Apr 2020 11:43:39 -0400 Subject: [PATCH 1/2] Pass empty params to launch endpoint rather than null to alleviate 400 error when launching a JT with default creds. --- awx/ui_next/src/components/LaunchButton/LaunchButton.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/ui_next/src/components/LaunchButton/LaunchButton.jsx b/awx/ui_next/src/components/LaunchButton/LaunchButton.jsx index 878945f8d8..1d232f0a87 100644 --- a/awx/ui_next/src/components/LaunchButton/LaunchButton.jsx +++ b/awx/ui_next/src/components/LaunchButton/LaunchButton.jsx @@ -71,7 +71,7 @@ class LaunchButton extends React.Component { const { data: launchConfig } = await readLaunch; if (canLaunchWithoutPrompt(launchConfig)) { - this.launchWithParams(null); + this.launchWithParams({}); } else { this.setState({ showLaunchPrompt: true, From 9d6fbd6c78e43fe4f65928e906d1ac798546e487 Mon Sep 17 00:00:00 2001 From: mabashian Date: Wed, 8 Apr 2020 16:08:59 -0400 Subject: [PATCH 2/2] Updates launch button tests to reflect passing empty object rather than null for launch payload without prompts --- awx/ui_next/src/components/LaunchButton/LaunchButton.test.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/awx/ui_next/src/components/LaunchButton/LaunchButton.test.jsx b/awx/ui_next/src/components/LaunchButton/LaunchButton.test.jsx index 8db633fd8c..8ca2b3d167 100644 --- a/awx/ui_next/src/components/LaunchButton/LaunchButton.test.jsx +++ b/awx/ui_next/src/components/LaunchButton/LaunchButton.test.jsx @@ -62,7 +62,7 @@ describe('LaunchButton', () => { button.prop('onClick')(); expect(JobTemplatesAPI.readLaunch).toHaveBeenCalledWith(1); await sleep(0); - expect(JobTemplatesAPI.launch).toHaveBeenCalledWith(1, null); + expect(JobTemplatesAPI.launch).toHaveBeenCalledWith(1, {}); expect(history.location.pathname).toEqual('/jobs/9000/output'); }); @@ -99,7 +99,7 @@ describe('LaunchButton', () => { button.prop('onClick')(); expect(WorkflowJobTemplatesAPI.readLaunch).toHaveBeenCalledWith(1); await sleep(0); - expect(WorkflowJobTemplatesAPI.launch).toHaveBeenCalledWith(1, null); + expect(WorkflowJobTemplatesAPI.launch).toHaveBeenCalledWith(1, {}); expect(history.location.pathname).toEqual('/jobs/workflow/9000/output'); });