Просмотр исходного кода

route provision placeholders to cluster settings

Justin Rhee 3 лет назад
Родитель
Сommit
567fe69a99

+ 24 - 1
dashboard/src/main/home/cluster-dashboard/ClusterDashboard.tsx

@@ -187,7 +187,17 @@ class ClusterDashboard extends Component<PropsType, StateType> {
         <Heading isAtTop>
           <Img src={loading} /> Your cluster is being created
         </Heading>
-        <Helper>You can view the status of your cluster creation here.</Helper>
+        <Helper>
+          You can view the status of your cluster creation{" "}
+          <Link onClick={() => {
+            pushFiltered(this.props, "/cluster-dashboard", ["project_id"], {
+              cluster: this.context.currentCluster.name,
+            });
+          }}>
+            here
+            <i className="material-icons">arrow_forward</i> 
+          </Link>
+        </Helper>
       </Placeholder>
     )
   }
@@ -390,6 +400,19 @@ ClusterDashboard.contextType = Context;
 
 export default withRouter(withAuth(ClusterDashboard));
 
+const Link = styled.a`
+  text-decoration: underline;
+  position: relative;
+  cursor: pointer;
+  > i {
+    color: #aaaabb;
+    font-size: 15px;
+    position: absolute;
+    right: -17px;
+    top: 1px;
+  }
+`;
+
 const Img = styled.img`
   height: 15px;
   margin-right: 15px;

+ 28 - 2
dashboard/src/main/home/cluster-dashboard/env-groups/EnvGroupDashboard.tsx

@@ -14,7 +14,7 @@ import EnvGroupList from "./EnvGroupList";
 import CreateEnvGroup from "./CreateEnvGroup";
 import ExpandedEnvGroup from "./ExpandedEnvGroup";
 import { RouteComponentProps, withRouter } from "react-router";
-import { getQueryParam, pushQueryParams } from "shared/routing";
+import { getQueryParam, pushQueryParams, pushFiltered } from "shared/routing";
 import { withAuth, WithAuthProps } from "shared/auth/AuthorizationHoc";
 import { useQuery } from "@tanstack/react-query";
 import api from "shared/api";
@@ -49,6 +49,8 @@ const EnvGroupDashboard = (props: PropsType) => {
       : "Newest",
   });
 
+  const { currentCluster } = useContext(Context);
+
   const setNamespace = (namespace: string) => {
     setState((state) => ({ ...state, namespace }));
     pushQueryParams(props, {
@@ -87,7 +89,17 @@ const EnvGroupDashboard = (props: PropsType) => {
         <Heading isAtTop>
           <Img src={loading} /> Your cluster is being created
         </Heading>
-        <Helper>You can view the status of your cluster creation here.</Helper>
+        <Helper>
+          You can view the status of your cluster creation{" "}
+          <Link onClick={() => {
+            pushFiltered(props, "/cluster-dashboard", ["project_id"], {
+              cluster: currentCluster.name,
+            });
+          }}>
+            here
+            <i className="material-icons">arrow_forward</i> 
+          </Link>
+        </Helper>
       </ClusterPlaceholder>
     )
   }
@@ -176,6 +188,20 @@ const EnvGroupDashboard = (props: PropsType) => {
 
 export default withRouter(withAuth(EnvGroupDashboard));
 
+const Link = styled.a`
+  text-decoration: underline;
+  position: relative;
+  cursor: pointer;
+  > i {
+    color: #aaaabb;
+    font-size: 15px;
+    position: absolute;
+    right: -17px;
+    top: 1px;
+  }
+`;
+
+
 const Img = styled.img`
   height: 15px;
   margin-right: 15px;