Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

added no saved query state

TzeYiing2e107b897328
diff --git a/studio/pages/project/[ref]/logs-explorer/saved.tsx b/studio/pages/project/[ref]/logs-explorer/saved.tsx
index d42dd5a1bec..074b4779e37 100644
--- a/studio/pages/project/[ref]/logs-explorer/saved.tsx
+++ b/studio/pages/project/[ref]/logs-explorer/saved.tsx
@@ -1,16 +1,19 @@
import React, { useEffect } from 'react'
import { NextPage } from 'next'
-
+import Link from 'next/link'
import { observer } from 'mobx-react-lite'
-import { Loading } from '@supabase/ui'
+import { IconSave, Loading } from '@supabase/ui'
import { useStore, withAuth } from 'hooks'
import { LogsSavedQueriesItem } from 'components/interfaces/Settings/Logs'
import LogsExplorerLayout from 'components/layouts/LogsExplorerLayout/LogsExplorerLayout'
import Table from 'components/to-be-cleaned/Table'
+import { useRouter } from 'next/router'
export const LogsExplorerPage: NextPage = () => {
const { content, ui } = useStore()
+ const router = useRouter()
+ const { ref } = router.query
useEffect(() => {
content.load()
@@ -25,28 +28,44 @@ export const LogsExplorerPage: NextPage = () => {
const saved = content.list()
- console.log('saved in parent', saved)
-
+ console.log('saved in parent', saved.length)
return (
<LogsExplorerLayout>
<div className="flex flex-col gap-3">
- <Table
- headTrClasses="expandable-tr"
- head={
- <>
- <Table.th>Name</Table.th>
- <Table.th>Description</Table.th>
- <Table.th className="">Created</Table.th>
- <Table.th className="">Last updated</Table.th>
- <Table.th className=""></Table.th>
- </>
- }
- body={
- saved.length > 0 &&
- saved[0].map((item: any) => <LogsSavedQueriesItem key={item.id} item={item} />)
- }
- />
+ {saved[0].length > 0 && (
+ <Table
+ headTrClasses="expandable-tr"
+ head={
+ <>
+ <Table.th>Name</Table.th>
+ <Table.th>Description</Table.th>
+ <Table.th className="">Created</Table.th>
+ <Table.th className="">Last updated</Table.th>
+ <Table.th className=""></Table.th>
+ </>
+ }
+ body={
+ saved.length > 0 &&
+ saved[0].map((item: any) => <LogsSavedQueriesItem key={item.id} item={item} />)
+ }
+ />
+ )}
</div>
+ {saved[0].length === 0 && (
+ <>
+ <div className="items-center flex flex-col gap-1 my-auto justify-center h-full flex-grow">
+ <IconSave className="animate-bounce" />
+ <h3 className="text-lg text-scale-1200">No Saved Queries Yet</h3>
+ <p className="text-sm text-scale-900">
+ Saved queries will appear here. Queries can be saved from the{' '}
+ <Link href={`/project/${ref}/logs-explorer`}>
+ <span className="font-bold underline text-white cursor-pointer">Query</span>
+ </Link>{' '}
+ tab.
+ </p>
+ </div>
+ </>
+ )}
</LogsExplorerLayout>
)
}