Chore: Support form | support access true as default (#35066)

* Update SupportFormV2.tsx

* Fix TS

* Update SupportFormV2.tsx

* Update SupportFormV2.tsx

* Small refactor after checking preview

* Clean up

* remove div

* Fix after merging master

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
This commit is contained in:
Jonathan Summers-MuirandJoshen Lim authored and GitHub committed 2025-04-16 21:10:47 +08:00
1 parent be2c3ccaf8
commit 08e5abc64a
3 files changed
+73 -51

No files matched your search

@@ -1,4 +1,4 @@
import { useNewLayout } from 'components/interfaces/App/FeaturePreview/FeaturePreviewContext'
import { useIsNewLayoutEnabled } from 'components/interfaces/App/FeaturePreview/FeaturePreviewContext'
import {
ScaffoldContainer,
ScaffoldContainerLegacy,
@@ -32,7 +32,7 @@ const BillingSettings = () => {
'billing:invoices',
])
const newLayoutPreview = useNewLayout()
const newLayoutPreview = useIsNewLayoutEnabled()
const org = useSelectedOrganization()
const { data: subscription } = useOrgSubscriptionQuery({ orgSlug: org?.slug })
@@ -1,6 +1,6 @@
import { zodResolver } from '@hookform/resolvers/zod'
import * as Sentry from '@sentry/nextjs'
import { ChevronRight, ExternalLink, Loader2, Mail, Plus, X } from 'lucide-react'
import { ChevronRight, ExternalLink, Mail, Plus, X } from 'lucide-react'
import Link from 'next/link'
import { ChangeEvent, useEffect, useMemo, useRef, useState } from 'react'
import { SubmitHandler, useForm } from 'react-hook-form'
@@ -112,7 +112,7 @@ export const SupportFormV2 = ({ setSentCategory, setSelectedProject }: SupportFo
subject: '',
message: '',
affectedServices: '',
allowSupportAccess: false,
allowSupportAccess: true,
}
const form = useForm<z.infer<typeof FormSchema>>({
@@ -685,60 +685,78 @@ export const SupportFormV2 = ({ setSentCategory, setSelectedProject }: SupportFo
<FormField_Shadcn_
name="allowSupportAccess"
control={form.control}
render={({ field }) => (
<FormItemLayout
name="allowSupportAccess"
className="px-6"
layout="flex"
label="Allow Supabase Support and AI-Assisted Diagnostics access to your project"
description={
<Collapsible_Shadcn_>
render={({ field }) => {
return (
<FormItemLayout
name="allowSupportAccess"
className="px-6"
layout="flex"
label={
<div className="flex items-center gap-x-2">
<CollapsibleTrigger_Shadcn_ className="group flex items-center gap-x-2 ">
<ChevronRight
strokeWidth={2}
size={14}
className="transition-all group-data-[state=open]:rotate-90 text-foreground-lighter duration-200 -ml-1"
/>
<p className="text-xs text-foreground-light underline">
More information about temporary access
</p>
</CollapsibleTrigger_Shadcn_>
<span className="text-foreground">
Allow support access to your project
</span>
<Badge className="bg-opacity-100">Recommended</Badge>
</div>
<CollapsibleContent_Shadcn_ className="text-xs text-foreground-light mt-2 space-y-2">
<p>
By enabling this, you grant permission for our support team to access your
project temporarily and, if applicable, to use AI tools to assist in
diagnosing and resolving issues. This access may involve analyzing
database configurations, query performance, and other relevant data to
expedite troubleshooting and enhance support accuracy. We are committed to
maintaining strict data privacy and security standards in all support
activities.{' '}
<Link
href="https://supabase.com/privacy"
target="_blank"
rel="noreferrer"
className="text-foreground-light underline hover:text-foreground transition"
}
description={
<div className="flex flex-col">
<span className="text-foreground-light">
Human support and AI diagnostic access.
</span>
<Collapsible_Shadcn_ className="mt-2">
<CollapsibleTrigger_Shadcn_
className={
'group flex items-center gap-x-1 group-data-[state=open]:text-foreground hover:text-foreground transition'
}
>
Privacy Policy
</Link>
</p>
</CollapsibleContent_Shadcn_>
</Collapsible_Shadcn_>
}
>
<Switch
id="allowSupportAccess"
checked={field.value}
onCheckedChange={field.onChange}
/>
</FormItemLayout>
)}
<ChevronRight
strokeWidth={2}
size={14}
className="transition-all group-data-[state=open]:rotate-90 text-foreground-muted -ml-1"
/>
<span className="text-sm">More information</span>
</CollapsibleTrigger_Shadcn_>
<CollapsibleContent_Shadcn_ className="text-sm text-foreground-light mt-2 space-y-2">
<p>
By enabling this, you grant permission for our support team to access
your project temporarily and, if applicable, to use AI tools to assist
in diagnosing and resolving issues. This access may involve analyzing
database configurations, query performance, and other relevant data to
expedite troubleshooting and enhance support accuracy.
</p>
<p>
We are committed to maintaining strict data privacy and security
standards in all support activities.{' '}
<Link
href="https://supabase.com/privacy"
target="_blank"
rel="noreferrer"
className="text-foreground-light underline hover:text-foreground transition"
>
Privacy Policy
</Link>
</p>
</CollapsibleContent_Shadcn_>
</Collapsible_Shadcn_>
</div>
}
>
<Switch
size="large"
id="allowSupportAccess"
checked={field.value}
onCheckedChange={field.onChange}
/>
</FormItemLayout>
)
}}
/>
<Separator />
</>
)}
<div className={cn(CONTAINER_CLASSES, 'flex flex-col items-end gap-3 -mt-4')}>
<div className={cn(CONTAINER_CLASSES, 'flex flex-col items-end gap-3')}>
<Button
htmlType="submit"
size="large"
@@ -19,6 +19,7 @@ import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'
import { useSelectedProject } from 'hooks/misc/useSelectedProject'
import { useShowLayoutHeader } from 'hooks/misc/useShowLayoutHeader'
import { IS_PLATFORM } from 'lib/constants'
import { useAppStateSnapshot } from 'state/app-state'
import { Badge, cn } from 'ui'
import BreadcrumbsView from './BreadcrumbsView'
import { FeedbackDropdown } from './FeedbackDropdown'
@@ -49,12 +50,14 @@ interface LayoutHeaderProps {
customHeaderComponents?: ReactNode
breadcrumbs?: any[]
headerTitle?: string
showProductMenu?: boolean
}
const LayoutHeader = ({
customHeaderComponents,
breadcrumbs = [],
headerTitle,
showProductMenu,
}: LayoutHeaderProps) => {
const newLayoutPreview = useIsNewLayoutEnabled()
@@ -62,6 +65,7 @@ const LayoutHeader = ({
const { ref: projectRef, slug } = useParams()
const selectedProject = useSelectedProject()
const selectedOrganization = useSelectedOrganization()
const { setMobileMenuOpen } = useAppStateSnapshot()
const isBranchingEnabled = selectedProject?.is_branch_enabled === true
// We only want to query the org usage and check for possible over-ages for plans without usage billing enabled (free or pro with spend cap)