Skip to content

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

Joshen/fe 2660 clean up stale feature flags enabled for 2 months part 2 (#43331)

Joshen Limddd94a9c2439
diff --git a/apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicaDetails.tsx b/apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicaDetails.tsx
index 5178b6daa02..1a0035403db 100644
--- a/apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicaDetails.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicaDetails.tsx
@@ -1,17 +1,6 @@
+import { useParams } from 'common'
import { BarChart2 } from 'lucide-react'
import { useMemo } from 'react'
-
-import { REPORT_DATERANGE_HELPER_LABELS } from '@/components/interfaces/Reports/Reports.constants'
-import { REPLICA_STATUS } from '@/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.constants'
-import { ScaffoldContainer, ScaffoldSection } from '@/components/layouts/Scaffold'
-import { useInfraMonitoringAttributesQuery } from '@/data/analytics/infra-monitoring-query'
-import { useLoadBalancersQuery } from '@/data/read-replicas/load-balancers-query'
-import { useReplicationLagQuery } from '@/data/read-replicas/replica-lag-query'
-import { useReadReplicasQuery } from '@/data/read-replicas/replicas-query'
-import { useReadReplicasStatusesQuery } from '@/data/read-replicas/replicas-status-query'
-import { useReportDateRange } from '@/hooks/misc/useReportDateRange'
-import { BASE_PATH } from '@/lib/constants'
-import { useFlag, useParams } from 'common'
import { AWS_REGIONS } from 'shared-data'
import { Card, CardContent, CardHeader, CardTitle } from 'ui'
import {
@@ -28,11 +17,21 @@ import {
import { Input } from 'ui-patterns/DataInputs/Input'
import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
+import { REPORT_DATERANGE_HELPER_LABELS } from '@/components/interfaces/Reports/Reports.constants'
+import { REPLICA_STATUS } from '@/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.constants'
+import { ScaffoldContainer, ScaffoldSection } from '@/components/layouts/Scaffold'
+import { useInfraMonitoringAttributesQuery } from '@/data/analytics/infra-monitoring-query'
+import { useLoadBalancersQuery } from '@/data/read-replicas/load-balancers-query'
+import { useReplicationLagQuery } from '@/data/read-replicas/replica-lag-query'
+import { useReadReplicasQuery } from '@/data/read-replicas/replicas-query'
+import { useReadReplicasStatusesQuery } from '@/data/read-replicas/replicas-status-query'
+import { useReportDateRange } from '@/hooks/misc/useReportDateRange'
+import { BASE_PATH } from '@/lib/constants'
+
const attribute = 'physical_replication_lag_physical_replication_lag_seconds'
export const ReadReplicaDetails = () => {
const { ref: projectRef, replicaId } = useParams()
- const reportGranularityV2 = useFlag('reportGranularityV2')
const { data = [], isPending: isLoadingDatabases } = useReadReplicasQuery({ projectRef })
const replica = data.find((x) => x.identifier === replicaId)
@@ -57,10 +56,7 @@ export const ReadReplicaDetails = () => {
{ enabled: status === REPLICA_STATUS.ACTIVE_HEALTHY }
)
- const { selectedDateRange } = useReportDateRange(
- REPORT_DATERANGE_HELPER_LABELS.LAST_60_MINUTES,
- reportGranularityV2
- )
+ const { selectedDateRange } = useReportDateRange(REPORT_DATERANGE_HELPER_LABELS.LAST_60_MINUTES)
// [Joshen] This is unused but intentional to scaffold the usage for now, refer to comment below
const { data: infraMonitoringData, isPending: isFetchingInfraMonitoring } =
useInfraMonitoringAttributesQuery(
diff --git a/apps/studio/components/interfaces/Observability/ObservabilityOverview.tsx b/apps/studio/components/interfaces/Observability/ObservabilityOverview.tsx
index a41b5d6e045..998916d8924 100644
--- a/apps/studio/components/interfaces/Observability/ObservabilityOverview.tsx
+++ b/apps/studio/components/interfaces/Observability/ObservabilityOverview.tsx
@@ -1,5 +1,5 @@
import { useQueryClient } from '@tanstack/react-query'
-import { useFlag, useParams } from 'common'
+import { useParams } from 'common'
import ReportHeader from 'components/interfaces/Reports/ReportHeader'
import ReportPadding from 'components/interfaces/Reports/ReportPadding'
import { ChartIntervalDropdown } from 'components/ui/Logs/ChartIntervalDropdown'
@@ -28,11 +28,6 @@ export const ObservabilityOverview = () => {
const { plan } = useCurrentOrgPlan()
const queryClient = useQueryClient()
- const authReportEnabled = useFlag('authreportv2')
- const edgeFnReportEnabled = useFlag('edgefunctionreport')
- const realtimeReportEnabled = useFlag('realtimeReport')
- const storageReportEnabled = useFlag('storagereport')
- const postgrestReportEnabled = useFlag('postgrestreport')
const { projectStorageAll: storageSupported } = useIsFeatureEnabled(['project_storage:all'])
const DEFAULT_INTERVAL: ChartIntervalKey = '1day'
@@ -77,7 +72,7 @@ export const ObservabilityOverview = () => {
reportUrl: `/project/${projectRef}/observability/auth`,
logsUrl: `/project/${projectRef}/logs/auth-logs`,
enabled: true,
- hasReport: authReportEnabled,
+ hasReport: true,
},
{
key: 'functions' as const,
@@ -85,7 +80,7 @@ export const ObservabilityOverview = () => {
reportUrl: `/project/${projectRef}/observability/edge-functions`,
logsUrl: `/project/${projectRef}/logs/edge-functions-logs`,
enabled: true,
- hasReport: edgeFnReportEnabled,
+ hasReport: true,
},
{
key: 'realtime' as const,
@@ -93,7 +88,7 @@ export const ObservabilityOverview = () => {
reportUrl: `/project/${projectRef}/observability/realtime`,
logsUrl: `/project/${projectRef}/logs/realtime-logs`,
enabled: true,
- hasReport: realtimeReportEnabled,
+ hasReport: true,
},
{
key: 'storage' as const,
@@ -101,7 +96,7 @@ export const ObservabilityOverview = () => {
reportUrl: `/project/${projectRef}/observability/storage`,
logsUrl: `/project/${projectRef}/logs/storage-logs`,
enabled: storageSupported,
- hasReport: storageReportEnabled,
+ hasReport: true,
},
{
key: 'postgrest' as const,
@@ -109,18 +104,10 @@ export const ObservabilityOverview = () => {
reportUrl: `/project/${projectRef}/observability/postgrest`,
logsUrl: `/project/${projectRef}/logs/postgrest-logs`,
enabled: true,
- hasReport: postgrestReportEnabled,
+ hasReport: true,
},
],
- [
- projectRef,
- authReportEnabled,
- edgeFnReportEnabled,
- realtimeReportEnabled,
- storageReportEnabled,
- storageSupported,
- postgrestReportEnabled,
- ]
+ [projectRef, storageSupported]
)
const enabledServices = serviceBase.filter((s) => s.enabled)
diff --git a/apps/studio/components/interfaces/Storage/AnalyticsBuckets/AnalyticsBucketDetails/ConnectTablesDialog.tsx b/apps/studio/components/interfaces/Storage/AnalyticsBuckets/AnalyticsBucketDetails/ConnectTablesDialog.tsx
index 62075f62eb8..4d29c5a141b 100644
--- a/apps/studio/components/interfaces/Storage/AnalyticsBuckets/AnalyticsBucketDetails/ConnectTablesDialog.tsx
+++ b/apps/studio/components/interfaces/Storage/AnalyticsBuckets/AnalyticsBucketDetails/ConnectTablesDialog.tsx
@@ -1,16 +1,8 @@
import { zodResolver } from '@hookform/resolvers/zod'
import { PermissionAction } from '@supabase/shared-types/out/constants'
-import { AnimatePresence, motion } from 'framer-motion'
-import { Loader2, Plus } from 'lucide-react'
-import { useEffect, useMemo, useState } from 'react'
-import { SubmitHandler, useForm } from 'react-hook-form'
-import { toast } from 'sonner'
-import z from 'zod'
-
-import { useFlag, useParams } from 'common'
+import { useParams } from 'common'
import { useIsETLPrivateAlpha } from 'components/interfaces/Database/Replication/useIsETLPrivateAlpha'
import { convertKVStringArrayToJson } from 'components/interfaces/Integrations/Wrappers/Wrappers.utils'
-import { ButtonTooltip } from 'components/ui/ButtonTooltip'
import { getKeys, useAPIKeysQuery } from 'data/api-keys/api-keys-query'
import { useProjectSettingsV2Query } from 'data/config/project-settings-v2-query'
import { useCreateDestinationPipelineMutation } from 'data/replication/create-destination-pipeline-mutation'
@@ -21,8 +13,13 @@ import { useReplicationSourcesQuery } from 'data/replication/sources-query'
import { useStartPipelineMutation } from 'data/replication/start-pipeline-mutation'
import { useReplicationTablesQuery } from 'data/replication/tables-query'
import { getDecryptedValues } from 'data/vault/vault-secret-decrypted-value-query'
+import { AnimatePresence, motion } from 'framer-motion'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { Loader2, Plus } from 'lucide-react'
+import { useEffect, useMemo, useState } from 'react'
+import { SubmitHandler, useForm } from 'react-hook-form'
+import { toast } from 'sonner'
import {
Button,
Dialog,
@@ -42,6 +39,8 @@ import {
import { Admonition } from 'ui-patterns'
import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
import { MultiSelector } from 'ui-patterns/multi-select'
+import z from 'zod'
+
import {
getAnalyticsBucketPublicationName,
getAnalyticsBucketsDestinationName,
@@ -100,12 +99,11 @@ interface ConnectTablesDialogProps {
onSuccessConnectTables: () => void
}
+/** [Joshen] This component is currently not user-facing atm, might opt to clean up as we're likely not going to use this UI flow */
export const ConnectTablesDialog = ({ onSuccessConnectTables }: ConnectTablesDialogProps) => {
const { ref: projectRef, bucketId } = useParams()
const [visible, setVisible] = useState(false)
- const isEnabled = useFlag('storageAnalyticsVector') // Kill switch if we wanna hold off supporting connecting tables
-
const { sourceId, pipeline, publication } = useAnalyticsBucketAssociatedEntities({
projectRef,
bucketId,
@@ -115,16 +113,9 @@ export const ConnectTablesDialog = ({ onSuccessConnectTables }: ConnectTablesDia
return (
<Dialog open={visible} onOpenChange={setVisible}>
<DialogTrigger asChild>
- <ButtonTooltip
- disabled={!isEnabled}
- size="tiny"
- type="primary"
- icon={<Plus />}
- onClick={() => setVisible(true)}
- tooltip={{ content: { side: 'bottom', text: !isEnabled ? 'Coming soon' : undefined } }}
- >
+ <Button size="tiny" type="primary" icon={<Plus />} onClick={() => setVisible(true)}>
{isEditingExistingPublication ? 'Add tables' : 'Connect tables'}
- </ButtonTooltip>
+ </Button>
</DialogTrigger>
{!sourceId ? (
diff --git a/apps/studio/components/layouts/ObservabilityLayout/ObservabilityMenu.tsx b/apps/studio/components/layouts/ObservabilityLayout/ObservabilityMenu.tsx
index b0e186cbb4e..6c7d4df9742 100644
--- a/apps/studio/components/layouts/ObservabilityLayout/ObservabilityMenu.tsx
+++ b/apps/studio/components/layouts/ObservabilityLayout/ObservabilityMenu.tsx
@@ -16,7 +16,7 @@ import { parseAsBoolean, useQueryState } from 'nuqs'
import { Fragment, useMemo, useState } from 'react'
import { toast } from 'sonner'
import type { Dashboards } from 'types'
-import { Menu, cn } from 'ui'
+import { cn, Menu } from 'ui'
import { InnerSideBarEmptyPanel } from 'ui-patterns'
import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal'
import { ShimmeringLoader } from 'ui-patterns/ShimmeringLoader'
@@ -29,15 +29,9 @@ const ObservabilityMenu = () => {
const { ref, id } = useParams()
const pageKey = (id || router.pathname.split('/')[4] || 'observability') as string
const showOverview = useFlag('observabilityOverview')
- const authEnabled = useFlag('authreportv2')
- const edgeFnEnabled = useFlag('edgefunctionreport')
- const realtimeEnabled = useFlag('realtimeReport')
- const storageReportEnabled = useFlag('storagereport')
- const postgrestReportEnabled = useFlag('postgrestreport')
// b/c fly doesn't support storage
const storageSupported = useIsFeatureEnabled('project_storage:all')
- const storageEnabled = storageReportEnabled && storageSupported
const { can: canCreateCustomReport } = useAsyncCheckPermissions(
PermissionAction.CREATE,
@@ -162,43 +156,27 @@ const ObservabilityMenu = () => {
title: 'PRODUCT',
key: 'product-section',
items: [
- ...(IS_PLATFORM
- ? [
- {
- name: 'Database',
- key: 'database',
- url: `/project/${ref}/observability/database${preservedQueryParams}`,
- },
- ]
- : []),
- ...(postgrestReportEnabled
- ? [
- {
- name: 'Data API',
- key: 'postgrest',
- url: `/project/${ref}/observability/postgrest${preservedQueryParams}`,
- },
- ]
- : []),
- ...(authEnabled
- ? [
- {
- name: 'Auth',
- key: 'auth',
- url: `/project/${ref}/observability/auth${preservedQueryParams}`,
- },
- ]
- : []),
- ...(edgeFnEnabled
- ? [
- {
- name: 'Edge Functions',
- key: 'edge-functions',
- url: `/project/${ref}/observability/edge-functions${preservedQueryParams}`,
- },
- ]
- : []),
- ...(storageEnabled
+ {
+ name: 'Database',
+ key: 'database',
+ url: `/project/${ref}/observability/database${preservedQueryParams}`,
+ },
+ {
+ name: 'Data API',
+ key: 'postgrest',
+ url: `/project/${ref}/observability/postgrest${preservedQueryParams}`,
+ },
+ {
+ name: 'Auth',
+ key: 'auth',
+ url: `/project/${ref}/observability/auth${preservedQueryParams}`,
+ },
+ {
+ name: 'Edge Functions',
+ key: 'edge-functions',
+ url: `/project/${ref}/observability/edge-functions${preservedQueryParams}`,
+ },
+ ...(storageSupported
? [
{
name: 'Storage',
@@ -207,15 +185,11 @@ const ObservabilityMenu = () => {
},
]
: []),
- ...(realtimeEnabled
- ? [
- {
- name: 'Realtime',
- key: 'realtime',
- url: `/project/${ref}/observability/realtime${preservedQueryParams}`,
- },
- ]
- : []),
+ {
+ name: 'Realtime',
+ key: 'realtime',
+ url: `/project/${ref}/observability/realtime${preservedQueryParams}`,
+ },
],
},
]
diff --git a/apps/studio/components/layouts/ReportsLayout/ReportsMenu.tsx b/apps/studio/components/layouts/ReportsLayout/ReportsMenu.tsx
index 6d4f00599ac..312840a4ea8 100644
--- a/apps/studio/components/layouts/ReportsLayout/ReportsMenu.tsx
+++ b/apps/studio/components/layouts/ReportsLayout/ReportsMenu.tsx
@@ -1,11 +1,5 @@
import { PermissionAction } from '@supabase/shared-types/out/constants'
-import { Plus } from 'lucide-react'
-import Link from 'next/link'
-import { useRouter } from 'next/router'
-import { useMemo, useState } from 'react'
-import { toast } from 'sonner'
-
-import { useFlag, useParams } from 'common'
+import { useParams } from 'common'
import { CreateReportModal } from 'components/interfaces/Reports/CreateReportModal'
import { UpdateCustomReportModal } from 'components/interfaces/Reports/UpdateModal'
import { ButtonTooltip } from 'components/ui/ButtonTooltip'
@@ -14,26 +8,26 @@ import { Content, useContentQuery } from 'data/content/content-query'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
import { useProfile } from 'lib/profile'
-import { Menu, cn } from 'ui'
+import { Plus } from 'lucide-react'
+import Link from 'next/link'
+import { useRouter } from 'next/router'
+import { parseAsBoolean, useQueryState } from 'nuqs'
+import { useMemo, useState } from 'react'
+import { toast } from 'sonner'
+import { cn, Menu } from 'ui'
import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal'
import { ShimmeringLoader } from 'ui-patterns/ShimmeringLoader'
+
import { ReportMenuItem } from './ReportMenuItem'
-import { useQueryState, parseAsBoolean } from 'nuqs'
const ReportsMenu = () => {
const router = useRouter()
const { profile } = useProfile()
const { ref, id } = useParams()
const pageKey = (id || router.pathname.split('/')[4]) as string
- const authEnabled = useFlag('authreportv2')
- const edgeFnEnabled = useFlag('edgefunctionreport')
- const realtimeEnabled = useFlag('realtimeReport')
- const storageReportEnabled = useFlag('storagereport')
- const postgrestReportEnabled = useFlag('postgrestreport')
// b/c fly doesn't support storage
const storageSupported = useIsFeatureEnabled('project_storage:all')
- const storageEnabled = storageReportEnabled && storageSupported
const { can: canCreateCustomReport } = useAsyncCheckPermissions(
PermissionAction.CREATE,
@@ -127,54 +121,37 @@ const ReportsMenu = () => {
key: 'api-overview',
url: `/project/${ref}/reports/api-overview${preservedQueryParams}`,
},
- ...(authEnabled
- ? [
- {
- name: 'Auth',
- key: 'auth',
- url: `/project/${ref}/reports/auth${preservedQueryParams}`,
- },
- ]
- : []),
+ {
+ name: 'Auth',
+ key: 'auth',
+ url: `/project/${ref}/reports/auth${preservedQueryParams}`,
+ },
{
name: 'Database',
key: 'database',
url: `/project/${ref}/reports/database${preservedQueryParams}`,
},
- ...(edgeFnEnabled
- ? [
- {
- name: 'Edge Functions',
- key: 'edge-functions',
- url: `/project/${ref}/reports/edge-functions${preservedQueryParams}`,
- },
- ]
- : []),
+ {
+ name: 'Edge Functions',
+ key: 'edge-functions',
+ url: `/project/${ref}/reports/edge-functions${preservedQueryParams}`,
+ },
{
name: 'Query Performance',
key: 'query-performance',
url: `/project/${ref}/reports/query-performance${preservedQueryParams}`,
},
- ...(postgrestReportEnabled
- ? [
- {
- name: 'PostgREST',
- key: 'postgrest',
- url: `/project/${ref}/reports/postgrest${preservedQueryParams}`,
- },
- ]
- : []),
- ...(realtimeEnabled
- ? [
- {
- name: 'Realtime',
- key: 'realtime',
- url: `/project/${ref}/reports/realtime${preservedQueryParams}`,
- },
- ]
- : []),
-
- ...(storageEnabled
+ {
+ name: 'PostgREST',
+ key: 'postgrest',
+ url: `/project/${ref}/reports/postgrest${preservedQueryParams}`,
+ },
+ {
+ name: 'Realtime',
+ key: 'realtime',
+ url: `/project/${ref}/reports/realtime${preservedQueryParams}`,
+ },
+ ...(storageSupported
? [
{
name: 'Storage',
diff --git a/apps/studio/hooks/misc/useReportDateRange.ts b/apps/studio/hooks/misc/useReportDateRange.ts
index c55756b4008..a4744ada6e6 100644
--- a/apps/studio/hooks/misc/useReportDateRange.ts
+++ b/apps/studio/hooks/misc/useReportDateRange.ts
@@ -46,8 +46,7 @@ export const useReportDateRange = (
defaultHelper:
| REPORT_DATERANGE_HELPER_LABELS
| string
- | ReportsDatetimeHelper = REPORT_DATERANGE_HELPER_LABELS.LAST_60_MINUTES,
- useV2Granularity = false
+ | ReportsDatetimeHelper = REPORT_DATERANGE_HELPER_LABELS.LAST_60_MINUTES
) => {
const { plan: orgPlan, isLoading: isOrgPlanLoading } = useCurrentOrgPlan()
const [showUpgradePrompt, setShowUpgradePrompt] = useState(false)
@@ -180,35 +179,11 @@ export const useReportDateRange = (
const diffInDays = dayjs(to).diff(from, 'day', true)
const diffInHours = dayjs(to).diff(from, 'hour', true)
- if (useV2Granularity) {
- if (diffInHours <= 1) return '1m'
- if (diffInHours <= 12) return '2m'
- if (diffInHours <= 24) return '10m'
- if (diffInDays <= 7) return '1h'
- return '1d'
- }
-
- const conditions = {
- '1m': diffInHours < 1.1, // less than 1.1 hours
- '5m': diffInHours < 3.1, // less than 3.1 hours
- '10m': diffInHours < 6.1, // less than 6.1 hours
- '30m': diffInHours < 25, // less than 25 hours
- '1h': diffInDays < 10, // less than 10 days
- '1d': diffInDays >= 10, // more than 10 days
- }
-
- switch (true) {
- case conditions['1m']:
- return '1m'
- case conditions['5m']:
- return '5m'
- case conditions['10m']:
- return '10m'
- case conditions['30m']:
- return '30m'
- default:
- return '1h'
- }
+ if (diffInHours <= 1) return '1m'
+ if (diffInHours <= 12) return '2m'
+ if (diffInHours <= 24) return '10m'
+ if (diffInDays <= 7) return '1h'
+ return '1d'
}
// Derive selectedDateRange from current values
@@ -218,7 +193,7 @@ export const useReportDateRange = (
period_end: { date: timestampEnd, time_period: 'today' },
interval: handleIntervalGranularity(timestampStart, timestampEnd),
}),
- [timestampStart, timestampEnd, useV2Granularity]
+ [timestampStart, timestampEnd]
)
const updateDateRange = useCallback(
diff --git a/apps/studio/pages/project/[ref]/functions/[functionSlug]/index.tsx b/apps/studio/pages/project/[ref]/functions/[functionSlug]/index.tsx
index b2708a94193..62863ee2593 100644
--- a/apps/studio/pages/project/[ref]/functions/[functionSlug]/index.tsx
+++ b/apps/studio/pages/project/[ref]/functions/[functionSlug]/index.tsx
@@ -1,5 +1,5 @@
import { PermissionAction } from '@supabase/shared-types/out/constants'
-import { IS_PLATFORM, useFlag, useParams } from 'common'
+import { IS_PLATFORM, useParams } from 'common'
import { EdgeFunctionRecentInvocations } from 'components/interfaces/Functions/EdgeFunctionRecentInvocations'
import ReportWidget from 'components/interfaces/Reports/ReportWidget'
import DefaultLayout from 'components/layouts/DefaultLayout'
@@ -19,7 +19,7 @@ import maxBy from 'lodash/maxBy'
import meanBy from 'lodash/meanBy'
import sumBy from 'lodash/sumBy'
import { useRouter } from 'next/router'
-import { useEffect, useMemo, useState } from 'react'
+import { useMemo, useState } from 'react'
import type { ChartIntervals, NextPageWithLayout } from 'types'
import {
Alert_Shadcn_,
@@ -66,7 +66,6 @@ const PageLayout: NextPageWithLayout = () => {
const router = useRouter()
const { ref: projectRef, functionSlug } = useParams()
- const newChartsEnabled = useFlag('newEdgeFunctionOverviewCharts')
const [interval, setInterval] = useState<string>('15min')
const selectedInterval = CHART_INTERVALS.find((i) => i.key === interval) || CHART_INTERVALS[1]
const { data: selectedFunction } = useEdgeFunctionQuery({
@@ -204,20 +203,18 @@ const PageLayout: NextPageWithLayout = () => {
format="ms"
highlightedValue={meanBy(props.data, 'avg_execution_time')}
/>
- {newChartsEnabled && (
- <AreaChart
- title="Max execution time"
- className="w-full"
- xAxisKey="timestamp"
- customDateFormat={selectedInterval.format}
- yAxisKey="max_execution_time"
- data={props.data}
- format="ms"
- highlightedValue={
- maxBy(props.data, 'max_execution_time')?.max_execution_time
- }
- />
- )}
+ <AreaChart
+ title="Max execution time"
+ className="w-full"
+ xAxisKey="timestamp"
+ customDateFormat={selectedInterval.format}
+ yAxisKey="max_execution_time"
+ data={props.data}
+ format="ms"
+ highlightedValue={
+ maxBy(props.data, 'max_execution_time')?.max_execution_time
+ }
+ />
</div>
)
}}
@@ -302,24 +299,22 @@ const PageLayout: NextPageWithLayout = () => {
)
}}
/>
- {newChartsEnabled && (
- <StackedBarChart
- title="Worker Logs"
- className="w-full"
- xAxisKey="timestamp"
- yAxisKey="count"
- stackKey="status"
- data={logsData}
- highlightedValue={sumBy(logsData, 'count')}
- customDateFormat={selectedInterval.format}
- stackColors={['red', 'brand', 'yellow']}
- onBarClick={() => {
- router.push(
- `/project/${projectRef}/functions/${functionSlug}/logs?its=${startDate.toISOString()}`
- )
- }}
- />
- )}
+ <StackedBarChart
+ title="Worker Logs"
+ className="w-full"
+ xAxisKey="timestamp"
+ yAxisKey="count"
+ stackKey="status"
+ data={logsData}
+ highlightedValue={sumBy(logsData, 'count')}
+ customDateFormat={selectedInterval.format}
+ stackColors={['red', 'brand', 'yellow']}
+ onBarClick={() => {
+ router.push(
+ `/project/${projectRef}/functions/${functionSlug}/logs?its=${startDate.toISOString()}`
+ )
+ }}
+ />
</div>
)
}
@@ -351,20 +346,16 @@ const PageLayout: NextPageWithLayout = () => {
format="ms"
highlightedValue={meanBy(props.data, 'avg_cpu_time_used')}
/>
- {newChartsEnabled && (
- <AreaChart
- title="Max CPU Time"
- className="w-full"
- xAxisKey="timestamp"
- customDateFormat={selectedInterval.format}
- yAxisKey="max_cpu_time_used"
- data={props.data}
- format="ms"
- highlightedValue={
- maxBy(props.data, 'max_cpu_time_used')?.max_cpu_time_used
- }
- />
- )}
+ <AreaChart
+ title="Max CPU Time"
+ className="w-full"
+ xAxisKey="timestamp"
+ customDateFormat={selectedInterval.format}
+ yAxisKey="max_cpu_time_used"
+ data={props.data}
+ format="ms"
+ highlightedValue={maxBy(props.data, 'max_cpu_time_used')?.max_cpu_time_used}
+ />
</div>
)
}}
@@ -414,20 +405,18 @@ const PageLayout: NextPageWithLayout = () => {
format="MB"
highlightedValue={meanBy(props.data, 'avg_memory_used')}
/>
- {newChartsEnabled && (
- <StackedBarChart
- title="Average Memory Usage by Type"
- className="w-full"
- xAxisKey="timestamp"
- yAxisKey="count"
- stackKey="type"
- format="MB"
- data={memoryData}
- highlightedValue={sumBy(memoryData, 'count')}
- customDateFormat={selectedInterval.format}
- stackColors={['blue', 'brand']}
- />
- )}
+ <StackedBarChart
+ title="Average Memory Usage by Type"
+ className="w-full"
+ xAxisKey="timestamp"
+ yAxisKey="count"
+ stackKey="type"
+ format="MB"
+ data={memoryData}
+ highlightedValue={sumBy(memoryData, 'count')}
+ customDateFormat={selectedInterval.format}
+ stackColors={['blue', 'brand']}
+ />
</div>
)
}}
diff --git a/apps/studio/pages/project/[ref]/observability/database.tsx b/apps/studio/pages/project/[ref]/observability/database.tsx
index cdbeac91ac1..da3f9b26c82 100644
--- a/apps/studio/pages/project/[ref]/observability/database.tsx
+++ b/apps/studio/pages/project/[ref]/observability/database.tsx
@@ -1,12 +1,6 @@
import { PermissionAction } from '@supabase/shared-types/out/constants'
import { useQueryClient } from '@tanstack/react-query'
-import dayjs from 'dayjs'
-import { ArrowRight, ExternalLink, RefreshCw } from 'lucide-react'
-import Link from 'next/link'
-import { useEffect, useRef, useState } from 'react'
-import { toast } from 'sonner'
-
-import { useFlag, useParams } from 'common'
+import { useParams } from 'common'
import ReportHeader from 'components/interfaces/Reports/ReportHeader'
import ReportPadding from 'components/interfaces/Reports/ReportPadding'
import { REPORT_DATERANGE_HELPER_LABELS } from 'components/interfaces/Reports/Reports.constants'
@@ -36,15 +30,20 @@ import { usePgbouncerConfigQuery } from 'data/database/pgbouncer-config-query'
import { getReportAttributesV2 } from 'data/reports/database-charts'
import { useDatabaseReport } from 'data/reports/database-report-query'
import { useProjectAddonsQuery } from 'data/subscriptions/project-addons-query'
+import dayjs from 'dayjs'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useRefreshHandler, useReportDateRange } from 'hooks/misc/useReportDateRange'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
import { DOCS_URL } from 'lib/constants'
import { formatBytes } from 'lib/helpers'
+import { ArrowRight, ExternalLink, RefreshCw } from 'lucide-react'
+import Link from 'next/link'
+import { useEffect, useRef, useState } from 'react'
+import { toast } from 'sonner'
import { useDatabaseSelectorStateSnapshot } from 'state/database-selector'
import type { NextPageWithLayout } from 'types'
-import { AlertDescription_Shadcn_, Alert_Shadcn_, Button } from 'ui'
+import { Alert_Shadcn_, AlertDescription_Shadcn_, Button } from 'ui'
const DatabaseReport: NextPageWithLayout = () => {
return (
@@ -67,7 +66,6 @@ const DatabaseUsage = () => {
const { db, chart, ref } = useParams()
const { data: project } = useSelectedProjectQuery()
const { data: org } = useSelectedOrganizationQuery()
- const reportGranularityV2 = useFlag('reportGranularityV2')
const {
selectedDateRange,
@@ -78,7 +76,7 @@ const DatabaseUsage = () => {
showUpgradePrompt,
setShowUpgradePrompt,
handleDatePickerChange,
- } = useReportDateRange(REPORT_DATERANGE_HELPER_LABELS.LAST_60_MINUTES, reportGranularityV2)
+ } = useReportDateRange(REPORT_DATERANGE_HELPER_LABELS.LAST_60_MINUTES)
const state = useDatabaseSelectorStateSnapshot()
const queryClient = useQueryClient()
diff --git a/apps/studio/state/table-editor-table.tsx b/apps/studio/state/table-editor-table.tsx
index 4641a5548ab..b2d863355b5 100644
--- a/apps/studio/state/table-editor-table.tsx
+++ b/apps/studio/state/table-editor-table.tsx
@@ -1,4 +1,3 @@
-import { useFlag } from 'common'
import { TableIndexAdvisorProvider } from 'components/grid/context/TableIndexAdvisorContext'
import {
loadTableEditorStateFromLocalStorage,
@@ -196,7 +195,6 @@ export const TableEditorTableStateContextProvider = ({
table,
...props
}: PropsWithChildren<TableEditorTableStateContextProviderProps>) => {
- const showIndexAdvisor = useFlag('ShowIndexAdvisorOnTableEditor')
const tableEditorSnap = useTableEditorStateSnapshot()
const state = useRef(
createTableEditorTableState({
@@ -246,7 +244,7 @@ export const TableEditorTableStateContextProvider = ({
return (
<TableEditorTableStateContext.Provider value={state}>
- {showIndexAdvisor && state.table.schema ? (
+ {state.table.schema ? (
<TableIndexAdvisorProvider schema={state.table.schema ?? 'public'} table={state.table.name}>
{children}
</TableIndexAdvisorProvider>