Skip to content

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

chore: cleanup dead code paths for Stripe (#30001)

Kevin Grünebergc4dfc4a45471
diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/CostControl/CostControl.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/CostControl/CostControl.tsx
index 172cf511853..0a4e467a763 100644
--- a/apps/studio/components/interfaces/Organization/BillingSettings/CostControl/CostControl.tsx
+++ b/apps/studio/components/interfaces/Organization/BillingSettings/CostControl/CostControl.tsx
@@ -1,6 +1,5 @@
import { PermissionAction } from '@supabase/shared-types/out/constants'
-import dayjs from 'dayjs'
-import { Calendar, ExternalLink } from 'lucide-react'
+import { ExternalLink } from 'lucide-react'
import { useTheme } from 'next-themes'
import Image from 'next/image'
import Link from 'next/link'
@@ -14,13 +13,12 @@ import {
import AlertError from 'components/ui/AlertError'
import NoPermission from 'components/ui/NoPermission'
import ShimmeringLoader from 'components/ui/ShimmeringLoader'
-import { useOrganizationBillingSubscriptionCancelSchedule } from 'data/subscriptions/org-subscription-cancel-schedule-mutation'
import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-query'
import { useCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useFlag } from 'hooks/ui/useFlag'
import { BASE_PATH } from 'lib/constants'
import { useOrgSettingsPageStateSnapshot } from 'state/organization-settings'
-import { Alert, AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_, Button } from 'ui'
+import { Alert, Button } from 'ui'
import ProjectUpdateDisabledTooltip from '../ProjectUpdateDisabledTooltip'
import SpendCapSidePanel from './SpendCapSidePanel'
@@ -51,9 +49,6 @@ const CostControl = ({}: CostControlProps) => {
const canChangeTier =
!projectUpdateDisabled && !['team', 'enterprise'].includes(currentPlan?.id || '')
- const { mutate: cancelSubscriptionSchedule, isLoading: cancelSubscriptionScheduleLoading } =
- useOrganizationBillingSubscriptionCancelSchedule()
-
return (
<>
<ScaffoldSection>
@@ -132,36 +127,6 @@ const CostControl = ({}: CostControlProps) => {
</p>
)}
- {/** Toggled on spend cap, scheduled change for end-of-cycle */}
- {subscription?.scheduled_plan_change?.target_plan === 'pro' &&
- subscription?.scheduled_plan_change?.usage_billing_enabled === false &&
- subscription?.plan.id === 'pro' && (
- <Alert_Shadcn_ className="mb-2" title="Scheduled downgrade">
- <Calendar className="h-4 w-4" />
- <AlertTitle_Shadcn_>Scheduled change</AlertTitle_Shadcn_>
- <AlertDescription_Shadcn_ className="flex flex-col gap-3">
- <div>
- Your spend cap will be enabled on{' '}
- {dayjs(subscription?.scheduled_plan_change?.at).format('MMMM D, YYYY')}.
- You will not be charged for any over-usage moving on. If you would like
- to keep the spend cap disabled and scale as you go, you may still cancel
- the scheduled change.
- </div>
- <div>
- <Button
- type="default"
- loading={cancelSubscriptionScheduleLoading}
- onClick={() => {
- return cancelSubscriptionSchedule({ slug: slug! })
- }}
- >
- Cancel
- </Button>
- </div>
- </AlertDescription_Shadcn_>
- </Alert_Shadcn_>
- )}
-
<div className="flex space-x-6">
<div>
<div className="rounded-md bg-surface-200 w-[160px] h-[96px] shadow">
diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/Subscription.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/Subscription.tsx
index 674d32fb95b..c24a6a46c70 100644
--- a/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/Subscription.tsx
+++ b/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/Subscription.tsx
@@ -1,7 +1,7 @@
import { PermissionAction } from '@supabase/shared-types/out/constants'
import { useParams } from 'common'
import dayjs from 'dayjs'
-import { Calendar, ExternalLink } from 'lucide-react'
+import { ExternalLink } from 'lucide-react'
import Link from 'next/link'
import {
@@ -13,12 +13,11 @@ import AlertError from 'components/ui/AlertError'
import NoPermission from 'components/ui/NoPermission'
import ShimmeringLoader from 'components/ui/ShimmeringLoader'
import SparkBar from 'components/ui/SparkBar'
-import { useOrganizationBillingSubscriptionCancelSchedule } from 'data/subscriptions/org-subscription-cancel-schedule-mutation'
import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-query'
import { useCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useFlag } from 'hooks/ui/useFlag'
import { useOrgSettingsPageStateSnapshot } from 'state/organization-settings'
-import { Alert, AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_, Button } from 'ui'
+import { Alert, Button } from 'ui'
import ProjectUpdateDisabledTooltip from '../ProjectUpdateDisabledTooltip'
import { Restriction } from '../Restriction'
import PlanUpdateSidePanel from './PlanUpdateSidePanel'
@@ -41,9 +40,6 @@ const Subscription = () => {
isSuccess,
} = useOrgSubscriptionQuery({ orgSlug: slug }, { enabled: canReadSubscriptions })
- const { mutate: cancelSubscriptionSchedule, isLoading: cancelSubscriptionScheduleLoading } =
- useOrganizationBillingSubscriptionCancelSchedule()
-
const currentPlan = subscription?.plan
const planName = currentPlan?.name ?? 'Unknown'
const billingCycleStart = dayjs.unix(subscription?.current_period_start ?? 0).utc()
@@ -99,38 +95,6 @@ const Subscription = () => {
</p>
</div>
- {subscription?.scheduled_plan_change &&
- subscription?.scheduled_plan_change?.target_plan !== subscription.plan.id && (
- <Alert_Shadcn_ className="mb-2" title="Scheduled downgrade">
- <Calendar className="h-4 w-4" />
- <AlertTitle_Shadcn_>Scheduled downgrade</AlertTitle_Shadcn_>
- <AlertDescription_Shadcn_ className="flex flex-col gap-3">
- <div>
- Your organization will automatically be downgraded from the{' '}
- <span>{subscription.plan.name}</span> plan to the{' '}
- <span className="capitalize">
- {subscription?.scheduled_plan_change?.target_plan}
- </span>{' '}
- plan on{' '}
- {dayjs(subscription?.scheduled_plan_change?.at).format('MMMM D, YYYY')}.
- If you would like to stay on the <span>{subscription.plan.name}</span>{' '}
- plan, cancel the scheduled downgrade.
- </div>
- <div>
- <Button
- type="default"
- loading={cancelSubscriptionScheduleLoading}
- onClick={() => {
- return cancelSubscriptionSchedule({ slug: slug! })
- }}
- >
- Cancel downgrade
- </Button>
- </div>
- </AlertDescription_Shadcn_>
- </Alert_Shadcn_>
- )}
-
<div>
<ProjectUpdateDisabledTooltip projectUpdateDisabled={projectUpdateDisabled}>
<Button
diff --git a/apps/studio/components/interfaces/Organization/Usage/TotalUsage.tsx b/apps/studio/components/interfaces/Organization/Usage/TotalUsage.tsx
index 9b6e6f45f1c..44a3790427a 100644
--- a/apps/studio/components/interfaces/Organization/Usage/TotalUsage.tsx
+++ b/apps/studio/components/interfaces/Organization/Usage/TotalUsage.tsx
@@ -114,8 +114,8 @@ const TotalUsage = ({
section={{
name: 'Usage Summary',
description: isUsageBillingEnabled
- ? `Your plan includes a limited amount of usage. If exceeded, you will be charged for the overages. It may take up to ${subscription?.usage_based_billing_project_addons ? '1 hour' : '24 hours'} for usage stats to update.`
- : `Your plan includes a limited amount of usage. If exceeded, you may experience restrictions, as you are currently not billed for overages. It may take up to ${subscription?.usage_based_billing_project_addons ? '1 hour' : '24 hours'} for usage stats to update.`,
+ ? `Your plan includes a limited amount of usage. If exceeded, you will be charged for the overages. It may take up to 1 hour to refresh.`
+ : `Your plan includes a limited amount of usage. If exceeded, you may experience restrictions, as you are currently not billed for overages. It may take up to 1 hour to refresh.`,
links: [
{
name: 'How billing works',
diff --git a/apps/studio/components/interfaces/Organization/Usage/Usage.constants.tsx b/apps/studio/components/interfaces/Organization/Usage/Usage.constants.tsx
index aebafdd48a3..49c11f00cef 100644
--- a/apps/studio/components/interfaces/Organization/Usage/Usage.constants.tsx
+++ b/apps/studio/components/interfaces/Organization/Usage/Usage.constants.tsx
@@ -100,7 +100,7 @@ export const USAGE_CATEGORIES: (subscription?: OrgSubscription) => CategoryMeta[
name: 'Database & Storage Size',
description: 'Amount of resources your project is consuming',
attributes: [
- subscription?.plan.id === 'free' || subscription?.usage_based_billing_project_addons !== true
+ subscription?.plan.id === 'free'
? {
anchor: 'dbSize',
key: PricingMetric.DATABASE_SIZE,
@@ -115,14 +115,6 @@ export const USAGE_CATEGORIES: (subscription?: OrgSubscription) => CategoryMeta[
name: 'Documentation',
url: 'https://supabase.com/docs/guides/platform/database-size',
},
- ...(subscription?.usage_based_billing_project_addons === true
- ? [
- {
- name: 'Disk Management',
- url: 'https://supabase.com/docs/guides/platform/database-size#disk-management',
- },
- ]
- : []),
],
chartDescription: 'The data refreshes every 24 hours.',
additionalInfo: (usage?: OrgUsageResponse) => {
diff --git a/apps/studio/components/interfaces/Settings/Addons/ComputeInstanceSidePanel.tsx b/apps/studio/components/interfaces/Settings/Addons/ComputeInstanceSidePanel.tsx
index 95500d92ebd..f3c8beb61d3 100644
--- a/apps/studio/components/interfaces/Settings/Addons/ComputeInstanceSidePanel.tsx
+++ b/apps/studio/components/interfaces/Settings/Addons/ComputeInstanceSidePanel.tsx
@@ -454,18 +454,6 @@ const ComputeInstanceSidePanel = () => {
</AlertDescription_Shadcn_>
</Alert_Shadcn_>
) : null}
-
- {hasChanges &&
- subscription?.billing_via_partner &&
- subscription.scheduled_plan_change?.target_plan !== undefined && (
- <Alert_Shadcn_ variant={'warning'} className="mb-2">
- <CriticalIcon />
- <AlertDescription_Shadcn_>
- You have a scheduled subscription change that will be canceled if you change
- your compute size.
- </AlertDescription_Shadcn_>
- </Alert_Shadcn_>
- )}
</div>
</SidePanel.Content>
</SidePanel>
diff --git a/apps/studio/components/interfaces/Settings/Addons/CustomDomainSidePanel.tsx b/apps/studio/components/interfaces/Settings/Addons/CustomDomainSidePanel.tsx
index 04e6b853e75..efc429764c8 100644
--- a/apps/studio/components/interfaces/Settings/Addons/CustomDomainSidePanel.tsx
+++ b/apps/studio/components/interfaces/Settings/Addons/CustomDomainSidePanel.tsx
@@ -215,60 +215,11 @@ const CustomDomainSidePanel = () => {
</Radio.Group>
</div>
- {hasChanges && (
- <>
- {selectedOption === 'cd_none' ||
- (selectedCustomDomain?.price ?? 0) < (subscriptionCDOption?.variant.price ?? 0)
- ? subscription?.billing_via_partner === false &&
- // Old addon billing with upfront payment
- subscription.usage_based_billing_project_addons === false && (
- <p className="text-sm text-foreground-light">
- <span>
- Upon clicking confirm, the add-on is removed immediately and any unused time
- in the current billing cycle is added as prorated credits to your
- organization and used in subsequent billing cycles.
- </span>
- </p>
- )
- : !subscription?.billing_via_partner && (
- <p className="text-sm text-foreground-light">
- {subscription?.usage_based_billing_project_addons === false ? (
- <span>
- Upon clicking confirm, the amount of{' '}
- <span className="text-foreground">
- {formatCurrency(selectedCustomDomain?.price)}
- </span>{' '}
- will be added to your monthly invoice. The addon is prepaid per month and
- in case of a downgrade, you get credits for the remaining time. For the
- current billing cycle you're immediately charged a prorated amount for the
- remaining days.
- </span>
- ) : (
- <span>
- There are no immediate charges. The addon is billed at the end of your
- billing cycle based on your usage and prorated to the hour.
- </span>
- )}
- </p>
- )}
-
- {
- // Billed via partner
- subscription?.billing_via_partner &&
- // Project addons are still billed the old way (upfront payment)
- subscription?.usage_based_billing_project_addons === false &&
- // Scheduled billing plan change
- subscription.scheduled_plan_change?.target_plan !== undefined && (
- <Alert_Shadcn_ variant={'warning'} className="mb-2">
- <AlertTriangle className="h-4 w-4" />
- <AlertDescription_Shadcn_>
- You have a scheduled subscription change that will be canceled if you change
- your custom domain add on.
- </AlertDescription_Shadcn_>
- </Alert_Shadcn_>
- )
- }
- </>
+ {hasChanges && selectedOption !== 'cd_none' && (
+ <p className="text-sm text-foreground-light">
+ There are no immediate charges. The addon is billed at the end of your billing cycle
+ based on your usage and prorated to the hour.
+ </p>
)}
{isFreePlan && (
diff --git a/apps/studio/components/interfaces/Settings/Addons/IPv4SidePanel.tsx b/apps/studio/components/interfaces/Settings/Addons/IPv4SidePanel.tsx
index ab14efb9640..252cabdfd02 100644
--- a/apps/studio/components/interfaces/Settings/Addons/IPv4SidePanel.tsx
+++ b/apps/studio/components/interfaces/Settings/Addons/IPv4SidePanel.tsx
@@ -187,72 +187,30 @@ const IPv4SidePanel = () => {
{hasChanges && (
<>
- {selectedOption === 'ipv4_none' ||
- (selectedIPv4?.price ?? 0) < (subscriptionIpV4Option?.variant.price ?? 0) ? (
- subscription?.billing_via_partner === false &&
- // Old addon billing with upfront payment
- subscription.usage_based_billing_project_addons === false && (
- <p className="text-sm text-foreground-light">
- Upon clicking confirm, the add-on is removed immediately and any unused time in
- the current billing cycle is added as prorated credits to your organization and
- used in subsequent billing cycles.
- </p>
- )
- ) : (
- <>
- <Alert withIcon variant="info" title="Potential downtime">
- There might be some downtime when enabling the add-on since some DNS clients
- might have cached the old DNS entry. Generally, this should be less than a
- minute.
- </Alert>
- <p className="text-sm text-foreground-light">
- By default, this is only applied to the Primary database for your project. If{' '}
- <Link
- href="/docs/guides/platform/read-replicas"
- className="text-brand"
- target="_blank"
- >
- Read replicas
- </Link>{' '}
- are used, each replica also gets its own IPv4 address, with a corresponding{' '}
- <span className="text-foreground">{formatCurrency(selectedIPv4?.price)}</span>{' '}
- charge.
- </p>
- {!subscription?.billing_via_partner && (
- <p className="text-sm text-foreground-light">
- {subscription?.usage_based_billing_project_addons === false ? (
- <span>
- Upon clicking confirm, the respective amount will be added to your monthly
- invoice. The addon is prepaid per month and in case of a downgrade, you
- get credits for the remaining time. For the current billing cycle you're
- immediately charged a prorated amount for the remaining days.
- </span>
- ) : (
- <span>
- There are no immediate charges. The addon is billed at the end of your
- billing cycle based on your usage and prorated to the hour.
- </span>
- )}
- </p>
- )}
-
- {
- // Billed via partner
- subscription?.billing_via_partner &&
- // Project addons are still billed the old way (upfront payment)
- subscription?.usage_based_billing_project_addons === false &&
- // Scheduled billing plan change
- subscription.scheduled_plan_change?.target_plan !== undefined && (
- <Alert_Shadcn_ variant={'warning'} className="mb-2">
- <AlertTriangle className="h-4 w-4" />
- <AlertDescription_Shadcn_>
- You have a scheduled subscription change that will be canceled if you
- change your PITR add on.
- </AlertDescription_Shadcn_>
- </Alert_Shadcn_>
- )
- }
- </>
+ <Alert withIcon variant="info" title="Potential downtime">
+ There might be some downtime when enabling the add-on since some DNS clients might
+ have cached the old DNS entry. Generally, this should be less than a minute.
+ </Alert>
+ {selectedOption !== 'ipv4_none' && (
+ <p className="text-sm text-foreground-light">
+ By default, this is only applied to the Primary database for your project. If{' '}
+ <Link
+ href="/docs/guides/platform/read-replicas"
+ className="text-brand"
+ target="_blank"
+ >
+ Read replicas
+ </Link>{' '}
+ are used, each replica also gets its own IPv4 address, with a corresponding{' '}
+ <span className="text-foreground">{formatCurrency(selectedIPv4?.price)}</span>{' '}
+ charge.
+ </p>
+ )}
+ {!subscription?.billing_via_partner && (
+ <p className="text-sm text-foreground-light">
+ There are no immediate charges. The addon is billed at the end of your billing
+ cycle based on your usage and prorated to the hour.
+ </p>
)}
</>
)}
diff --git a/apps/studio/components/interfaces/Settings/Addons/PITRSidePanel.tsx b/apps/studio/components/interfaces/Settings/Addons/PITRSidePanel.tsx
index 8169b1ec33f..62b21a77f8f 100644
--- a/apps/studio/components/interfaces/Settings/Addons/PITRSidePanel.tsx
+++ b/apps/studio/components/interfaces/Settings/Addons/PITRSidePanel.tsx
@@ -346,58 +346,11 @@ const PITRSidePanel = () => {
</div>
)}
- {hasChanges && !blockDowngradeDueToReadReplicas && (
- <>
- {selectedOption === 'pitr_0' ||
- (selectedPitr?.price ?? 0) < (subscriptionPitr?.variant.price ?? 0)
- ? subscription?.billing_via_partner === false &&
- // Old addon billing with upfront payment
- subscription.usage_based_billing_project_addons === false && (
- <p className="text-sm text-foreground-light">
- Upon clicking confirm, the add-on is removed immediately and any unused time
- in the current billing cycle is added as prorated credits to your organization
- and used in subsequent billing cycles.
- </p>
- )
- : !subscription?.billing_via_partner && (
- <p className="text-sm text-foreground-light">
- {subscription?.usage_based_billing_project_addons === false ? (
- <span>
- Upon clicking confirm, the amount of{' '}
- <span className="text-foreground">
- {formatCurrency(selectedPitr?.price)}
- </span>{' '}
- will be added to your monthly invoice. The addon is prepaid per month and
- in case of a downgrade, you get credits for the remaining time. For the
- current billing cycle you're immediately charged a prorated amount for the
- remaining days.
- </span>
- ) : (
- <span>
- There are no immediate charges. The addon is billed at the end of your
- billing cycle based on your usage and prorated to the hour.
- </span>
- )}
- </p>
- )}
-
- {
- // Billed via partner
- subscription?.billing_via_partner &&
- // Project addons are still billed the old way (upfront payment)
- subscription?.usage_based_billing_project_addons === false &&
- // Scheduled billing plan change
- subscription.scheduled_plan_change?.target_plan !== undefined && (
- <Alert_Shadcn_ variant={'warning'} className="mb-2">
- <AlertTriangle className="h-4 w-4" />
- <AlertDescription_Shadcn_>
- You have a scheduled subscription change that will be canceled if you change
- your PITR add on.
- </AlertDescription_Shadcn_>
- </Alert_Shadcn_>
- )
- }
- </>
+ {hasChanges && !blockDowngradeDueToReadReplicas && selectedOption !== 'pitr_0' && (
+ <p className="text-sm text-foreground-light">
+ There are no immediate charges. The addon is billed at the end of your billing cycle
+ based on your usage and prorated to the hour.
+ </p>
)}
</div>
</SidePanel.Content>
diff --git a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DeployNewReplicaPanel.tsx b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DeployNewReplicaPanel.tsx
index a1e5ab6d240..7a6bcf26f45 100644
--- a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DeployNewReplicaPanel.tsx
+++ b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DeployNewReplicaPanel.tsx
@@ -98,10 +98,7 @@ const DeployNewReplicaPanel = ({
// @ts-ignore
const { size_gb, type, throughput_mbps, iops } = diskConfiguration?.attributes ?? {}
- const showNewDiskManagementUI =
- diskManagementV2 &&
- subscription?.usage_based_billing_project_addons &&
- project?.cloud_provider === 'AWS'
+ const showNewDiskManagementUI = diskManagementV2 && project?.cloud_provider === 'AWS'
const readReplicaDiskSizes = (size_gb ?? 0) * 1.25
const additionalCostDiskSize = readReplicaDiskSizes * DISK_PRICING[type as DiskType]?.storage ?? 0
const additionalCostIOPS = calculateIOPSPrice({
diff --git a/apps/studio/components/ui/Charts/AreaChart.tsx b/apps/studio/components/ui/Charts/AreaChart.tsx
index 933999a0cf1..c5820d5b7e9 100644
--- a/apps/studio/components/ui/Charts/AreaChart.tsx
+++ b/apps/studio/components/ui/Charts/AreaChart.tsx
@@ -48,7 +48,7 @@ const AreaChart = ({
if (data.length === 0) {
return (
<NoDataPlaceholder
- description="It may take up to 24 hours for data to show"
+ description="It may take up to 24 hours for data to refresh"
size={size}
className={className}
attribute={title}
diff --git a/apps/studio/components/ui/Charts/BarChart.tsx b/apps/studio/components/ui/Charts/BarChart.tsx
index 117c4e103bf..aa2ec9766b6 100644
--- a/apps/studio/components/ui/Charts/BarChart.tsx
+++ b/apps/studio/components/ui/Charts/BarChart.tsx
@@ -96,7 +96,7 @@ const BarChart = ({
return (
<NoDataPlaceholder
message={emptyStateMessage}
- description="It may take up to 24 hours for data to show"
+ description="It may take up to 24 hours for data to refresh"
size={size}
className={className}
attribute={title}
diff --git a/apps/studio/data/subscriptions/org-subscription-cancel-schedule-mutation.ts b/apps/studio/data/subscriptions/org-subscription-cancel-schedule-mutation.ts
deleted file mode 100644
index 161c05277d1..00000000000
--- a/apps/studio/data/subscriptions/org-subscription-cancel-schedule-mutation.ts
+++ /dev/null
@@ -1,52 +0,0 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
-import { toast } from 'sonner'
-
-import { del, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
-import { subscriptionKeys } from './keys'
-
-export type OrganizationBillingSubscriptionCancelScheduleVariables = {
- slug: string
-}
-
-export async function cancelSubscriptionSchedule({
- slug,
-}: OrganizationBillingSubscriptionCancelScheduleVariables) {
- const { data, error } = await del(
- '/platform/organizations/{slug}/billing/subscription/schedule',
- {
- params: { path: { slug } },
- }
- )
- if (error) handleError(error)
- return data
-}
-
-export const useOrganizationBillingSubscriptionCancelSchedule = ({
- onSuccess,
- onError,
- ...options
-}: Omit<
- UseMutationOptions<never, ResponseError, OrganizationBillingSubscriptionCancelScheduleVariables>,
- 'mutationFn'
-> = {}) => {
- const queryClient = useQueryClient()
-
- return useMutation<never, ResponseError, OrganizationBillingSubscriptionCancelScheduleVariables>(
- (vars) => cancelSubscriptionSchedule(vars),
- {
- async onSuccess(data, variables, context) {
- await queryClient.invalidateQueries(subscriptionKeys.orgSubscription(variables.slug))
- await onSuccess?.(data, variables, context)
- },
- async onError(data, variables, context) {
- if (onError === undefined) {
- toast.error(`Failed to cancel subscription schedule: ${data.message}`)
- } else {
- onError(data, variables, context)
- }
- },
- ...options,
- }
- )
-}
diff --git a/apps/studio/pages/project/[ref]/reports/database.tsx b/apps/studio/pages/project/[ref]/reports/database.tsx
index 5e565ec1dc8..c573b79a3c2 100644
--- a/apps/studio/pages/project/[ref]/reports/database.tsx
+++ b/apps/studio/pages/project/[ref]/reports/database.tsx
@@ -26,7 +26,6 @@ import { TIME_PERIODS_INFRA } from 'lib/constants/metrics'
import { formatBytes } from 'lib/helpers'
import { useDatabaseSelectorStateSnapshot } from 'state/database-selector'
import type { NextPageWithLayout } from 'types'
-import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-query'
import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'
import { useFlag } from 'hooks/ui/useFlag'
@@ -53,11 +52,7 @@ const DatabaseUsage = () => {
const isReplicaSelected = state.selectedDatabaseId !== project?.ref
- const { data: subscription } = useOrgSubscriptionQuery({ orgSlug: org?.slug })
- const showNewDiskManagementUI =
- subscription?.usage_based_billing_project_addons &&
- diskManagementV2 &&
- project?.cloud_provider === 'AWS'
+ const showNewDiskManagementUI = diskManagementV2 && project?.cloud_provider === 'AWS'
const report = useDatabaseReport()
const { data } = useDatabaseSizeQuery({
diff --git a/apps/studio/pages/project/[ref]/settings/database.tsx b/apps/studio/pages/project/[ref]/settings/database.tsx
index 2a7b0c0239c..23d237dfb53 100644
--- a/apps/studio/pages/project/[ref]/settings/database.tsx
+++ b/apps/studio/pages/project/[ref]/settings/database.tsx
@@ -15,20 +15,13 @@ import SSLConfiguration from 'components/interfaces/Settings/Database/SSLConfigu
import { ScaffoldContainer, ScaffoldHeader, ScaffoldTitle } from 'components/layouts/Scaffold'
import DiskSizeConfiguration from 'components/interfaces/Settings/Database/DiskSizeConfiguration'
import { useFlag } from 'hooks/ui/useFlag'
-import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'
-import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-query'
import { useSelectedProject } from 'hooks/misc/useSelectedProject'
const ProjectSettings: NextPageWithLayout = () => {
const diskManagementV2 = useFlag('diskManagementV2')
const project = useSelectedProject()
- const selectedOrg = useSelectedOrganization()
- const { data: subscription } = useOrgSubscriptionQuery({ orgSlug: selectedOrg?.slug })
- const showNewDiskManagementUI =
- diskManagementV2 &&
- project?.cloud_provider === 'AWS' &&
- subscription?.usage_based_billing_project_addons
+ const showNewDiskManagementUI = diskManagementV2 && project?.cloud_provider === 'AWS'
return (
<>