Skip to content

Commit

Permalink
unblock datastores tab on sandbox
Browse files Browse the repository at this point in the history
  • Loading branch information
Feroze Mohideen committed May 9, 2024
1 parent 8e442ec commit 7783c40
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 23 deletions.
23 changes: 2 additions & 21 deletions dashboard/src/main/home/database-dashboard/DatabaseDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down
9 changes: 7 additions & 2 deletions dashboard/src/main/home/sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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", "", [
Expand Down

0 comments on commit 7783c40

Please sign in to comment.