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

[Code] show nothing if setup status is not ready yet. #31993

Merged
merged 1 commit into from
Feb 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 29 additions & 24 deletions x-pack/plugins/code/public/components/admin_page/setup_guide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,28 +94,33 @@ const steps = [
];

export const SetupGuide = (props: { setupFailed?: boolean }) => {
return (
<Root>
{props.setupFailed && (
<EuiCallOut title="Code instance not found." color="danger" iconType="cross">
<p>
Please follow the guide below to configure your Kibana instance and then refresh this
page.
</p>
</EuiCallOut>
)}
{!props.setupFailed && (
<EuiButton iconType="sortLeft">
<Link to="/admin">Back To Project Dashboard</Link>
</EuiButton>
)}
<EuiPanel>
<EuiTitle>
<h3>Getting started in Elastic Code</h3>
</EuiTitle>
<EuiSpacer />
<EuiSteps steps={steps} />
</EuiPanel>
</Root>
);
let setup = null;
if (props.setupFailed !== undefined) {
setup = (
<React.Fragment>
{props.setupFailed && (
<EuiCallOut title="Code instance not found." color="danger" iconType="cross">
<p>
Please follow the guide below to configure your Kibana instance and then refresh this
page.
</p>
</EuiCallOut>
)}
{props.setupFailed === false && (
<EuiButton iconType="sortLeft">
<Link to="/admin">Back To Project Dashboard</Link>
</EuiButton>
)}
<EuiPanel>
<EuiTitle>
<h3>Getting started in Elastic Code</h3>
</EuiTitle>
<EuiSpacer />
<EuiSteps steps={steps} />
</EuiPanel>
</React.Fragment>
);
}

return <Root>{setup}</Root>;
};
2 changes: 1 addition & 1 deletion x-pack/plugins/code/public/components/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const RooComponent = (props: { setupOk: boolean }) => {
if (props.setupOk) {
return <Redirect to={'/admin'} />;
}
return <SetupGuide setupFailed={true} />;
return <SetupGuide />;
};

const mapStateToProps = (state: RootState) => ({
Expand Down