Ver código fonte

Merge branch 'nico/new-onboarding-flow' of https://github.com/porter-dev/porter into nico/new-onboarding-flow

jusrhee 4 anos atrás
pai
commit
a7acf7be14

+ 14 - 4
dashboard/src/main/home/modals/RedirectToOnboardingModal.tsx

@@ -5,12 +5,22 @@ import api from "../../../shared/api";
 import Loading from "../../../components/Loading";
 import Heading from "components/form-components/Heading";
 import Helper from "components/form-components/Helper";
+import { Link } from "react-router-dom";
+import { Context } from "shared/Context";
 
 const RedirectToOnboardingModal = () => {
+  const { setCurrentModal } = useContext(Context);
+
   return (
     <>
-      <Helper>You need to complete the onboarding process in order to use Porter.</Helper>
-      <ContinueButton href="/onboarding">
+      <Helper>
+        You need to complete the onboarding process in order to use Porter.
+      </Helper>
+      <ContinueButton
+        as={Link}
+        to="/onboarding"
+        onClick={() => setCurrentModal(null, null)}
+      >
         <i className="material-icons">east</i>
         Continue Setup
       </ContinueButton>
@@ -35,7 +45,7 @@ const ContinueButton = styled.a`
   margin-top: 25px;
   width: 160px;
   border-radius: 5px;
-  background: #616FEEcc;
+  background: #616feecc;
   box-shadow: 0 2px 5px 0 #00000030;
   cursor: pointer;
   user-select: none;
@@ -59,4 +69,4 @@ const ContinueButton = styled.a`
     margin-left: -5px;
     justify-content: center;
   }
-`;
+`;

+ 15 - 11
dashboard/src/main/home/sidebar/Sidebar.tsx

@@ -267,17 +267,21 @@ class Sidebar extends Component<PropsType, StateType> {
 
           <br />
 
-          <SidebarLabel>Current Cluster</SidebarLabel>
-          <ClusterSection
-            forceCloseDrawer={this.state.forceCloseDrawer}
-            releaseDrawer={() => this.setState({ forceCloseDrawer: false })}
-            setWelcome={this.props.setWelcome}
-            currentView={currentView}
-            isSelected={false}
-            forceRefreshClusters={this.props.forceRefreshClusters}
-            setRefreshClusters={this.props.setRefreshClusters}
-          />
-          {this.renderClusterContent()}
+          {this.context.hasFinishedOnboarding && (
+            <>
+              <SidebarLabel>Current Cluster</SidebarLabel>
+              <ClusterSection
+                forceCloseDrawer={this.state.forceCloseDrawer}
+                releaseDrawer={() => this.setState({ forceCloseDrawer: false })}
+                setWelcome={this.props.setWelcome}
+                currentView={currentView}
+                isSelected={false}
+                forceRefreshClusters={this.props.forceRefreshClusters}
+                setRefreshClusters={this.props.setRefreshClusters}
+              />
+              {this.renderClusterContent()}
+            </>
+          )}
         </>
       );
     }