Skip to content

Commit e65c8f0

Browse files
authored
Chore/disable more sections 05 (supabase#38091)
* Add flags for policies, third party auth, and manual linking + providers in sign in page * Add flag for rate limitm page * Add UnknownInterface components * Update comment * Flip flags to true * Add flags for realtime policies and reports page * Temp * Add flag for sign in providers page * Add flag for stripe wrapper * Add flag for custom domains * Add flag for dedicated ipv4 address addon * Add empty state for realtime policies * Add empty state for reports page * Add flag for disable legacy JWT keys section * Add flag for legacy jwt keys * nit * Remove ConnectionStringMoved call out * Add flag for project settings log drains * Add flag for subscription link in project settings * Deprecate settings/auth page and redirect directly to auth page * Flip back flags * Add flags for account preferences analytics marketing and account deleetion * Remove 'table_editor:enable_rls_toggle' flag and revert UI changes * Remove 'authentication:policies' flag and revert UI changes * Add flags for cmd K routes * Add flags for instance size in infra settings * Small refactor to DisplayApiSettings, decouple ToggleLegacyApiKeysPanel from it * Have project_connection:javascript_example toggle code example title to TS * add flag for templates dropdown in logs explorer * UsesOverview only show link to providers page if providers is enabled * API Docs UserManagement to only include docs on third party auth if providers is enabled * Hide instance size on project card if flag is off * Remove links to billing under org usage if billing:all is off * Fix
1 parent 159ede2 commit e65c8f0

File tree

4 files changed

+44
-31
lines changed

4 files changed

+44
-31
lines changed

apps/studio/components/interfaces/Organization/Usage/Compute.tsx

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { DataPoint } from 'data/analytics/constants'
88
import { useOrgDailyComputeStatsQuery } from 'data/analytics/org-daily-compute-stats-query'
99
import { ComputeUsageMetric, computeUsageMetricLabel } from 'data/analytics/org-daily-stats-query'
1010
import type { OrgSubscription } from 'data/subscriptions/types'
11+
import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
1112
import SectionContent from './SectionContent'
1213
import { Attribute, AttributeColor } from './Usage.constants'
1314
import UsageBarChart from './UsageBarChart'
@@ -34,6 +35,8 @@ const Compute = ({ orgSlug, projectRef, startDate, endDate }: ComputeProps) => {
3435
endDate,
3536
})
3637

38+
const { billingAll } = useIsFeatureEnabled(['billing:all'])
39+
3740
const chartData: DataPoint[] = egressData?.data ?? []
3841

3942
const COMPUTE_TO_COLOR: Record<ComputeUsageMetric, AttributeColor> = {
@@ -79,16 +82,18 @@ const Compute = ({ orgSlug, projectRef, startDate, endDate }: ComputeProps) => {
7982
name: 'Compute Hours',
8083
description:
8184
'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.',
82-
links: [
83-
{
84-
name: 'Compute Add-ons',
85-
url: 'https://supabase.com/docs/guides/platform/compute-add-ons',
86-
},
87-
{
88-
name: 'Usage-billing for Compute',
89-
url: 'https://supabase.com/docs/guides/platform/manage-your-usage/compute',
90-
},
91-
],
85+
links: billingAll
86+
? [
87+
{
88+
name: 'Compute Add-ons',
89+
url: 'https://supabase.com/docs/guides/platform/compute-add-ons',
90+
},
91+
{
92+
name: 'Usage-billing for Compute',
93+
url: 'https://supabase.com/docs/guides/platform/manage-your-usage/compute',
94+
},
95+
]
96+
: [],
9297
}}
9398
>
9499
{isLoading && <GenericSkeletonLoader />}

apps/studio/components/interfaces/Organization/Usage/TotalUsage.tsx

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
} from 'data/analytics/org-daily-stats-query'
1010
import type { OrgSubscription } from 'data/subscriptions/types'
1111
import { useOrgUsageQuery } from 'data/usage/org-usage-query'
12+
import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
1213
import { cn } from 'ui'
1314
import { BILLING_BREAKDOWN_METRICS } from '../BillingSettings/BillingBreakdown/BillingBreakdown.constants'
1415
import BillingMetric from '../BillingSettings/BillingBreakdown/BillingMetric'
@@ -32,7 +33,7 @@ const METRICS_TO_HIDE_WITH_NO_USAGE: PricingMetric[] = [
3233
PricingMetric.DISK_THROUGHPUT_GP3,
3334
]
3435

35-
const TotalUsage = ({
36+
export const TotalUsage = ({
3637
orgSlug,
3738
projectRef,
3839
subscription,
@@ -41,6 +42,7 @@ const TotalUsage = ({
4142
currentBillingCycleSelected,
4243
}: ComputeProps) => {
4344
const isUsageBillingEnabled = subscription?.usage_billing_enabled
45+
const { billingAll } = useIsFeatureEnabled(['billing:all'])
4446

4547
const {
4648
data: usage,
@@ -117,16 +119,18 @@ const TotalUsage = ({
117119
description: isUsageBillingEnabled
118120
? `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.`
119121
: `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.`,
120-
links: [
121-
{
122-
name: 'How billing works',
123-
url: 'https://supabase.com/docs/guides/platform/billing-on-supabase',
124-
},
125-
{
126-
name: 'Supabase Plans',
127-
url: 'https://supabase.com/pricing',
128-
},
129-
],
122+
links: billingAll
123+
? [
124+
{
125+
name: 'How billing works',
126+
url: 'https://supabase.com/docs/guides/platform/billing-on-supabase',
127+
},
128+
{
129+
name: 'Supabase Plans',
130+
url: 'https://supabase.com/pricing',
131+
},
132+
]
133+
: [],
130134
}}
131135
>
132136
{isLoadingUsage && (
@@ -234,5 +238,3 @@ const TotalUsage = ({
234238
</div>
235239
)
236240
}
237-
238-
export default TotalUsage

apps/studio/components/interfaces/Organization/Usage/Usage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ import { cn, Listbox } from 'ui'
2222
import { Admonition } from 'ui-patterns'
2323
import { Restriction } from '../BillingSettings/Restriction'
2424
import Activity from './Activity'
25-
import Egress from './Egress'
2625
import Compute from './Compute'
26+
import Egress from './Egress'
2727
import SizeAndCounts from './SizeAndCounts'
28-
import TotalUsage from './TotalUsage'
28+
import { TotalUsage } from './TotalUsage'
2929

3030
const Usage = () => {
3131
const { slug, projectRef } = useParams()

apps/studio/components/interfaces/ProjectAPIDocs/Content/UserManagement.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
12
import ContentSnippet from '../ContentSnippet'
23
import { DOCS_CONTENT } from '../ProjectAPIDocs.constants'
34
import type { ContentProps } from './Content.types'
45

56
const UserManagement = ({ language, apikey, endpoint }: ContentProps) => {
7+
const { authenticationSignInProviders } = useIsFeatureEnabled([
8+
'authentication:sign_in_providers',
9+
])
610
return (
711
<>
812
<ContentSnippet selectedLanguage={language} snippet={DOCS_CONTENT.userManagement} />
@@ -42,12 +46,14 @@ const UserManagement = ({ language, apikey, endpoint }: ContentProps) => {
4246
endpoint={endpoint}
4347
snippet={DOCS_CONTENT.smsVerify}
4448
/>
45-
<ContentSnippet
46-
selectedLanguage={language}
47-
apikey={apikey}
48-
endpoint={endpoint}
49-
snippet={DOCS_CONTENT.oauthLogin}
50-
/>
49+
{authenticationSignInProviders && (
50+
<ContentSnippet
51+
selectedLanguage={language}
52+
apikey={apikey}
53+
endpoint={endpoint}
54+
snippet={DOCS_CONTENT.oauthLogin}
55+
/>
56+
)}
5157
<ContentSnippet
5258
selectedLanguage={language}
5359
apikey={apikey}

0 commit comments

Comments
 (0)