mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 18:05:11 +03:00
## 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>
54 lines
1.4 KiB
TypeScript
54 lines
1.4 KiB
TypeScript
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 type { Lint } from '@/data/lint/lint-query'
|
|
import type { Notification } from '@/data/notifications/notifications-v2-query'
|
|
|
|
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} onAfterAction={onAfterLintAction} />
|
|
</div>
|
|
)
|
|
}
|
|
|
|
if (item.source === 'signal') {
|
|
return (
|
|
<div className="px-6 py-6">
|
|
<AdvisorSignalDetail item={item} />
|
|
</div>
|
|
)
|
|
}
|
|
|
|
if (item.source === 'notification') {
|
|
const notification = item.original as Notification
|
|
return (
|
|
<div className="px-6 py-6">
|
|
<NotificationDetail
|
|
notification={notification}
|
|
onUpdateStatus={onUpdateNotificationStatus}
|
|
/>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
return null
|
|
}
|