mirror of
https://github.com/supabase/supabase.git
synced 2026-10-10 20:05:06 +03:00
## Context Related to FE-2461 More refactoring to clean up usage of `useQueryStateWithSelect`, in the following pages - Auth OAuth Apps - Cron Jobs - Vaults Secrets Management - Database Hooks - Wrappers ## To test In each of those pages, verify that - [ ] Clicking the "new" cta updates the URL params, and refreshing should re-open the sheet - [ ] Editing an existing item should update URL params, and refreshing should re-open the sheet with the right item - Verify that if the URL param has the wrong id, page should not open the sheet, show a toast, and reset the URL param - [ ] Deleting an existing item should update URL params, and refreshing should re-open the sheet with the right item - Verify that if the URL param has the wrong id, page should not open the sheet, show a toast, and reset the URL param <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Added "item not found" toasts and clearer feedback after create/update/delete actions; prevent opening create flows when server features are disabled. * **Style** * Standardized button labels, sizes and modal/dialog spacing; refined table column widths and inline code formatting for readability. * **Refactor** * Simplified UI state flows across OAuth Apps, Hooks/Webhooks, Cron Jobs, Vault Secrets, and Wrappers to use consistent URL-driven interactions and centralized modals. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
27 lines
923 B
TypeScript
27 lines
923 B
TypeScript
import { PermissionAction } from '@supabase/shared-types/out/constants'
|
|
|
|
import { DeleteHookModal } from '@/components/interfaces/Database/Hooks/DeleteHookModal'
|
|
import { EditHookPanel } from '@/components/interfaces/Database/Hooks/EditHookPanel'
|
|
import { HooksList } from '@/components/interfaces/Database/Hooks/HooksList/HooksList'
|
|
import { NoPermission } from '@/components/ui/NoPermission'
|
|
import { useAsyncCheckPermissions } from '@/hooks/misc/useCheckPermissions'
|
|
|
|
export const WebhooksListTab = () => {
|
|
const { can: canReadWebhooks, isSuccess: isPermissionsLoaded } = useAsyncCheckPermissions(
|
|
PermissionAction.TENANT_SQL_ADMIN_READ,
|
|
'triggers'
|
|
)
|
|
|
|
if (isPermissionsLoaded && !canReadWebhooks) {
|
|
return <NoPermission isFullPage resourceText="view database webhooks" />
|
|
}
|
|
|
|
return (
|
|
<div className="p-10">
|
|
<HooksList />
|
|
<EditHookPanel />
|
|
<DeleteHookModal />
|
|
</div>
|
|
)
|
|
}
|