Преглед изворни кода

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

mergin
Alexander Belanger пре 4 година
родитељ
комит
18e13fb0ef
2 измењених фајлова са 4 додато и 35 уклоњено
  1. 1 35
      dashboard/src/main/home/Home.tsx
  2. 3 0
      dashboard/src/main/home/project-settings/InviteList.tsx

+ 1 - 35
dashboard/src/main/home/Home.tsx

@@ -79,37 +79,6 @@ class Home extends Component<PropsType, StateType> {
     showWelcomeForm: true,
     showWelcomeForm: true,
   };
   };
 
 
-  // TODO: Refactor and prevent flash + multiple reload
-  initializeView = () => {
-    let { currentProject } = this.props;
-
-    if (!currentProject) return;
-
-    api
-      .getInfra(
-        "<token>",
-        {},
-        {
-          project_id: currentProject.id,
-        }
-      )
-      .then((res) => {
-        let creating = false;
-
-        for (var i = 0; i < res.data.length; i++) {
-          creating = res.data[i].status === "creating";
-        }
-        if (creating) {
-          pushFiltered(this.props, "/dashboard", ["project_id"], {
-            tab: "provisioner",
-          });
-        } else if (this.state.ghRedirect) {
-          pushFiltered(this.props, "/integrations", ["project_id"]);
-          this.setState({ ghRedirect: false });
-        }
-      });
-  };
-
   getMetadata = () => {
   getMetadata = () => {
     api
     api
       .getMetadata("<token>", {}, {})
       .getMetadata("<token>", {}, {})
@@ -158,9 +127,7 @@ class Home extends Component<PropsType, StateType> {
                   foundProject = project;
                   foundProject = project;
                 }
                 }
               });
               });
-              setCurrentProject(foundProject || res.data[0], () =>
-                this.initializeView()
-              );
+              setCurrentProject(foundProject || res.data[0]);
             }
             }
           }
           }
         }
         }
@@ -292,7 +259,6 @@ class Home extends Component<PropsType, StateType> {
       prevProps.currentProject !== this.props.currentProject ||
       prevProps.currentProject !== this.props.currentProject ||
       (!prevProps.currentCluster && this.props.currentCluster)
       (!prevProps.currentCluster && this.props.currentCluster)
     ) {
     ) {
-      this.initializeView();
       this.getMetadata();
       this.getMetadata();
     }
     }
   }
   }

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

@@ -366,6 +366,9 @@ const InvitePage: React.FunctionComponent<Props> = ({}) => {
   }, [invites, currentProject?.id, window?.location?.host, isHTTPS, user?.id]);
   }, [invites, currentProject?.id, window?.location?.host, isHTTPS, user?.id]);
 
 
   const hasSeats = () => {
   const hasSeats = () => {
+    if (String(edition) === "dev-ee") {
+      return true;
+    }
     // If usage limit is 0, the project has unlimited seats. Otherwise, check
     // If usage limit is 0, the project has unlimited seats. Otherwise, check
     // the usage limit against the current usage.
     // the usage limit against the current usage.
     if (usage?.limit.users === 0) {
     if (usage?.limit.users === 0) {