The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Chore/cleanup feature flags 140224 (#21249)
Joshen Lim21aa23ceaef7
diff --git a/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewModal.tsx b/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewModal.tsxindex d5292fd32c5..5636661f4b2 100644--- a/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewModal.tsx+++ b/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewModal.tsx@@ -5,7 +5,6 @@ import { useRouter } from 'next/router'import { useEffect, useState } from 'react'import { Button, IconExternalLink, IconEye, IconEyeOff, Modal, ScrollArea, cn } from 'ui'-import { useFlag } from 'hooks'import { LOCAL_STORAGE_KEYS } from 'lib/constants'import Telemetry from 'lib/telemetry'import { useAppStateSnapshot } from 'state/app-state'@@ -15,8 +14,6 @@ import { useFeaturePreviewContext } from './FeaturePreviewContext'import RLSAIAssistantPreview from './RLSAIAssistantPreview'const FeaturePreviewModal = () => {- const isAiAssistantEnabled = useFlag('policyEditorWithAi')-// [Ivan] We should probably move this to a separate file, together with LOCAL_STORAGE_KEYS. We should make adding new feature previews as simple as possible.const FEATURE_PREVIEWS: { key: string; name: string; content: any; discussionsUrl?: string }[] = [{@@ -25,16 +22,12 @@ const FeaturePreviewModal = () => {content: <APISidePanelPreview />,discussionsUrl: 'https://github.com/orgs/supabase/discussions/18038',},- ...(isAiAssistantEnabled- ? [- {- key: LOCAL_STORAGE_KEYS.UI_PREVIEW_RLS_AI_ASSISTANT,- name: 'Supabase Assistant for RLS policies',- content: <RLSAIAssistantPreview />,- discussionsUrl: 'https://github.com/orgs/supabase/discussions/19594',- },- ]- : []),+ {+ key: LOCAL_STORAGE_KEYS.UI_PREVIEW_RLS_AI_ASSISTANT,+ name: 'Supabase Assistant for RLS policies',+ content: <RLSAIAssistantPreview />,+ discussionsUrl: 'https://github.com/orgs/supabase/discussions/19594',+ },{key: LOCAL_STORAGE_KEYS.UI_PREVIEW_CLS,name: 'Column-level privileges',diff --git a/apps/studio/components/interfaces/Auth/BasicAuthSettingsForm/BasicAuthSettingsForm.tsx b/apps/studio/components/interfaces/Auth/BasicAuthSettingsForm/BasicAuthSettingsForm.tsxindex edec80576b2..ac78878ccfa 100644--- a/apps/studio/components/interfaces/Auth/BasicAuthSettingsForm/BasicAuthSettingsForm.tsx+++ b/apps/studio/components/interfaces/Auth/BasicAuthSettingsForm/BasicAuthSettingsForm.tsx@@ -1,7 +1,5 @@import { PermissionAction } from '@supabase/shared-types/out/constants'-import { useParams } from 'common'-import { observer } from 'mobx-react-lite'import { useEffect, useState } from 'react'import {AlertDescription_Shadcn_,@@ -18,6 +16,7 @@ import {} from 'ui'import { boolean, number, object, string } from 'yup'+import { Markdown } from 'components/interfaces/Markdown'import {FormActions,FormHeader,@@ -30,8 +29,7 @@ import UpgradeToPro from 'components/ui/UpgradeToPro'import { useAuthConfigQuery } from 'data/auth/auth-config-query'import { useAuthConfigUpdateMutation } from 'data/auth/auth-config-update-mutation'import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-query'-import { useCheckPermissions, useFlag, useSelectedOrganization, useStore } from 'hooks'-import { Markdown } from 'components/interfaces/Markdown'+import { useCheckPermissions, useSelectedOrganization, useStore } from 'hooks'import FormField from '../AuthProvidersForm/FormField'// Use a const string to represent no chars option. Represented as empty string on the backend side.@@ -75,7 +73,7 @@ function HoursOrNeverText({ value }: { value: number }) {const formId = 'auth-config-basic-settings'-const BasicAuthSettingsForm = observer(() => {+const BasicAuthSettingsForm = () => {const { ui } = useStore()const { ref: projectRef } = useParams()const {@@ -96,9 +94,6 @@ const BasicAuthSettingsForm = observer(() => {})const isProPlanAndUp = isSuccessSubscription && subscription?.plan?.id !== 'free'- const singlePerUserReleased = useFlag('authSingleSessionPerUserReleased')- const passwordStrengthReleased = useFlag('authPasswordStrengthReleased')- const hibpReleased = useFlag('authHIBPReleased')const INITIAL_VALUES = {DISABLE_SIGNUP: !authConfig?.DISABLE_SIGNUP,@@ -109,25 +104,11 @@ const BasicAuthSettingsForm = observer(() => {SECURITY_CAPTCHA_PROVIDER: authConfig?.SECURITY_CAPTCHA_PROVIDER || 'hcaptcha',SESSIONS_TIMEBOX: authConfig?.SESSIONS_TIMEBOX || 0,SESSIONS_INACTIVITY_TIMEOUT: authConfig?.SESSIONS_INACTIVITY_TIMEOUT || 0,- ...(singlePerUserReleased- ? {- SESSIONS_SINGLE_PER_USER: authConfig?.SESSIONS_SINGLE_PER_USER || false,- }- : null),-- ...(passwordStrengthReleased- ? {- PASSWORD_MIN_LENGTH: authConfig?.PASSWORD_MIN_LENGTH || 6,- PASSWORD_REQUIRED_CHARACTERS:- authConfig?.PASSWORD_REQUIRED_CHARACTERS || NO_REQUIRED_CHARACTERS,-- ...(hibpReleased- ? {- PASSWORD_HIBP_ENABLED: authConfig?.PASSWORD_HIBP_ENABLED || false,- }- : null),- }- : null),+ SESSIONS_SINGLE_PER_USER: authConfig?.SESSIONS_SINGLE_PER_USER || false,+ PASSWORD_MIN_LENGTH: authConfig?.PASSWORD_MIN_LENGTH || 6,+ PASSWORD_REQUIRED_CHARACTERS:+ authConfig?.PASSWORD_REQUIRED_CHARACTERS || NO_REQUIRED_CHARACTERS,+ PASSWORD_HIBP_ENABLED: authConfig?.PASSWORD_HIBP_ENABLED || false,}const onSubmit = (values: any, { resetForm }: any) => {@@ -173,6 +154,7 @@ const BasicAuthSettingsForm = observer(() => {{({ handleReset, resetForm, values, initialValues }: any) => {const hasChanges = JSON.stringify(values) !== JSON.stringify(initialValues)// Form is reset once remote data is loaded in store+ // eslint-disable-next-line react-hooks/rules-of-hooksuseEffect(() => {if (isSuccess) resetForm({ values: INITIAL_VALUES, initialValues: INITIAL_VALUES })}, [isSuccess])@@ -228,92 +210,85 @@ const BasicAuthSettingsForm = observer(() => {/></FormSectionContent></FormSection>- {passwordStrengthReleased && (- <>- <FormSection header={<FormSectionLabel>Passwords</FormSectionLabel>}>- <FormSectionContent loading={isLoading}>- <InputNumber- id="PASSWORD_MIN_LENGTH"- size="small"- label="Minimum password length"- descriptionText="Passwords shorter than this value will be rejected as weak. Minimum 6, recommended 8 or more."- actions={<span className="mr-3 text-foreground-lighter">characters</span>}- disabled={!canUpdateConfig}- />- <FormField- name="PASSWORD_REQUIRED_CHARACTERS"- properties={{- type: 'select',- title: 'Password Requirements',- description:- 'Passwords that do not have at least one of each will be rejected as weak.',- enum: [- {- label: 'No required characters (default)',- value: NO_REQUIRED_CHARACTERS,- },- {- label: 'Letters and digits',- value: LETTERS_AND_DIGITS,- },- {- label: 'Lowercase, uppercase letters and digits',- value: LOWER_UPPER_DIGITS,- },- {- label:- 'Lowercase, uppercase letters, digits and symbols (recommended)',- value: LOWER_UPPER_DIGITS_SYMBOLS,- },- ],- }}- formValues={values}- />- {isProPlanAndUp ? (- <></>- ) : (- <UpgradeToPro- primaryText="Upgrade to Pro"- secondaryText="Leaked password protection available on Pro plans and up."- projectRef={projectRef!}- organizationSlug={organization!.slug}- />- )}- <Toggle- id="PASSWORD_HIBP_ENABLED"- size="small"- label="Prevent use of leaked passwords"- afterLabel=" (recommended)"- layout="flex"- descriptionText="Rejects the use of known or easy to guess passwords on sign up or password change. Powered by the HaveIBeenPwned.org Pwned Passwords API."- disabled={!canUpdateConfig || !isProPlanAndUp}- />- </FormSectionContent>- </FormSection>- </>- )}- <FormSection header={<FormSectionLabel>User Sessions</FormSectionLabel>}>+ <FormSection header={<FormSectionLabel>Passwords</FormSectionLabel>}><FormSectionContent loading={isLoading}>+ <InputNumber+ id="PASSWORD_MIN_LENGTH"+ size="small"+ label="Minimum password length"+ descriptionText="Passwords shorter than this value will be rejected as weak. Minimum 6, recommended 8 or more."+ actions={<span className="mr-3 text-foreground-lighter">characters</span>}+ disabled={!canUpdateConfig}+ />+ <FormField+ name="PASSWORD_REQUIRED_CHARACTERS"+ properties={{+ type: 'select',+ title: 'Password Requirements',+ description:+ 'Passwords that do not have at least one of each will be rejected as weak.',+ enum: [+ {+ label: 'No required characters (default)',+ value: NO_REQUIRED_CHARACTERS,+ },+ {+ label: 'Letters and digits',+ value: LETTERS_AND_DIGITS,+ },+ {+ label: 'Lowercase, uppercase letters and digits',+ value: LOWER_UPPER_DIGITS,+ },+ {+ label: 'Lowercase, uppercase letters, digits and symbols (recommended)',+ value: LOWER_UPPER_DIGITS_SYMBOLS,+ },+ ],+ }}+ formValues={values}+ />{isProPlanAndUp ? (<></>) : (<UpgradeToProprimaryText="Upgrade to Pro"- secondaryText="Configuring user sessions requires the Pro plan."+ secondaryText="Leaked password protection available on Pro plans and up."projectRef={projectRef!}organizationSlug={organization!.slug}/>)}- {singlePerUserReleased && (- <Toggle- id="SESSIONS_SINGLE_PER_USER"- size="small"- label="Enforce single session per user"- layout="flex"- descriptionText="If enabled, all but a user's most recently active session will be terminated."- disabled={!canUpdateConfig || !isProPlanAndUp}+ <Toggle+ id="PASSWORD_HIBP_ENABLED"+ size="small"+ label="Prevent use of leaked passwords"+ afterLabel=" (recommended)"+ layout="flex"+ descriptionText="Rejects the use of known or easy to guess passwords on sign up or password change. Powered by the HaveIBeenPwned.org Pwned Passwords API."+ disabled={!canUpdateConfig || !isProPlanAndUp}+ />+ </FormSectionContent>+ </FormSection>+ <FormSection header={<FormSectionLabel>User Sessions</FormSectionLabel>}>+ <FormSectionContent loading={isLoading}>+ {isProPlanAndUp ? (+ <></>+ ) : (+ <UpgradeToPro+ primaryText="Upgrade to Pro"+ secondaryText="Configuring user sessions requires the Pro plan."+ projectRef={projectRef!}+ organizationSlug={organization!.slug}/>)}+ <Toggle+ id="SESSIONS_SINGLE_PER_USER"+ size="small"+ label="Enforce single session per user"+ layout="flex"+ descriptionText="If enabled, all but a user's most recently active session will be terminated."+ disabled={!canUpdateConfig || !isProPlanAndUp}+ /><InputNumberid="SESSIONS_TIMEBOX"size="small"@@ -398,6 +373,6 @@ const BasicAuthSettingsForm = observer(() => {}}</Form>)-})+}export default BasicAuthSettingsFormdiff --git a/apps/studio/components/interfaces/Auth/Hooks/BasicHooksConfig.tsx b/apps/studio/components/interfaces/Auth/Hooks/BasicHooksConfig.tsxindex ea90bb8f6d3..476f85236b7 100644--- a/apps/studio/components/interfaces/Auth/Hooks/BasicHooksConfig.tsx+++ b/apps/studio/components/interfaces/Auth/Hooks/BasicHooksConfig.tsx@@ -21,8 +21,7 @@ import {} from 'components/ui/Forms'import { useAuthConfigQuery } from 'data/auth/auth-config-query'import { useAuthConfigUpdateMutation } from 'data/auth/auth-config-update-mutation'-import { useCheckPermissions, useFlag, useStore } from 'hooks'-+import { useCheckPermissions, useStore } from 'hooks'import SchemaFunctionSelector from './SchemaFunctionSelector'const schema = object({@@ -43,19 +42,12 @@ const BasicHooksConfig = () => {isSuccess,} = useAuthConfigQuery({ projectRef })const { mutate: updateAuthConfig, isLoading: isUpdatingConfig } = useAuthConfigUpdateMutation()-- const customizeAccessTokenReleased = useFlag('authHooksCustomizeAccessToken')-const canUpdateConfig = useCheckPermissions(PermissionAction.UPDATE, 'custom_config_gotrue')// TODO: Remove as any once these properties are defined in Auth Config typesconst INITIAL_VALUES = {- ...(customizeAccessTokenReleased- ? {- HOOK_CUSTOM_ACCESS_TOKEN_ENABLED: authConfig?.HOOK_CUSTOM_ACCESS_TOKEN_ENABLED || false,- HOOK_CUSTOM_ACCESS_TOKEN_URI: authConfig?.HOOK_CUSTOM_ACCESS_TOKEN_URI || '',- }- : null),+ HOOK_CUSTOM_ACCESS_TOKEN_ENABLED: authConfig?.HOOK_CUSTOM_ACCESS_TOKEN_ENABLED || false,+ HOOK_CUSTOM_ACCESS_TOKEN_URI: authConfig?.HOOK_CUSTOM_ACCESS_TOKEN_URI || '',}const onSubmit = (values: any, { resetForm }: any) => {@@ -142,23 +134,15 @@ const BasicHooksConfig = () => {descriptionText="Select the function to be called by Supabase Auth each time a new JWT is created. It should return the claims you wish to be present in the JWT."values={values}setFieldValue={setFieldValue}- disabled={!canUpdateConfig || !customizeAccessTokenReleased}+ disabled={!canUpdateConfig}/>- {!customizeAccessTokenReleased && (- <Alert_Shadcn_ variant="default">- <AlertTitle_Shadcn_>Coming soon!</AlertTitle_Shadcn_>- <AlertDescription_Shadcn_>- This hook is not available yet on your project.- </AlertDescription_Shadcn_>- </Alert_Shadcn_>- )}{values.HOOK_CUSTOM_ACCESS_TOKEN_URI && (<Toggleid="HOOK_CUSTOM_ACCESS_TOKEN_ENABLED"size="medium"label="Enable hook"layout="flex"- disabled={!canUpdateConfig || !customizeAccessTokenReleased}+ disabled={!canUpdateConfig}/>)}</FormSectionContent>diff --git a/apps/studio/components/interfaces/Auth/Hooks/EnterpriseHooksConfig.tsx b/apps/studio/components/interfaces/Auth/Hooks/EnterpriseHooksConfig.tsxindex e027518dbeb..167f26f0c12 100644--- a/apps/studio/components/interfaces/Auth/Hooks/EnterpriseHooksConfig.tsx+++ b/apps/studio/components/interfaces/Auth/Hooks/EnterpriseHooksConfig.tsx@@ -23,8 +23,7 @@ import UpgradeToPro from 'components/ui/UpgradeToPro'import { useAuthConfigQuery } from 'data/auth/auth-config-query'import { useAuthConfigUpdateMutation } from 'data/auth/auth-config-update-mutation'import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-query'-import { useCheckPermissions, useFlag, useSelectedOrganization, useStore } from 'hooks'-+import { useCheckPermissions, useSelectedOrganization, useStore } from 'hooks'import SchemaFunctionSelector from './SchemaFunctionSelector'const schema = object({@@ -47,10 +46,7 @@ const EnterpriseHooksConfig = () => {isSuccess,} = useAuthConfigQuery({ projectRef })const { mutate: updateAuthConfig, isLoading: isUpdatingConfig } = useAuthConfigUpdateMutation()-const canUpdateConfig = useCheckPermissions(PermissionAction.UPDATE, 'custom_config_gotrue')- const mfaVerificationAttemptReleased = useFlag('authHookMFAVerification')- const passwordVerificationAttemptReleased = useFlag('authHookPasswordVerification')const organization = useSelectedOrganization()const { data: subscription, isSuccess: isSuccessSubscription } = useOrgSubscriptionQuery({@@ -61,22 +57,14 @@ const EnterpriseHooksConfig = () => {isSuccessSubscription && subscription?.plan?.id !== 'free' && subscription?.plan?.id !== 'pro'const INITIAL_VALUES = {- ...(mfaVerificationAttemptReleased- ? {- HOOK_MFA_VERIFICATION_ATTEMPT_ENABLED:- authConfig?.HOOK_MFA_VERIFICATION_ATTEMPT_ENABLED || false,- HOOK_MFA_VERIFICATION_ATTEMPT_URI: authConfig?.HOOK_MFA_VERIFICATION_ATTEMPT_URI || '',- }- : null),- ...(passwordVerificationAttemptReleased- ? {- // remove as any when the types are merged in- HOOK_PASSWORD_VERIFICATION_ATTEMPT_ENABLED:- (authConfig as any)?.HOOK_PASSWORD_VERIFICATION_ATTEMPT_ENABLED || false,- HOOK_PASSWORD_VERIFICATION_ATTEMPT_URI:- (authConfig as any)?.HOOK_PASSWORD_VERIFICATION_ATTEMPT_URI || '',- }- : null),+ HOOK_MFA_VERIFICATION_ATTEMPT_ENABLED:+ authConfig?.HOOK_MFA_VERIFICATION_ATTEMPT_ENABLED || false,+ HOOK_MFA_VERIFICATION_ATTEMPT_URI: authConfig?.HOOK_MFA_VERIFICATION_ATTEMPT_URI || '',+ // remove as any when the types are merged in+ HOOK_PASSWORD_VERIFICATION_ATTEMPT_ENABLED:+ (authConfig as any)?.HOOK_PASSWORD_VERIFICATION_ATTEMPT_ENABLED || false,+ HOOK_PASSWORD_VERIFICATION_ATTEMPT_URI:+ (authConfig as any)?.HOOK_PASSWORD_VERIFICATION_ATTEMPT_URI || '',}const onSubmit = (values: any, { resetForm }: any) => {@@ -172,31 +160,15 @@ const EnterpriseHooksConfig = () => {descriptionText="Select the function to be called by Supabase Auth each time a user tries to verify an MFA factor. Return a decision on whether to reject the attempt and future ones, or to allow the user to keep trying."values={values}setFieldValue={setFieldValue}- disabled={- !canUpdateConfig ||- !isTeamsEnterprisePlan ||- !mfaVerificationAttemptReleased- }+ disabled={!canUpdateConfig || !isTeamsEnterprisePlan}/>- {!mfaVerificationAttemptReleased && (- <Alert_Shadcn_ variant="default">- <AlertTitle_Shadcn_>Coming soon!</AlertTitle_Shadcn_>- <AlertDescription_Shadcn_>- This hook is not available yet on your project.- </AlertDescription_Shadcn_>- </Alert_Shadcn_>- )}{values.HOOK_MFA_VERIFICATION_ATTEMPT_URI && (<Toggleid="HOOK_MFA_VERIFICATION_ATTEMPT_ENABLED"size="small"label="Enable hook"layout="flex"- disabled={- !canUpdateConfig ||- !isTeamsEnterprisePlan ||- !mfaVerificationAttemptReleased- }+ disabled={!canUpdateConfig || !isTeamsEnterprisePlan}/>)}</FormSectionContent>@@ -212,31 +184,15 @@ const EnterpriseHooksConfig = () => {descriptionText="Select the function to be called by Supabase Auth each time a user tries to sign in with a password. Return a decision whether to allow the user to reject the attempt, or to allow the user to keep trying."values={values}setFieldValue={setFieldValue}- disabled={- !canUpdateConfig ||- !isTeamsEnterprisePlan ||- !passwordVerificationAttemptReleased- }+ disabled={!canUpdateConfig || !isTeamsEnterprisePlan}/>- {!passwordVerificationAttemptReleased && (- <Alert_Shadcn_ variant="default">- <AlertTitle_Shadcn_>Coming soon!</AlertTitle_Shadcn_>- <AlertDescription_Shadcn_>- This hook is not available yet on your project.- </AlertDescription_Shadcn_>- </Alert_Shadcn_>- )}{values.HOOK_PASSWORD_VERIFICATION_ATTEMPT_URI && (<Toggleid="HOOK_PASSWORD_VERIFICATION_ATTEMPT_ENABLED"size="small"label="Enable hook"layout="flex"- disabled={- !canUpdateConfig ||- !isTeamsEnterprisePlan ||- !passwordVerificationAttemptReleased- }+ disabled={!canUpdateConfig || !isTeamsEnterprisePlan}/>)}</FormSectionContent>diff --git a/apps/studio/components/interfaces/Settings/General/Infrastructure/Infrastructure.tsx b/apps/studio/components/interfaces/Settings/General/Infrastructure/Infrastructure.tsxindex 44063957396..df601a1124c 100644--- a/apps/studio/components/interfaces/Settings/General/Infrastructure/Infrastructure.tsx+++ b/apps/studio/components/interfaces/Settings/General/Infrastructure/Infrastructure.tsx@@ -1,9 +1,9 @@import * as Tooltip from '@radix-ui/react-tooltip'+import { useParams } from 'common'import { observer } from 'mobx-react-lite'import Link from 'next/link'import { Alert, Badge, Button, IconPackage, Input } from 'ui'-import { useParams } from 'common/hooks'import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext'import {FormHeader,@@ -13,11 +13,11 @@ import {FormSectionLabel,} from 'components/ui/Forms'import { useProjectUpgradeEligibilityQuery } from 'data/config/project-upgrade-eligibility-query'-import { useFlag, useSelectedOrganization } from 'hooks'+import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-query'+import { useSelectedOrganization } from 'hooks'import PauseProjectButton from './PauseProjectButton'import ProjectUpgradeAlert from './ProjectUpgradeAlert'import RestartServerButton from './RestartServerButton'-import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-query'interface InfrastructureProps {}@@ -41,7 +41,6 @@ const Infrastructure = ({}: InfrastructureProps) => {const currentPgVersion = (current_app_version ?? '').split('supabase-postgres-')[1]const latestPgVersion = (latest_app_version ?? '').split('supabase-postgres-')[1]- const showDbUpgrades = useFlag('databaseUpgrades')const subject = 'Request%20for%20Postgres%20upgrade%20for%20project'const message = `Upgrade information:%0A• Manual intervention reason: ${requires_manual_intervention}`@@ -125,8 +124,8 @@ const Infrastructure = ({}: InfrastructureProps) => {),]}/>- {showDbUpgrades && data?.eligible && <ProjectUpgradeAlert />}- {showDbUpgrades && !data?.eligible && data?.requires_manual_intervention && (+ {data?.eligible && <ProjectUpgradeAlert />}+ {!data?.eligible && data?.requires_manual_intervention && (<Alerticon={<IconPackage className="text-foreground-light" strokeWidth={1.5} />}variant="neutral"diff --git a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureInfo.tsx b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureInfo.tsxindex 205318470e5..8175dd819cc 100644--- a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureInfo.tsx+++ b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureInfo.tsx@@ -1,7 +1,15 @@import * as Tooltip from '@radix-ui/react-tooltip'+import { useParams } from 'common'import Link from 'next/link'+import {+ AlertDescription_Shadcn_,+ AlertTitle_Shadcn_,+ Alert_Shadcn_,+ Badge,+ Button,+ Input,+} from 'ui'-import { useParams } from 'common'import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext'import {ScaffoldContainer,@@ -15,14 +23,6 @@ import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader'import { useProjectUpgradeEligibilityQuery } from 'data/config/project-upgrade-eligibility-query'import { useReadReplicasQuery } from 'data/read-replicas/replicas-query'import { useFlag, useIsFeatureEnabled } from 'hooks'-import {- AlertDescription_Shadcn_,- AlertTitle_Shadcn_,- Alert_Shadcn_,- Badge,- Button,- Input,-} from 'ui'import ProjectUpgradeAlert from '../General/Infrastructure/ProjectUpgradeAlert'import InstanceConfiguration from './InfrastructureConfiguration/InstanceConfiguration'@@ -47,7 +47,6 @@ const InfrastructureInfo = () => {const currentPgVersion = (current_app_version ?? '').split('supabase-postgres-')[1]const latestPgVersion = (latest_app_version ?? '').split('supabase-postgres-')[1]- const showDbUpgrades = useFlag('databaseUpgrades')const readReplicasEnabled = useFlag('readReplicas')const showReadReplicasUI = readReplicasEnabled && project?.is_read_replicas_enabledconst hasReadReplicas = (databases ?? []).length > 1@@ -155,8 +154,8 @@ const InfrastructureInfo = () => {),]}/>- {showDbUpgrades && data?.eligible && !hasReadReplicas && <ProjectUpgradeAlert />}- {showDbUpgrades && data.eligible && hasReadReplicas && (+ {data?.eligible && !hasReadReplicas && <ProjectUpgradeAlert />}+ {data.eligible && hasReadReplicas && (<Alert_Shadcn_><AlertTitle_Shadcn_>A new version of Postgres is available for your project@@ -167,7 +166,7 @@ const InfrastructureInfo = () => {</AlertDescription_Shadcn_></Alert_Shadcn_>)}- {showDbUpgrades && !data?.eligible && data?.requires_manual_intervention && (+ {!data?.eligible && data?.requires_manual_intervention && (<Alert_Shadcn_ title="A new version of Postgres is available for your project"><AlertTitle_Shadcn_>A new version of Postgres is available for your project@@ -189,49 +188,47 @@ const InfrastructureInfo = () => {</AlertDescription_Shadcn_></Alert_Shadcn_>)}- {showDbUpgrades &&- !data?.eligible &&- (data?.extension_dependent_objects || []).length > 0 && (- <Alert_Shadcn_- variant="warning"- title="A new version of Postgres is available for your project"- >- <AlertTitle_Shadcn_>New version of Postgres available</AlertTitle_Shadcn_>- <AlertDescription_Shadcn_ className="flex flex-col gap-3">- <div>- <p className="mb-1">- This project cannot be upgraded due to the following extension dependent- objects:- </p>-- <ul className="pl-4">- {(data?.extension_dependent_objects || []).map((obj) => (- <li className="list-disc" key={obj}>- {obj}- </li>- ))}- </ul>- </div>- <p>- Once the above objects are exported and removed, you can proceed to- upgrade your project, and re-import the objects after the upgrade- operation is complete. Please refer to the docs on additional extensions- that might also need to be dropped.+ {!data?.eligible && (data?.extension_dependent_objects || []).length > 0 && (+ <Alert_Shadcn_+ variant="warning"+ title="A new version of Postgres is available for your project"+ >+ <AlertTitle_Shadcn_>New version of Postgres available</AlertTitle_Shadcn_>+ <AlertDescription_Shadcn_ className="flex flex-col gap-3">+ <div>+ <p className="mb-1">+ This project cannot be upgraded due to the following extension dependent+ objects:</p>- <div>- <Button size="tiny" type="default" asChild>- <Link- href="https://supabase.com/docs/guides/platform/migrating-and-upgrading-projects#caveats"- target="_blank"- rel="noreferrer"- >- View docs- </Link>- </Button>- </div>- </AlertDescription_Shadcn_>- </Alert_Shadcn_>- )}++ <ul className="pl-4">+ {(data?.extension_dependent_objects || []).map((obj) => (+ <li className="list-disc" key={obj}>+ {obj}+ </li>+ ))}+ </ul>+ </div>+ <p>+ Once the above objects are exported and removed, you can proceed to upgrade+ your project, and re-import the objects after the upgrade operation is+ complete. Please refer to the docs on additional extensions that might also+ need to be dropped.+ </p>+ <div>+ <Button size="tiny" type="default" asChild>+ <Link+ href="https://supabase.com/docs/guides/platform/migrating-and-upgrading-projects#caveats"+ target="_blank"+ rel="noreferrer"+ >+ View docs+ </Link>+ </Button>+ </div>+ </AlertDescription_Shadcn_>+ </Alert_Shadcn_>+ )}</>)}</ScaffoldSectionContent>diff --git a/apps/studio/components/layouts/AppLayout/AppHeader.tsx b/apps/studio/components/layouts/AppLayout/AppHeader.tsxindex a93adbc4a19..e742a1df910 100644--- a/apps/studio/components/layouts/AppLayout/AppHeader.tsx+++ b/apps/studio/components/layouts/AppLayout/AppHeader.tsx@@ -2,7 +2,7 @@ import { useParams } from 'common'import Link from 'next/link'import { useRouter } from 'next/router'-import { useFlag, useSelectedOrganization, useSelectedProject } from 'hooks'+import { useSelectedOrganization, useSelectedProject } from 'hooks'import FeedbackDropdown from '../ProjectLayout/LayoutHeader/FeedbackDropdown'import HelpPopover from '../ProjectLayout/LayoutHeader/HelpPopover'import NotificationsPopoverV2 from '../ProjectLayout/LayoutHeader/NotificationsPopoverV2/NotificationsPopover'@@ -21,7 +21,6 @@ const AppHeader = () => {const { ref } = useParams()const project = useSelectedProject()const organization = useSelectedOrganization()- const enableBranchManagement = useFlag('branchManagement')const isBranchingEnabled =project?.is_branch_enabled === true || project?.parent_project_ref !== undefined@@ -41,7 +40,7 @@ const AppHeader = () => {</Link><OrganizationDropdown isNewNav />{ref !== undefined && <ProjectDropdown isNewNav />}- {ref !== undefined && enableBranchManagement && (+ {ref !== undefined && (<>{isBranchingEnabled ? <BranchDropdown isNewNav /> : <EnableBranchingButton isNewNav />}</>diff --git a/apps/studio/components/layouts/AuthLayout/AuthLayout.tsx b/apps/studio/components/layouts/AuthLayout/AuthLayout.tsxindex 4d3d62e1312..1a247684ec7 100644--- a/apps/studio/components/layouts/AuthLayout/AuthLayout.tsx+++ b/apps/studio/components/layouts/AuthLayout/AuthLayout.tsx@@ -5,7 +5,7 @@ import { PropsWithChildren } from 'react'import { useIsColumnLevelPrivilegesEnabled } from 'components/interfaces/App/FeaturePreview/FeaturePreviewContext'import ProductMenu from 'components/ui/ProductMenu'import { useAuthConfigPrefetch } from 'data/auth/auth-config-query'-import { useFlag, withAuth } from 'hooks'+import { withAuth } from 'hooks'import ProjectLayout from '../'import { generateAuthMenu } from './AuthLayout.utils'@@ -15,7 +15,6 @@ export interface AuthLayoutProps {const AuthLayout = ({ title, children }: PropsWithChildren<AuthLayoutProps>) => {const { ref: projectRef = 'default' } = useParams()- const hooksReleased = useFlag('authHooksReleased')const columnLevelPrivileges = useIsColumnLevelPrivilegesEnabled()useAuthConfigPrefetch({ projectRef })@@ -30,7 +29,7 @@ const AuthLayout = ({ title, children }: PropsWithChildren<AuthLayoutProps>) =>productMenu={<ProductMenupage={page}- menu={generateAuthMenu(projectRef ?? 'default', { hooksReleased, columnLevelPrivileges })}+ menu={generateAuthMenu(projectRef ?? 'default', { columnLevelPrivileges })}/>}isBlocking={false}diff --git a/apps/studio/components/layouts/AuthLayout/AuthLayout.utils.ts b/apps/studio/components/layouts/AuthLayout/AuthLayout.utils.tsindex e3bfdcfc5b4..4704150201f 100644--- a/apps/studio/components/layouts/AuthLayout/AuthLayout.utils.ts+++ b/apps/studio/components/layouts/AuthLayout/AuthLayout.utils.ts@@ -3,7 +3,7 @@ import { IS_PLATFORM } from 'lib/constants'export const generateAuthMenu = (ref: string,- options: { hooksReleased?: boolean; columnLevelPrivileges?: boolean } = {}+ options: { columnLevelPrivileges?: boolean } = {}): ProductMenuGroup[] => {return [{@@ -56,17 +56,13 @@ export const generateAuthMenu = (url: `/project/${ref}/auth/url-configuration`,items: [],},- ...(options?.hooksReleased- ? [- {- name: 'Hooks',- key: 'hooks',- url: `/project/${ref}/auth/hooks`,- items: [],- label: 'BETA',- },- ]- : []),+ {+ name: 'Hooks',+ key: 'hooks',+ url: `/project/${ref}/auth/hooks`,+ items: [],+ label: 'BETA',+ },]: []),],diff --git a/apps/studio/components/layouts/ProjectLayout/LayoutHeader/LayoutHeader.tsx b/apps/studio/components/layouts/ProjectLayout/LayoutHeader/LayoutHeader.tsxindex 124adf73571..8763801d2ef 100644--- a/apps/studio/components/layouts/ProjectLayout/LayoutHeader/LayoutHeader.tsx+++ b/apps/studio/components/layouts/ProjectLayout/LayoutHeader/LayoutHeader.tsx@@ -22,8 +22,6 @@ const LayoutHeader = ({ customHeaderComponents, breadcrumbs = [], headerBorder =const selectedProject = useSelectedProject()const selectedOrganization = useSelectedOrganization()- const enableBranchManagement = useFlag('branchManagement')-const isBranchingEnabled =selectedProject?.is_branch_enabled === true || selectedProject?.parent_project_ref !== undefined@@ -42,7 +40,6 @@ const LayoutHeader = ({ customHeaderComponents, breadcrumbs = [], headerBorder =const projectHasNoLimits = subscription?.usage_billing_enabled === trueconst showOverUsageBadge =- useFlag('overusageBadge') &&(subscription?.plan.id === 'free' || subscription?.plan.id === 'pro') &&!projectHasNoLimits &&exceedingLimits@@ -89,7 +86,7 @@ const LayoutHeader = ({ customHeaderComponents, breadcrumbs = [], headerBorder =</>)}- {selectedProject && enableBranchManagement && (+ {selectedProject && (<><span className="text-border-stronger"><svgdiff --git a/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.tsx b/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.tsxindex 022d8c3cbec..09c23e6e139 100644--- a/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.tsx+++ b/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.tsx@@ -5,7 +5,6 @@ import { FlaskConical } from 'lucide-react'import { useTheme } from 'next-themes'import Link from 'next/link'import { useRouter } from 'next/router'-import {Button,DropdownMenu,@@ -51,7 +50,6 @@ const NavigationBar = () => {const { project } = useProjectContext()const navLayoutV2 = useFlag('navigationLayoutV2')- const showFeaturePreviews = useFlag('featurePreviews')const isNewAPIDocsEnabled = useIsAPIDocsSidePanelEnabled()const {@@ -218,17 +216,15 @@ const NavigationBar = () => {<p>Account preferences</p></Link></DropdownMenuItem>- {showFeaturePreviews && (- <DropdownMenuItem- key="header"- className="space-x-2"- onClick={() => snap.setShowFeaturePreviewModal(true)}- onSelect={() => snap.setShowFeaturePreviewModal(true)}- >- <FlaskConical size={14} strokeWidth={2} />- <p>Feature previews</p>- </DropdownMenuItem>- )}+ <DropdownMenuItem+ key="header"+ className="space-x-2"+ onClick={() => snap.setShowFeaturePreviewModal(true)}+ onSelect={() => snap.setShowFeaturePreviewModal(true)}+ >+ <FlaskConical size={14} strokeWidth={2} />+ <p>Feature previews</p>+ </DropdownMenuItem><DropdownMenuSeparator /></>)}diff --git a/apps/studio/components/ui/ProjectUpgradeFailedBanner.tsx b/apps/studio/components/ui/ProjectUpgradeFailedBanner.tsxindex 3acd4028082..9b1cfe5fee3 100644--- a/apps/studio/components/ui/ProjectUpgradeFailedBanner.tsx+++ b/apps/studio/components/ui/ProjectUpgradeFailedBanner.tsx@@ -1,18 +1,17 @@+import { DatabaseUpgradeStatus } from '@supabase/shared-types/out/events'+import { useParams } from 'common'import dayjs from 'dayjs'import Link from 'next/link'import { useState } from 'react'import { Alert, Button, IconX } from 'ui'-import { useParams } from 'common/hooks'-import { IS_PLATFORM } from 'lib/constants'+import { useProjectUpgradingStatusQuery } from 'data/config/project-upgrade-status-query'-import { DatabaseUpgradeStatus } from '@supabase/shared-types/out/events'-import { useFlag } from 'hooks'+import { IS_PLATFORM } from 'lib/constants'// [Joshen] Think twice about the category though - it doesn't correspondconst ProjectUpgradeFailedBanner = () => {const { ref } = useParams()- const showDbUpgrades = useFlag('databaseUpgrades')const { data } = useProjectUpgradingStatusQuery({ projectRef: ref }, { enabled: IS_PLATFORM })const { status, initiated_at, error } = data?.databaseUpgradeStatus ?? {}@@ -35,7 +34,7 @@ const ProjectUpgradeFailedBanner = () => {localStorage.setItem(key, 'true')}- if (!isFailed || !showMessage || !showDbUpgrades) return null+ if (!isFailed || !showMessage) return nullreturn (<div className="max-w-7xl">