From a88c88fa3641de17c3826b58faa5c30455a6f21a Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Mon, 5 Jan 2026 12:14:19 +0700 Subject: [PATCH] Hide RLS disabled CTA in table editor header if no lints (#41517) * Hide RLS disabled CTA in table editor header if no lints * Clean * Update e2e tests * INvlidate lints when creating tbale * Revert * Invalidate lints when duplicating table --- .../interfaces/Settings/API/PostgrestConfig.tsx | 2 -- .../TableGridEditor/GridHeaderActions.tsx | 12 ++++++++++-- .../SidePanelEditor/SidePanelEditor.tsx | 3 +++ .../project-postgrest-config-update-mutation.ts | 6 +++++- e2e/studio/features/table-editor.spec.ts | 13 +++++++++---- 5 files changed, 27 insertions(+), 9 deletions(-) diff --git a/apps/studio/components/interfaces/Settings/API/PostgrestConfig.tsx b/apps/studio/components/interfaces/Settings/API/PostgrestConfig.tsx index 1d88dcdf0d5..454d3fcf907 100644 --- a/apps/studio/components/interfaces/Settings/API/PostgrestConfig.tsx +++ b/apps/studio/components/interfaces/Settings/API/PostgrestConfig.tsx @@ -35,11 +35,9 @@ import { Form_Shadcn_, Input_Shadcn_, PrePostTab, - Separator, Skeleton, Switch, WarningIcon, - cn, } from 'ui' import { GenericSkeletonLoader } from 'ui-patterns' import { Admonition } from 'ui-patterns/admonition' diff --git a/apps/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx b/apps/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx index fc77f12c9c4..0c91f6e92a0 100644 --- a/apps/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx +++ b/apps/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx @@ -161,6 +161,14 @@ export const GridHeaderActions = ({ table, isRefetching }: GridHeaderActionsProp // This will change when we allow autogenerated API docs for schemas other than `public` const doesHaveAutoGeneratedAPIDocs = table.schema === 'public' + const { hasLint: tableHasLints } = getEntityLintDetails( + table.name, + 'rls_disabled_in_public', + ['ERROR'], + lints, + table.schema + ) + const { hasLint: viewHasLints, matchingLint: matchingViewLint } = getEntityLintDetails( table.name, 'security_definer_view', @@ -301,7 +309,7 @@ export const GridHeaderActions = ({ table, isRefetching }: GridHeaderActionsProp )} - ) : ( + ) : tableHasLints ? (