11import saveAs from 'file-saver'
2- import { Clipboard , Copy , Download , Edit , Lock , MoreHorizontal , Trash , Unlock } from 'lucide-react'
2+ import { Clipboard , Copy , Download , Edit , Lock , MoreHorizontal , Trash } from 'lucide-react'
33import Link from 'next/link'
44import Papa from 'papaparse'
55import { toast } from 'sonner'
@@ -29,6 +29,7 @@ import { formatSql } from 'lib/formatSql'
2929import { useTableEditorStateSnapshot } from 'state/table-editor'
3030import { createTabId , useTabsStateSnapshot } from 'state/tabs'
3131import {
32+ Badge ,
3233 cn ,
3334 copyToClipboard ,
3435 DropdownMenu ,
@@ -251,28 +252,26 @@ const EntityListItem: ItemRenderer<Entity, EntityListItemProps> = ({
251252 </ Tooltip >
252253 < div
253254 className = { cn (
254- 'truncate' ,
255- 'overflow-hidden text-ellipsis whitespace-nowrap flex items-center gap-2 relative w-full' ,
255+ 'truncate overflow-hidden text-ellipsis whitespace-nowrap flex items-center gap-2 relative w-full' ,
256256 isActive && 'text-foreground'
257257 ) }
258258 >
259259 < span
260260 className = { cn (
261261 isActive ? 'text-foreground' : 'text-foreground-light group-hover:text-foreground' ,
262- 'text-sm' ,
263- 'transition' ,
264- 'truncate'
262+ 'text-sm transition truncate'
265263 ) }
266264 >
267265 { entity . name }
268266 </ span >
269- < EntityTooltipTrigger
270- entity = { entity }
271- isActive = { isActive }
272- tableHasLints = { tableHasLints }
273- viewHasLints = { viewHasLints }
274- materializedViewHasLints = { materializedViewHasLints }
275- />
267+ < div >
268+ < EntityTooltipTrigger
269+ entity = { entity }
270+ tableHasLints = { tableHasLints }
271+ viewHasLints = { viewHasLints }
272+ materializedViewHasLints = { materializedViewHasLints }
273+ />
274+ </ div >
276275 </ div >
277276
278277 { canEdit && (
@@ -425,37 +424,36 @@ const EntityListItem: ItemRenderer<Entity, EntityListItemProps> = ({
425424
426425const EntityTooltipTrigger = ( {
427426 entity,
428- isActive,
429427 tableHasLints,
430428 viewHasLints,
431429 materializedViewHasLints,
432430} : {
433431 entity : Entity
434- isActive : boolean
435432 tableHasLints : boolean
436433 viewHasLints : boolean
437434 materializedViewHasLints : boolean
438435} ) => {
439436 let tooltipContent = ''
437+ const accessWarning = 'Data is publicly accessible via API'
440438
441439 switch ( entity . type ) {
442440 case ENTITY_TYPE . TABLE :
443441 if ( tableHasLints ) {
444- tooltipContent = ' RLS disabled'
442+ tooltipContent = ` ${ accessWarning } as RLS is disabled`
445443 }
446444 break
447445 case ENTITY_TYPE . VIEW :
448446 if ( viewHasLints ) {
449- tooltipContent = ' Security definer view'
447+ tooltipContent = ` ${ accessWarning } as this is a Security definer view`
450448 }
451449 break
452450 case ENTITY_TYPE . MATERIALIZED_VIEW :
453451 if ( materializedViewHasLints ) {
454- tooltipContent = ' Security definer view'
452+ tooltipContent = ` ${ accessWarning } Security definer view`
455453 }
456454 break
457455 case ENTITY_TYPE . FOREIGN_TABLE :
458- tooltipContent = ' RLS is not enforced on foreign tables'
456+ tooltipContent = ` ${ accessWarning } as RLS via is not enforced on foreign tables`
459457 break
460458 default :
461459 break
@@ -465,13 +463,9 @@ const EntityTooltipTrigger = ({
465463 return (
466464 < Tooltip disableHoverableContent = { true } >
467465 < TooltipTrigger className = "min-w-4" >
468- < Unlock
469- size = { 14 }
470- strokeWidth = { 2 }
471- className = { cn ( 'min-w-4' , isActive ? 'text-warning-600' : 'text-warning-500' ) }
472- />
466+ < Badge variant = "destructive" > Unrestricted</ Badge >
473467 </ TooltipTrigger >
474- < TooltipContent side = "bottom" >
468+ < TooltipContent side = "bottom" className = "max-w-44 text-center" >
475469 < span > { tooltipContent } </ span >
476470 </ TooltipContent >
477471 </ Tooltip >
0 commit comments