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

Merge pull request #2390 from porter-dev/reorganize-sidebar

expand projectsection
jusrhee 3 лет назад
Родитель
Сommit
5ba5fc453d

+ 1 - 1
dashboard/src/main/home/dashboard/ClusterList.tsx

@@ -162,7 +162,7 @@ class Templates extends Component<PropsType, StateType> {
           <TemplateBlock
             onClick={() => {
               this.context.setCurrentCluster(cluster);
-              pushFiltered(this.props, "/cluster-dashboard", ["project_id"], {
+              pushFiltered(this.props, "/applications", ["project_id"], {
                 cluster: cluster.name,
               });
             }}

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

@@ -134,7 +134,20 @@ export const ClusterSection: React.FC<Props> = ({
 
   return (
     <>
-      <ClusterSelector onClick={() => setIsExpanded(!isExpanded)}>
+      <ClusterSelector 
+        onClick={() => setIsExpanded(!isExpanded)}
+        active={
+          !isExpanded && cluster.id === currentCluster.id && [
+            "/cluster-dashboard",
+            "/preview-environments",
+            "/stacks",
+            "/databases",
+            "/env-groups",
+            "/jobs",
+            "/applications"
+          ].includes(window.location.pathname)
+        }
+      >
         <LinkWrapper>
           <ClusterIcon>
             <svg

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

@@ -200,7 +200,7 @@ const Dropdown = styled.div`
   right: 13px;
   top: calc(100% + 5px);
   background: #26282f;
-  width: 199px;
+  width: 210px;
   max-height: 500px;
   border-radius: 3px;
   z-index: 999;