Browse Source

properly unblock datastores for sandbox (#4642)

Feroze Mohideen 2 năm trước cách đây
mục cha
commit
d1704a00c5

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

@@ -69,7 +69,7 @@ const DatabaseDashboard: React.FC = () => {
   }, [datastores, searchValue, typeFilter]);
 
   const renderContents = (): JSX.Element => {
-    if (!currentProject?.db_enabled) {
+    if (!currentProject?.sandbox_enabled && !currentProject?.db_enabled) {
       return (
         <DashboardPlaceholder>
           <Text size={16}>Datastores are not enabled for this project</Text>

+ 6 - 0
dashboard/src/main/home/sidebar/Sidebar.tsx

@@ -319,6 +319,12 @@ class Sidebar extends Component<PropsType, StateType> {
                   <Img src={database} />
                   Datastores
                 </Container>
+                {match(currentProject)
+                  .with({ sandbox_enabled: true }, () => <Badge>NEW</Badge>)
+                  .with({ db_enabled: false }, () => (
+                    <Image size={15} src={lock}></Image>
+                  ))
+                  .otherwise(() => null)}
               </Container>
             </NavButton>
             {!currentProject.sandbox_enabled && (