jusrhee 2 лет назад
Родитель
Сommit
8d63f46b52
1 измененных файлов с 41 добавлено и 41 удалено
  1. 41 41
      dashboard/src/main/home/database-dashboard/DatabaseDashboard.tsx

+ 41 - 41
dashboard/src/main/home/database-dashboard/DatabaseDashboard.tsx

@@ -81,48 +81,48 @@ const DatabaseDashboard: React.FC = () => {
     return filteredByEngine;
   }, [datastores, searchValue, typeFilter, engineFilter]);
 
-  if (currentProject?.sandbox_enabled) {
-    return (
-      <DashboardPlaceholder>
-        <Text size={16}>Databases are not enabled for sandbox users</Text>
-        <Spacer y={0.5} />
-        <Text color={"helper"}>
-          Eject to your own cloud account to enable managed databases.
-        </Text>
-        <Spacer y={1} />
-        <ShowIntercomButton
-          alt
-          message="I would like to eject to my own cloud account"
-          height="35px"
-        >
-          Request ejection
-        </ShowIntercomButton>
-      </DashboardPlaceholder>
-    );
-  }
-
-  if (!currentProject?.db_enabled) {
-    return (
-      <DashboardPlaceholder>
-        <Text size={16}>Datastores are not enabled for this project</Text>
-        <Spacer y={0.5} />
-        <Text color={"helper"}>
-          Reach out to the Porter team to enable managed datastores on your
-          project.
-        </Text>
-        <Spacer y={1} />
-        <ShowIntercomButton
-          alt
-          message="I would like to enable managed datastores on my project"
-          height="35px"
-        >
-          Request to enable
-        </ShowIntercomButton>
-      </DashboardPlaceholder>
-    );
-  }
-
   const renderContents = (): JSX.Element => {
+    if (currentProject?.sandbox_enabled) {
+      return (
+        <DashboardPlaceholder>
+          <Text size={16}>Databases are not enabled for sandbox users</Text>
+          <Spacer y={0.5} />
+          <Text color={"helper"}>
+            Eject to your own cloud account to enable managed databases.
+          </Text>
+          <Spacer y={1} />
+          <ShowIntercomButton
+            alt
+            message="I would like to eject to my own cloud account"
+            height="35px"
+          >
+            Request ejection
+          </ShowIntercomButton>
+        </DashboardPlaceholder>
+      );
+    }
+  
+    if (!currentProject?.db_enabled) {
+      return (
+        <DashboardPlaceholder>
+          <Text size={16}>Datastores are not enabled for this project</Text>
+          <Spacer y={0.5} />
+          <Text color={"helper"}>
+            Reach out to the Porter team to enable managed datastores on your
+            project.
+          </Text>
+          <Spacer y={1} />
+          <ShowIntercomButton
+            alt
+            message="I would like to enable managed datastores on my project"
+            height="35px"
+          >
+            Request to enable
+          </ShowIntercomButton>
+        </DashboardPlaceholder>
+      );
+    }
+  
     if (datastores === undefined || isLoading || isLoadingClusters) {
       return <Loading offset="-150px" />;
     }