Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unblock datastores tab on sandbox #4627

Merged
merged 7 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading