Skip to content

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

Chore/disable more sections 05 (#38091)

Joshen Lime65c8f0c648e
diff --git a/apps/studio/components/interfaces/Organization/Usage/Compute.tsx b/apps/studio/components/interfaces/Organization/Usage/Compute.tsx
index 4436a14590d..e32c1458b89 100644
--- a/apps/studio/components/interfaces/Organization/Usage/Compute.tsx
+++ b/apps/studio/components/interfaces/Organization/Usage/Compute.tsx
@@ -8,6 +8,7 @@ import { DataPoint } from 'data/analytics/constants'
import { useOrgDailyComputeStatsQuery } from 'data/analytics/org-daily-compute-stats-query'
import { ComputeUsageMetric, computeUsageMetricLabel } from 'data/analytics/org-daily-stats-query'
import type { OrgSubscription } from 'data/subscriptions/types'
+import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
import SectionContent from './SectionContent'
import { Attribute, AttributeColor } from './Usage.constants'
import UsageBarChart from './UsageBarChart'
@@ -34,6 +35,8 @@ const Compute = ({ orgSlug, projectRef, startDate, endDate }: ComputeProps) => {
endDate,
})
+ const { billingAll } = useIsFeatureEnabled(['billing:all'])
+
const chartData: DataPoint[] = egressData?.data ?? []
const COMPUTE_TO_COLOR: Record<ComputeUsageMetric, AttributeColor> = {
@@ -79,16 +82,18 @@ const Compute = ({ orgSlug, projectRef, startDate, endDate }: ComputeProps) => {
name: 'Compute Hours',
description:
'Amount of hours your projects were active. Each project is a dedicated server and database.\nPaid plans come with $10 in Compute Credits to cover one project running on Micro Compute or parts of any compute add-on.\nBilling is based on the sum of Compute Hours used. Paused projects do not count towards usage.',
- links: [
- {
- name: 'Compute Add-ons',
- url: 'https://supabase.com/docs/guides/platform/compute-add-ons',
- },
- {
- name: 'Usage-billing for Compute',
- url: 'https://supabase.com/docs/guides/platform/manage-your-usage/compute',
- },
- ],
+ links: billingAll
+ ? [
+ {
+ name: 'Compute Add-ons',
+ url: 'https://supabase.com/docs/guides/platform/compute-add-ons',
+ },
+ {
+ name: 'Usage-billing for Compute',
+ url: 'https://supabase.com/docs/guides/platform/manage-your-usage/compute',
+ },
+ ]
+ : [],
}}
>
{isLoading && <GenericSkeletonLoader />}
diff --git a/apps/studio/components/interfaces/Organization/Usage/TotalUsage.tsx b/apps/studio/components/interfaces/Organization/Usage/TotalUsage.tsx
index 726ec20f6ff..c6329db4280 100644
--- a/apps/studio/components/interfaces/Organization/Usage/TotalUsage.tsx
+++ b/apps/studio/components/interfaces/Organization/Usage/TotalUsage.tsx
@@ -9,6 +9,7 @@ import {
} from 'data/analytics/org-daily-stats-query'
import type { OrgSubscription } from 'data/subscriptions/types'
import { useOrgUsageQuery } from 'data/usage/org-usage-query'
+import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
import { cn } from 'ui'
import { BILLING_BREAKDOWN_METRICS } from '../BillingSettings/BillingBreakdown/BillingBreakdown.constants'
import BillingMetric from '../BillingSettings/BillingBreakdown/BillingMetric'
@@ -32,7 +33,7 @@ const METRICS_TO_HIDE_WITH_NO_USAGE: PricingMetric[] = [
PricingMetric.DISK_THROUGHPUT_GP3,
]
-const TotalUsage = ({
+export const TotalUsage = ({
orgSlug,
projectRef,
subscription,
@@ -41,6 +42,7 @@ const TotalUsage = ({
currentBillingCycleSelected,
}: ComputeProps) => {
const isUsageBillingEnabled = subscription?.usage_billing_enabled
+ const { billingAll } = useIsFeatureEnabled(['billing:all'])
const {
data: usage,
@@ -117,16 +119,18 @@ const TotalUsage = ({
description: isUsageBillingEnabled
? `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',
- url: 'https://supabase.com/docs/guides/platform/billing-on-supabase',
- },
- {
- name: 'Supabase Plans',
- url: 'https://supabase.com/pricing',
- },
- ],
+ links: billingAll
+ ? [
+ {
+ name: 'How billing works',
+ url: 'https://supabase.com/docs/guides/platform/billing-on-supabase',
+ },
+ {
+ name: 'Supabase Plans',
+ url: 'https://supabase.com/pricing',
+ },
+ ]
+ : [],
}}
>
{isLoadingUsage && (
@@ -234,5 +238,3 @@ const TotalUsage = ({
</div>
)
}
-
-export default TotalUsage
diff --git a/apps/studio/components/interfaces/Organization/Usage/Usage.tsx b/apps/studio/components/interfaces/Organization/Usage/Usage.tsx
index 80a68493edf..32420143d36 100644
--- a/apps/studio/components/interfaces/Organization/Usage/Usage.tsx
+++ b/apps/studio/components/interfaces/Organization/Usage/Usage.tsx
@@ -22,10 +22,10 @@ import { cn, Listbox } from 'ui'
import { Admonition } from 'ui-patterns'
import { Restriction } from '../BillingSettings/Restriction'
import Activity from './Activity'
-import Egress from './Egress'
import Compute from './Compute'
+import Egress from './Egress'
import SizeAndCounts from './SizeAndCounts'
-import TotalUsage from './TotalUsage'
+import { TotalUsage } from './TotalUsage'
const Usage = () => {
const { slug, projectRef } = useParams()
diff --git a/apps/studio/components/interfaces/ProjectAPIDocs/Content/UserManagement.tsx b/apps/studio/components/interfaces/ProjectAPIDocs/Content/UserManagement.tsx
index 22e762d9eb5..e4bc2e18795 100644
--- a/apps/studio/components/interfaces/ProjectAPIDocs/Content/UserManagement.tsx
+++ b/apps/studio/components/interfaces/ProjectAPIDocs/Content/UserManagement.tsx
@@ -1,8 +1,12 @@
+import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
import ContentSnippet from '../ContentSnippet'
import { DOCS_CONTENT } from '../ProjectAPIDocs.constants'
import type { ContentProps } from './Content.types'
const UserManagement = ({ language, apikey, endpoint }: ContentProps) => {
+ const { authenticationSignInProviders } = useIsFeatureEnabled([
+ 'authentication:sign_in_providers',
+ ])
return (
<>
<ContentSnippet selectedLanguage={language} snippet={DOCS_CONTENT.userManagement} />
@@ -42,12 +46,14 @@ const UserManagement = ({ language, apikey, endpoint }: ContentProps) => {
endpoint={endpoint}
snippet={DOCS_CONTENT.smsVerify}
/>
- <ContentSnippet
- selectedLanguage={language}
- apikey={apikey}
- endpoint={endpoint}
- snippet={DOCS_CONTENT.oauthLogin}
- />
+ {authenticationSignInProviders && (
+ <ContentSnippet
+ selectedLanguage={language}
+ apikey={apikey}
+ endpoint={endpoint}
+ snippet={DOCS_CONTENT.oauthLogin}
+ />
+ )}
<ContentSnippet
selectedLanguage={language}
apikey={apikey}