chore: help users navigate graphql lints for anon and authenticated roles (#45295)

## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

Bug fix, feature, docs update, ...

- Hide lints when exposed within local storage 
- Revoke on roles 


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added a GraphQL-exposure action in linter items that shows a
confirmation modal with the exact SQL, lets you revoke GraphQL access,
executes the operation, shows success/error toasts, and refreshes lint
results.
* Added an informational callout linking to database integration
settings when GraphQL exposure is detected.
* Lint actions now close the side panel and return the UI to the list
after completion.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
This commit is contained in:
Ali Waseem
2026-04-30 07:16:06 -06:00
committed by GitHub
parent ebe3ef0133
commit 2f5f6ffa79
8 changed files with 248 additions and 18 deletions

View File

@@ -3,7 +3,7 @@ import { noop } from 'lodash'
import type { AdvisorItem } from './AdvisorPanel.types'
import { AdvisorSignalDetail } from './AdvisorSignalDetail'
import { NotificationDetail } from './NotificationDetail'
import LintDetail from '@/components/interfaces/Linter/LintDetail'
import { LintDetail } from '@/components/interfaces/Linter/LintDetail'
import type { Lint } from '@/data/lint/lint-query'
import type { Notification } from '@/data/notifications/notifications-v2-query'
@@ -11,18 +11,20 @@ interface AdvisorDetailProps {
item: AdvisorItem
projectRef: string
onUpdateNotificationStatus?: (id: string, status: 'archived' | 'seen') => void
onAfterLintAction?: () => void
}
export const AdvisorDetail = ({
item,
projectRef,
onUpdateNotificationStatus = noop,
onAfterLintAction,
}: AdvisorDetailProps) => {
if (item.source === 'lint') {
const lint = item.original as Lint
return (
<div className="px-6 py-6">
<LintDetail lint={lint} projectRef={projectRef} />
<LintDetail lint={lint} projectRef={projectRef} onAfterAction={onAfterLintAction} />
</div>
)
}

View File

@@ -102,7 +102,7 @@ export const AdvisorPanel = () => {
}
const lintItems = useMemo<AdvisorItem[]>(() => {
return createAdvisorLintItems(lintData)
return createAdvisorLintItems(lintData ?? [])
}, [lintData])
const notificationItems = useMemo<AdvisorItem[]>(() => {
@@ -240,6 +240,7 @@ export const AdvisorPanel = () => {
item={selectedItem}
projectRef={project?.ref ?? ''}
onUpdateNotificationStatus={handleUpdateNotificationStatus}
onAfterLintAction={handleBackToList}
/>
) : (
<div className="px-6 py-8">