Only render the launch modals if errors are present. This addresses a local unit test failure.

This commit is contained in:
mabashian
2019-09-27 11:05:23 -04:00
parent af90a78df5
commit bb474b0797

View File

@@ -113,6 +113,7 @@ class LaunchButton extends React.Component {
handleLaunch: this.handleLaunch, handleLaunch: this.handleLaunch,
handleRelaunch: this.handleRelaunch, handleRelaunch: this.handleRelaunch,
})} })}
{launchError && (
<AlertModal <AlertModal
isOpen={launchError} isOpen={launchError}
variant="danger" variant="danger"
@@ -122,6 +123,8 @@ class LaunchButton extends React.Component {
{i18n._(t`Failed to launch job.`)} {i18n._(t`Failed to launch job.`)}
<ErrorDetail error={launchError} /> <ErrorDetail error={launchError} />
</AlertModal> </AlertModal>
)}
{promptError && (
<AlertModal <AlertModal
isOpen={promptError} isOpen={promptError}
variant="info" variant="info"
@@ -132,6 +135,7 @@ class LaunchButton extends React.Component {
t`Launching jobs with promptable fields is not supported at this time.` t`Launching jobs with promptable fields is not supported at this time.`
)} )}
</AlertModal> </AlertModal>
)}
</Fragment> </Fragment>
); );
} }