The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Update UI based on feedback
Joshen Lima8b44a110dde
diff --git a/studio/components/interfaces/Functions/EdgeFunctionSecrets/EdgeFunctionSecret.tsx b/studio/components/interfaces/Functions/EdgeFunctionSecrets/EdgeFunctionSecret.tsxindex 0b01ffb2c15..19ee0b99205 100644--- a/studio/components/interfaces/Functions/EdgeFunctionSecrets/EdgeFunctionSecret.tsx+++ b/studio/components/interfaces/Functions/EdgeFunctionSecrets/EdgeFunctionSecret.tsx@@ -1,7 +1,6 @@import Table from 'components/to-be-cleaned/Table'import { ProjectSecret } from 'data/secrets/secrets-query'-import { useState } from 'react'-import { Button, IconEye, IconEyeOff, IconTrash, Input } from 'ui'+import { Button, IconTrash } from 'ui'interface EdgeFunctionSecretProps {secret: ProjectSecret@@ -9,15 +8,13 @@ interface EdgeFunctionSecretProps {}const EdgeFunctionSecret = ({ secret, onSelectDelete }: EdgeFunctionSecretProps) => {- const [show, setShow] = useState(false)-return (<Table.tr><Table.td><p className="truncate py-2">{secret.name}</p></Table.td><Table.td>- <div className="flex items-center space-x-2 max-w-[500px]">+ <div className="flex items-center space-x-2"><p className="font-mono text-sm truncate" title={secret.value}>{secret.value}</p>diff --git a/studio/components/interfaces/Functions/EdgeFunctionSecrets/EdgeFunctionSecrets.tsx b/studio/components/interfaces/Functions/EdgeFunctionSecrets/EdgeFunctionSecrets.tsxindex d2cda9e90c7..42b04c840fc 100644--- a/studio/components/interfaces/Functions/EdgeFunctionSecrets/EdgeFunctionSecrets.tsx+++ b/studio/components/interfaces/Functions/EdgeFunctionSecrets/EdgeFunctionSecrets.tsx@@ -1,6 +1,6 @@import { useParams } from 'common'import { useState } from 'react'-import { Button, Modal } from 'ui'+import { Button, IconSearch, Input, Modal } from 'ui'import Table from 'components/to-be-cleaned/Table'import AlertError from 'components/ui/AlertError'@@ -15,16 +15,11 @@ import EdgeFunctionSecret from './EdgeFunctionSecret'const EdgeFunctionSecrets = () => {const { ui } = useStore()const { ref: projectRef } = useParams()+ const [searchString, setSearchString] = useState('')const [showCreateSecret, setShowCreateSecret] = useState(false)const [selectedSecret, setSelectedSecret] = useState<ProjectSecret>()- const {- data: secrets,- error,- isLoading,- isSuccess,- isError,- } = useSecretsQuery({+ const { data, error, isLoading, isSuccess, isError } = useSecretsQuery({projectRef: projectRef,})@@ -38,6 +33,12 @@ const EdgeFunctionSecrets = () => {},})+ const secrets =+ searchString.length > 0+ ? data?.filter((secret) => secret.name.toLowerCase().includes(searchString.toLowerCase())) ??+ []+ : data ?? []+return (<><div>@@ -52,24 +53,55 @@ const EdgeFunctionSecrets = () => {{isError && <AlertError error={error} subject="Failed to retrieve project secrets" />}{isSuccess && (- <Table- head={[- <Table.th key="secret-name">Name</Table.th>,- <Table.th key="secret-value">Digest</Table.th>,- <Table.th key="add-secret">- <div className="flex items-center justify-end">- <Button onClick={() => setShowCreateSecret(true)}>Add new secret</Button>- </div>- </Table.th>,- ]}- body={secrets?.map((secret) => (- <EdgeFunctionSecret- key={secret.name}- secret={secret}- onSelectDelete={() => setSelectedSecret(secret)}+ <div className="space-y-4">+ <div className="flex items-center justify-between">+ <Input+ size="small"+ className="w-80"+ placeholder="Search for a secret"+ value={searchString}+ onChange={(e: any) => setSearchString(e.target.value)}+ icon={<IconSearch size="tiny" />}/>- ))}- />+ <Button onClick={() => setShowCreateSecret(true)}>Add new secret</Button>+ </div>+ <Table+ head={[+ <Table.th key="secret-name">Name</Table.th>,+ <Table.th key="secret-value">Digest</Table.th>,+ <Table.th key="actions" />,+ ]}+ body={+ secrets.length > 0 ? (+ secrets.map((secret) => (+ <EdgeFunctionSecret+ key={secret.name}+ secret={secret}+ onSelectDelete={() => setSelectedSecret(secret)}+ />+ ))+ ) : secrets.length === 0 && searchString.length > 0 ? (+ <Table.tr>+ <Table.td colSpan={3}>+ <p className="text-sm text-scale-1200">No results found</p>+ <p className="text-sm text-light">+ Your search for "{searchString}" did not return any results+ </p>+ </Table.td>+ </Table.tr>+ ) : (+ <Table.tr>+ <Table.td colSpan={3}>+ <p className="text-sm text-scale-1200">No secrets created</p>+ <p className="text-sm text-light">+ There are no secrets associated with your project yet+ </p>+ </Table.td>+ </Table.tr>+ )+ }+ />+ </div>)}<AddNewSecretModal visible={showCreateSecret} onClose={() => setShowCreateSecret(false)} />