mirror of
https://github.com/supabase/supabase.git
synced 2026-10-19 08:09:11 +03:00
* Add settings for queues: toggle expose through postgrest + permissions via table privileges * Ensure appropriate grants are granted when toggling, and revoked when disabling * Update to use queues_public schema * Update queue schema to pgmq_public and add/remove from data api when enabling/disabling * Fix query for retrieving toggle state * Add schema invalidation * Remove hard code * Use QueuesSettings from Queues folder, remove from NewQueues * Update SQL for toggling exposure + support RLS enabling * Support toggling RLS for a queue * Update admonition copy in queues for enabling/disable postgrest exposure * Add custom RLS policy for queue * Minor style fixes * Fix * Remove hard code * Update RLS to add message regarding relevancy only if exposure to PostgREST is enabled * Update message in exposing queues to postgREST * Address feedback * Address feedback * Don't revoke postgres role stuff * Remove hard code * Update copy * Update * Address Oli's feedback, ensure that queues ALL have RLS enabled prior to allowing exposure to PostgREST * Address remaining feedback * Remove hardcode * Update * Address feedback
41 lines
1.3 KiB
TypeScript
41 lines
1.3 KiB
TypeScript
import { useSelectedProject } from 'hooks/misc/useSelectedProject'
|
|
import { IntegrationOverviewTab } from '../Integration/IntegrationOverviewTab'
|
|
import { useQueuesExposePostgrestStatusQuery } from 'data/database-queues/database-queues-expose-postgrest-status-query'
|
|
import { Admonition } from 'ui-patterns'
|
|
import { Button } from 'ui'
|
|
import Link from 'next/link'
|
|
import { useParams } from 'common'
|
|
|
|
export const QueuesOverviewTab = () => {
|
|
const { ref } = useParams()
|
|
const project = useSelectedProject()
|
|
|
|
const { data: isExposed } = useQueuesExposePostgrestStatusQuery({
|
|
projectRef: project?.ref,
|
|
connectionString: project?.connectionString,
|
|
})
|
|
|
|
return (
|
|
<IntegrationOverviewTab
|
|
actions={
|
|
!isExposed ? (
|
|
<Admonition
|
|
type="default"
|
|
title="Queues can be managed via any Supabase client library or PostgREST endpoints"
|
|
>
|
|
<p>
|
|
You may choose to toggle the exposure of Queues through PostgREST via the queues
|
|
settings
|
|
</p>
|
|
<Button asChild type="default">
|
|
<Link href={`/project/${ref}/integrations/queues/settings`}>
|
|
Head to queues settings
|
|
</Link>
|
|
</Button>
|
|
</Admonition>
|
|
) : null
|
|
}
|
|
/>
|
|
)
|
|
}
|