From 0e3c911b0f34d5ac5c07eeaeeeac113ff773dfee Mon Sep 17 00:00:00 2001 From: spacedragon Date: Tue, 26 Feb 2019 15:12:16 +0800 Subject: [PATCH] [Code] show nothing if setup status is not ready yet. --- .../components/admin_page/setup_guide.tsx | 53 ++++++++++--------- x-pack/plugins/code/public/components/app.tsx | 2 +- 2 files changed, 30 insertions(+), 25 deletions(-) diff --git a/x-pack/plugins/code/public/components/admin_page/setup_guide.tsx b/x-pack/plugins/code/public/components/admin_page/setup_guide.tsx index 928176e93cc010..4b9fd2fc8580d1 100644 --- a/x-pack/plugins/code/public/components/admin_page/setup_guide.tsx +++ b/x-pack/plugins/code/public/components/admin_page/setup_guide.tsx @@ -94,28 +94,33 @@ const steps = [ ]; export const SetupGuide = (props: { setupFailed?: boolean }) => { - return ( - - {props.setupFailed && ( - -

- Please follow the guide below to configure your Kibana instance and then refresh this - page. -

-
- )} - {!props.setupFailed && ( - - Back To Project Dashboard - - )} - - -

Getting started in Elastic Code

-
- - -
-
- ); + let setup = null; + if (props.setupFailed !== undefined) { + setup = ( + + {props.setupFailed && ( + +

+ Please follow the guide below to configure your Kibana instance and then refresh this + page. +

+
+ )} + {props.setupFailed === false && ( + + Back To Project Dashboard + + )} + + +

Getting started in Elastic Code

+
+ + +
+
+ ); + } + + return {setup}; }; diff --git a/x-pack/plugins/code/public/components/app.tsx b/x-pack/plugins/code/public/components/app.tsx index 97bb36b5fa21af..e033123cb0d8a7 100644 --- a/x-pack/plugins/code/public/components/app.tsx +++ b/x-pack/plugins/code/public/components/app.tsx @@ -24,7 +24,7 @@ const RooComponent = (props: { setupOk: boolean }) => { if (props.setupOk) { return ; } - return ; + return ; }; const mapStateToProps = (state: RootState) => ({