mirror of
https://github.com/supabase/supabase.git
synced 2026-07-01 01:25:54 +08:00
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:
@@ -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>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user