mirror of
https://github.com/supabase/supabase.git
synced 2026-10-07 10:25:06 +03:00
fix: Fix the exposed foreign table in the tooltip in table list (#37668)
This commit is contained in:
1 parent
de80626671
commit
37bc6cda3a
1 file changed
+14
-1
@@ -108,6 +108,14 @@ const EntityListItem: ItemRenderer<Entity, EntityListItemProps> = ({
|
||||
selectedSchema
|
||||
).hasLint
|
||||
|
||||
const foreignTableHasLints: boolean = getEntityLintDetails(
|
||||
entity.name,
|
||||
'foreign_table_in_api',
|
||||
['ERROR', 'WARN'],
|
||||
lints,
|
||||
selectedSchema
|
||||
).hasLint
|
||||
|
||||
const formatTooltipText = (entityType: string) => {
|
||||
return Object.entries(ENTITY_TYPE)
|
||||
.find(([, value]) => value === entityType)?.[0]
|
||||
@@ -270,6 +278,7 @@ const EntityListItem: ItemRenderer<Entity, EntityListItemProps> = ({
|
||||
tableHasLints={tableHasLints}
|
||||
viewHasLints={viewHasLints}
|
||||
materializedViewHasLints={materializedViewHasLints}
|
||||
foreignTableHasLints={foreignTableHasLints}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -427,11 +436,13 @@ const EntityTooltipTrigger = ({
|
||||
tableHasLints,
|
||||
viewHasLints,
|
||||
materializedViewHasLints,
|
||||
foreignTableHasLints,
|
||||
}: {
|
||||
entity: Entity
|
||||
tableHasLints: boolean
|
||||
viewHasLints: boolean
|
||||
materializedViewHasLints: boolean
|
||||
foreignTableHasLints: boolean
|
||||
}) => {
|
||||
let tooltipContent = ''
|
||||
const accessWarning = 'Data is publicly accessible via API'
|
||||
@@ -453,7 +464,9 @@ const EntityTooltipTrigger = ({
|
||||
}
|
||||
break
|
||||
case ENTITY_TYPE.FOREIGN_TABLE:
|
||||
tooltipContent = `${accessWarning} as RLS via is not enforced on foreign tables`
|
||||
if (foreignTableHasLints) {
|
||||
tooltipContent = `${accessWarning} as RLS is not enforced on foreign tables`
|
||||
}
|
||||
break
|
||||
default:
|
||||
break
|
||||
|
||||
Reference in new issue
Block a user