Skip to content

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

Chore/cleanup feature flags 130524 (#35648)

Joshen Lim9139418ef0d3
diff --git a/apps/studio/components/interfaces/Functions/FunctionsEmptyState.tsx b/apps/studio/components/interfaces/Functions/FunctionsEmptyState.tsx
index d2bf5dab7ea..bdb96a65b02 100644
--- a/apps/studio/components/interfaces/Functions/FunctionsEmptyState.tsx
+++ b/apps/studio/components/interfaces/Functions/FunctionsEmptyState.tsx
@@ -4,7 +4,6 @@ import { ResourceItem } from 'components/ui/Resource/ResourceItem'
import { ResourceList } from 'components/ui/Resource/ResourceList'
import { useSendEventMutation } from 'data/telemetry/send-event-mutation'
import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'
-import { useFlag } from 'hooks/ui/useFlag'
import { Code, Terminal } from 'lucide-react'
import Link from 'next/link'
import { useRouter } from 'next/router'
@@ -28,7 +27,6 @@ export const FunctionsEmptyState = () => {
const { ref } = useParams()
const router = useRouter()
const aiSnap = useAiAssistantStateSnapshot()
- const edgeFunctionCreate = useFlag('edgeFunctionCreate')
const { mutate: sendEvent } = useSendEventMutation()
const org = useSelectedOrganization()
@@ -41,30 +39,28 @@ export const FunctionsEmptyState = () => {
</CardHeader>
<CardContent className="p-0 grid grid-cols-[repeat(auto-fit,minmax(240px,1fr))] divide-y md:divide-y-0 md:divide-x divide-default items-stretch">
{/* Editor Option */}
- {edgeFunctionCreate && (
- <div className="p-8">
- <div className="flex items-center gap-2">
- <Code strokeWidth={1.5} size={20} />
- <h4 className="text-base text-foreground">Via Editor</h4>
- </div>
- <p className="text-sm text-foreground-light mb-4 mt-1">
- Create and edit functions directly in the browser. Download to local at any time.
- </p>
- <Button
- type="default"
- onClick={() => {
- router.push(`/project/${ref}/functions/new`)
- sendEvent({
- action: 'edge_function_via_editor_button_clicked',
- properties: { origin: 'no_functions_block' },
- groups: { project: ref ?? 'Unknown', organization: org?.slug ?? 'Unknown' },
- })
- }}
- >
- Open Editor
- </Button>
+ <div className="p-8">
+ <div className="flex items-center gap-2">
+ <Code strokeWidth={1.5} size={20} />
+ <h4 className="text-base text-foreground">Via Editor</h4>
</div>
- )}
+ <p className="text-sm text-foreground-light mb-4 mt-1">
+ Create and edit functions directly in the browser. Download to local at any time.
+ </p>
+ <Button
+ type="default"
+ onClick={() => {
+ router.push(`/project/${ref}/functions/new`)
+ sendEvent({
+ action: 'edge_function_via_editor_button_clicked',
+ properties: { origin: 'no_functions_block' },
+ groups: { project: ref ?? 'Unknown', organization: org?.slug ?? 'Unknown' },
+ })
+ }}
+ >
+ Open Editor
+ </Button>
+ </div>
{/* AI Assistant Option */}
<div className="p-8">
@@ -138,33 +134,29 @@ export const FunctionsEmptyState = () => {
</div>
</CardContent>
</Card>
- {edgeFunctionCreate && (
- <>
- <ScaffoldSectionTitle className="text-xl mb-4 mt-12">
- Start with a template
- </ScaffoldSectionTitle>
- <ResourceList>
- {EDGE_FUNCTION_TEMPLATES.map((template) => (
- <ResourceItem
- key={template.name}
- media={<Code strokeWidth={1.5} size={16} className="-translate-y-[9px]" />}
- onClick={() => {
- sendEvent({
- action: 'edge_function_template_clicked',
- properties: { templateName: template.name, origin: 'functions_page' },
- groups: { project: ref ?? 'Unknown', organization: org?.slug ?? 'Unknown' },
- })
- }}
- >
- <Link href={`/project/${ref}/functions/new?template=${template.value}`}>
- <p>{template.name}</p>
- <p className="text-sm text-foreground-lighter">{template.description}</p>
- </Link>
- </ResourceItem>
- ))}
- </ResourceList>
- </>
- )}
+ <ScaffoldSectionTitle className="text-xl mb-4 mt-12">
+ Start with a template
+ </ScaffoldSectionTitle>
+ <ResourceList>
+ {EDGE_FUNCTION_TEMPLATES.map((template) => (
+ <ResourceItem
+ key={template.name}
+ media={<Code strokeWidth={1.5} size={16} className="-translate-y-[9px]" />}
+ onClick={() => {
+ sendEvent({
+ action: 'edge_function_template_clicked',
+ properties: { templateName: template.name, origin: 'functions_page' },
+ groups: { project: ref ?? 'Unknown', organization: org?.slug ?? 'Unknown' },
+ })
+ }}
+ >
+ <Link href={`/project/${ref}/functions/new?template=${template.value}`}>
+ <p>{template.name}</p>
+ <p className="text-sm text-foreground-lighter">{template.description}</p>
+ </Link>
+ </ResourceItem>
+ ))}
+ </ResourceList>
</>
)
}
diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/CreditBalance.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/CreditBalance.tsx
index 11e8d02f1be..bb5344693d4 100644
--- a/apps/studio/components/interfaces/Organization/BillingSettings/CreditBalance.tsx
+++ b/apps/studio/components/interfaces/Organization/BillingSettings/CreditBalance.tsx
@@ -12,12 +12,10 @@ import { FormSection, FormSectionContent } from 'components/ui/Forms/FormSection
import NoPermission from 'components/ui/NoPermission'
import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-query'
import { useAsyncCheckProjectPermissions } from 'hooks/misc/useCheckPermissions'
-import { useFlag } from 'hooks/ui/useFlag'
import { CreditTopUp } from './CreditTopUp'
const CreditBalance = () => {
const { slug } = useParams()
- const creditTopUpEnabled = useFlag('creditTopUp')
const { isSuccess: isPermissionsLoaded, can: canReadSubscriptions } =
useAsyncCheckProjectPermissions(PermissionAction.BILLING_READ, 'stripe.subscriptions')
@@ -55,32 +53,30 @@ const CreditBalance = () => {
{isPermissionsLoaded && !canReadSubscriptions ? (
<NoPermission resourceText="view this organization's credits" />
) : (
- <>
- <FormPanel footer={creditTopUpEnabled ? <CreditTopUp slug={slug} /> : null}>
- <FormSection>
- <FormSectionContent fullWidth loading={isLoading}>
- {isError && (
- <AlertError
- subject="Failed to retrieve organization customer profile"
- error={error}
- />
- )}
+ <FormPanel footer={<CreditTopUp slug={slug} />}>
+ <FormSection>
+ <FormSectionContent fullWidth loading={isLoading}>
+ {isError && (
+ <AlertError
+ subject="Failed to retrieve organization customer profile"
+ error={error}
+ />
+ )}
- {isSuccess && (
- <div className="flex w-full justify-between items-center">
- <span>Balance</span>
- <div className="flex items-center space-x-1">
- {isDebt && <h4 className="opacity-50">-</h4>}
- <h4 className="opacity-50">$</h4>
- <h2 className="text-2xl relative">{balance}</h2>
- {isCredit && <h4 className="opacity-50">/credits</h4>}
- </div>
+ {isSuccess && (
+ <div className="flex w-full justify-between items-center">
+ <span>Balance</span>
+ <div className="flex items-center space-x-1">
+ {isDebt && <h4 className="opacity-50">-</h4>}
+ <h4 className="opacity-50">$</h4>
+ <h2 className="text-2xl relative">{balance}</h2>
+ {isCredit && <h4 className="opacity-50">/credits</h4>}
</div>
- )}
- </FormSectionContent>
- </FormSection>
- </FormPanel>
- </>
+ </div>
+ )}
+ </FormSectionContent>
+ </FormSection>
+ </FormPanel>
)}
</ScaffoldSectionContent>
</ScaffoldSection>
diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/PlanUpdateSidePanel.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/PlanUpdateSidePanel.tsx
index b0d72ca2baf..cf47851064d 100644
--- a/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/PlanUpdateSidePanel.tsx
+++ b/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/PlanUpdateSidePanel.tsx
@@ -17,7 +17,6 @@ import type { OrgPlan } from 'data/subscriptions/types'
import { useSendEventMutation } from 'data/telemetry/send-event-mutation'
import { useCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'
-import { useFlag } from 'hooks/ui/useFlag'
import { formatCurrency } from 'lib/helpers'
import { pickFeatures, pickFooter, plans as subscriptionsPlans } from 'shared-data/plans'
import { useOrgSettingsPageStateSnapshot } from 'state/organization-settings'
@@ -36,7 +35,6 @@ const PlanUpdateSidePanel = () => {
const { mutate: sendEvent } = useSendEventMutation()
const originalPlanRef = useRef<string>()
- const allowOrioleDB = useFlag('allowOrioleDb')
const [showExitSurvey, setShowExitSurvey] = useState(false)
const [showUpgradeSurvey, setShowUpgradeSurvey] = useState(false)
@@ -52,8 +50,8 @@ const PlanUpdateSidePanel = () => {
(it) => it.organization_id === selectedOrganization?.id
)
- const { data } = useOrganizationQuery({ slug }, { enabled: allowOrioleDB })
- const hasOrioleProjects = allowOrioleDB ? false : !!data?.has_oriole_project
+ const { data } = useOrganizationQuery({ slug })
+ const hasOrioleProjects = !!data?.has_oriole_project
const snap = useOrgSettingsPageStateSnapshot()
const visible = snap.panelKey === 'subscriptionPlan'
diff --git a/apps/studio/components/interfaces/Reports/MetricOptions.tsx b/apps/studio/components/interfaces/Reports/MetricOptions.tsx
index 63e830f6f53..fed79e7c292 100644
--- a/apps/studio/components/interfaces/Reports/MetricOptions.tsx
+++ b/apps/studio/components/interfaces/Reports/MetricOptions.tsx
@@ -7,7 +7,6 @@ import { useContentQuery } from 'data/content/content-query'
import { useSendEventMutation } from 'data/telemetry/send-event-mutation'
import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'
-import { useFlag } from 'hooks/ui/useFlag'
import { Metric, METRIC_CATEGORIES, METRICS } from 'lib/constants/metrics'
import { Dashboards } from 'types'
import {
@@ -41,7 +40,6 @@ interface MetricOptionsProps {
export const MetricOptions = ({ config, handleChartSelection }: MetricOptionsProps) => {
const { ref: projectRef } = useParams()
const selectedOrganization = useSelectedOrganization()
- const supportSQLBlocks = useFlag('reportsV2')
const [search, setSearch] = useState('')
const { projectAuthAll: authEnabled, projectStorageAll: storageEnabled } = useIsFeatureEnabled([
@@ -98,70 +96,68 @@ export const MetricOptions = ({ config, handleChartSelection }: MetricOptionsPro
</DropdownMenuSub>
)
})}
- {supportSQLBlocks && (
- <DropdownMenuSub>
- <DropdownMenuSubTrigger className="space-x-2">
- <SQL_ICON
- size={14}
- strokeWidth={1.5}
- className="fill-foreground-light w-5 h-4 shrink-0 grow-0 -ml-0.5"
- />
- <p>SQL Snippets</p>
- </DropdownMenuSubTrigger>
- <DropdownMenuPortal>
- <DropdownMenuSubContent className="p-0">
- <Command_Shadcn_ shouldFilter={false}>
- <CommandInput_Shadcn_
- autoFocus
- placeholder="Search snippets..."
- value={search}
- onValueChange={setSearch}
- />
- <CommandList_Shadcn_>
- {isLoading ? (
- <div className="flex flex-col p-1 gap-y-1">
- <ShimmeringLoader />
- <ShimmeringLoader className="w-3/4" />
- </div>
- ) : (
- <CommandEmpty_Shadcn_>No snippets found</CommandEmpty_Shadcn_>
- )}
- <CommandGroup_Shadcn_>
- {snippets?.map((snippet) => (
- <CommandItem_Shadcn_
- key={snippet.id}
- value={snippet.id}
- className="cursor-pointer"
- onSelect={() => {
- if (!config?.layout.find((x) => x.id === snippet.id)) {
- handleChartSelection({
- metric: {
- id: snippet.id,
- key: `snippet_${snippet.id}`,
- label: snippet.name,
- },
- isAddingChart: true,
- })
- sendEvent({
- action: 'custom_report_add_sql_block_clicked',
- groups: {
- project: projectRef ?? 'Unknown',
- organization: selectedOrganization?.slug ?? 'Unknown',
- },
- })
- }
- }}
- >
- {snippet.name}
- </CommandItem_Shadcn_>
- ))}
- </CommandGroup_Shadcn_>
- </CommandList_Shadcn_>
- </Command_Shadcn_>
- </DropdownMenuSubContent>
- </DropdownMenuPortal>
- </DropdownMenuSub>
- )}
+ <DropdownMenuSub>
+ <DropdownMenuSubTrigger className="space-x-2">
+ <SQL_ICON
+ size={14}
+ strokeWidth={1.5}
+ className="fill-foreground-light w-5 h-4 shrink-0 grow-0 -ml-0.5"
+ />
+ <p>SQL Snippets</p>
+ </DropdownMenuSubTrigger>
+ <DropdownMenuPortal>
+ <DropdownMenuSubContent className="p-0">
+ <Command_Shadcn_ shouldFilter={false}>
+ <CommandInput_Shadcn_
+ autoFocus
+ placeholder="Search snippets..."
+ value={search}
+ onValueChange={setSearch}
+ />
+ <CommandList_Shadcn_>
+ {isLoading ? (
+ <div className="flex flex-col p-1 gap-y-1">
+ <ShimmeringLoader />
+ <ShimmeringLoader className="w-3/4" />
+ </div>
+ ) : (
+ <CommandEmpty_Shadcn_>No snippets found</CommandEmpty_Shadcn_>
+ )}
+ <CommandGroup_Shadcn_>
+ {snippets?.map((snippet) => (
+ <CommandItem_Shadcn_
+ key={snippet.id}
+ value={snippet.id}
+ className="cursor-pointer"
+ onSelect={() => {
+ if (!config?.layout.find((x) => x.id === snippet.id)) {
+ handleChartSelection({
+ metric: {
+ id: snippet.id,
+ key: `snippet_${snippet.id}`,
+ label: snippet.name,
+ },
+ isAddingChart: true,
+ })
+ sendEvent({
+ action: 'custom_report_add_sql_block_clicked',
+ groups: {
+ project: projectRef ?? 'Unknown',
+ organization: selectedOrganization?.slug ?? 'Unknown',
+ },
+ })
+ }
+ }}
+ >
+ {snippet.name}
+ </CommandItem_Shadcn_>
+ ))}
+ </CommandGroup_Shadcn_>
+ </CommandList_Shadcn_>
+ </Command_Shadcn_>
+ </DropdownMenuSubContent>
+ </DropdownMenuPortal>
+ </DropdownMenuSub>
</>
)
}
diff --git a/apps/studio/components/interfaces/SQLEditor/UtilityPanel/ChartConfig.tsx b/apps/studio/components/interfaces/SQLEditor/UtilityPanel/ChartConfig.tsx
index ff1a708ccb1..6dd29c18b8c 100644
--- a/apps/studio/components/interfaces/SQLEditor/UtilityPanel/ChartConfig.tsx
+++ b/apps/studio/components/interfaces/SQLEditor/UtilityPanel/ChartConfig.tsx
@@ -7,7 +7,6 @@ import { ButtonTooltip } from 'components/ui/ButtonTooltip'
import BarChart from 'components/ui/Charts/BarChart'
import NoDataPlaceholder from 'components/ui/Charts/NoDataPlaceholder'
import { useLocalStorageQuery } from 'hooks/misc/useLocalStorage'
-import { useFlag } from 'hooks/ui/useFlag'
import Link from 'next/link'
import {
Badge,
@@ -69,7 +68,6 @@ export const ChartConfig = ({
onConfigChange,
}: ChartConfigProps) => {
const { ref } = useParams()
- const supportSQLBlocks = useFlag('reportsV2')
const [acknowledged, setAcknowledged] = useLocalStorageQuery(
LOCAL_STORAGE_KEYS.SQL_EDITOR_SQL_BLOCK_ACKNOWLEDGED(ref as string),
@@ -203,7 +201,7 @@ export const ChartConfig = ({
)}
</div>
- {supportSQLBlocks && !acknowledged && (
+ {!acknowledged && (
<Admonition showIcon={false} type="tip" className="p-2 relative group">
<Tooltip>
<TooltipTrigger
diff --git a/apps/studio/components/layouts/EdgeFunctionsLayout/EdgeFunctionDetailsLayout.tsx b/apps/studio/components/layouts/EdgeFunctionsLayout/EdgeFunctionDetailsLayout.tsx
index be5f497ffcc..cf1e55afaac 100644
--- a/apps/studio/components/layouts/EdgeFunctionsLayout/EdgeFunctionDetailsLayout.tsx
+++ b/apps/studio/components/layouts/EdgeFunctionsLayout/EdgeFunctionDetailsLayout.tsx
@@ -18,7 +18,6 @@ import { useSendEventMutation } from 'data/telemetry/send-event-mutation'
import { useAsyncCheckProjectPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'
import { withAuth } from 'hooks/misc/withAuth'
-import { useFlag } from 'hooks/ui/useFlag'
import {
Button,
Popover_Shadcn_,
@@ -43,7 +42,6 @@ const EdgeFunctionDetailsLayout = ({
const org = useSelectedOrganization()
const { mutate: sendEvent } = useSendEventMutation()
- const edgeFunctionCreate = useFlag('edgeFunctionCreate')
const isNewAPIDocsEnabled = useIsAPIDocsSidePanelEnabled()
const { isLoading, can: canReadFunctions } = useAsyncCheckProjectPermissions(
PermissionAction.FUNCTIONS_READ,
@@ -86,14 +84,10 @@ const EdgeFunctionDetailsLayout = ({
label: 'Logs',
href: `/project/${ref}/functions/${functionSlug}/logs`,
},
- ...(edgeFunctionCreate
- ? [
- {
- label: 'Code',
- href: `/project/${ref}/functions/${functionSlug}/code`,
- },
- ]
- : []),
+ {
+ label: 'Code',
+ href: `/project/${ref}/functions/${functionSlug}/code`,
+ },
{
label: 'Details',
href: `/project/${ref}/functions/${functionSlug}/details`,
@@ -194,7 +188,7 @@ const EdgeFunctionDetailsLayout = ({
</div>
</PopoverContent_Shadcn_>
</Popover_Shadcn_>
- {edgeFunctionCreate && !!functionSlug && (
+ {!!functionSlug && (
<Button
type="default"
icon={<Send />}
diff --git a/apps/studio/components/ui/AIAssistantPanel/MessageMarkdown.tsx b/apps/studio/components/ui/AIAssistantPanel/MessageMarkdown.tsx
index 31b3f7a129f..9b482072b50 100644
--- a/apps/studio/components/ui/AIAssistantPanel/MessageMarkdown.tsx
+++ b/apps/studio/components/ui/AIAssistantPanel/MessageMarkdown.tsx
@@ -14,7 +14,8 @@ import { PermissionAction } from '@supabase/shared-types/out/constants'
import { ChartConfig } from 'components/interfaces/SQLEditor/UtilityPanel/ChartConfig'
import { useSendEventMutation } from 'data/telemetry/send-event-mutation'
import { useCheckPermissions } from 'hooks/misc/useCheckPermissions'
-import { useFlag } from 'hooks/ui/useFlag'
+import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'
+import { useSelectedProject } from 'hooks/misc/useSelectedProject'
import { useProfile } from 'lib/profile'
import { useAiAssistantStateSnapshot } from 'state/ai-assistant-state'
import { Dashboards } from 'types'
@@ -26,8 +27,6 @@ import { AssistantSnippetProps } from './AIAssistant.types'
import { identifyQueryType } from './AIAssistant.utils'
import CollapsibleCodeBlock from './CollapsibleCodeBlock'
import { MessageContext } from './Message'
-import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'
-import { useSelectedProject } from 'hooks/misc/useSelectedProject'
export const OrderedList = memo(({ children }: { children: ReactNode }) => (
<ol className="flex flex-col gap-y-4">{children}</ol>
@@ -168,7 +167,6 @@ export const MarkdownPre = ({
const { isLoading, readOnly } = useContext(MessageContext)
const { mutate: sendEvent } = useSendEventMutation()
const snap = useAiAssistantStateSnapshot()
- const supportSQLBlocks = useFlag('reportsV2')
const project = useSelectedProject()
const org = useSelectedOrganization()
@@ -209,8 +207,7 @@ export const MarkdownPre = ({
// Strip props from the content for both SQL and edge functions
const cleanContent = rawContent.replace(/(?:--|\/\/)\s*props:\s*\{[^}]+\}/, '').trim()
- const isDraggableToReports =
- supportSQLBlocks && canCreateSQLSnippet && router.pathname.endsWith('/reports/[id]')
+ const isDraggableToReports = canCreateSQLSnippet && router.pathname.endsWith('/reports/[id]')
useEffect(() => {
chartConfig.current = {
diff --git a/apps/studio/pages/new/[slug].tsx b/apps/studio/pages/new/[slug].tsx
index f159e150a0e..a989aa3c47c 100644
--- a/apps/studio/pages/new/[slug].tsx
+++ b/apps/studio/pages/new/[slug].tsx
@@ -151,7 +151,6 @@ const Wizard: NextPageWithLayout = () => {
const projectCreationDisabled = useFlag('disableProjectCreationAndUpdate')
const showPostgresVersionSelector = useFlag('showPostgresVersionSelector')
const cloudProviderEnabled = useFlag('enableFlyCloudProvider')
- const allowOrioleDB = useFlag('allowOrioleDb')
const { data: membersExceededLimit } = useFreeProjectLimitCheckQuery(
{ slug },
{ enabled: isFreePlan }
@@ -898,9 +897,7 @@ const Wizard: NextPageWithLayout = () => {
)}
<SecurityOptions form={form} />
- {allowOrioleDB && !!availableOrioleVersion && (
- <AdvancedConfiguration form={form} />
- )}
+ {!!availableOrioleVersion && <AdvancedConfiguration form={form} />}
</>
)}
diff --git a/apps/studio/pages/project/[ref]/functions/[functionSlug]/code.tsx b/apps/studio/pages/project/[ref]/functions/[functionSlug]/code.tsx
index fcbdba5c5bc..10c19229ecb 100644
--- a/apps/studio/pages/project/[ref]/functions/[functionSlug]/code.tsx
+++ b/apps/studio/pages/project/[ref]/functions/[functionSlug]/code.tsx
@@ -1,11 +1,10 @@
import { common, dirname, relative } from '@std/path/posix'
+import { PermissionAction } from '@supabase/shared-types/out/constants'
import { AlertCircle, CornerDownLeft, Loader2 } from 'lucide-react'
import { useRouter } from 'next/router'
import { useEffect, useState } from 'react'
import { toast } from 'sonner'
-import { PermissionAction } from '@supabase/shared-types/out/constants'
-import { LogoLoader } from 'ui'
import { useParams } from 'common'
import { DeployEdgeFunctionWarningModal } from 'components/interfaces/EdgeFunctions/DeployEdgeFunctionWarningModal'
import DefaultLayout from 'components/layouts/DefaultLayout'
@@ -20,8 +19,8 @@ import { useCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useOrgOptedIntoAi } from 'hooks/misc/useOrgOptedIntoAi'
import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'
import { useSelectedProject } from 'hooks/misc/useSelectedProject'
-import { useFlag } from 'hooks/ui/useFlag'
import { BASE_PATH, IS_PLATFORM } from 'lib/constants'
+import { LogoLoader } from 'ui'
const CodePage = () => {
const router = useRouter()
@@ -29,7 +28,6 @@ const CodePage = () => {
const project = useSelectedProject()
const isOptedInToAI = useOrgOptedIntoAi()
const includeSchemaMetadata = isOptedInToAI || !IS_PLATFORM
- const edgeFunctionCreate = useFlag('edgeFunctionCreate')
const { mutate: sendEvent } = useSendEventMutation()
const org = useSelectedOrganization()
const [showDeployWarning, setShowDeployWarning] = useState(false)
@@ -149,13 +147,6 @@ const CodePage = () => {
onUpdate()
}
- // TODO (Saxon): Remove this once the flag is fully launched
- useEffect(() => {
- if (edgeFunctionCreate !== undefined && !edgeFunctionCreate) {
- router.push(`/project/${ref}/functions`)
- }
- }, [edgeFunctionCreate])
-
useEffect(() => {
// Set files from API response when available
if (selectedFunction?.entrypoint_path && functionFiles) {
diff --git a/apps/studio/pages/project/[ref]/functions/index.tsx b/apps/studio/pages/project/[ref]/functions/index.tsx
index 52da2deba1a..5731e692c60 100644
--- a/apps/studio/pages/project/[ref]/functions/index.tsx
+++ b/apps/studio/pages/project/[ref]/functions/index.tsx
@@ -11,13 +11,11 @@ import { PageLayout } from 'components/layouts/PageLayout/PageLayout'
import { ScaffoldContainer, ScaffoldSection } from 'components/layouts/Scaffold'
import Table from 'components/to-be-cleaned/Table'
import AlertError from 'components/ui/AlertError'
-import { ButtonTooltip } from 'components/ui/ButtonTooltip'
import { DocsButton } from 'components/ui/DocsButton'
import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader'
import { useEdgeFunctionsQuery } from 'data/edge-functions/edge-functions-query'
import { useSendEventMutation } from 'data/telemetry/send-event-mutation'
import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'
-import { useFlag } from 'hooks/ui/useFlag'
import { useAiAssistantStateSnapshot } from 'state/ai-assistant-state'
import type { NextPageWithLayout } from 'types'
import {
@@ -45,7 +43,6 @@ const EdgeFunctionsPage: NextPageWithLayout = () => {
isError,
isSuccess,
} = useEdgeFunctionsQuery({ projectRef: ref })
- const edgeFunctionCreate = useFlag('edgeFunctionCreate')
const { mutate: sendEvent } = useSendEventMutation()
const org = useSelectedOrganization()
@@ -59,25 +56,23 @@ const EdgeFunctionsPage: NextPageWithLayout = () => {
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end" className="w-80">
- {edgeFunctionCreate && (
- <DropdownMenuItem
- onSelect={() => {
- router.push(`/project/${ref}/functions/new`)
- sendEvent({
- action: 'edge_function_via_editor_button_clicked',
- properties: { origin: 'secondary_action' },
- groups: { project: ref ?? 'Unknown', organization: org?.slug ?? 'Unknown' },
- })
- }}
- className="gap-4"
- >
- <Code className="shrink-0" size={16} strokeWidth={1.5} />
- <div>
- <span className="text-foreground">Via Editor</span>
- <p>Write and deploy in the browser</p>
- </div>
- </DropdownMenuItem>
- )}
+ <DropdownMenuItem
+ onSelect={() => {
+ router.push(`/project/${ref}/functions/new`)
+ sendEvent({
+ action: 'edge_function_via_editor_button_clicked',
+ properties: { origin: 'secondary_action' },
+ groups: { project: ref ?? 'Unknown', organization: org?.slug ?? 'Unknown' },
+ })
+ }}
+ className="gap-4"
+ >
+ <Code className="shrink-0" size={16} strokeWidth={1.5} />
+ <div>
+ <span className="text-foreground">Via Editor</span>
+ <p>Write and deploy in the browser</p>
+ </div>
+ </DropdownMenuItem>
<Dialog>
<DialogTrigger asChild>
<DropdownMenuItem
diff --git a/apps/studio/pages/project/[ref]/functions/new.tsx b/apps/studio/pages/project/[ref]/functions/new.tsx
index 03d47e91046..5a69bbe84e9 100644
--- a/apps/studio/pages/project/[ref]/functions/new.tsx
+++ b/apps/studio/pages/project/[ref]/functions/new.tsx
@@ -17,7 +17,6 @@ import { useSendEventMutation } from 'data/telemetry/send-event-mutation'
import { useOrgOptedIntoAi } from 'hooks/misc/useOrgOptedIntoAi'
import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'
import { useSelectedProject } from 'hooks/misc/useSelectedProject'
-import { useFlag } from 'hooks/ui/useFlag'
import { BASE_PATH, IS_PLATFORM } from 'lib/constants'
import { useAiAssistantStateSnapshot } from 'state/ai-assistant-state'
import {
@@ -104,7 +103,6 @@ const NewFunctionPage = () => {
const isOptedInToAI = useOrgOptedIntoAi()
const includeSchemaMetadata = isOptedInToAI || !IS_PLATFORM
const snap = useAiAssistantStateSnapshot()
- const edgeFunctionCreate = useFlag('edgeFunctionCreate')
const { mutate: sendEvent } = useSendEventMutation()
const org = useSelectedOrganization()
@@ -231,13 +229,6 @@ const NewFunctionPage = () => {
form.handleSubmit(onSubmit)()
}
- // TODO (Saxon): Remove this once the flag is fully launched
- useEffect(() => {
- if (!edgeFunctionCreate) {
- router.push(`/project/${ref}/functions`)
- }
- }, [edgeFunctionCreate, ref, router])
-
useEffect(() => {
if (template) {
const templateMeta = EDGE_FUNCTION_TEMPLATES.find((x) => x.value === template)