Browse Source

updated all dashboard redirects to overview

Jo Chuang 5 năm trước cách đây
mục cha
commit
2b2b72991d

+ 2 - 2
dashboard/src/main/home/Home.tsx

@@ -81,7 +81,7 @@ class Home extends Component<PropsType, StateType> {
           this.props.history.push("integrations");
           this.setState({ ghRedirect: false });
         } else if (this.props.currentRoute !== "dashboard") {
-          this.props.history.push("dashboard");
+          this.props.history.push("dashboard?tab=overview");
         }
       }
     );
@@ -476,7 +476,7 @@ class Home extends Component<PropsType, StateType> {
       }
     );
     setCurrentModal(null, null);
-    this.props.history.push("dashboard");
+    this.props.history.push("dashboard?tab=overview");
   };
 
   render() {

+ 1 - 1
dashboard/src/main/home/modals/UpdateClusterModal.tsx

@@ -51,7 +51,7 @@ class UpdateClusterModal extends Component<PropsType, StateType> {
           this.props.setRefreshClusters(true);
           this.setState({ status: "successful", showDeleteOverlay: false });
           this.context.setCurrentModal(null, null);
-          this.props.history.push("dashboard");
+          this.props.history.push("dashboard?tab=overview");
           return;
         }
 

+ 1 - 1
dashboard/src/main/home/provisioner/ExistingClusterSection.tsx

@@ -52,7 +52,7 @@ class ExistingClusterSection extends Component<PropsType, StateType> {
                   });
                   setCurrentProject(proj);
 
-                  this.props.history.push("dashboard");
+                  this.props.history.push("dashboard?tab=overview");
                 }
               }
             }

+ 1 - 1
dashboard/src/main/home/provisioner/ProvisionerSettings.tsx

@@ -39,7 +39,7 @@ class NewProject extends Component<PropsType, StateType> {
     setCurrentError(
       "Provisioning failed. Check your credentials and try again."
     );
-    this.props.history.push("dashboard");
+    this.props.history.push("dashboard?tab=overview");
   };
 
   renderSelectedProvider = () => {

+ 1 - 1
dashboard/src/main/home/sidebar/ClusterSection.tsx

@@ -81,7 +81,7 @@ class ClusterSection extends Component<PropsType, StateType> {
             ) {
               this.setState({ clusters: [] });
               setCurrentCluster(null);
-              // this.props.history.push("dashboard");
+              // this.props.history.push("dashboard?tab=overview");
             }
           }
         }

+ 6 - 6
dashboard/src/main/home/sidebar/Sidebar.tsx

@@ -7,10 +7,10 @@ import settings from "assets/settings.svg";
 
 import { Context } from "shared/Context";
 
-import ClusterSection from './ClusterSection';
-import ProjectSectionContainer from './ProjectSectionContainer';
-import loading from 'assets/loading.gif';
-import { RouteComponentProps, withRouter } from 'react-router';
+import ClusterSection from "./ClusterSection";
+import ProjectSectionContainer from "./ProjectSectionContainer";
+import loading from "assets/loading.gif";
+import { RouteComponentProps, withRouter } from "react-router";
 
 type PropsType = RouteComponentProps & {
   forceSidebar: boolean;
@@ -102,7 +102,7 @@ class Sidebar extends Component<PropsType, StateType> {
           <NavButton
             onClick={() =>
               currentView !== "provisioner" &&
-              this.props.history.push("dashboard")
+              this.props.history.push("dashboard?tab=overview")
             }
             selected={
               currentView === "dashboard" || currentView === "provisioner"
@@ -119,7 +119,7 @@ class Sidebar extends Component<PropsType, StateType> {
             Templates
           </NavButton>
           <NavButton
-            selected={currentView === 'integrations'}
+            selected={currentView === "integrations"}
             /* 
             onClick={() => {
               setCurrentView('integrations')