Explorar el Código

Reverted comments for mocking

jnfrati hace 4 años
padre
commit
7506ee84fb

+ 16 - 16
dashboard/src/main/home/cluster-dashboard/preview-environments/PreviewEnvironmentsHome.tsx

@@ -72,22 +72,22 @@ const PreviewEnvironmentsHome = () => {
     return <Placeholder>Something went wrong, please try again</Placeholder>;
     return <Placeholder>Something went wrong, please try again</Placeholder>;
   }
   }
 
 
-  // if (!isEnabled) {
-  //   return (
-  //     <>
-  //       <PreviewEnvironmentsHeader />
-  //       <LineBreak />
-  //       <Placeholder>
-  //         <Title>Preview environments are not enabled on this cluster</Title>
-  //         <Subtitle>
-  //           In order to use preview environments, you must enable preview
-  //           environments on this cluster.
-  //         </Subtitle>
-  //         <ButtonEnablePREnvironments />
-  //       </Placeholder>
-  //     </>
-  //   );
-  // }
+  if (!isEnabled) {
+    return (
+      <>
+        <PreviewEnvironmentsHeader />
+        <LineBreak />
+        <Placeholder>
+          <Title>Preview environments are not enabled on this cluster</Title>
+          <Subtitle>
+            In order to use preview environments, you must enable preview
+            environments on this cluster.
+          </Subtitle>
+          <ButtonEnablePREnvironments />
+        </Placeholder>
+      </>
+    );
+  }
 
 
   return (
   return (
     <>
     <>

+ 9 - 10
dashboard/src/main/home/cluster-dashboard/preview-environments/environments/EnvironmentsList.tsx

@@ -15,16 +15,15 @@ const EnvironmentsList = () => {
 
 
   useEffect(() => {
   useEffect(() => {
     let isSubscribed = true;
     let isSubscribed = true;
-    // api
-    //   .listEnvironments<Environment[]>(
-    //     "<token>",
-    //     {},
-    //     {
-    //       project_id: currentProject?.id,
-    //       cluster_id: currentCluster?.id,
-    //     }
-    //   )
-    mockRequest()
+    api
+      .listEnvironments<Environment[]>(
+        "<token>",
+        {},
+        {
+          project_id: currentProject?.id,
+          cluster_id: currentCluster?.id,
+        }
+      )
       .then(({ data }) => {
       .then(({ data }) => {
         if (!isSubscribed) {
         if (!isSubscribed) {
           return;
           return;