Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

preflight result page design updates #798

Merged
merged 2 commits into from
Jul 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
34 changes: 13 additions & 21 deletions kotsadm/web/src/components/PreflightResultPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ class PreflightResultPage extends Component {
if (showSkipModal) {
this.hideSkipModal();
}

preflightJSON = JSON.parse(preflightResultData?.result);
}
const hasResult = size(preflightJSON.results) > 0;
const hasErrors = size(preflightJSON.errors) > 0;
const preflightState = getPreflightResultState(preflightJSON);

return (
<div className="flex-column flex1 container">
Expand All @@ -177,7 +177,7 @@ class PreflightResultPage extends Component {
<Loader size="60" />
</div>
)}
{hasErrors && this.renderErrors(preflightJSON?.errors) }
{hasErrors && this.renderErrors(preflightJSON?.errors)}
{stopPolling && !hasErrors &&
<div className="flex-column">
<PreflightRenderer
Expand All @@ -190,29 +190,22 @@ class PreflightResultPage extends Component {
</div>
</div>

{ hasErrors && null }
{ (hasResult || stopPolling) &&
{this.props.fromLicenseFlow &&
<div className="flex-auto flex justifyContent--flexEnd">
{(hasResult || stopPolling) && preflightState !== "pass" &&
<Link to={`/app/${preflightResultData?.appSlug}`}>
<button type="button" className="btn secondary u-marginRight--10">Cancel</button>
</Link>
}
<button
type="button"
className="btn primary blue u-marginBottom--15"
onClick={() => this.deployKotsDownstream(false)}
onClick={(hasResult || stopPolling) ? () => this.deployKotsDownstream(false) : this.showSkipModal}
>
Continue
{(hasResult || stopPolling) ? "Continue" : "Skip"}
</button>
</div>
}
{ (!hasResult && !stopPolling) &&
<div className="flex-auto flex justifyContent--flexEnd">
<button
type="button"
className="btn primary blue u-marginBottom--15"
onClick={this.showSkipModal}
>
Skip
</button>
</div>
}

<Modal
isOpen={showSkipModal}
Expand All @@ -223,11 +216,11 @@ class PreflightResultPage extends Component {
className="Modal"
>
<div className="Modal-body">

<p className="u-fontSize--normal u-color--dustyGray u-lineHeight--normal u-marginBottom--20">Skipping preflight checks will not cancel them. They will continue to run in the background. Do you want to continue to the {preflightResultData?.appSlug} dashboard? </p>
<div className="u-marginTop--10 flex justifyContent--flexEnd">
<button type="button" className="btn secondary" onClick={this.hideSkipModal}>Close</button>
<Link to={`/app/${preflightResultData?.appSlug}`}>
<button type="button" className="btn blue primary">Go to Dashboard</button>
<button type="button" className="btn blue primary u-marginLeft--10">Go to Dashboard</button>
</Link>
</div>
</div>
Expand All @@ -242,10 +235,9 @@ class PreflightResultPage extends Component {
className="Modal"
>
<div className="Modal-body">

<p className="u-fontSize--normal u-color--dustyGray u-lineHeight--normal u-marginBottom--20">Preflight is showing some issues, are you sure you want to continue?</p>
<div className="u-marginTop--10 flex justifyContent--flexEnd">
<button type="button" className="btn secondary" onClick={this.hideWarningModal}>Cancel</button>
<button type="button" className="btn secondary" onClick={this.hideWarningModal}>Close</button>
<button type="button" className="btn blue primary u-marginLeft--10" onClick={() => this.deployKotsDownstream(true)}>
Deploy and continue
</button>
Expand Down