From bb474b07979485fdb16969690703f1c5ff026f16 Mon Sep 17 00:00:00 2001 From: mabashian Date: Fri, 27 Sep 2019 11:05:23 -0400 Subject: [PATCH] Only render the launch modals if errors are present. This addresses a local unit test failure. --- .../components/LaunchButton/LaunchButton.jsx | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/awx/ui_next/src/components/LaunchButton/LaunchButton.jsx b/awx/ui_next/src/components/LaunchButton/LaunchButton.jsx index 7137f44860..830a660603 100644 --- a/awx/ui_next/src/components/LaunchButton/LaunchButton.jsx +++ b/awx/ui_next/src/components/LaunchButton/LaunchButton.jsx @@ -113,25 +113,29 @@ class LaunchButton extends React.Component { handleLaunch: this.handleLaunch, handleRelaunch: this.handleRelaunch, })} - - {i18n._(t`Failed to launch job.`)} - - - - {i18n._( - t`Launching jobs with promptable fields is not supported at this time.` - )} - + {launchError && ( + + {i18n._(t`Failed to launch job.`)} + + + )} + {promptError && ( + + {i18n._( + t`Launching jobs with promptable fields is not supported at this time.` + )} + + )} ); }