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

misc e.g. project list sorting

Sean Rhee 5 лет назад
Родитель
Сommit
f9edecffb4

+ 3 - 3
dashboard/src/main/home/cluster-dashboard/expanded-chart/status/ControllerTab.tsx

@@ -230,13 +230,13 @@ const Name = styled.div`
 const Tooltip = styled.div`
   position: absolute;
   left: 35px;
+  word-wrap: break-word;
   top: 38px;
-  white-space: nowrap;
-  height: 18px;
+  min-height: 18px;
+  max-width: calc(100% - 75px);
   padding: 2px 5px;
   background: #383842dd;
   display: flex;
-  align-items: center;
   justify-content: center;
   flex: 1;
   color: white;

+ 0 - 1
dashboard/src/main/home/project-settings/InviteList.tsx

@@ -122,7 +122,6 @@ export default class InviteList extends Component<PropsType, StateType> {
       var collabList: any[] = [];
       this.state.invites.sort((a: any, b: any) => (a.email > b.email) ? 1 : -1);
       this.state.invites.sort((a: any, b: any) => (a.accepted > b.accepted) ? 1 : -1);
-      console.log(this.state.invites);
       for (let i = 0; i < this.state.invites.length; i++) {
         if (this.state.invites[i].accepted) {
           collabList.push(

+ 1 - 46
dashboard/src/main/home/project-settings/ProjectSettings.tsx

@@ -103,52 +103,7 @@ const StyledProjectSettings = styled.div`
   width: calc(90% - 130px);
   min-width: 300px;
   padding-top: 70px;
-`;
-
-const LineBreak = styled.div`
-  width: calc(100% - 0px);
-  height: 2px;
-  background: #ffffff20;
-  margin: 10px 0px -20px;
-`;
-
-const Subtitle = styled.div`
-  font-size: 18px;
-  font-weight: 700;
-  font-family: 'Work Sans', sans-serif;
-  color: #ffffff;
-  white-space: nowrap;
-  overflow: hidden;
-  text-overflow: ellipsis;
-  margin-bottom: 24px;
-  margin-top: 32px;
-`;
-
-const BodyText = styled.div`
-  color: #ffffff;
-  font-weight: 400;
-  font-size: 13px;
-`;
-
-const CopyButton = styled.div`
-  color: #ffffff;
-  font-weight: 400;
-  font-size: 13px;
-  margin-left: 12px;
-  float: right;
-  width: 128px;
-  padding-top: 8px;
-  padding-bottom: 8px;
-  border-radius: 5px;
-  border: 1px solid #ffffff20;
-  background-color: #ffffff10;
-  text-align: center;
-  overflow: hidden;
-  transition: all 0.1s ease-out;
-  :hover {
-    border: 1px solid #ffffff66;
-    background-color: #ffffff20;
-  }
+  height: 100vh;
 `;
 
 const DeleteButton = styled.div`

+ 4 - 3
dashboard/src/main/home/sidebar/ClusterSection.tsx

@@ -59,9 +59,10 @@ export default class ClusterSection extends Component<PropsType, StateType> {
             if (localStorage.getItem('currentCluster') !== 'null') {
               setCurrentCluster(clusters[0]);
               for (let i = 0; i < clusters.length; i++) {
-                if (clusters[i].id = saved.id 
-                  && clusters[i].project_id === saved.project_id 
-                  && clusters[i].name === saved.name
+                if (
+                  clusters[i].id = saved.id &&
+                  clusters[i].project_id === saved.project_id && 
+                  clusters[i].name === saved.name
                 ) {
                   setCurrentCluster(clusters[i]);
                   break;

+ 2 - 0
dashboard/src/shared/Context.tsx

@@ -37,6 +37,7 @@ class ContextProvider extends Component {
     },
     currentCluster: null as ClusterType | null,
     setCurrentCluster: (currentCluster: ClusterType, callback?: any) => {
+      localStorage.setItem('currentCluster', JSON.stringify(currentCluster));
       this.setState({ currentCluster }, () => {
         callback && callback();
       });
@@ -49,6 +50,7 @@ class ContextProvider extends Component {
     },
     projects: [] as ProjectType[],
     setProjects: (projects: ProjectType[]) => {
+      projects.sort((a: any, b: any) => (a.name > b.name) ? 1 : -1);
       this.setState({ projects });
     },
     user: null as any,