diff --git a/apps/studio/components/interfaces/Settings/Addons/Addons.tsx b/apps/studio/components/interfaces/Settings/Addons/Addons.tsx index feb7c2872b..361379be6b 100644 --- a/apps/studio/components/interfaces/Settings/Addons/Addons.tsx +++ b/apps/studio/components/interfaces/Settings/Addons/Addons.tsx @@ -1,6 +1,6 @@ import { SupportCategories } from '@supabase/shared-types/out/constants' import { useFlag, useParams } from 'common' -import { AlertCircle, Lock } from 'lucide-react' +import { Lock } from 'lucide-react' import { useTheme } from 'next-themes' import Image from 'next/image' import Link from 'next/link' @@ -14,6 +14,7 @@ import { TooltipContent, TooltipTrigger, } from 'ui' +import { Admonition } from 'ui-patterns' import { PageContainer } from 'ui-patterns/PageContainer' import { PageSection } from 'ui-patterns/PageSection' @@ -33,11 +34,11 @@ import { import { ProjectUpdateDisabledTooltip } from '@/components/interfaces/Organization/BillingSettings/ProjectUpdateDisabledTooltip' import { SupportLink } from '@/components/interfaces/Support/SupportLink' import AlertError from '@/components/ui/AlertError' +import { InlineLink } from '@/components/ui/InlineLink' import { ResourceItem } from '@/components/ui/Resource/ResourceItem' import { ResourceList } from '@/components/ui/Resource/ResourceList' import { HorizontalShimmerWithIcon } from '@/components/ui/Shimmers' import { useProjectSettingsV2Query } from '@/data/config/project-settings-v2-query' -import { useProjectDetailQuery } from '@/data/projects/project-detail-query' import { useOrgSubscriptionQuery } from '@/data/subscriptions/org-subscription-query' import { useProjectAddonsQuery } from '@/data/subscriptions/project-addons-query' import { useIsFeatureEnabled } from '@/hooks/misc/useIsFeatureEnabled' @@ -67,10 +68,7 @@ export const Addons = () => { const { data: selectedOrg } = useSelectedOrganizationQuery() const { data: selectedProject } = useSelectedProjectQuery() - const { data: parentProject } = useProjectDetailQuery({ - ref: selectedProject?.parent_project_ref, - }) - const isBranch = parentProject !== undefined + const isBranch = selectedProject?.parent_project_ref const { data: settings } = useProjectSettingsV2Query({ projectRef }) const { data: subscription } = useOrgSubscriptionQuery({ orgSlug: selectedOrg?.slug }) @@ -196,20 +194,18 @@ export const Addons = () => { {isBranch && ( - - - - You are currently on a preview branch of your project - - - Updating add-ons here will only apply to this preview branch. To manage add-ons for - your main branch, please visit the{' '} - - main branch - - . - - + + Updating add-ons here will only apply to this preview branch. To manage add-ons for your + main branch, please visit the{' '} + + main branch + + . + )} {isLoading && ( diff --git a/apps/studio/components/interfaces/Settings/General/General.tsx b/apps/studio/components/interfaces/Settings/General/General.tsx index 0b1ac77f81..d980f900fe 100644 --- a/apps/studio/components/interfaces/Settings/General/General.tsx +++ b/apps/studio/components/interfaces/Settings/General/General.tsx @@ -1,12 +1,8 @@ import { zodResolver } from '@hookform/resolvers/zod' import { PermissionAction } from '@supabase/shared-types/out/constants' -import Link from 'next/link' import { useForm } from 'react-hook-form' import { toast } from 'sonner' import { - Alert_Shadcn_, - AlertDescription_Shadcn_, - AlertTitle_Shadcn_, Button, Card, CardContent, @@ -15,8 +11,8 @@ import { FormControl, FormField, Input_Shadcn_, - WarningIcon, } from 'ui' +import { Admonition } from 'ui-patterns' import { Input } from 'ui-patterns/DataInputs/Input' import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout' import { @@ -30,6 +26,7 @@ import { GenericSkeletonLoader } from 'ui-patterns/ShimmeringLoader' import * as z from 'zod' import { ProjectAccessSection } from './ProjectAccessSection' +import { InlineLink } from '@/components/ui/InlineLink' import { useProjectUpdateMutation } from '@/data/projects/project-update-mutation' import { useAsyncCheckPermissions } from '@/hooks/misc/useCheckPermissions' import { useSelectedProjectQuery } from '@/hooks/misc/useSelectedProject' @@ -83,23 +80,18 @@ export const General = () => { {isBranch && ( - - - - You are currently on a preview branch of your project - - - Certain settings are not available while you're on a preview branch. To adjust your - project settings, you may return to your{' '} - - main branch - - . - - + + Certain settings are not available while you're on a preview branch. To adjust your + project settings, you may return to your{' '} + + main branch + + . + )} {project === undefined ? ( diff --git a/apps/studio/components/interfaces/Settings/Integrations/IntegrationsSettings.tsx b/apps/studio/components/interfaces/Settings/Integrations/IntegrationsSettings.tsx index 4786db626d..39c6b7b939 100644 --- a/apps/studio/components/interfaces/Settings/Integrations/IntegrationsSettings.tsx +++ b/apps/studio/components/interfaces/Settings/Integrations/IntegrationsSettings.tsx @@ -1,12 +1,11 @@ -import Link from 'next/link' -import { Alert_Shadcn_, AlertDescription_Shadcn_, AlertTitle_Shadcn_, WarningIcon } from 'ui' +import { Admonition } from 'ui-patterns' import { AWSPrivateLinkSection } from './AWSPrivateLink/AWSPrivateLinkSection' import { GitHubSection } from './GithubIntegration/GithubSection' import { VercelSection } from './VercelIntegration/VercelSection' import { SidePanelVercelProjectLinker } from '@/components/interfaces/Organization/IntegrationSettings/SidePanelVercelProjectLinker' import { ScaffoldContainer, ScaffoldDivider } from '@/components/layouts/Scaffold' -import { useProjectDetailQuery } from '@/data/projects/project-detail-query' +import { InlineLink } from '@/components/ui/InlineLink' import { useIsFeatureEnabled } from '@/hooks/misc/useIsFeatureEnabled' import { useSelectedProjectQuery } from '@/hooks/misc/useSelectedProject' import { BASE_PATH } from '@/lib/constants' @@ -21,9 +20,8 @@ export const IntegrationImageHandler = ({ title }: { title: 'vercel' | 'github' ) } -const IntegrationSettings = () => { +export const IntegrationSettings = () => { const { data: project } = useSelectedProjectQuery() - const { data: parentProject } = useProjectDetailQuery({ ref: project?.parent_project_ref }) const isBranch = project?.parent_project_ref !== undefined const showVercelIntegration = useIsFeatureEnabled('integrations:vercel') @@ -36,22 +34,21 @@ const IntegrationSettings = () => { <> {isBranch && ( - - - - You are currently on a preview branch of your project - - - To adjust your project's integration settings, you may return to your{' '} - - main branch - - . - - + + To adjust your project's integration settings, you may return to your{' '} + + main branch + + . + )} + {showVercelIntegration && ( <> @@ -59,6 +56,7 @@ const IntegrationSettings = () => { )} + {showAWSPrivateLink && ( <> @@ -68,5 +66,3 @@ const IntegrationSettings = () => { ) } - -export default IntegrationSettings diff --git a/apps/studio/pages/project/[ref]/settings/integrations.tsx b/apps/studio/pages/project/[ref]/settings/integrations.tsx index 85fbb8abef..1e0654c2f8 100644 --- a/apps/studio/pages/project/[ref]/settings/integrations.tsx +++ b/apps/studio/pages/project/[ref]/settings/integrations.tsx @@ -1,5 +1,5 @@ -import IntegrationSettings from '@/components/interfaces/Settings/Integrations/IntegrationsSettings' -import DefaultLayout from '@/components/layouts/DefaultLayout' +import { IntegrationSettings } from '@/components/interfaces/Settings/Integrations/IntegrationsSettings' +import { DefaultLayout } from '@/components/layouts/DefaultLayout' import SettingsLayout from '@/components/layouts/ProjectSettingsLayout/SettingsLayout' import { ScaffoldContainer,