2
0
Эх сурвалжийг харах

unblock datastores tab on sandbox

Feroze Mohideen 2 жил өмнө
parent
commit
7783c40ce6

+ 2 - 21
dashboard/src/main/home/database-dashboard/DatabaseDashboard.tsx

@@ -82,25 +82,6 @@ const DatabaseDashboard: React.FC = () => {
   }, [datastores, searchValue, typeFilter, engineFilter]);
 
   const renderContents = (): JSX.Element => {
-    if (currentProject?.sandbox_enabled) {
-      return (
-        <DashboardPlaceholder>
-          <Text size={16}>Datastores are coming soon to the Porter Cloud</Text>
-          <Spacer y={0.5} />
-          <Text color={"helper"}>
-            You can also eject to your own cloud account to start using managed
-            datastores immediately.
-          </Text>
-          <Spacer y={1} />
-          <PorterLink to="https://docs.porter.run/other/eject">
-            <Button alt height="35px">
-              Eject to AWS, Azure, or GCP
-            </Button>
-          </PorterLink>
-        </DashboardPlaceholder>
-      );
-    }
-
     if (!currentProject?.db_enabled) {
       return (
         <DashboardPlaceholder>
@@ -343,8 +324,8 @@ export const DatastoreList: React.FC<{
         return (
           <Row
             key={i}
-            onClick={async () => {
-              await onClick(datastore);
+            onClick={() => {
+              void onClick(datastore);
             }}
           >
             <Container row spaced>

+ 7 - 2
dashboard/src/main/home/sidebar/Sidebar.tsx

@@ -1,6 +1,7 @@
 import React, { Component } from "react";
 import { withRouter, type RouteComponentProps } from "react-router";
 import styled from "styled-components";
+import { match } from "ts-pattern";
 
 import Container from "components/porter/Container";
 import Image from "components/porter/Image";
@@ -203,8 +204,12 @@ class Sidebar extends Component<PropsType, StateType> {
                   <Img src={database} />
                   Datastores
                 </Container>
-                {(currentProject.sandbox_enabled ||
-                  !currentProject.db_enabled) && <Image size={15} src={lock} />}
+                {match(currentProject)
+                  .with({ sandbox_enabled: true }, () => <Badge>NEW</Badge>)
+                  .with({ db_enabled: false }, () => (
+                    <Image size={15} src={lock}></Image>
+                  ))
+                  .otherwise(() => null)}
               </Container>
             </NavButton>
             {this.props.isAuthorized("settings", "", [