Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix: Bail on audit logs permissions (#28096)

Kamil Ogórek057b2f17055b
diff --git a/apps/studio/components/interfaces/Organization/AuditLogs/AuditLogs.tsx b/apps/studio/components/interfaces/Organization/AuditLogs/AuditLogs.tsx
index c4b98bb7504..8a0865d6e8e 100644
--- a/apps/studio/components/interfaces/Organization/AuditLogs/AuditLogs.tsx
+++ b/apps/studio/components/interfaces/Organization/AuditLogs/AuditLogs.tsx
@@ -69,7 +69,7 @@ const AuditLogs = () => {
{
enabled: canReadAuditLogs,
retry(_failureCount, error) {
- if (error.message.endsWith('upgrade to team or Enterprise Plan to access audit logs.')) {
+ if (error.message.endsWith('upgrade to Team or Enterprise Plan to access audit logs.')) {
return false
}
return true
@@ -144,7 +144,7 @@ const AuditLogs = () => {
)}
{isError ? (
- error.message.endsWith('upgrade to team or Enterprise Plan to access audit logs.') ? (
+ error.message.endsWith('upgrade to Team or Enterprise Plan to access audit logs.') ? (
<Alert_Shadcn_
variant="default"
title="Organization Audit Logs are not available on Free or Pro plans"
diff --git a/apps/studio/components/interfaces/Reports/renderers/ApiRenderers.tsx b/apps/studio/components/interfaces/Reports/renderers/ApiRenderers.tsx
index 18f848a3938..31724e689f6 100644
--- a/apps/studio/components/interfaces/Reports/renderers/ApiRenderers.tsx
+++ b/apps/studio/components/interfaces/Reports/renderers/ApiRenderers.tsx
@@ -1,6 +1,6 @@
import sumBy from 'lodash/sumBy'
-import { Fragment, useState } from 'react'
import { ChevronRight } from 'lucide-react'
+import { Fragment, useState } from 'react'
import { useParams } from 'common'
import {
@@ -8,20 +8,20 @@ import {
TextFormatter,
} from 'components/interfaces/Settings/Logs/LogsFormatters'
import Table from 'components/to-be-cleaned/Table'
+import AlertError from 'components/ui/AlertError'
import BarChart from 'components/ui/Charts/BarChart'
import { useFillTimeseriesSorted } from 'hooks/analytics/useFillTimeseriesSorted'
+import { ResponseError } from 'types'
import {
Alert_Shadcn_,
AlertDescription_Shadcn_,
AlertTitle_Shadcn_,
Button,
Collapsible,
+ WarningIcon,
} from 'ui'
import { queryParamsToObject } from '../Reports.utils'
import { ReportWidgetProps, ReportWidgetRendererProps } from '../ReportWidget'
-import AlertError from 'components/ui/AlertError'
-import { ResponseError } from 'types'
-import { WarningIcon } from 'ui-patterns/Icons/StatusIcons'
export const NetworkTrafficRenderer = (
props: ReportWidgetProps<{
diff --git a/apps/studio/pages/project/[ref]/functions/[functionSlug]/index.tsx b/apps/studio/pages/project/[ref]/functions/[functionSlug]/index.tsx
index 3f57756e7a8..d305ac3490c 100644
--- a/apps/studio/pages/project/[ref]/functions/[functionSlug]/index.tsx
+++ b/apps/studio/pages/project/[ref]/functions/[functionSlug]/index.tsx
@@ -17,8 +17,13 @@ import { useEdgeFunctionQuery } from 'data/edge-functions/edge-function-query'
import { useFillTimeseriesSorted } from 'hooks/analytics/useFillTimeseriesSorted'
import { useCheckPermissions } from 'hooks/misc/useCheckPermissions'
import type { ChartIntervals, NextPageWithLayout } from 'types'
-import { AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_, Button } from 'ui'
-import { WarningIcon } from 'ui-patterns/Icons/StatusIcons'
+import {
+ AlertDescription_Shadcn_,
+ AlertTitle_Shadcn_,
+ Alert_Shadcn_,
+ Button,
+ WarningIcon,
+} from 'ui'
const CHART_INTERVALS: ChartIntervals[] = [
{