Skip to content

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

chore: Update "Allow Support Access" to toggle and move above send button (#30470)

Monica Khouryc394f4631d07
diff --git a/apps/studio/components/interfaces/Support/SupportFormV2.tsx b/apps/studio/components/interfaces/Support/SupportFormV2.tsx
index 26de59605a7..90f1b94e127 100644
--- a/apps/studio/components/interfaces/Support/SupportFormV2.tsx
+++ b/apps/studio/components/interfaces/Support/SupportFormV2.tsx
@@ -1,7 +1,7 @@
import { zodResolver } from '@hookform/resolvers/zod'
import * as Sentry from '@sentry/nextjs'
import { useSupabaseClient } from '@supabase/auth-helpers-react'
-import { ChevronDown, ExternalLink, Loader2, Mail, Plus, X } from 'lucide-react'
+import { ChevronRight, ExternalLink, Loader2, Mail, Plus, X } from 'lucide-react'
import Link from 'next/link'
import { ChangeEvent, useEffect, useRef, useState } from 'react'
import { SubmitHandler, useForm } from 'react-hook-form'
@@ -21,7 +21,6 @@ import { useProfile } from 'lib/profile'
import {
Badge,
Button,
- Checkbox_Shadcn_,
cn,
Collapsible_Shadcn_,
CollapsibleContent_Shadcn_,
@@ -38,6 +37,7 @@ import {
SelectTrigger_Shadcn_,
SelectValue_Shadcn_,
Separator,
+ Switch,
TextArea_Shadcn_,
} from 'ui'
import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
@@ -642,60 +642,6 @@ export const SupportFormV2 = ({ setSentCategory, setSelectedProject }: SupportFo
)}
/>
- {['Problem', 'Database_unresponsive', 'Performance'].includes(category) && (
- <FormField_Shadcn_
- name="allowSupportAccess"
- control={form.control}
- render={({ field }) => (
- <FormItemLayout
- layout="flex"
- className={cn(CONTAINER_CLASSES)}
- label="Allow Supabase Support to access your project temporarily"
- description={
- <>
- <Collapsible_Shadcn_>
- <CollapsibleTrigger_Shadcn_ className="flex items-center gap-x-2 [&[data-state=open]>svg]:!-rotate-180">
- More information about temporary access
- <ChevronDown
- className="transition-transform duration-200"
- strokeWidth={1.5}
- size={14}
- />
- </CollapsibleTrigger_Shadcn_>
- <CollapsibleContent_Shadcn_>
- By checking this box, 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
- target="_blank"
- rel="noreferrer noopener"
- href="https://supabase.com/privacy"
- className="text-foreground-light underline hover:text-foreground underline-offset-2 transition"
- >
- Privacy Policy
- </Link>
- </CollapsibleContent_Shadcn_>
- </Collapsible_Shadcn_>
- </>
- }
- >
- <FormControl_Shadcn_>
- <Checkbox_Shadcn_
- {...field}
- value={String(field.value)}
- checked={field.value}
- onCheckedChange={(value) => field.onChange(value)}
- />
- </FormControl_Shadcn_>
- </FormItemLayout>
- )}
- />
- )}
-
<div className={cn(CONTAINER_CLASSES)}>
<div className="flex flex-col gap-y-1">
<p className="text-sm text-foreground-light">Attachments</p>
@@ -746,26 +692,85 @@ export const SupportFormV2 = ({ setSentCategory, setSelectedProject }: SupportFo
</div>
</div>
- <div className={cn(CONTAINER_CLASSES)}>
- <div className="flex items-center space-x-1 justify-end block text-sm mt-0 mb-2">
- <p className="text-foreground-light">We will contact you at</p>
- <p className="text-foreground font-medium">{respondToEmail}</p>
- </div>
- <div className="flex items-center space-x-1 justify-end block text-sm mt-0 mb-2">
- <p className="text-foreground-light">
- Please ensure you haven't blocked Hubspot in your emails
- </p>
- </div>
- <div className="flex justify-end">
- <Button
- htmlType="submit"
- size="small"
- icon={<Mail />}
- disabled={isSubmitting}
- loading={isSubmitting}
- >
- Send support request
- </Button>
+ <Separator />
+
+ {['Problem', 'Database_unresponsive', 'Performance'].includes(category) && (
+ <>
+ <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_>
+ <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_>
+ </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"
+ >
+ Privacy Policy
+ </Link>
+ </p>
+ </CollapsibleContent_Shadcn_>
+ </Collapsible_Shadcn_>
+ }
+ >
+ <Switch
+ id="allowSupportAccess"
+ checked={field.value}
+ onCheckedChange={field.onChange}
+ />
+ </FormItemLayout>
+ )}
+ />
+ </>
+ )}
+
+ <div className={cn(CONTAINER_CLASSES, 'flex flex-col items-end gap-3 -mt-4')}>
+ <Button
+ htmlType="submit"
+ size="large"
+ block
+ icon={<Mail />}
+ disabled={isSubmitting}
+ loading={isSubmitting}
+ >
+ Send support request
+ </Button>
+ <div className="flex flex-col items-end gap-1">
+ <div className="space-x-1 text-xs">
+ <span className="text-foreground-light">We will contact you at</span>
+ <span className="text-foreground font-medium">{respondToEmail}</span>
+ </div>
+ <span className="text-foreground-light text-xs">
+ Please ensure emails from supabase.io are allowed
+ </span>
</div>
</div>
</form>